Skip to content

Commit 9115dd7

Browse files
committed
refactor: propagate definitions
1 parent 1156681 commit 9115dd7

File tree

1 file changed

+10
-17
lines changed

1 file changed

+10
-17
lines changed

src/Function/Structures.agda

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ module Function.Structures {a b ℓ₁ ℓ₂}
1919

2020
open import Data.Product.Base as Product using (∃; _×_; _,_)
2121
open import Function.Base
22-
open import Function.Consequences
22+
open import Function.Consequences.Setoid
2323
open import Function.Definitions
2424
open import Level using (_⊔_)
2525

@@ -67,15 +67,8 @@ record IsSurjection (f : A → B) : Set (a ⊔ b ⊔ ℓ₁ ⊔ ℓ₂) where
6767

6868
open IsCongruent isCongruent public
6969

70-
private module S = Section _≈₂_ surjective
71-
72-
open S public using (section; inverseˡ)
73-
74-
strictlySurjective : StrictlySurjective _≈₂_ f
75-
strictlySurjective = S.strictlySurjective Eq₁.refl
76-
77-
strictlyInverseˡ : StrictlyInverseˡ _≈₂_ f section
78-
strictlyInverseˡ _ = inverseˡ Eq₁.refl
70+
open Section Eq₁.setoid Eq₂.setoid surjective public
71+
using (section; inverseˡ; strictlyInverseˡ; strictlySurjective)
7972

8073

8174
record IsBijection (f : A B) : Set (a ⊔ b ⊔ ℓ₁ ⊔ ℓ₂) where
@@ -94,16 +87,16 @@ record IsBijection (f : A → B) : Set (a ⊔ b ⊔ ℓ₁ ⊔ ℓ₂) where
9487
; surjective = surjective
9588
}
9689

97-
open IsSurjection isSurjection public
98-
using (strictlySurjective; section; inverseˡ; strictlyInverseˡ)
90+
private module S = Section Eq₁.setoid Eq₂.setoid surjective
9991

100-
private module S = Section _≈₂_ surjective
92+
open S public
93+
using (strictlySurjective; section; inverseˡ; strictlyInverseˡ)
10194

10295
inverseʳ : Inverseʳ _≈₁_ _≈₂_ f section
103-
inverseʳ = S.inverseʳ injective Eq₁.refl Eq₂.trans
96+
inverseʳ = S.inverseʳ injective
10497

10598
strictlyInverseʳ : StrictlyInverseʳ _≈₁_ f section
106-
strictlyInverseʳ _ = inverseʳ Eq₂.refl
99+
strictlyInverseʳ = S.strictlyInverseʳ injective
107100

108101

109102
------------------------------------------------------------------------
@@ -125,7 +118,7 @@ record IsLeftInverse (to : A → B) (from : B → A) : Set (a ⊔ b ⊔ ℓ₁
125118
isSurjection : IsSurjection to
126119
isSurjection = record
127120
{ isCongruent = isCongruent
128-
; surjective = inverseˡ⇒surjective _≈₂_ inverseˡ
121+
; surjective = inverseˡ⇒surjective Eq₁.setoid Eq₂.setoid inverseˡ
129122
}
130123

131124

@@ -142,7 +135,7 @@ record IsRightInverse (to : A → B) (from : B → A) : Set (a ⊔ b ⊔ ℓ₁
142135
strictlyInverseʳ _ = inverseʳ Eq₂.refl
143136

144137
injective : Injective _≈₁_ _≈₂_ to
145-
injective = inverseʳ⇒injective _≈₂_ to Eq₂.refl Eq₁.sym Eq₁.trans inverseʳ
138+
injective = inverseʳ⇒injective Eq₁.setoid Eq₂.setoid to inverseʳ
146139

147140
isInjection : IsInjection to
148141
isInjection = record

0 commit comments

Comments
 (0)