Skip to content

Commit eee973a

Browse files
committed
Progress on Section 11
1 parent 0f0b430 commit eee973a

File tree

1 file changed

+281
-27
lines changed

1 file changed

+281
-27
lines changed

src/literature/introduction-to-homotopy-type-theory.lagda.md

+281-27
Original file line numberDiff line numberDiff line change
@@ -1852,37 +1852,55 @@ and `B : 𝒱` aren't assumed to be in the same universe, then we need to raise
18521852
identity type of `A`, the identity type of `B`, and the empty type to `𝒰 ⊔ 𝒱`.
18531853

18541854
```agda
1855-
open import foundation.equality-coproduct-types using
1856-
( Eq-coproduct)
1855+
module _
1856+
{A B : UU}
1857+
where
18571858
1858-
-- (a)
1859-
open import foundation.equality-coproduct-types using
1860-
( Eq-eq-coproduct
1861-
; eq-Eq-coproduct)
1859+
Eq-copr : (x y : A + B) → UU
1860+
Eq-copr (inl x) (inl x') = x = x'
1861+
Eq-copr (inl x) (inr y') = empty
1862+
Eq-copr (inr y) (inl x') = empty
1863+
Eq-copr (inr y) (inr y') = y = y'
18621864
1863-
_ :
1864-
{l1 l2 : Level} {A : UU l1} {B : UU l2} →
1865-
(x y : A + B) → (x = y) ↔ Eq-coproduct x y
1866-
_ = λ x y → (Eq-eq-coproduct x y , eq-Eq-coproduct x y)
1865+
-- (a)
1866+
open import foundation.equality-coproduct-types using
1867+
( Eq-eq-coproduct
1868+
; eq-Eq-coproduct)
18671869
1868-
-- (b)
1869-
open import foundation.decidable-equality using
1870-
( has-decidable-equality-coproduct
1871-
; has-decidable-equality-left-summand
1872-
; has-decidable-equality-right-summand)
1870+
refl-Eq-copr : (x : A + B) → Eq-copr x x
1871+
refl-Eq-copr (inl x) = refl
1872+
refl-Eq-copr (inr y) = refl
18731873
1874-
_ :
1875-
{l1 l2 : Level} {A : UU l1} {B : UU l2} →
1876-
has-decidable-equality A × has-decidable-equality B ↔
1877-
has-decidable-equality (A + B)
1878-
_ =
1879-
( λ (eqA , eqB) → has-decidable-equality-coproduct eqA eqB) ,
1880-
( λ eqAB →
1881-
has-decidable-equality-left-summand eqAB ,
1882-
has-decidable-equality-right-summand eqAB)
1874+
Eq-eq-copr : (x y : A + B) → x = y → Eq-copr x y
1875+
Eq-eq-copr x ._ refl = refl-Eq-copr x
1876+
1877+
eq-Eq-copr : (x y : A + B) → Eq-copr x y → x = y
1878+
eq-Eq-copr (inl x) (inl x') p = ap inl p
1879+
eq-Eq-copr (inr y) (inr y') p = ap inr p
1880+
1881+
_ : (x y : A + B) → (x = y) ↔ Eq-copr x y
1882+
_ = λ x y → (Eq-eq-copr x y , eq-Eq-copr x y)
1883+
1884+
-- TODO the rest
1885+
1886+
-- (b)
1887+
open import foundation.decidable-equality using
1888+
( has-decidable-equality-coproduct
1889+
; has-decidable-equality-left-summand
1890+
; has-decidable-equality-right-summand)
1891+
1892+
_ :
1893+
{l1 l2 : Level} {A : UU l1} {B : UU l2} →
1894+
has-decidable-equality A × has-decidable-equality B ↔
1895+
has-decidable-equality (A + B)
1896+
_ =
1897+
( λ (eqA , eqB) → has-decidable-equality-coproduct eqA eqB) ,
1898+
( λ eqAB →
1899+
has-decidable-equality-left-summand eqAB ,
1900+
has-decidable-equality-right-summand eqAB)
18831901
1884-
open import elementary-number-theory.equality-integers using
1885-
( has-decidable-equality-ℤ)
1902+
open import elementary-number-theory.equality-integers using
1903+
( has-decidable-equality-ℤ)
18861904
```
18871905

