Skip to content

Commit 2f6b3c2

Browse files
committed
add: module IsSurjective to Consequences
1 parent 7ef3206 commit 2f6b3c2

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/Function/Consequences.agda

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
module Function.Consequences where
1212

1313
open import Data.Product.Base as Product
14+
open import Function.Base using (_∘_)
1415
open import Function.Definitions
1516
open import Level using (Level)
1617
open import Relation.Binary.Core using (Rel)
@@ -81,6 +82,23 @@ strictlySurjective⇒surjective : Transitive ≈₂ →
8182
strictlySurjective⇒surjective trans cong surj x =
8283
Product.map₂ (λ fy≈x z≈y trans (cong z≈y) fy≈x) (surj x)
8384

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+
84102
------------------------------------------------------------------------
85103
-- StrictlyInverseˡ
86104

0 commit comments

Comments
 (0)