20
20
module Function.Bundles where
21
21
22
22
open import Function.Base using (_∘_)
23
+ open import Function.Consequences.Propositional
24
+ using (strictlySurjective⇒surjective; strictlyInverseˡ⇒inverseˡ; strictlyInverseʳ⇒inverseʳ)
23
25
open import Function.Definitions
24
26
import Function.Structures as FunctionStructures
25
27
open import Level using (Level; _⊔_; suc)
26
28
open import Data.Product.Base using (_,_; proj₁; proj₂)
27
29
open import Relation.Binary.Bundles using (Setoid)
28
- open import Relation.Binary.Core using (_Preserves_⟶_)
29
30
open import Relation.Binary.PropositionalEquality.Core as ≡
30
31
using (_≡_)
31
32
import Relation.Binary.PropositionalEquality.Properties as ≡
32
- open import Function.Consequences.Propositional
33
33
open Setoid using (isEquivalence)
34
34
35
35
private
@@ -113,13 +113,24 @@ module _ (From : Setoid a ℓ₁) (To : Setoid b ℓ₂) where
113
113
open IsSurjection isSurjection public
114
114
using
115
115
( strictlySurjective
116
+ ; from
117
+ ; inverseˡ
118
+ ; strictlyInverseˡ
116
119
)
117
120
118
121
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
+ #-}
120
127
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
+ #-}
123
134
124
135
125
136
record Bijection : Set (a ⊔ b ⊔ ℓ₁ ⊔ ℓ₂) where
@@ -146,16 +157,27 @@ module _ (From : Setoid a ℓ₁) (To : Setoid b ℓ₂) where
146
157
; surjective = surjective
147
158
}
148
159
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
+ )
151
169
152
170
isBijection : IsBijection to
153
171
isBijection = record
154
172
{ isInjection = isInjection
155
173
; surjective = surjective
156
174
}
157
175
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
+ )
159
181
160
182
161
183
------------------------------------------------------------------------
@@ -220,6 +242,8 @@ module _ (From : Setoid a ℓ₁) (To : Setoid b ℓ₂) where
220
242
open IsLeftInverse isLeftInverse public
221
243
using (module Eq₁ ; module Eq₂ ; strictlyInverseˡ; isSurjection)
222
244
245
+ open IsSurjection isSurjection public using (surjective)
246
+
223
247
equivalence : Equivalence
224
248
equivalence = record
225
249
{ to-cong = to-cong
@@ -236,7 +260,7 @@ module _ (From : Setoid a ℓ₁) (To : Setoid b ℓ₂) where
236
260
surjection = record
237
261
{ to = to
238
262
; cong = to-cong
239
- ; surjective = λ y → from y , inverseˡ
263
+ ; surjective = surjective
240
264
}
241
265
242
266
@@ -246,7 +270,7 @@ module _ (From : Setoid a ℓ₁) (To : Setoid b ℓ₂) where
246
270
to : A → B
247
271
from : B → A
248
272
to-cong : Congruent _≈₁_ _≈₂_ to
249
- from-cong : from Preserves _≈₂_ ⟶ _≈₁_
273
+ from-cong : Congruent _≈₂_ _≈₁_ from
250
274
inverseʳ : Inverseʳ _≈₁_ _≈₂_ to from
251
275
252
276
isCongruent : IsCongruent to
@@ -264,14 +288,23 @@ module _ (From : Setoid a ℓ₁) (To : Setoid b ℓ₂) where
264
288
}
265
289
266
290
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)
268
294
269
295
equivalence : Equivalence
270
296
equivalence = record
271
297
{ to-cong = to-cong
272
298
; from-cong = from-cong
273
299
}
274
300
301
+ injection : Injection From To
302
+ injection = record
303
+ { to = to
304
+ ; cong = to-cong
305
+ ; injective = injective
306
+ }
307
+
275
308
276
309
record Inverse : Set (a ⊔ b ⊔ ℓ₁ ⊔ ℓ₂) where
277
310
field
@@ -370,7 +403,7 @@ module _ (From : Setoid a ℓ₁) (To : Setoid b ℓ₂) where
370
403
-- function for elements `x₁` and `x₂` are equal if `x₁ ≈ x₂` .
371
404
--
372
405
-- 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
374
407
-- need not respect equality, whereas it must in a split surjection.
375
408
--
376
409
-- The two notions coincide when the equivalence relation on `B` is
0 commit comments