18881906
**Exercise 8.8.** Decidable equality in dependent pair types.
@@ -2295,6 +2313,7 @@ open import foundation.equivalences using
22952313
; is-equiv-top-map-triangle -- is-equiv g → is-equiv f → is-equiv h
22962314
; is-equiv-is-section
22972315
; is-equiv-is-retraction
2316+
; _∘e_ -- in particular, equivalences compose
22982317
)
22992318
```
23002319

@@ -2330,7 +2349,7 @@ open import foundation.functoriality-coproduct-types using
23302349
23312350
-- (d)
23322351
open import foundation.functoriality-coproduct-types using
2333-
( is-equiv-map-coproduct)
2352+
( is-equiv-map-coproduct ; equiv-coproduct)
23342353
```
23352354

23362355
**Exercise 9.7.** Functoriality of products.
@@ -2684,6 +2703,7 @@ open import foundation.contractible-types using
26842703
( is-equiv-is-contr -- is-contr A → is-contr B → is-equiv f
26852704
; is-contr-is-equiv -- is-equiv f → is-contr B → is-contr A
26862705
; is-contr-is-equiv' -- is-equiv f → is-contr A → is-contr B
2706+
; is-contr-equiv
26872707
)
26882708
```
26892709

@@ -2799,3 +2819,237 @@ _ :
27992819
coherence-triangle-maps f pr1 (map-equiv (inv-equiv-total-fiber f))
28002820
_ = λ f → refl-htpy
28012821
```
2822+
2823+
## 11 The fundamental theorem of identity types
2824+
2825+
### 11.1 Families of equivalences
2826+
2827+
**Definition 11.1.1.** Induced maps of total spaces.
2828+
2829+
```agda
2830+
open import foundation.functoriality-dependent-pair-types using
2831+
( tot)
2832+
```
2833+
2834+
**Lemma 11.1.2.** Fibers of `tot f`.
2835+
2836+
```agda
2837+
open import foundation.functoriality-dependent-pair-types using
2838+
( compute-fiber-tot)
2839+
```
2840+
2841+
**Theorem 11.1.3.** `f` is a family of equivalences if and only if `tot f` is an
2842+
equivalence.
2843+
2844+
```agda
2845+
open import foundation.functoriality-dependent-pair-types using
2846+
( is-equiv-tot-is-fiberwise-equiv
2847+
; is-fiberwise-equiv-is-equiv-tot)
2848+
2849+
_ :
2850+
{l1 l2 l3 : Level} {A : UU l1} {B : A → UU l2} {C : A → UU l3}
2851+
{f : (x : A) → B x → C x} →
2852+
((x : A) → is-equiv (f x)) ↔ is-equiv (tot f)
2853+
_ = is-equiv-tot-is-fiberwise-equiv , is-fiberwise-equiv-is-equiv-tot
2854+
```
2855+
2856+
**Lemma 11.1.4.** If `f` is an equivalence, then `σf` is an equivalence.
2857+
2858+
```agda
2859+
open import foundation.functoriality-dependent-pair-types using
2860+
( map-Σ-map-base -- σ
2861+
; is-equiv-map-Σ-map-base
2862+
)
2863+
```
2864+
2865+
**Definition 11.1.5.** Bifunctoriality of dependent pair types.
2866+
2867+
```agda
2868+
open import foundation.functoriality-dependent-pair-types using
2869+
( map-Σ -- tot f g
2870+
)
2871+
```
2872+
2873+
**Theorem 11.1.6.** A family of maps `g` over an equivalence is a family of
2874+
equivalences if and only if `tot f g` is an equivalence.
2875+
2876+
```agda
2877+
open import foundation.functoriality-dependent-pair-types using
2878+
( is-equiv-map-Σ
2879+
; is-fiberwise-equiv-is-equiv-map-Σ)
2880+
2881+
_ :
2882+
{l1 l2 l3 l4 : Level} {A : UU l1} {B : UU l2} {C : A → UU l3} (D : B → UU l4)
2883+
{f : A → B} {g : (x : A) → C x → D (f x)} → is-equiv f →
2884+
((x : A) → is-equiv (g x)) ↔ is-equiv (map-Σ D f g)
2885+
_ = λ D H → is-equiv-map-Σ D H , is-fiberwise-equiv-is-equiv-map-Σ D _ _ H
2886+
```
2887+
2888+
### 11.2 The fundamental theorem
2889+
2890+
**Definition 11.2.1.** Unary identity systems.
2891+
2892+
```agda
2893+
open import foundation.identity-systems using
2894+
( is-identity-system)
2895+
```
2896+
2897+
**Theorem 11.2.2.** The fundamental theorem of identity types.
2898+
2899+
```agda
2900+
open import foundation.fundamental-theorem-of-identity-types using
2901+
( fundamental-theorem-id -- (ii) → (i)
2902+
; fundamental-theorem-id' -- (i) → (ii)
2903+
)
2904+
open import foundation.identity-systems using
2905+
( is-identity-system-is-torsorial -- (ii) → (iii)
2906+
; fundamental-theorem-id-is-identity-system -- (iii) → (i)
2907+
)
2908+
open import foundation.fundamental-theorem-of-identity-types using
2909+
( fundamental-theorem-id-J -- the particular case
2910+
; fundamental-theorem-id-J'
2911+
)
2912+
```
2913+
2914+
### 11.3 Equality on the natural numbers
2915+
2916+
**Theorem 11.3.1.** Characterization of equality of natural numbers.
2917+
2918+
```agda
2919+
open import elementary-number-theory.equality-natural-numbers using
2920+
( is-equiv-Eq-eq-ℕ)
2921+
```
2922+
2923+
### 11.4 Embeddings
2924+
2925+
**Definition 11.4.1.** Embeddings.
2926+
2927+
```agda
2928+
open import foundation.embeddings using
2929+
( is-emb
2930+
; _↪_)
2931+
```
2932+
2933+
**Theorem 11.4.2.** Any equivalence is an embedding.
2934+
2935+
```agda
2936+
open import foundation.equivalences using
2937+
( is-emb-is-equiv)
2938+
```
2939+
2940+
### 11.5 Disjointness of coproducts
2941+
2942+
**Definition 11.5.2.** Observational equality of coproducts.
2943+
2944+
TODO: report that `Eq-copr` has already been defined in Exercise 8.7?
2945+
2946+
```agda
2947+
_ = Eq-copr
2948+
```
2949+
2950+
**Lemma 11.5.3.** Reflexivity of `Eq-copr`.
2951+
2952+
```agda
2953+
_ = refl-Eq-copr
2954+
```
2955+
2956+
**Proposition 11.5.4.** Torsoriality of observational equality of coproducts.
2957+
2958+
```agda
2959+
is-torsorial-Eq-copr :
2960+
{A B : UU} (s : A + B) → is-contr (Σ (A + B) (λ t → Eq-copr s t))
2961+
is-torsorial-Eq-copr {A} {B} (inl x) =
2962+
is-contr-equiv
2963+
( Σ A (λ x' → x = x'))
2964+
( right-unit-law-coproduct (Σ A (λ x' → x = x')) ∘e
2965+
equiv-coproduct id-equiv (right-zero-law-product B) ∘e
2966+
right-distributive-Σ-coproduct A B (Eq-copr (inl x)) )
2967+
( is-torsorial-Id x)
2968+
is-torsorial-Eq-copr {A} {B} (inr y) =
2969+
is-contr-equiv
2970+
( Σ B (λ y' → y = y'))
2971+
( left-unit-law-coproduct (Σ B (λ y' → y = y')) ∘e
2972+
equiv-coproduct (right-zero-law-product A) id-equiv ∘e
2973+
right-distributive-Σ-coproduct A B (Eq-copr (inr y)))
2974+
( is-torsorial-Id y)
2975+
```
2976+
2977+
**Theorem 11.5.1.** Characterization of equality of coproducts.
2978+
2979+
```agda
2980+
is-equiv-Eq-eq-copr : {A B : UU} (x y : A + B) → is-equiv (Eq-eq-copr x y)
2981+
is-equiv-Eq-eq-copr x =
2982+
fundamental-theorem-id (is-torsorial-Eq-copr x) (Eq-eq-copr x)
2983+
2984+
equiv-Eq-eq-copr : {A B : UU} (x y : A + B) → (x = y) ≃ (Eq-copr x y)
2985+
pr1 (equiv-Eq-eq-copr x y) = Eq-eq-copr x y
2986+
pr2 (equiv-Eq-eq-copr x y) = is-equiv-Eq-eq-copr x y
2987+
2988+
module _
2989+
{A B : UU}
2990+
where
2991+
2992+
private variable
2993+
x x' : A
2994+
y y' : B
2995+
2996+
_ : (inl {B = B} x = inl x') ≃ (x = x')
2997+
_ = equiv-Eq-eq-copr (inl _) (inl _)
2998+
2999+
_ : (inl x = inr y') ≃ empty
3000+
_ = equiv-Eq-eq-copr (inl _) (inr _)
3001+
3002+
_ : (inr y = inl x') ≃ empty
3003+
_ = equiv-Eq-eq-copr (inr _) (inl _)
3004+
3005+
_ : (inr {A = A} y = inr y') ≃ (y = y')
3006+
_ = equiv-Eq-eq-copr (inr _) (inr _)
3007+
```
3008+
3009+
### 11.6 The structure identity principle
3010+
3011+
**Definition 11.6.1.** Dependent identity systems.
3012+
3013+
TODO, apparently?
3014+
3015+
**Theorem 11.6.2.** The structure identity principle.
3016+
3017+
TODO as stated? We use torsoriality instead of dependent identity systems.
3018+
3019+
```agda
3020+
open import foundation.structure-identity-principle using
3021+
( extensionality-Σ)
3022+
```
3023+
3024+
**Example 11.6.3.** Characterization of equality of fibers.
3025+
3026+
TODO: report "alternative characterization of the fiber" should probably say
3027+
"equality"
3028+
3029+
TODO: do we have access to `equiv-right-transpose-eq-concat`?
3030+
3031+
```agda
3032+
module _
3033+
{l1 l2 : Level} {A : UU l1} {B : UU l2} (f : A → B) (b : B)
3034+
where
3035+
3036+
open import foundation.identity-types
3037+
3038+
alt-Eq-fiber : (x y : fiber f b) → UU (l1 ⊔ l2)
3039+
alt-Eq-fiber (x , p) (y , q) = fiber (ap f) (p ∙ inv q)
3040+
3041+
refl-alt-Eq-fiber : (x : fiber f b) → alt-Eq-fiber x x
3042+
refl-alt-Eq-fiber (x , p) = refl , (inv (right-inv p))
3043+
3044+
_ : (x y : fiber f b) → (x = y) ≃ alt-Eq-fiber x y
3045+
_ =
3046+
λ (x , p) →
3047+
extensionality-Σ
3048+
( λ q α → ap f α = p ∙ inv q)
3049+
( refl)
3050+
( inv (right-inv p))
3051+
( λ y → id-equiv)
3052+
( λ q → equiv-right-transpose-eq-concat refl q p ∘e equiv-inv p q)
3053+
```
3054+
3055+
### Exercises

0 commit comments

Comments
 (0)