2020module Function.Bundles where
2121
2222open import Function.Base using (_∘_)
23+ open import Function.Consequences.Propositional
24+ using (strictlySurjective⇒surjective; strictlyInverseˡ⇒inverseˡ; strictlyInverseʳ⇒inverseʳ)
2325open import Function.Definitions
2426import Function.Structures as FunctionStructures
2527open import Level using (Level; _⊔_; suc)
2628open import Data.Product.Base using (_,_; proj₁; proj₂)
2729open import Relation.Binary.Bundles using (Setoid)
28- open import Relation.Binary.Core using (_Preserves_⟶_)
2930open import Relation.Binary.PropositionalEquality.Core as ≡
3031 using (_≡_)
3132import Relation.Binary.PropositionalEquality.Properties as ≡
32- open import Function.Consequences.Propositional
3333open Setoid using (isEquivalence)
3434
3535private
@@ -113,13 +113,24 @@ module _ (From : Setoid a ℓ₁) (To : Setoid b ℓ₂) where
113113 open IsSurjection isSurjection public
114114 using
115115 ( strictlySurjective
116+ ; from
117+ ; inverseˡ
118+ ; strictlyInverseˡ
116119 )
117120
118121 to⁻ : B → A
119- to⁻ = proj₁ ∘ surjective
122+ to⁻ = from
123+ {-# WARNING_ON_USAGE to⁻
124+ "Warning: to⁻ was deprecated in v2.3.
125+ Please use Function.Structures.IsSurjection.from instead. "
126+ #-}
120127
121- to∘to⁻ : ∀ x → to (to⁻ x) ≈₂ x
122- to∘to⁻ = proj₂ ∘ strictlySurjective
128+ to∘to⁻ : StrictlyInverseˡ _≈₂_ to from
129+ to∘to⁻ = strictlyInverseˡ
130+ {-# WARNING_ON_USAGE to∘to⁻
131+ "Warning: to∘to⁻ was deprecated in v2.3.
132+ Please use Function.Structures.IsSurjection.strictlyInverseˡ instead. "
133+ #-}
123134
124135
125136 record Bijection : Set (a ⊔ b ⊔ ℓ₁ ⊔ ℓ₂) where
@@ -146,16 +157,27 @@ module _ (From : Setoid a ℓ₁) (To : Setoid b ℓ₂) where
146157 ; surjective = surjective
147158 }
148159
149- open Injection injection public using (isInjection)
150- open Surjection surjection public using (isSurjection; to⁻; strictlySurjective)
160+ open Injection injection public
161+ using (isInjection)
162+ open Surjection surjection public
163+ using (isSurjection
164+ ; strictlySurjective
165+ ; from
166+ ; inverseˡ
167+ ; strictlyInverseˡ
168+ )
151169
152170 isBijection : IsBijection to
153171 isBijection = record
154172 { isInjection = isInjection
155173 ; surjective = surjective
156174 }
157175
158- open IsBijection isBijection public using (module Eq₁ ; module Eq₂ )
176+ open IsBijection isBijection public
177+ using (module Eq₁ ; module Eq₂
178+ ; inverseʳ; strictlyInverseʳ
179+ ; from-cong; from-injective; from-surjective; from-bijective
180+ )
159181
160182
161183------------------------------------------------------------------------
@@ -220,6 +242,8 @@ module _ (From : Setoid a ℓ₁) (To : Setoid b ℓ₂) where
220242 open IsLeftInverse isLeftInverse public
221243 using (module Eq₁ ; module Eq₂ ; strictlyInverseˡ; isSurjection)
222244
245+ open IsSurjection isSurjection public using (surjective)
246+
223247 equivalence : Equivalence
224248 equivalence = record
225249 { to-cong = to-cong
@@ -236,7 +260,7 @@ module _ (From : Setoid a ℓ₁) (To : Setoid b ℓ₂) where
236260 surjection = record
237261 { to = to
238262 ; cong = to-cong
239- ; surjective = λ y → from y , inverseˡ
263+ ; surjective = surjective
240264 }
241265
242266
@@ -246,7 +270,7 @@ module _ (From : Setoid a ℓ₁) (To : Setoid b ℓ₂) where
246270 to : A → B
247271 from : B → A
248272 to-cong : Congruent _≈₁_ _≈₂_ to
249- from-cong : from Preserves _≈₂_ ⟶ _≈₁_
273+ from-cong : Congruent _≈₂_ _≈₁_ from
250274 inverseʳ : Inverseʳ _≈₁_ _≈₂_ to from
251275
252276 isCongruent : IsCongruent to
@@ -264,14 +288,23 @@ module _ (From : Setoid a ℓ₁) (To : Setoid b ℓ₂) where
264288 }
265289
266290 open IsRightInverse isRightInverse public
267- using (module Eq₁ ; module Eq₂ ; strictlyInverseʳ)
291+ using (module Eq₁ ; module Eq₂ ; strictlyInverseʳ; isInjection)
292+
293+ open IsInjection isInjection public using (injective)
268294
269295 equivalence : Equivalence
270296 equivalence = record
271297 { to-cong = to-cong
272298 ; from-cong = from-cong
273299 }
274300
301+ injection : Injection From To
302+ injection = record
303+ { to = to
304+ ; cong = to-cong
305+ ; injective = injective
306+ }
307+
275308
276309 record Inverse : Set (a ⊔ b ⊔ ℓ₁ ⊔ ℓ₂) where
277310 field
@@ -370,7 +403,7 @@ module _ (From : Setoid a ℓ₁) (To : Setoid b ℓ₂) where
370403 -- function for elements `x₁` and `x₂` are equal if `x₁ ≈ x₂` .
371404 --
372405 -- The difference is the `from-cong` law --- generally, the section
373- -- (called `Surjection.to⁻ ` or `SplitSurjection.from`) of a surjection
406+ -- (called `Surjection.from ` or `SplitSurjection.from`) of a surjection
374407 -- need not respect equality, whereas it must in a split surjection.
375408 --
376409 -- The two notions coincide when the equivalence relation on `B` is
0 commit comments