TheHoTTGame/1FundamentalGroup/Quest0Solutions.agda

42 lines
1.0 KiB
Agda
Raw 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.Quest0Solutions where
open import Cubical.Data.Empty
open import Cubical.Data.Unit renaming ( Unit to )
open import Cubical.Data.Bool
open import Cubical.Foundations.Prelude renaming ( subst to endPt )
open import Cubical.Foundations.Isomorphism renaming ( Iso to _≅_ )
open import Cubical.Foundations.Path
open import Cubical.HITs.S1
Refl : base base
Refl = λ i base
Flip : Bool Bool
Flip false = true
Flip true = false
-- notice we used `refl` instead of `λ i → false`,
-- more on `refl` in Quest1
flipIso : Bool Bool
flipIso = iso Flip Flip s r where
s : section Flip Flip
s false = refl
s true = refl
r : retract Flip Flip
r false = refl
r true = refl
flipPath : Bool Bool
flipPath = isoToPath flipIso
doubleCover : Type
doubleCover base = Bool
doubleCover (loop i) = flipPath i
endPtOfTrue : (p : base base) doubleCover base
endPtOfTrue p = endPt doubleCover p true
Refl≢loop : Refl loop
Refl≢loop p = true≢false (cong endPtOfTrue p)