Skip to content

Commit b423ee4

Browse files
authored
defn: equivalences over (#398)
Defines "equivalences over", or displayed equivalences, along with three examples: - an adjunction is an equivalence iff being invertible is equivalent to itself over the Hom-equivalence; - being a symmetric monoidal monad is equivalent to being a symmetric monad strength over the equivalence between monoidal monads and commutative monads; - being a concrete abelian group is equivalent to being an abelian group over the equivalence between concrete groups and groups. ## Checklist Before submitting a merge request, please check the items below: - [X] I've read [the contributing guidelines](https://github.com/plt-amy/1lab/blob/main/CONTRIBUTING.md). - [X] The imports of new modules have been sorted with `support/sort-imports.hs` (or `nix run --experimental-features nix-command -f . sort-imports`). - [X] All new code blocks have "agda" as their language. If your change affects many files without adding substantial content, and you don't want your name to appear on those pages (for example, treewide refactorings or reformattings), start the commit message and PR title with `chore:`.
1 parent 88c2d5d commit b423ee4

File tree

11 files changed

+209
-50
lines changed

11 files changed

+209
-50
lines changed

src/1Lab/Equiv/Fibrewise.lagda.md

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
---
22
description: |
33
We establish a correspondence between "fibrewise equivalences" and
4-
equivalences of total spaces (Σ-types).
4+
equivalences of total spaces (Σ-types), and define equivalences over.
55
---
66
<!--
77
```agda
8+
open import 1Lab.Equiv.FromPath
89
open import 1Lab.HLevel.Closure
10+
open import 1Lab.Type.Sigma
11+
open import 1Lab.HLevel
912
open import 1Lab.Equiv
1013
open import 1Lab.Path
1114
open import 1Lab.Type
@@ -91,3 +94,62 @@ equiv→total always-eqv .is-eqv y =
9194
(total-fibres .snd)
9295
(always-eqv .is-eqv (y .snd))
9396
```
97+
98+
## Equivalences over {defines="equivalence-over"}
99+
100+
We can generalise the notion of fibrewise equivalence to families
101+
$P : A \to \ty$, $Q : B \to \ty$ over *different* base types,
102+
provided we have an equivalence $e : A \simeq B$. In that case, we
103+
say that $P$ and $Q$ are **equivalent over** $e$ if $P(a) \simeq Q(b)$
104+
whenever $a : A$ and $b : B$ are identified [[over|path over]] $e$.
105+
106+
Using univalence, we can see this as a special case of [[dependent paths]],
107+
where the base type is taken to be the universe and the type family sends
108+
a type $A$ to the type of type families over $A$. However, the
109+
following explicit definition is easier to work with.
110+
111+
<!--
112+
```agda
113+
module _ {ℓa ℓb} {A : Type ℓa} {B : Type ℓb} where
114+
```
115+
-->
116+
117+
```agda
118+
_≃[_]_ : ∀ {ℓp ℓq} (P : A → Type ℓp) (e : A ≃ B) (Q : B → Type ℓq) → Type _
119+
P ≃[ e ] Q = ∀ (a : A) (b : B) → e .fst a ≡ b → P a ≃ Q b
120+
```
121+
122+
While this definition is convenient to *use*, we provide helpers that
123+
make it easier to *build* equivalences over.
124+
125+
<!--
126+
```agda
127+
module _ {ℓp ℓq} {P : A → Type ℓp} {Q : B → Type ℓq} (e : A ≃ B) where
128+
private module e = Equiv e
129+
```
130+
-->
131+
132+
```agda
133+
over-left→over : (∀ (a : A) → P a ≃ Q (e.to a)) → P ≃[ e ] Q
134+
over-left→over e' a b p = e' a ∙e line→equiv (λ i → Q (p i))
135+
136+
over-right→over : (∀ (b : B) → P (e.from b) ≃ Q b) → P ≃[ e ] Q
137+
over-right→over e' a b p = line→equiv (λ i → P (e.adjunctl p i)) ∙e e' b
138+
139+
prop-over-ext
140+
: (∀ {a} → is-prop (P a))
141+
→ (∀ {b} → is-prop (Q b))
142+
→ (∀ (a : A) → P a → Q (e.to a))
143+
→ (∀ (b : B) → Q b → P (e.from b))
144+
→ P ≃[ e ] Q
145+
prop-over-ext propP propQ P→Q Q→P a b p = prop-ext propP propQ
146+
(subst Q p ∘ P→Q a)
147+
(subst P (sym (e.adjunctl p)) ∘ Q→P b)
148+
```
149+
150+
An equivalence over $e$ induces an equivalence of total spaces:
151+
152+
```agda
153+
over→total : P ≃[ e ] Q → Σ A P ≃ Σ B Q
154+
over→total e' = Σ-ap e λ a → e' a (e.to a) refl
155+
```

src/1Lab/Path.lagda.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ module _ {ℓ} {A : Type ℓ} {a b : A} {p : a ≡ b} where private
165165
right-endpoint = refl
166166
```
167167

168-
## Dependent paths
168+
## Dependent paths {defines="dependent-path path-over"}
169169

170170
Since we're working in dependent type theory, a sensible question to ask
171171
is whether we can extend the idea that paths are functions $\bI \to A$

src/1Lab/Prelude.agda

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ open import 1Lab.Equiv.HalfAdjoint public
3333
open import 1Lab.Function.Surjection public
3434

3535
open import 1Lab.Univalence public
36-
open import 1Lab.Univalence.SIP public
36+
open import 1Lab.Univalence.SIP
37+
renaming (_≃[_]_ to _≃[_]s_)
38+
public
3739

3840
open import 1Lab.Type.Pi public
3941
open import 1Lab.Type.Sigma public

src/1Lab/Reflection/HLevel.agda

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ open import 1Lab.Reflection.Signature
22
open import 1Lab.Function.Embedding
33
open import 1Lab.Reflection.Record
44
open import 1Lab.Reflection.Subst
5+
open import 1Lab.Equiv.Fibrewise
56
open import 1Lab.HLevel.Universe
67
open import 1Lab.HLevel.Closure
78
open import 1Lab.Reflection
@@ -235,6 +236,7 @@ private module _ {ℓ} {A : n-Type ℓ 2} {B : ∣ A ∣ → n-Type ℓ 3} where
235236
private variable
236237
ℓ ℓ' : Level
237238
A B C : Type ℓ
239+
P Q : A Type ℓ
238240

239241
{-
240242
In addition to the top-level 'hlevel' entry point, there are quite a few
@@ -259,6 +261,15 @@ prop-ext!
259261
A ≃ B
260262
prop-ext! = prop-ext (hlevel 1) (hlevel 1)
261263

264+
prop-over-ext!
265+
: (e : A ≃ B) (let module e = Equiv e)
266+
{a} H-Level (P a) 1
267+
{b} H-Level (Q b) 1
268+
( (a : A) P a Q (e.to a))
269+
( (b : B) Q b P (e.from b))
270+
P ≃[ e ] Q
271+
prop-over-ext! e = prop-over-ext e (hlevel 1) (hlevel 1)
272+
262273
Σ-prop-path!
263274
: {ℓ ℓ'} {A : Type ℓ} {B : A Type ℓ'}
264275
→ ⦃ bxprop : {x} H-Level (B x) 1

src/Algebra/Group/Ab.lagda.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ private variable
3838
3939
Group-on-is-abelian : Group-on G → Type _
4040
Group-on-is-abelian G = ∀ x y → Group-on._⋆_ G x y ≡ Group-on._⋆_ G y x
41+
42+
Group-on-is-abelian-is-prop : (g : Group-on G) → is-prop (Group-on-is-abelian g)
43+
Group-on-is-abelian-is-prop g = Π-is-hlevel² 1 λ _ _ → g .Group-on.has-is-set _ _
4144
```
4245
-->
4346

@@ -60,7 +63,7 @@ instance
6063
H-Level-is-abelian-group
6164
: ∀ {n} {* : G → G → G} → H-Level (is-abelian-group *) (suc n)
6265
H-Level-is-abelian-group = prop-instance $ Iso→is-hlevel 1 eqv $
63-
Σ-is-hlevel 1 (hlevel 1) λ x → Π-is-hlevel' 1 λ _ → Π-is-hlevel' 1 λ _ →
66+
Σ-is-hlevel 1 (hlevel 1) λ x → Π-is-hlevel²' 1 λ _ _ →
6467
is-group.has-is-set x _ _
6568
```
6669
-->

src/Algebra/Group/Concrete.lagda.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ opaque
120120
S¹-concrete : ConcreteGroup lzero
121121
S¹-concrete .B = S¹∙
122122
S¹-concrete .has-is-connected = S¹-is-connected
123-
S¹-concrete .has-is-groupoid = hlevel 3
123+
S¹-concrete .has-is-groupoid = S¹-is-groupoid
124124
```
125125

126126
## The category of concrete groups
@@ -409,7 +409,7 @@ need to bend the path into a `Square`{.Agda}:
409409
linv = funext∙ g≡f ptg≡ptf
410410
```
411411

412-
*Phew*. At last, `π₁F`{.Agda} is fully faithful.
412+
At last, `π₁F`{.Agda} is fully faithful.
413413

414414
```agda
415415
π₁F-is-ff : is-fully-faithful (π₁F {ℓ})
@@ -428,11 +428,11 @@ this lets us conclude with the desired equivalence.
428428
(λ {G} {H} → π₁F-is-ff {_} {G} {H})
429429
π₁F-is-split-eso
430430
431-
π₁B-is-equiv : is-equiv (π₁B {ℓ})
432-
π₁B-is-equiv = is-cat-equivalence→equiv-on-objects
431+
Concrete≃Abstract : ConcreteGroup ℓ ≃ Group ℓ
432+
Concrete≃Abstract = _ , is-cat-equivalence→equiv-on-objects
433433
ConcreteGroups-is-category
434434
Groups-is-category
435435
π₁F-is-equivalence
436436
437-
module Concrete≃Abstract {ℓ} = Equiv (_ , π₁B-is-equiv {ℓ})
437+
module Concrete≃Abstract {ℓ} = Equiv (Concrete≃Abstract {ℓ})
438438
```

src/Algebra/Group/Concrete/Abelian.lagda.md

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -59,30 +59,27 @@ that has equal opposite sides.
5959
x
6060
```
6161

62-
Still unsurprisingly, the delooping of an abelian group is abelian.
62+
Still unsurprisingly, the properties of being a concrete abelian group
63+
and being an abelian group are [[equivalent over|equivalence over]]
64+
the equivalence between concrete and abstract groups.
6365

6466
```agda
65-
Deloop-abelian
66-
: ∀ {ℓ} {G : Group ℓ}
67-
→ is-commutative-group G → is-concrete-abelian (Concrete G)
68-
Deloop-abelian G-ab = ∙-comm _ G-ab
67+
abelian≃abelian
68+
: ∀ {ℓ}
69+
→ is-concrete-abelian ≃[ Concrete≃Abstract {ℓ} ] is-commutative-group
70+
abelian≃abelian = prop-over-ext Concrete≃Abstract
71+
(λ {G} → is-concrete-abelian-is-prop G)
72+
(λ {G} → Group-on-is-abelian-is-prop (G .snd))
73+
(λ G G-ab → G-ab)
74+
(λ G G-ab → ∙-comm _ G-ab)
6975
```
7076

71-
The circle is another example, being the delooping of $\mathbb{Z}$.
77+
For example, the circle is abelian, being the delooping of $\mathbb{Z}$.
7278

7379
```agda
74-
π₁-abelian→abelian
75-
: ∀ {ℓ} {G : ConcreteGroup ℓ}
76-
→ is-commutative-group (π₁B G) → is-concrete-abelian G
77-
π₁-abelian→abelian {G = G} π₁G-ab = subst is-concrete-abelian
78-
(Concrete≃Abstract.η G)
79-
(Deloop-abelian π₁G-ab)
80-
8180
S¹-concrete-abelian : is-concrete-abelian S¹-concrete
82-
S¹-concrete-abelian = π₁-abelian→abelian {G = S¹-concrete}
83-
(subst is-commutative-group
84-
(sym π₁S¹≡ℤ)
85-
(Abelian→Group-on-abelian (ℤ-ab .snd)))
81+
S¹-concrete-abelian = Equiv.from (abelian≃abelian S¹-concrete ℤ π₁S¹≡ℤ)
82+
(Abelian→Group-on-abelian (ℤ-ab .snd))
8683
```
8784

8885
## First abelian group cohomology
@@ -228,6 +225,8 @@ module _ {ℓ}
228225
: H¹[ Concrete G , Concrete H ] ≃ Hom (Groups ℓ) G H
229226
first-abelian-group-cohomology =
230227
first-concrete-abelian-group-cohomology
231-
(Concrete G) (Concrete H) (Deloop-abelian H-ab) e⁻¹
228+
(Concrete G) (Concrete H)
229+
(Equiv.from (abelian≃abelian (Concrete H) H (Concrete≃Abstract.ε H)) H-ab)
230+
e⁻¹
232231
∙e Deloop-hom-equiv
233232
```

src/Cat/Functor/Adjoint.lagda.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,9 @@ $\hom(La,b) \cong \hom(a,Rb)$.
220220
R-adjunct-is-equiv : ∀ {a b} → is-equiv (R-adjunct {a} {b})
221221
R-adjunct-is-equiv = is-iso→is-equiv
222222
(iso L-adjunct R-L-adjunct L-R-adjunct)
223+
224+
adjunct-hom-equiv : ∀ {a b} → D.Hom (L.₀ a) b ≃ C.Hom a (R.₀ b)
225+
adjunct-hom-equiv = L-adjunct , L-adjunct-is-equiv
223226
```
224227

225228
<!--

src/Cat/Functor/Adjoint/Hom.lagda.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ module _ {o ℓ o'} {C : Precategory o ℓ} {D : Precategory o' ℓ}
182182
module R = Func R
183183
184184
hom-equiv : ∀ {a b} → C.Hom (L.₀ a) b ≃ D.Hom a (R.₀ b)
185-
hom-equiv = _ , L-adjunct-is-equiv adj
185+
hom-equiv = adjunct-hom-equiv adj
186186
187187
adjunct-hom-iso-from
188188
: ∀ a → Hom-from C (L.₀ a) ≅ⁿ Hom-from D a F∘ R

src/Cat/Functor/Equivalence.lagda.md

Lines changed: 90 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -562,19 +562,6 @@ open is-equivalence
562562
open Precategory
563563
open _⊣_
564564
565-
Id-is-equivalence : ∀ {o h} {C : Precategory o h} → is-equivalence {C = C} Id
566-
Id-is-equivalence {C = C} .F⁻¹ = Id
567-
Id-is-equivalence {C = C} .F⊣F⁻¹ .unit .η x = C .id
568-
Id-is-equivalence {C = C} .F⊣F⁻¹ .unit .is-natural x y f = C .idl _ ∙ sym (C .idr _)
569-
Id-is-equivalence {C = C} .F⊣F⁻¹ .counit .η x = C .id
570-
Id-is-equivalence {C = C} .F⊣F⁻¹ .counit .is-natural x y f = C .idl _ ∙ sym (C .idr _)
571-
Id-is-equivalence {C = C} .F⊣F⁻¹ .zig = C .idl _
572-
Id-is-equivalence {C = C} .F⊣F⁻¹ .zag = C .idl _
573-
Id-is-equivalence {C = C} .unit-iso x =
574-
Cat.Reasoning.make-invertible C (C .id) (C .idl _) (C .idl _)
575-
Id-is-equivalence {C = C} .counit-iso x =
576-
Cat.Reasoning.make-invertible C (C .id) (C .idl _) (C .idl _)
577-
578565
unquoteDecl H-Level-is-precat-iso = declare-record-hlevel 1 H-Level-is-precat-iso (quote is-precat-iso)
579566
580567
module
@@ -831,3 +818,93 @@ _∘Equivalence_ : Equivalence C D → Equivalence D E → Equivalence C E
831818
(F ∘Equivalence G) .Equivalence.To-equiv =
832819
is-equivalence-∘ (Equivalence.To-equiv G) (Equivalence.To-equiv F)
833820
```
821+
822+
Unsurprisingly, the identity functor is an equivalence.
823+
824+
```agda
825+
Id-is-equivalence : ∀ {o h} {C : Precategory o h} → is-equivalence {C = C} Id
826+
Id-is-equivalence {C = C} .F⁻¹ = Id
827+
Id-is-equivalence {C = C} .F⊣F⁻¹ .unit .η x = C .id
828+
Id-is-equivalence {C = C} .F⊣F⁻¹ .unit .is-natural x y f = C .idl _ ∙ sym (C .idr _)
829+
Id-is-equivalence {C = C} .F⊣F⁻¹ .counit .η x = C .id
830+
Id-is-equivalence {C = C} .F⊣F⁻¹ .counit .is-natural x y f = C .idl _ ∙ sym (C .idr _)
831+
Id-is-equivalence {C = C} .F⊣F⁻¹ .zig = C .idl _
832+
Id-is-equivalence {C = C} .F⊣F⁻¹ .zag = C .idl _
833+
Id-is-equivalence {C = C} .unit-iso x =
834+
Cat.Reasoning.make-invertible C (C .id) (C .idl _) (C .idl _)
835+
Id-is-equivalence {C = C} .counit-iso x =
836+
Cat.Reasoning.make-invertible C (C .id) (C .idl _) (C .idl _)
837+
```
838+
839+
### Preserving invertibility
840+
841+
We can characterise equivalences as those adjunctions $L \vdash R$ that
842+
*preserve invertibility*, in the sense that the adjunct of an isomorphism
843+
$L(a) \cong b$ is an isomorphism $a \cong R(b)$ and vice versa;
844+
that is, the property of being invertible in $\cC$ is equivalent to
845+
the property of being invertible in $\cD$ [[over|equivalence over]]
846+
the adjunction's $\hom$-equivalence $(L(a) \to b) \simeq (a \to R(b))$.
847+
848+
<!--
849+
```agda
850+
module
851+
_ {o ℓ o' ℓ'} {C : Precategory o ℓ} {D : Precategory o' ℓ'}
852+
{L : Functor C D} {R : Functor D C} (L⊣R : L ⊣ R)
853+
where
854+
private
855+
module C = Cat.Reasoning C
856+
module D = Cat.Reasoning D
857+
module L = Fr L
858+
module R = Fr R
859+
```
860+
-->
861+
862+
```agda
863+
preserves-invertibility : Type (o ⊔ ℓ ⊔ o' ⊔ ℓ')
864+
preserves-invertibility = ∀ {a b} →
865+
D.is-invertible ≃[ adjunct-hom-equiv L⊣R {a} {b} ] C.is-invertible
866+
```
867+
868+
Since the unit and counit of an adjunction are adjuncts of identities,
869+
it's not hard to see that they must be invertible if the adjunction
870+
preserves invertibility.
871+
872+
```agda
873+
preserves-invertibility→equivalence
874+
: preserves-invertibility → is-equivalence L
875+
preserves-invertibility→equivalence e .F⁻¹ = R
876+
preserves-invertibility→equivalence e .F⊣F⁻¹ = L⊣R
877+
preserves-invertibility→equivalence e .unit-iso c = C.invertible-cancelr
878+
(R.F-map-invertible D.id-invertible)
879+
(Equiv.to (e D.id _ refl) D.id-invertible)
880+
preserves-invertibility→equivalence e .counit-iso d = D.invertible-cancell
881+
(L.F-map-invertible C.id-invertible)
882+
(Equiv.from (e _ _ (L-R-adjunct L⊣R _)) C.id-invertible)
883+
```
884+
885+
The other direction is just as straightforward, since adjuncts are
886+
defined by composition with the (co)unit, and isomorphisms compose.
887+
888+
<!--
889+
```agda
890+
module
891+
_ {o ℓ o' ℓ'} {C : Precategory o ℓ} {D : Precategory o' ℓ'}
892+
(F : Functor C D) (eqv : is-equivalence F)
893+
where
894+
private
895+
module e = is-equivalence eqv
896+
module C = Cat.Reasoning C
897+
module D = Cat.Reasoning D
898+
module F = Fr F
899+
module F⁻¹ = Fr e.F⁻¹
900+
```
901+
-->
902+
903+
```agda
904+
equivalence→preserves-invertibility : preserves-invertibility e.F⊣F⁻¹
905+
equivalence→preserves-invertibility = prop-over-ext
906+
(adjunct-hom-equiv e.F⊣F⁻¹)
907+
(hlevel 1) (hlevel 1)
908+
(λ f inv → C.invertible-∘ (F⁻¹.F-map-invertible inv) (e.unit-iso _))
909+
(λ f inv → D.invertible-∘ (e.counit-iso _) (F.F-map-invertible inv))
910+
```

0 commit comments

Comments
 (0)