Skip to content

Commit 72f7c78

Browse files
committed
refactor: move properties from Symmetry to Consequences; rename module
1 parent 6bb39ce commit 72f7c78

File tree

1 file changed

+35
-17
lines changed

1 file changed

+35
-17
lines changed

src/Function/Consequences.agda

Lines changed: 35 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -82,23 +82,6 @@ strictlySurjective⇒surjective : Transitive ≈₂ →
8282
strictlySurjective⇒surjective trans cong surj x =
8383
Product.map₂ (λ fy≈x z≈y trans (cong z≈y) fy≈x) (surj x)
8484

85-
module IsSurjective {f : A B} (surjective : Surjective ≈₁ ≈₂ f) where
86-
87-
section : B A
88-
section = proj₁ ∘ surjective
89-
90-
section-inverseˡ : Inverseˡ ≈₁ ≈₂ f section
91-
section-inverseˡ {x = x} = proj₂ (surjective x)
92-
93-
module _ (refl : Reflexive ≈₁) where
94-
95-
strictlySurjective : StrictlySurjective ≈₂ f
96-
strictlySurjective = surjective⇒strictlySurjective ≈₂ refl surjective
97-
98-
section-strictInverseˡ : StrictlyInverseˡ ≈₂ f section
99-
section-strictInverseˡ _ = section-inverseˡ refl
100-
101-
10285
------------------------------------------------------------------------
10386
-- StrictlyInverseˡ
10487

@@ -130,3 +113,38 @@ strictlyInverseʳ⇒inverseʳ : Transitive ≈₁ →
130113
Inverseʳ ≈₁ ≈₂ f f⁻¹
131114
strictlyInverseʳ⇒inverseʳ trans cong sinv {x} y≈f⁻¹x =
132115
trans (cong y≈f⁻¹x) (sinv x)
116+
117+
------------------------------------------------------------------------
118+
-- Theory of the section of a Surjective function
119+
120+
module Section (≈₂ : Rel B ℓ₂) (surj : Surjective {A = A} ≈₁ ≈₂ f) where
121+
122+
section : B A
123+
section = proj₁ ∘ surj
124+
125+
inverseˡ : Inverseˡ ≈₁ ≈₂ f section
126+
inverseˡ {x = x} = proj₂ (surj x)
127+
128+
module _ (refl : Reflexive ≈₁) where
129+
130+
strictlySurjective : StrictlySurjective ≈₂ f
131+
strictlySurjective = surjective⇒strictlySurjective ≈₂ refl surj
132+
133+
strictInverseˡ : StrictlyInverseˡ ≈₂ f section
134+
strictInverseˡ _ = inverseˡ refl
135+
136+
module _ (inj : Injective ≈₁ ≈₂ f) (refl : Reflexive ≈₁) where
137+
138+
private f∘section≡id = strictInverseˡ refl
139+
140+
cong : Symmetric ≈₂ Transitive ≈₂ Congruent ≈₂ ≈₁ section
141+
cong sym trans = inj ∘ trans (f∘section≡id _) ∘ sym ∘ trans (f∘section≡id _) ∘ sym
142+
143+
surjective : Transitive ≈₂ Surjective ≈₂ ≈₁ section
144+
surjective trans x = f x , inj ∘ trans (f∘section≡id _)
145+
146+
injective : Symmetric ≈₂ Transitive ≈₂ Injective ≈₂ ≈₁ section
147+
injective sym trans = trans (sym (f∘section≡id _)) ∘ inverseˡ
148+
149+
bijective : Symmetric ≈₂ Transitive ≈₂ Bijective ≈₂ ≈₁ section
150+
bijective sym trans = injective sym trans , surjective trans

0 commit comments

Comments
 (0)