@@ -35,39 +35,33 @@ module _ (≈₁ : Rel A ℓ₁) (≈₂ : Rel B ℓ₂) (≈₃ : Rel C ℓ₃)
35
35
Injective ≈₁ ≈₃ (g ∘ f)
36
36
injective f-inj g-inj = f-inj ∘ g-inj
37
37
38
- surjective : Transitive ≈₃ → Congruent ≈₂ ≈₃ g →
39
- Surjective ≈₁ ≈₂ f → Surjective ≈₂ ≈₃ g →
38
+ surjective : Surjective ≈₁ ≈₂ f → Surjective ≈₂ ≈₃ g →
40
39
Surjective ≈₁ ≈₃ (g ∘ f)
41
- surjective trans g-cong f-sur g-sur x with g-sur x
42
- ... | y , fy≈x with f-sur y
43
- ... | z , fz≈y = z , trans (g-cong fz≈y) fy≈x
40
+ surjective f-sur g-sur x with g-sur x
41
+ ... | y , gproof with f-sur y
42
+ ... | z , fproof = z , λ a a≈z → gproof (f a) (fproof a a≈z)
44
43
45
- bijective : Transitive ≈₃ → Congruent ≈₂ ≈₃ g →
46
- Bijective ≈₁ ≈₂ f → Bijective ≈₂ ≈₃ g →
44
+ bijective : Bijective ≈₁ ≈₂ f → Bijective ≈₂ ≈₃ g →
47
45
Bijective ≈₁ ≈₃ (g ∘ f)
48
- bijective trans g-cong (f-inj , f-sur) (g-inj , g-sur) =
49
- injective f-inj g-inj , surjective trans g-cong f-sur g-sur
46
+ bijective (f-inj , f-sur) (g-inj , g-sur) =
47
+ injective f-inj g-inj , surjective f-sur g-sur
50
48
51
49
module _ (≈₁ : Rel A ℓ₁) (≈₂ : Rel B ℓ₂) (≈₃ : Rel C ℓ₃)
52
50
(f : A → B) {f⁻¹ : B → A} {g : B → C} (g⁻¹ : C → B)
53
51
where
54
52
55
- inverseˡ : Transitive ≈₃ → Congruent ≈₂ ≈₃ g →
56
- Inverseˡ ≈₁ ≈₂ f f⁻¹ → Inverseˡ ≈₂ ≈₃ g g⁻¹ →
53
+ inverseˡ : Inverseˡ ≈₁ ≈₂ f f⁻¹ → Inverseˡ ≈₂ ≈₃ g g⁻¹ →
57
54
Inverseˡ ≈₁ ≈₃ (g ∘ f) (f⁻¹ ∘ g⁻¹)
58
- inverseˡ trn g-cong f-inv g-inv x = trn (g-cong (f-inv _)) (g -inv x )
55
+ inverseˡ f-inv g-inv x y y≈gfx = g-inv x (f y) (f -inv (g⁻¹ x) y y≈gfx )
59
56
60
- inverseʳ : Transitive ≈₁ → Congruent ≈₂ ≈₁ f⁻¹ →
61
- Inverseʳ ≈₁ ≈₂ f f⁻¹ → Inverseʳ ≈₂ ≈₃ g g⁻¹ →
57
+ inverseʳ : Inverseʳ ≈₁ ≈₂ f f⁻¹ → Inverseʳ ≈₂ ≈₃ g g⁻¹ →
62
58
Inverseʳ ≈₁ ≈₃ (g ∘ f) (f⁻¹ ∘ g⁻¹)
63
- inverseʳ trn f⁻¹-cong f- inv g-inv x = trn (f⁻¹-cong (g-inv _)) (f-inv x )
59
+ inverseʳ f- inv g-inv x y y≈gfx = f-inv x (g⁻¹ y) (g-inv (f x) y y≈gfx )
64
60
65
- inverseᵇ : Transitive ≈₁ → Transitive ≈₃ →
66
- Congruent ≈₂ ≈₃ g → Congruent ≈₂ ≈₁ f⁻¹ →
67
- Inverseᵇ ≈₁ ≈₂ f f⁻¹ → Inverseᵇ ≈₂ ≈₃ g g⁻¹ →
61
+ inverseᵇ : Inverseᵇ ≈₁ ≈₂ f f⁻¹ → Inverseᵇ ≈₂ ≈₃ g g⁻¹ →
68
62
Inverseᵇ ≈₁ ≈₃ (g ∘ f) (f⁻¹ ∘ g⁻¹)
69
- inverseᵇ trn₁ trn₃ g-cong f⁻¹-cong (f-invˡ , f-invʳ) (g-invˡ , g-invʳ) =
70
- inverseˡ trn₃ g-cong f-invˡ g-invˡ , inverseʳ trn₁ f⁻¹-cong f-invʳ g-invʳ
63
+ inverseᵇ (f-invˡ , f-invʳ) (g-invˡ , g-invʳ) =
64
+ inverseˡ f-invˡ g-invˡ , inverseʳ f-invʳ g-invʳ
71
65
72
66
------------------------------------------------------------------------
73
67
-- Structures
@@ -95,14 +89,14 @@ module _ {≈₁ : Rel A ℓ₁} {≈₂ : Rel B ℓ₂} {≈₃ : Rel C ℓ₃}
95
89
IsSurjection ≈₁ ≈₃ (g ∘ f)
96
90
isSurjection f-surj g-surj = record
97
91
{ isCongruent = isCongruent F.isCongruent G.isCongruent
98
- ; surjective = surjective ≈₁ ≈₂ ≈₃ G.Eq₂.trans G.cong F.surjective G.surjective
92
+ ; surjective = surjective ≈₁ ≈₂ ≈₃ F.surjective G.surjective
99
93
} where module F = IsSurjection f-surj; module G = IsSurjection g-surj
100
94
101
95
isBijection : IsBijection ≈₁ ≈₂ f → IsBijection ≈₂ ≈₃ g →
102
96
IsBijection ≈₁ ≈₃ (g ∘ f)
103
97
isBijection f-bij g-bij = record
104
98
{ isInjection = isInjection F.isInjection G.isInjection
105
- ; surjective = surjective ≈₁ ≈₂ ≈₃ G.Eq₂.trans G.cong F.surjective G.surjective
99
+ ; surjective = surjective ≈₁ ≈₂ ≈₃ F.surjective G.surjective
106
100
} where module F = IsBijection f-bij; module G = IsBijection g-bij
107
101
108
102
module _ {≈₁ : Rel A ℓ₁} {≈₂ : Rel B ℓ₂} {≈₃ : Rel C ℓ₃}
@@ -114,22 +108,22 @@ module _ {≈₁ : Rel A ℓ₁} {≈₂ : Rel B ℓ₂} {≈₃ : Rel C ℓ₃}
114
108
isLeftInverse f-invˡ g-invˡ = record
115
109
{ isCongruent = isCongruent F.isCongruent G.isCongruent
116
110
; cong₂ = congruent ≈₃ ≈₂ ≈₁ G.cong₂ F.cong₂
117
- ; inverseˡ = inverseˡ ≈₁ ≈₂ ≈₃ f _ G.Eq₂.trans G.cong₁ F.inverseˡ G.inverseˡ
111
+ ; inverseˡ = inverseˡ ≈₁ ≈₂ ≈₃ f _ F.inverseˡ G.inverseˡ
118
112
} where module F = IsLeftInverse f-invˡ; module G = IsLeftInverse g-invˡ
119
113
120
114
isRightInverse : IsRightInverse ≈₁ ≈₂ f f⁻¹ → IsRightInverse ≈₂ ≈₃ g g⁻¹ →
121
115
IsRightInverse ≈₁ ≈₃ (g ∘ f) (f⁻¹ ∘ g⁻¹)
122
116
isRightInverse f-invʳ g-invʳ = record
123
117
{ isCongruent = isCongruent F.isCongruent G.isCongruent
124
118
; cong₂ = congruent ≈₃ ≈₂ ≈₁ G.cong₂ F.cong₂
125
- ; inverseʳ = inverseʳ ≈₁ ≈₂ ≈₃ _ g⁻¹ F.Eq₁.trans F.cong₂ F. inverseʳ G.inverseʳ
119
+ ; inverseʳ = inverseʳ ≈₁ ≈₂ ≈₃ _ g⁻¹ F.inverseʳ G.inverseʳ
126
120
} where module F = IsRightInverse f-invʳ; module G = IsRightInverse g-invʳ
127
121
128
122
isInverse : IsInverse ≈₁ ≈₂ f f⁻¹ → IsInverse ≈₂ ≈₃ g g⁻¹ →
129
123
IsInverse ≈₁ ≈₃ (g ∘ f) (f⁻¹ ∘ g⁻¹)
130
124
isInverse f-inv g-inv = record
131
125
{ isLeftInverse = isLeftInverse F.isLeftInverse G.isLeftInverse
132
- ; inverseʳ = inverseʳ ≈₁ ≈₂ ≈₃ _ g⁻¹ F.Eq₁.trans F.cong₂ F. inverseʳ G.inverseʳ
126
+ ; inverseʳ = inverseʳ ≈₁ ≈₂ ≈₃ _ g⁻¹ F.inverseʳ G.inverseʳ
133
127
} where module F = IsInverse f-inv; module G = IsInverse g-inv
134
128
135
129
------------------------------------------------------------------------
@@ -150,14 +144,14 @@ module _ {R : Setoid a ℓ₁} {S : Setoid b ℓ₂} {T : Setoid c ℓ₃} where
150
144
surjection surj₁ surj₂ = record
151
145
{ f = G.f ∘ F.f
152
146
; cong = congruent (≈ R) (≈ S) (≈ T) F.cong G.cong
153
- ; surjective = surjective (≈ R) (≈ S) (≈ T) G.Eq₂.trans G.cong F.surjective G.surjective
147
+ ; surjective = surjective (≈ R) (≈ S) (≈ T) F.surjective G.surjective
154
148
} where module F = Surjection surj₁; module G = Surjection surj₂
155
149
156
150
bijection : Bijection R S → Bijection S T → Bijection R T
157
151
bijection bij₁ bij₂ = record
158
152
{ f = G.f ∘ F.f
159
153
; cong = congruent (≈ R) (≈ S) (≈ T) F.cong G.cong
160
- ; bijective = bijective (≈ R) (≈ S) (≈ T) (trans T) G.cong F.bijective G.bijective
154
+ ; bijective = bijective (≈ R) (≈ S) (≈ T) F.bijective G.bijective
161
155
} where module F = Bijection bij₁; module G = Bijection bij₂
162
156
163
157
equivalence : Equivalence R S → Equivalence S T → Equivalence R T
@@ -174,7 +168,7 @@ module _ {R : Setoid a ℓ₁} {S : Setoid b ℓ₂} {T : Setoid c ℓ₃} where
174
168
; g = F.g ∘ G.g
175
169
; cong₁ = congruent (≈ R) (≈ S) (≈ T) F.cong₁ G.cong₁
176
170
; cong₂ = congruent (≈ T) (≈ S) (≈ R) G.cong₂ F.cong₂
177
- ; inverseˡ = inverseˡ (≈ R) (≈ S) (≈ T) F.f _ (trans T) G.cong₁ F.inverseˡ G.inverseˡ
171
+ ; inverseˡ = inverseˡ (≈ R) (≈ S) (≈ T) F.f _ F.inverseˡ G.inverseˡ
178
172
} where module F = LeftInverse invˡ₁; module G = LeftInverse invˡ₂
179
173
180
174
rightInverse : RightInverse R S → RightInverse S T → RightInverse R T
@@ -183,7 +177,7 @@ module _ {R : Setoid a ℓ₁} {S : Setoid b ℓ₂} {T : Setoid c ℓ₃} where
183
177
; g = F.g ∘ G.g
184
178
; cong₁ = congruent (≈ R) (≈ S) (≈ T) F.cong₁ G.cong₁
185
179
; cong₂ = congruent (≈ T) (≈ S) (≈ R) G.cong₂ F.cong₂
186
- ; inverseʳ = inverseʳ (≈ R) (≈ S) (≈ T) _ G.g (trans R) F.cong₂ F.inverseʳ G.inverseʳ
180
+ ; inverseʳ = inverseʳ (≈ R) (≈ S) (≈ T) _ G.g F.inverseʳ G.inverseʳ
187
181
} where module F = RightInverse invʳ₁; module G = RightInverse invʳ₂
188
182
189
183
inverse : Inverse R S → Inverse S T → Inverse R T
@@ -192,7 +186,7 @@ module _ {R : Setoid a ℓ₁} {S : Setoid b ℓ₂} {T : Setoid c ℓ₃} where
192
186
; f⁻¹ = F.f⁻¹ ∘ G.f⁻¹
193
187
; cong₁ = congruent (≈ R) (≈ S) (≈ T) F.cong₁ G.cong₁
194
188
; cong₂ = congruent (≈ T) (≈ S) (≈ R) G.cong₂ F.cong₂
195
- ; inverse = inverseᵇ (≈ R) (≈ S) (≈ T) _ G.f⁻¹ (trans R) (trans T) G.cong₁ F.cong₂ F.inverse G.inverse
189
+ ; inverse = inverseᵇ (≈ R) (≈ S) (≈ T) _ G.f⁻¹ F.inverse G.inverse
196
190
} where module F = Inverse inv₁; module G = Inverse inv₂
197
191
198
192
------------------------------------------------------------------------
0 commit comments