TheHoTTGame/1FundamentalGroup/Quest2Part0.md
2021-09-22 09:58:48 +01:00

90 lines
3.0 KiB
Markdown
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.

# Comparison maps between `Ω S¹ base` and ``
In `Quest1` we have defined the map `loop_times : → Ω S¹ base`.
Creating the inverse map is difficult without access to the entire circle.
Similarly to how we used `doubleCover` to distinguish `refl` and `base`,
the idea is to replace `Bool` with ``,
allowing us to distinguish between all loops on `S¹`.
In `Part0` and `Part1` we will construct one of the two comparison maps
across the whole circle, called `spinCount`.
The plan is :
1. Define a function `suc : ` that increases every integer by one
2. Prove that `suc` is an isomorphism by constructing
an inverse map `pred : `.
3. Turn `suc` into a path `sucPath : ` using `isoToPath`
4. Define `helix : S¹ → Type` by mapping `base` to `` and
a generic point `loop i` to `sucPath i`.
5. Use `helix` and `endPt` to define the map
`spinCountBase : base ≡ 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`.