added quest2solutions.agda

This commit is contained in:
Jlh18 2021-09-28 16:05:09 +01:00
parent ddfecdd209
commit 40ba57887c
8 changed files with 59 additions and 37 deletions

View File

@ -5,4 +5,4 @@ open import Cubical.Data.Int using ( ; pos ; negsuc ; -_) public
open import Cubical.Foundations.Isomorphism public
open import Cubical.Foundations.Prelude renaming (subst to endPt) public
open import Cubical.HITs.S1 using ( ; base ; loop) public
open import 1FundamentalGroup.Quest1 public
open import 1FundamentalGroup.Quest1Solutions public

View File

@ -1,12 +1,6 @@
-- ignore
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
open import 1FundamentalGroup.Preambles.P0
Refl : base base
Refl = λ i base

View File

@ -2,40 +2,27 @@
module 1FundamentalGroup.Quest2 where
open import 1FundamentalGroup.Preambles.P2
suc :
suc (pos n) = pos (suc n)
suc (negsuc zero) = pos zero
suc (negsuc (suc n)) = negsuc n
{-
The definition of suc goes here.
-}
pred :
pred (pos zero) = negsuc zero
pred (pos (suc n)) = pos n
pred (negsuc n) = negsuc (suc n)
{-
The definition of pred goes here.
-}
sucIso : Iso
sucIso = iso suc pred s r where
{-
The definition of sucIso goes here.
-}
s : section suc pred
s (pos zero) = refl
s (pos (suc n)) = refl
s (negsuc zero) = refl
s (negsuc (suc n)) = refl
r : retract suc pred
r (pos zero) = refl
r (pos (suc n)) = refl
r (negsuc zero) = refl
r (negsuc (suc n)) = refl
sucPath :
sucPath = isoToPath sucIso
{-
The definition of sucPath goes here.
-}
helix : Type
helix base =
helix (loop i) = sucPath i
helix = {!!}
spinCountBase : base base
spinCountBase p = endPt helix p (pos zero)
spinCountBase = ?
spinCount : (x : ) base x helix x
spinCount x p = endPt helix p (pos zero)
spinCount = ?

View File

@ -0,0 +1,41 @@
-- ignore
module 1FundamentalGroup.Quest2Solutions where
open import 1FundamentalGroup.Preambles.P2
suc :
suc (pos n) = pos (suc n)
suc (negsuc zero) = pos zero
suc (negsuc (suc n)) = negsuc n
pred :
pred (pos zero) = negsuc zero
pred (pos (suc n)) = pos n
pred (negsuc n) = negsuc (suc n)
sucIso : Iso
sucIso = iso suc pred s r where
s : section suc pred
s (pos zero) = refl
s (pos (suc n)) = refl
s (negsuc zero) = refl
s (negsuc (suc n)) = refl
r : retract suc pred
r (pos zero) = refl
r (pos (suc n)) = refl
r (negsuc zero) = refl
r (negsuc (suc n)) = refl
sucPath :
sucPath = isoToPath sucIso
helix : Type
helix base =
helix (loop i) = sucPath i
spinCountBase : base base
spinCountBase p = endPt helix p (pos zero)
spinCount : (x : ) base x helix x
spinCount x p = endPt helix p (pos zero)