more proofs

This commit is contained in:
Michael Zhang 2024-09-27 13:50:18 -05:00
parent dcfc5e58f4
commit aba838f901
4 changed files with 76 additions and 29 deletions

View file

@ -5,7 +5,8 @@ module CubicalHott.Lemma2-3-10 where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Function
lemma : {A B : Type} {f : A B} {P : B Type} {x y : A}
lemma : {A B : Type} {x y : A}
(f : A B) (P : B Type)
(p : x y) (u : P (f x))
subst (P f) p u subst P (cong f p) u
lemma {f = f} {P = P} p u i = transp (λ i P (f (p i))) i0 u
lemma f P p u i = transp (λ i P (f (p i))) i0 u

View file

@ -21,21 +21,25 @@ private
-- Definition 8.1.1
suc≃ :
suc≃ = isoToEquiv (iso suc pred sec ret) where
sec : section suc pred
sec (+_ zero) = refl
sec +[1+ n ] = refl
sec (-[1+_] zero) = refl
sec (-[1+_] (nsuc n)) = refl
ret : retract suc pred
ret (+_ zero) = refl
ret +[1+ n ] = refl
ret (-[1+_] zero) = refl
ret (-[1+_] (nsuc n)) = refl
suc≡ :
suc≡ = ua suc≃
code : Type
code base =
code (loop i) = ua suc≃ i where
suc≃ :
suc≃ = isoToEquiv (iso suc pred sec ret) where
sec : section suc pred
sec (+_ zero) = refl
sec +[1+ n ] = refl
sec (-[1+_] zero) = refl
sec (-[1+_] (nsuc n)) = refl
ret : retract suc pred
ret (+_ zero) = refl
ret +[1+ n ] = refl
ret (-[1+_] zero) = refl
ret (-[1+_] (nsuc n)) = refl
code (loop i) = suc≡ i
loop⁻ : base base
loop⁻ (+_ zero) = refl
@ -47,8 +51,9 @@ loop⁻ (-[1+_] (nsuc n)) = loop⁻ -[1+ n ] ∙ (sym loop)
lemma8-1-2a : (x : ) subst code loop x suc x
lemma8-1-2a x =
subst code loop x ≡⟨ lemma2-3-10 {! !} {! !}
subst (idfun _) (cong code loop) x ≡⟨ {! !}
subst code loop x ≡⟨ lemma2-3-10 (idfun ) code loop x
subst (idfun Type) (cong code loop) x ≡⟨⟩
subst (idfun Type) suc≡ x ≡⟨⟩
suc x
-- Definition 8.1.5
@ -59,8 +64,14 @@ encode s p = subst code p +0
-- Definition 8.1.6
decode : (x : ) code x base x
decode base c = refl
decode (loop i) c = {! !}
decode base c = loop⁻ c
decode (loop i) c j =
let u = λ k λ where
(i = i0) {! !}
(i = i1) loop⁻ c j
(j = i0) base
(j = i1) loop (i ~ k)
in hcomp u {! !}
-- Corollary 8.1.10

View file

@ -40,7 +40,7 @@ Prove the propositional computation law for `J`:
```agda
JRefl : {A : Type } {x : A} (P : (z : A) → x ≡ z → Type '')
(d : P x refl) → J P d refl ≡ d
JRefl P d i = {! !}
JRefl {x = x} P d i = transp (λ _ → P x refl) i d
```
### Exercise 2 (★★)
@ -58,7 +58,7 @@ transport computes away at `i = i1`.
```agda
fromPathP : {A : I → Type } {x : A i0} {y : A i1} →
PathP A x y → transport (λ i → A i) x ≡ y
fromPathP {A = A} p i = {!!}
fromPathP {A = A} {x = x} p i = {! !}
```
### Exercise 3 (★★★)
@ -122,5 +122,17 @@ This requires drawing a cube (yes, an actual 3D one)!
```agda
isPropIsContr : {A : Type } → isProp (isContr A)
isPropIsContr (c0 , h0) (c1 , h1) j = {!!}
isPropIsContr (c0 , h0) (c1 , h1) j = sym (h1 c0) j , λ y i →
-- A
-- ———— Boundary (wanted) —————————————————————————————————————
-- i = i0 ⊢ h1 c0 (~ j)
-- i = i1 ⊢ y
-- j = i0 ⊢ h0 y i
-- j = i1 ⊢ h1 y i
let u = λ k → λ where
(i = i0) → h1 c0 (~ j ∧ k)
(i = i1) → y
(j = i0) → {! h0 y i !}
(j = i1) → {! !}
in hcomp u {! !}
```

View file

@ -43,7 +43,15 @@ Hint: one hcomp should suffice. Use `comp-filler` and connections
```agda
lUnit : {A : Type } {x y : A} (p : x ≡ y) → refl ∙ p ≡ p
lUnit = {!!}
lUnit {x = x} {y = y} p i j =
let u = λ k → λ where
(i = i0) → hfill (λ k → λ { (j = i0) → x ; (j = i1) → p k }) (inS x) k
(i = i1) → p j
(j = i0) → x
(j = i1) → p (i k)
in hcomp u (p (i ∧ j))
cf = comp-filler
```
### (b)
@ -53,15 +61,18 @@ Hint: use (almost) the exact same hcomp.
```agda
rUnit : {A : Type } {x y : A} (p : x ≡ y) → p ∙ refl ≡ p
rUnit = {!!}
rUnit {x = x} {y = y} p i j =
let u = λ k → λ where
(i = i0) → hfill (λ k → λ { (j = i0) → x ; (j = i1) → y }) (inS (p j)) k
(i = i1) → p (j ∧ k)
(j = i0) → x
(j = i1) → p (k ~ i)
in hcomp u (p (j ∧ ~ i))
-- uncomment to see if it type-checks
{-
rUnit≡lUnit : ∀ {} {A : Type } {x : A} → rUnit (refl {x = x}) ≡ lUnit refl
rUnit≡lUnit = refl
-}
```
@ -73,8 +84,20 @@ Hint: one hcomp should suffice. This one can be done without connections
```agda
assoc : {A : Type } {x y z w : A} (p : x ≡ y) (q : y ≡ z) (r : z ≡ w)
→ p ∙ (q ∙ r) ≡ (p ∙ q) ∙ r
assoc = {!!}
assoc {} {A} {x} {y} {z} {w} p q r i j =
-- A
-- ———— Boundary (wanted) —————————————————————————————————————
-- j = i0 ⊢ x
-- j = i1 ⊢ w
-- i = i0 ⊢ hcomp (λ { j₁ (j = i0) → x ; j₁ (j = i1) → (q ∙ r) j₁ }) -- (p j)
-- i = i1 ⊢ hcomp (λ { j₁ (j = i0) → x ; j₁ (j = i1) → r j₁ }) -- ((p ∙ q) j)
let u = λ k → λ where
(i = i0) → hfill (λ k → λ { (j = i0) → x ; (j = i1) → (q ∙ r) k }) (inS (p j)) k
(i = i1) → hfill (λ k → λ { (j = i0) → x ; (j = i1) → r k }) (inS ((p ∙ q) j)) k
(j = i0) → x
(j = i1) → hfill (λ i → λ { (k = i0) → w ; (k = i1) → q i }) (inS {! r k !}) {! i !}
in hcomp u {! !}
-- (hfill (λ i → λ { (j = i0) → x ; (j = i1) → q i }) (inS (p j)) i)
```
### Exercise 3 (Master class in connections) (🌶)