Merge branch 'main' of https://github.com/thehottgame/TheHoTTGame
This commit is contained in:
commit
70fd1aa024
47
1FundamentalGroup/Quest2.agda
Normal file
47
1FundamentalGroup/Quest2.agda
Normal 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 (S¹ ; 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)
|
||||||
|
|
||||||
|
sucℤIso : Iso ℤ ℤ
|
||||||
|
sucℤIso = 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
|
||||||
|
|
||||||
|
sucℤPath : ℤ ≡ ℤ
|
||||||
|
sucℤPath = isoToPath sucℤIso
|
||||||
|
|
||||||
|
helix : S¹ → Type
|
||||||
|
helix base = ℤ
|
||||||
|
helix (loop i) = sucℤPath i
|
||||||
|
|
||||||
|
spinCountBase : base ≡ base → ℤ
|
||||||
|
spinCountBase p = endPt helix p 0
|
||||||
|
|
||||||
|
spinCount : (x : S¹) → base ≡ x → helix x
|
||||||
|
spinCount x p = endPt helix p 0
|
@ -5,6 +5,8 @@ Creating the inverse map is difficult without access to the entire circle.
|
|||||||
Similarly to how we used `doubleCover` to distinguish `refl` and `base`,
|
Similarly to how we used `doubleCover` to distinguish `refl` and `base`,
|
||||||
the idea is to replace `Bool` with `ℤ`,
|
the idea is to replace `Bool` with `ℤ`,
|
||||||
allowing us to distinguish between all loops on `S¹`.
|
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 :
|
The plan is :
|
||||||
|
|
||||||
@ -14,11 +16,21 @@ The plan is :
|
|||||||
3. Turn `sucℤ` into a path `sucPath : ℤ ≡ ℤ` using `isoToPath`
|
3. Turn `sucℤ` into a path `sucPath : ℤ ≡ ℤ` using `isoToPath`
|
||||||
4. 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`.
|
||||||
|
<<<<<<< HEAD
|
||||||
5. Use `helix` and `endPt` to define the map `base ≡ x → helix x`
|
5. Use `helix` and `endPt` to define the map `base ≡ x → helix x`
|
||||||
on all `x : S¹`, in particular giving us `Ω S¹ base → ℤ`
|
on all `x : S¹`, in particular giving us `Ω S¹ base → ℤ`
|
||||||
when applied to `base`.
|
when applied to `base`.
|
||||||
|
|
||||||
In this part, we focus on `1` and `2`.
|
In this part, we focus on `1` and `2`.
|
||||||
|
=======
|
||||||
|
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`.
|
||||||
|
>>>>>>> df5d7c381b1adae1d2547df95f5d73bcf3447ac4
|
||||||
|
|
||||||
## `sucℤ`
|
## `sucℤ`
|
||||||
|
|
||||||
@ -77,4 +89,13 @@ In this part, we focus on `1` and `2`.
|
|||||||
- Imitating what we did with `flipIso` and
|
- Imitating what we did with `flipIso` and
|
||||||
give a point `sucℤIso : ℤ ≅ ℤ`
|
give a point `sucℤIso : ℤ ≅ ℤ`
|
||||||
by using `predℤ` as the inverse and proving
|
by using `predℤ` as the inverse and proving
|
||||||
|
<<<<<<< HEAD
|
||||||
`section sucℤ predℤ` and `retract sucℤ predℤ`.
|
`section sucℤ predℤ` and `retract sucℤ predℤ`.
|
||||||
|
=======
|
||||||
|
`section sucℤ predℤ` and `retract sucℤ predℤ`.
|
||||||
|
|
||||||
|
## `sucℤ` is a path
|
||||||
|
|
||||||
|
- Imitating what we did with `flipPath`,
|
||||||
|
upgrade `sucℤIso` to `sucℤPath`.
|
||||||
|
>>>>>>> df5d7c381b1adae1d2547df95f5d73bcf3447ac4
|
||||||
|
54
1FundamentalGroup/Quest2Part1.md
Normal file
54
1FundamentalGroup/Quest2Part1.md
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
# Comparison maps between `Ω S¹ base` and `ℤ` - `spinCount`
|
||||||
|
|
||||||
|
## The `ℤ`-bundle `helix`
|
||||||
|
|
||||||
|
We want to make a `ℤ`-bundle over `S¹` by
|
||||||
|
'copying ℤ across the loop via `sucℤPath`'.
|
||||||
|
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 `ℤ`.
|
43
README.md
43
README.md
@ -43,26 +43,29 @@ Try opening `Trinitarianism/Quest0.agda` in Emacs
|
|||||||
and do `Ctrl-c Ctrl-l`.
|
and do `Ctrl-c Ctrl-l`.
|
||||||
Some text should be highlighted, and any `?` should turn into `{ }`.
|
Some text should be highlighted, and any `?` should turn into `{ }`.
|
||||||
|
|
||||||
## How the game works
|
## Where to start?
|
||||||
|
|
||||||
Our Game is currently under development.
|
You can start with `0Trinitarianism` if you are interested in
|
||||||
As of now you can try the _quests_ in the `Trinitarianism` folder.
|
how logic, type theory and category theory come together
|
||||||
Each quest consists of three files, for example :
|
as different ways to view the same thing.
|
||||||
- `Trinitarianism/Quest0.md` is the guide for the quest.
|
If you are more interested in homotopy theory,
|
||||||
In there, you will find details of the tasks
|
try `1FundamentalGroup` where we show that the
|
||||||
you must finish in order to complete the quest.
|
fundamental group of `S¹` is `ℤ`.
|
||||||
For now, it is recommended that
|
|
||||||
you view these online within github.
|
|
||||||
- `Trinitarianism/Quest0.agda` is the agda file in which
|
|
||||||
you do the quest.
|
|
||||||
- `Trinitarianism/Quest0Solutions.agda` contains
|
|
||||||
solutions to the tasks in the quest.
|
|
||||||
|
|
||||||
## Emacs and Agda usage
|
## How to start?
|
||||||
We have a file with a list of [basic Emacs commands](
|
|
||||||
|
To start with `1FundamentalGroup` (for example),
|
||||||
|
find the GitHub page [`1FundamentalGroup/Quest0Part0.md`](
|
||||||
|
https://github.com/thehottgame/TheHoTTGame/blob/main/1FundamentalGroup/Quest0Part0.md
|
||||||
|
)
|
||||||
|
and follow the instructions there,
|
||||||
|
then trying the following files in the same directory.
|
||||||
|
Open up the corresponding `.agda` file in `emacs` to
|
||||||
|
follow along with the instructions in the quests.
|
||||||
|
|
||||||
|
## Emacs issues
|
||||||
|
|
||||||
|
If you can't figure out `emacs` or forget some command, then
|
||||||
|
try consulting our guide for [basic Emacs commands](
|
||||||
https://github.com/thehottgame/TheHoTTGame/blob/main/EmacsCommands.md
|
https://github.com/thehottgame/TheHoTTGame/blob/main/EmacsCommands.md
|
||||||
),
|
).
|
||||||
but you _should_ be able to learn how to use Agda as you go along.
|
|
||||||
|
|
||||||
## Feedback
|
|
||||||
If you have any feedback please contact the devs.
|
|
||||||
|
Binary file not shown.
BIN
_build/2.6.2/agda/1FundamentalGroup/Quest2.agdai
Normal file
BIN
_build/2.6.2/agda/1FundamentalGroup/Quest2.agdai
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user