Quest2/Part0,Part1 finished

This commit is contained in:
Jlh18 2021-09-21 13:02:20 +01:00
parent 0b24937e0c
commit 6a3bf93dd8
5 changed files with 178 additions and 9 deletions

View File

@ -0,0 +1,47 @@
module 1FundamentalGroup.Quest2 where
open import Cubical.Core.Everything
open import Cubical.Data.Nat
open import Cubical.Data.Int using ( ; pos ; negsuc ; -_)
open import Cubical.Foundations.Isomorphism
open import Cubical.Foundations.Prelude renaming (subst to endPt)
open import Cubical.HITs.S1 using ( ; base ; loop)
open import 1FundamentalGroup.Quest1
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 0
spinCount : (x : ) base x helix x
spinCount x p = endPt helix p 0

View File

@ -8,12 +8,80 @@ allowing us to distinguish between all loops on `S¹`.
The plan is : The plan is :
- Define a function `suc : ` that increases every integer by one 1. Define a function `suc : ` that increases every integer by one
- Prove that `suc` is an isomorphism by constructing 2. Prove that `suc` is an isomorphism by constructing
an inverse map `pred : `. an inverse map `pred : `.
- Turn `suc` into a path `sucPath : ` using `isoToPath` 3. Turn `suc` into a path `sucPath : ` using `isoToPath`
- Define `helix : S¹ → Type` by mapping `base` to `` and 4. Define `helix : S¹ → Type` by mapping `base` to `` and
a generic point `loop i` to `sucPath i`. a generic point `loop i` to `sucPath i`.
- Use `helix` and `endPt` to define the map `base ≡ x → helix x` 5. Use `helix` and `endPt` to define the map
on all `x : S¹`, in particular giving us `Ω S¹ base → ` `spinCountBase : base ≡ base → `
when applied to `base`. Intuitively it counts how many times a path loops around `S¹`.
a generic point `loop i` to `sucPath i`.
6. Generalize this across the circle.
In this part, we focus on `1`, `2` and `3`.
## `suc`
- Setup the definition of `suc` so that it looks of the form :
```agda
Name : TypeOfSpace
Name inputs = ?
```
Compare it with our solutions in `1FundamentalGroup/Quest1.agda`
- We will define `suc` the same way we defined `loop_times` :
by induction.
Do cases on the input of `suc`.
You should have something like :
```agda
suc :
suc pos n = ?
suc negsuc n = ?
```
- For the non-negative integers `pos n` we want to map to its successor.
Recall that the `n` here is a point of the naturals `` whose definition is :
```agda
data : Type where
zero :
suc :
```
Use `suc` to map `pos n` to its successor.
- The negative integers require a bit more care.
Recall that annoyingly `negsuc n` means "`- (n + 1)`".
We want to map `- (n + 1)` to `- n`.
Try doing this.
Then realise "you run out of negative integers at `-(0 + 1)`"
so you must do cases on `n` and treat the `-(0 + 1)` case separately.
<p>
<details>
<summary>Hint</summary>
Do `C-c C-c` on `n`.
Then map `negsuc 0` to `pos 0`.
For `negsuc (suc n)`, map it to `negsuc n`.
</details>
</p>
- This completes the definition of `suc`.
Use `C-c C-n` to check it computes correctly.
E.g. check that `suc (- 1)` computes to `pos 0`
and `suc (pos 0)` computes to `pos 1`.
## `suc` is an isomorphism
- The goal is to define `pred : ` which
"takes `n` to its predecessor `n - 1`".
This will act as the (homotopical) inverse of `suc`.
Now that you have experience from defining `suc`,
try defining `pred`.
- Imitating what we did with `flipIso` and
give a point `sucIso : `
by using `pred` as the inverse and proving
`section suc pred` and `retract suc pred`.
## `suc` is a path
- Imitating what we did with `flipPath`,
upgrade `sucIso` to `sucPath`.

View File

@ -0,0 +1,54 @@
# Comparison maps between `Ω S¹ base` and ``
## The ``-bundle `helix`
We want to make a ``-bundle over `S¹` by
'copying across the loop via `sucPath`'.
In `Quest2.agda` locate
```agda
helix : S¹ → Type
helix = {!!}
```
Try to imitate the definition of `doubleCover` to define the bunlde `helix`.
You should compare your definition to ours in `Quest2Solutions.agda`.
Note that we have called this `helix`, since the picture of this ``-bundle
looks like
<img src="images/helix.png"
alt="helix"
width="1000"
class="center"/>
## Counting loops
Now we can do what was originally difficult - constructing an inverse map
(over all points).
Now we want to be able to count how many times a path `base ≡ base` loops around
`S¹`, which we can do now using `helix` and finding end points of 'lifted' paths.
For example the path `loop` should loop around once,
counted by looking at the end point of 'lifted' `loop`, starting at `0`.
Hence try to define
```agda
spinCountBase : base ≡ base → helix base
spinCountBase = {!!}
```
Try computing a few values using `C-c C-n`,
you can try it on `refl`, `loop`, `loop 3 times`, `loop (- 1) times` and so on.
## Generalising
The function `spinCountBase`
can actually be improved without any extra work to a function on all of `S¹`
```agda
spinCount : (x : S¹) → base ≡ x → helix x
spinCount = {!!}
```
We will show that this and a general version of `loop_times` are
inverses of each other over `S¹`, in particular obtaining an isomorphism
between `base ≡ base` and ``.

Binary file not shown.