TheHoTTGame/1FundamentalGroup/Quest3Solutions.agda
2021-11-16 14:54:06 +00:00

108 lines
4.4 KiB
Agda
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

module 1FundamentalGroup.Quest3Solutions where
open import 1FundamentalGroup.Preambles.P3
loopSuctimes : (n : ) loop n times loop loop suc n times
loopSuctimes (pos n) = refl
loopSuctimes (negsuc zero) = sym∙ loop
loopSuctimes (negsuc (suc n)) =
(loop (negsuc n) times sym loop) loop
≡⟨ sym (assoc _ _ _)
loop (negsuc n) times (sym loop loop)
≡⟨ cong (λ p loop (negsuc n) times p) (sym∙ _)
loop (negsuc n) times refl
≡⟨ sym (∙Refl _)
loop (negsuc n) times
sucPred : (n : ) suc (pred n) n
sucPred (pos zero) = refl
sucPred (pos (suc n)) = refl
sucPred (negsuc n) = refl
pathToFunPathFibration : {A : Type} {x y z : A} (q : x y) (p : y z)
pathToFun (λ i x p i) q q p
pathToFunPathFibration {A} {x} {y} q = J (λ z p pathToFun (λ i x p i) q q p)
(
pathToFun refl q
≡⟨ pathToFunRefl q
q
≡⟨ ∙Refl q
q refl
)
rewind : (x : ) helix x base x
rewind = outOfS¹D (λ x helix x base x) loop_times
(
pathToFun (λ i sucPath i base loop i) loop_times
≡⟨ refl -- how pathToFun interacts with →
(λ n pathToFun (λ i base loop i) (loop_times (pathToFun (sym sucPath) n)))
≡⟨ refl -- sucPath is just taking successor, and so its inverse is definitionally taking predecessor
(λ n pathToFun (λ i base loop i) (loop_times (pred n)))
≡⟨ funExt (λ n pathToFunPathFibration _ _) -- how pathToFun interacts with the "path fibration"
(λ n (loop (pred n) times) loop)
≡⟨ funExt (λ n
loop pred n times loop
≡⟨ loopSuctimes (pred n)
loop (suc (pred n)) times
≡⟨ cong loop_times (sucPred n)
loop n times )
loop_times
)
windingNumberRewindBase : (n : ) windingNumber base (rewind base n) n
windingNumberRewindBase (pos zero) = refl
windingNumberRewindBase (pos (suc n)) =
windingNumber base (rewind base (pos (suc n)))
≡⟨ refl
windingNumber base (loop (pos n) times loop)
≡⟨ refl
endPt helix (loop (pos n) times loop) (pos zero)
≡⟨ refl
suc (endPt helix (loop (pos n) times) (pos zero))
≡⟨ cong suc (windingNumberRewindBase (pos n))
suc (pos n)
≡⟨ refl
pos (suc n)
windingNumberRewindBase (negsuc zero) = refl
windingNumberRewindBase (negsuc (suc n)) = cong pred (windingNumberRewindBase (negsuc n))
-----------------------------------
-- windingNumber base (rewind base n)
-- ≡⟨ refl ⟩
-- windingNumber base (loop n times)
-- ≡⟨ refl ⟩
-- endPt helix (loop n times) (pos zero)
-- ≡⟨ {!!} ⟩
-- n ∎
-------------------------------------
windingNumberRewind : (x : ) (n : helix x) windingNumber x (rewind x n) n
windingNumberRewind = -- must case on x / use recursor / outOfS¹ since that is def of rewind
outOfS¹D (λ x (n : helix x) windingNumber x (rewind x n) n)
windingNumberRewindBase (
pathToFun
(λ i (n : helix (loop i)) windingNumber (loop i) (rewind (loop i) n) n)
windingNumberRewindBase
≡⟨ funExt (λ x isSet _ _ _ _ ) -- they are just functions so use funExt.
-- two equalities in so must be equal by isSet
windingNumberRewindBase )
-- must case on p / use recursor / J since that is def of windingNumber / endPt
-- actually endPt and J are both just transport in cubical agda.
rewindWindingNumber : (x : ) (p : base x) rewind x (windingNumber x p) p
rewindWindingNumber x = J (λ x p rewind x (windingNumber x p) p)
(rewind base (windingNumber base refl)
≡⟨ refl
loop_times (endPt helix (refl {x = base}) (pos zero)) -- reduce both definitions
≡⟨ cong loop_times (cong (λ g g (pos zero)) (endPtRefl {x = base} helix))
loop (pos zero) times
≡⟨ refl
refl )
pathFibration≡helix : (x : ) (base x) helix x
pathFibration≡helix x =
isoToPath (iso (windingNumber x) (rewind x) (windingNumberRewind x) (rewindWindingNumber x))
loopSpaceS¹≡ : loopSpace base
loopSpaceS¹≡ = pathFibration≡helix base