Skip to content

Commit c5a3693

Browse files
laMudrijamesmckinna
authored andcommitted
Connect LeftInverse with (Split)Surjection (agda#2054)
1 parent ce4bd12 commit c5a3693

File tree

3 files changed

+87
-1
lines changed

3 files changed

+87
-1
lines changed

CHANGELOG.md

+13
Original file line numberDiff line numberDiff line change
@@ -3238,6 +3238,13 @@ Additions to existing modules
32383238
evalState : State s a → s → a
32393239
execState : State s a → s → s
32403240
```
3241+
3242+
* Added new proofs and definitions in `Function.Bundles`:
3243+
```agda
3244+
LeftInverse.isSplitSurjection : LeftInverse → IsSplitSurjection to
3245+
LeftInverse.surjection : LeftInverse → Surjection
3246+
SplitSurjection = LeftInverse
3247+
```
32413248

32423249
* Added new application operator synonym to `Function.Bundles`:
32433250
```agda
@@ -3260,6 +3267,12 @@ Additions to existing modules
32603267
_!|>_ : (a : A) → (∀ a → B a) → B a
32613268
_!|>′_ : A → (A → B) → B
32623269
```
3270+
3271+
* Added new proof and record in `Function.Structures`:
3272+
```agda
3273+
IsLeftInverse.isSurjection : IsLeftInverse to from → IsSurjection to
3274+
record IsSplitSurjection (f : A → B) : Set (a ⊔ b ⊔ ℓ₁ ⊔ ℓ₂)
3275+
```
32633276

32643277
* Added new definition to the `Surjection` module in `Function.Related.Surjection`:
32653278
```

src/Function/Bundles.agda

+54-1
Original file line numberDiff line numberDiff line change
@@ -218,14 +218,28 @@ module _ (From : Setoid a ℓ₁) (To : Setoid b ℓ₂) where
218218
}
219219

220220
open IsLeftInverse isLeftInverse public
221-
using (module Eq₁; module Eq₂; strictlyInverseˡ)
221+
using (module Eq₁; module Eq₂; strictlyInverseˡ; isSurjection)
222222

223223
equivalence : Equivalence
224224
equivalence = record
225225
{ to-cong = to-cong
226226
; from-cong = from-cong
227227
}
228228

229+
isSplitSurjection : IsSplitSurjection to
230+
isSplitSurjection = record
231+
{ from = from
232+
; isLeftInverse = isLeftInverse
233+
}
234+
235+
surjection : Surjection From To
236+
surjection = record
237+
{ to = to
238+
; cong = to-cong
239+
; surjective = λ y from y , inverseˡ
240+
}
241+
242+
229243

230244
record RightInverse : Set (a ⊔ b ⊔ ℓ₁ ⊔ ℓ₂) where
231245
field
@@ -346,6 +360,45 @@ module _ (From : Setoid a ℓ₁) (To : Setoid b ℓ₂) where
346360
; from₂-cong = from₂-cong
347361
}
348362

363+
------------------------------------------------------------------------
364+
-- Other
365+
366+
-- A left inverse is also known as a “split surjection”.
367+
--
368+
-- As the name implies, a split surjection is a special kind of
369+
-- surjection where the witness generated in the domain in the
370+
-- function for elements `x₁` and `x₂` are equal if `x₁ ≈ x₂` .
371+
--
372+
-- The difference is the `from-cong` law --- generally, the section
373+
-- (called `Surjection.to⁻` or `SplitSurjection.from`) of a surjection
374+
-- need not respect equality, whereas it must in a split surjection.
375+
--
376+
-- The two notions coincide when the equivalence relation on `B` is
377+
-- propositional equality (because all functions respect propositional
378+
-- equality).
379+
--
380+
-- For further background on (split) surjections, one may consult any
381+
-- general mathematical references which work without the principle
382+
-- of choice. For example:
383+
--
384+
-- https://ncatlab.org/nlab/show/split+epimorphism.
385+
--
386+
-- The connection to set-theoretic notions with the same names is
387+
-- justified by the setoid type theory/homotopy type theory
388+
-- observation/definition that (∃x : A. P) = ∥ Σx : A. P ∥ --- i.e.,
389+
-- we can read set-theoretic ∃ as squashed/propositionally truncated Σ.
390+
--
391+
-- We see working with setoids as working in the MLTT model of a setoid
392+
-- type theory, in which ∥ X ∥ is interpreted as the setoid with carrier
393+
-- set X and the equivalence relation that relates all elements.
394+
-- All maps into ∥ X ∥ respect equality, so in the idiomatic definitions
395+
-- here, we drop the corresponding trivial `cong` field completely.
396+
397+
SplitSurjection : Set _
398+
SplitSurjection = LeftInverse
399+
400+
module SplitSurjection (splitSurjection : SplitSurjection) =
401+
LeftInverse splitSurjection
349402

350403
------------------------------------------------------------------------
351404
-- Bundles specialised for propositional equality

src/Function/Structures.agda

+20
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,12 @@ record IsLeftInverse (to : A → B) (from : B → A) : Set (a ⊔ b ⊔ ℓ₁
107107
strictlyInverseˡ : StrictlyInverseˡ _≈₂_ to from
108108
strictlyInverseˡ x = inverseˡ Eq₁.refl
109109

110+
isSurjection : IsSurjection to
111+
isSurjection = record
112+
{ isCongruent = isCongruent
113+
; surjective = λ y from y , inverseˡ
114+
}
115+
110116

111117
record IsRightInverse (to : A B) (from : B A) : Set (a ⊔ b ⊔ ℓ₁ ⊔ ℓ₂) where
112118
field
@@ -168,3 +174,17 @@ record IsBiInverse
168174

169175
open IsCongruent to-isCongruent public
170176
renaming (cong to to-cong)
177+
178+
179+
------------------------------------------------------------------------
180+
-- Other
181+
------------------------------------------------------------------------
182+
183+
-- See the comment on `SplitSurjection` in `Function.Bundles` for an
184+
-- explanation of (split) surjections.
185+
record IsSplitSurjection (f : A B) : Set (a ⊔ b ⊔ ℓ₁ ⊔ ℓ₂) where
186+
field
187+
from : B A
188+
isLeftInverse : IsLeftInverse f from
189+
190+
open IsLeftInverse isLeftInverse public

0 commit comments

Comments
 (0)