Skip to content

Commit 629f00c

Browse files
committed
fix: streamlining
1 parent f981711 commit 629f00c

File tree

2 files changed

+14
-16
lines changed

2 files changed

+14
-16
lines changed

src/Function/Consequences.agda

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ inverseʳ⇒injective : ∀ (≈₂ : Rel B ℓ₂) f →
5050
Transitive ≈₁
5151
Inverseʳ ≈₁ ≈₂ f f⁻¹
5252
Injective ≈₁ ≈₂ f
53-
inverseʳ⇒injective ≈₂ f refl sym trans invʳ {x} {y} fx≈fy =
54-
trans (sym (invʳ refl)) (invʳ fx≈fy)
53+
inverseʳ⇒injective ≈₂ f refl sym trans invʳ = trans (sym (invʳ refl)) ∘ invʳ
5554

5655
------------------------------------------------------------------------
5756
-- Inverseᵇ
@@ -69,16 +68,15 @@ inverseᵇ⇒bijective {f = f} ≈₂ refl sym trans (invˡ , invʳ) =
6968
-- StrictlySurjective
7069

7170
surjective⇒strictlySurjective : (≈₂ : Rel B ℓ₂)
72-
Reflexive ≈₁
73-
Surjective ≈₁ ≈₂ f
74-
StrictlySurjective ≈₂ f
75-
surjective⇒strictlySurjective _ refl surj x =
76-
Product.map₂ (λ v v refl) (surj x)
71+
Reflexive ≈₁
72+
Surjective ≈₁ ≈₂ f
73+
StrictlySurjective ≈₂ f
74+
surjective⇒strictlySurjective _ refl surj = Product.map₂ (λ v v refl) ∘ surj
7775

7876
strictlySurjective⇒surjective : Transitive ≈₂
79-
Congruent ≈₁ ≈₂ f
80-
StrictlySurjective ≈₂ f
81-
Surjective ≈₁ ≈₂ f
77+
Congruent ≈₁ ≈₂ f
78+
StrictlySurjective ≈₂ f
79+
Surjective ≈₁ ≈₂ f
8280
strictlySurjective⇒surjective trans cong surj x =
8381
Product.map₂ (λ fy≈x z≈y trans (cong z≈y) fy≈x) (surj x)
8482

@@ -134,7 +132,7 @@ module Section (≈₂ : Rel B ℓ₂) (surj : Surjective {A = A} ≈₁ ≈₂
134132
strictlyInverseˡ _ = inverseˡ refl
135133

136134
strictlyInverseʳ : StrictlyInverseʳ ≈₂ section f
137-
strictlyInverseʳ _ = inverseˡ refl
135+
strictlyInverseʳ = strictlyInverseˡ
138136

139137
injective : Symmetric ≈₂ Transitive ≈₂ Injective ≈₂ ≈₁ section
140138
injective sym trans = trans (sym (strictlyInverseˡ _)) ∘ inverseˡ

src/Function/Structures.agda

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ record IsInjection (to : A → B) : Set (a ⊔ b ⊔ ℓ₁ ⊔ ℓ₂) where
6060
open IsCongruent isCongruent public
6161

6262

63-
record IsSurjection (f : A B ) : Set (a ⊔ b ⊔ ℓ₁ ⊔ ℓ₂) where
63+
record IsSurjection (f : A B) : Set (a ⊔ b ⊔ ℓ₁ ⊔ ℓ₂) where
6464
field
6565
isCongruent : IsCongruent f
6666
surjective : Surjective _≈₁_ _≈₂_ f
@@ -75,7 +75,7 @@ record IsSurjection (f : A → B ) : Set (a ⊔ b ⊔ ℓ₁ ⊔ ℓ₂) where
7575
strictlySurjective = S.strictlySurjective Eq₁.refl
7676

7777
strictlyInverseˡ : StrictlyInverseˡ _≈₂_ f section
78-
strictlyInverseˡ _ = S.inverseˡ Eq₁.refl
78+
strictlyInverseˡ _ = inverseˡ Eq₁.refl
7979

8080

8181
record IsBijection (f : A B) : Set (a ⊔ b ⊔ ℓ₁ ⊔ ℓ₂) where
@@ -120,7 +120,7 @@ record IsLeftInverse (to : A → B) (from : B → A) : Set (a ⊔ b ⊔ ℓ₁
120120
renaming (cong to to-cong)
121121

122122
strictlyInverseˡ : StrictlyInverseˡ _≈₂_ to from
123-
strictlyInverseˡ = inverseˡ⇒strictlyInverseˡ _≈₁_ _≈₂_ Eq₁.refl inverseˡ
123+
strictlyInverseˡ _ = inverseˡ Eq₁.refl
124124

125125
isSurjection : IsSurjection to
126126
isSurjection = record
@@ -139,10 +139,10 @@ record IsRightInverse (to : A → B) (from : B → A) : Set (a ⊔ b ⊔ ℓ₁
139139
renaming (cong to to-cong)
140140

141141
strictlyInverseʳ : StrictlyInverseʳ _≈₁_ to from
142-
strictlyInverseʳ = inverseʳ⇒strictlyInverseʳ _≈₁_ _≈₂_ Eq₂.refl inverseʳ
142+
strictlyInverseʳ _ = inverseʳ Eq₂.refl
143143

144144
injective : Injective _≈₁_ _≈₂_ to
145-
injective = inverseʳ⇒injective {f⁻¹ = from} _≈₂_ to Eq₂.refl Eq₁.sym Eq₁.trans inverseʳ
145+
injective = inverseʳ⇒injective _≈₂_ to Eq₂.refl Eq₁.sym Eq₁.trans inverseʳ
146146

147147
isInjection : IsInjection to
148148
isInjection = record

0 commit comments

Comments
 (0)