Edits to windows installation guide

This commit is contained in:
jlh 2021-08-11 17:16:07 +01:00
parent 74d3c18c9f
commit 2735e5623b
33 changed files with 209 additions and 99 deletions

View File

@ -1,3 +1,3 @@
module Trinitarianism.Preambles.P0 where
module 0Trinitarianism.Preambles.P0 where
open import Cubical.Core.Everything hiding (__) public

View File

@ -1,4 +1,4 @@
module Trinitarianism.Preambles.P1 where
module 0Trinitarianism.Preambles.P1 where
open import Cubical.Core.Everything public
open import Cubical.Data.Unit public renaming (Unit to )

View File

@ -1,6 +1,6 @@
module Trinitarianism.Preambles.P2 where
module 0Trinitarianism.Preambles.P2 where
open import Cubical.Core.Everything public
open import Cubical.Data.Nat public hiding (_+_ ; isEven)
open import Trinitarianism.Quest1Solutions public
open import 0Trinitarianism.Quest1Solutions public
open import Cubical.Data.Empty public using ()

View File

@ -1,5 +1,5 @@
module Trinitarianism.Quest0 where
open import Trinitarianism.Preambles.P0
module 0Trinitarianism.Quest0 where
open import 0Trinitarianism.Preambles.P0
data : Type where
tt :

View File

@ -13,7 +13,8 @@ we have another type `A → B : Type` which can be seen as
- internal hom of the category `Type`
To give examples of this, let's make some types first!
Here is how we define 'true'.
## True / Unit / Terminal object
```agda
data : Type where
@ -37,39 +38,60 @@ Let's see an example of _using_ a term of type ``:
```agda
TrueToTrue :
TrueToTrue = {!!}
TrueToTrue = { }
```
- enter `C-c C-l` (this means `Ctrl-c Ctrl-l`) to load the document,
and now you can fill the hole `{ }`
- navigate to the hole `{ }` using `C-c C-f` (forward) or `C-c C-b` (backward)
- enter `C-c C-r` and agda will try to help you (`r` stands for _refine_)
- you should see `λ x → { }`. This is agda's notation for `x ↦ { }`
and is called `λ` abstraction, `λ` for 'let'.
- navigate to the new hole
- enter `C-c C-,` to check the _goal_ (`C-c C-comma`)
- the Goal area ('agda information' window) should look like
```agda
- enter `C-c C-l` (this means `Ctrl-c Ctrl-l`).
Whenever you do this, Agda will check the document is written correctly.
This will open the `*Agda Information*` window looking like
```
?0 :
?1 :
?2 :
```
This says you have three unfilled holes.
- Now you can fill the hole `{ }0`.
- navigate to the hole `{ }` using `C-c C-f` (forward) or `C-c C-b` (backward)
- enter `C-c C-r`. The `r` stands for _refine_.
Whenever you do this whilst having your cursor in a hole,
Agda will try to help you.
- you should see `λ x → { }`. This is agda's notation for `x ↦ { }`
and is called `λ` abstraction, think `λ` for 'let'.
- navigate to the new hole
- enter `C-c C-,` (this means `Ctrl-c Ctrl-comma`).
Whenever you make this command whilst having your cursor in a hole,
Agda will check the _goal_.
- the goal (`*Agda information*` window) should look like
```
Goal:
—————————————————————————
x :
```
you have a proof/recipe/generalized element `x : `
and you need to give a proof/recipe/generalized element of ``
- write the proof/recipe/generalized element `x` of `` in the hole
- press `C-c C-SPC` to fill the hole with `x`.
In general when you have some term (and your cursor) in a hole,
doing `C-c C-SPC` will tell Agda to replace the hole with that term.
Agda will give you an error if it can't make sense of your term.
- the `*Agda Information*` window should now only have two unfilled holes left,
this means Agda has accepted your proof.
```
?1 :
?2 :
```
- you have a proof/recipe/generalized element `x : `
and you need to give a proof/recipe/generalized element of ``
- you can give it a proof/recipe/generalized element of ``
and press `C-c C-SPC` to fill the hole (`SPC` means the space button)
There is more than one proof (see solutions) -
are they 'the same'?
What is 'the same'?
Here is an important solution:
There is more than one proof (see solutions).
Here is an important one:
```agda
TrueToTrue' :
TrueToTrue' x = {!!}
TrueToTrue' x = { }
```
- Naviagate to the hole and check the goal.
@ -80,18 +102,30 @@ TrueToTrue' x = {!!}
tells agda to 'do cases on `x`'.
The only case is `tt`.
One proof says for any term `x : ` give `x` again.
The other says it suffices to do the case of `tt`,
for which we just give `tt`.
> Are these proofs 'the same'? What is 'the same'?
(This question is deep and should be unsettling.
Sneak peek: they are _internally_ but
not _externally_ 'the same'.)
Built into the definition of `` is agda's way of making a map out of
into another type A, which we have just used.
It says 'to map out of it suffices to do the case when `x` is `tt`', or
into another type `A`, which we have just used.
It says 'to map out of `` it suffices to do the case when `x` is `tt`', or
- the only proof of `` is `tt`
- the only recipe for `` is `tt`
- the only one generalized element `tt` in ``
Let's define another type.
## False / Empty / Initial object
```agda
data ⊥ : Type u where
data ⊥ : Type where
```
@ -105,7 +139,7 @@ Let's try mapping out of `⊥`.
```agda
explosion : ⊥ →
explosion x = {!!}
explosion x = { }
```
- Navigate to the hole and do cases on `x`.
@ -118,6 +152,8 @@ This has three interpretations:
there are no recipes of `⊥`.
- `⊥` is initial in the category `Type`
## The natural numbers
We can also encode "natural numbers" as a type.
```agda
@ -170,22 +206,13 @@ Type : Type₁, Type₁ : Type₂, Type₂ : Type₃, ⋯
```
These are called _universes_.
The numberings of universes are called _levels_.
We will start using universes in the next quest.
It will be crucial that types can be treated as terms.
This will allows us to
- reason about '_structures_' such as 'the structure of a group',
think 'for all groups'
- do category theory without stepping out of the theory
(no need for classes etc. For experts, we have Grothendieck universes.)
- reason about when two types are 'the same',
for example when are two definitions of
the natural numbers 'the same'? What is 'the same'?
<!--
Everything we will make will be closed in
the universe we are in.
For example,
- Do `C-c C-d`.
Agda will ask you to input an expression.
- Input `` and hit return.
In the 'agda information' window, you should see `Type`.
This means Agda has _deduced_ ` : Type`.
In general, you can use `C-c C-d` to check
the type of terms.
The reason that `` is a type in `Type`
is because both `, ` are.
-->

View File

@ -1,5 +1,5 @@
module Trinitarianism.Quest0Solutions where
open import Trinitarianism.Preambles.P0
module 0Trinitarianism.Quest0Solutions where
open import 0Trinitarianism.Preambles.P0
data : Type where

View File

@ -1,6 +1,6 @@
module Trinitarianism.Quest1 where
module 0Trinitarianism.Quest1 where
open import Trinitarianism.Preambles.P1
open import 0Trinitarianism.Preambles.P1
isEven : Type
isEven n = {!!}

View File

@ -6,6 +6,8 @@ the statement
> There exists a natural that is even.
## Predicates / Dependent Constructions / Bundles
This requires the notion of a _predicate_.
In general a predicate on a type `A : Type` is
a term of type `A → Type`.
@ -94,13 +96,21 @@ There are three interpretations of `isEven : → Type`.
or singleton.
In general given a type `A : Type`,
a _dependent type over `A`_ is a term of type `A → Type`.
a _dependent type `F` over `A`_ is a term `F : A → Type`.
This should be drawn as a collection of space parameterised
by the space `A`.
<img src="images/generalBundle.png"
alt="Bundle"
width="500"/>
You can check if `2` is even by asking agda to 'reduce' the term `isEven 2`:
do `C-c C-n` (`n` for normalize) and type in `isEven 2`.
(By the way you can write in numerals since we are now secretly
using `` from the cubical agda library.)
## Sigma Types
Now that we have expressed `isEven` we need to be able write down "existence".
In maths we might write
```
@ -111,6 +121,7 @@ which in agda notation is
Σ isEven
```
This is called a _sigma type_, which has three interpretations:
- the proposition 'there exists an even natural'
- the construction
'keep a recipe `n` of naturals together with a recipe of `isEven n`'
@ -119,25 +130,28 @@ This is called a _sigma type_, which has three interpretations:
Pictorially, it looks like
<img src="images/isEvenBundle.png"
alt="SigmaTypeOfIsEven"
width="500"/>
alt="SigmaTypeOfIsEven"
width="500"/>
which can also be viewed as the subset of even naturals,
since the fibers are either empty or singleton.
(It is a _subsingleton bundle_).
### Making terms in Sigma Types
Making a term of this type has three interpretations:
- a natural `n : ` together with a proof `hn : isEven n` that `n` is even.
- a recipe `n : ` together with a recipe `hn : isEven n`.
- a point in the total space is a point `n : ` downstairs
together with a point `hn : isEven n` in its fiber.
Now you can prove that there exists an even natural:
- Formulate the statement you need. Make sure you have it of the form
```agda
Name : Statement
Name = ?
```
```agda
Name : Statement
Name = ?
```
- Load the file, go to the hole and refine the goal.
- If you formulated the statement right it should split into `{!!} , {!!}`
and you can check the types of terms the holes require.
@ -167,6 +181,8 @@ A × C = Σ A (λ a → C)
Agda supports the notation `_×_` (without spaces)
which means from now on you can write `A × C` (with spaces).
### Using Terms in Sigma Types
There are two ways of using a term in a sigma type.
We can extract the first part using `fst` or the second part using `snd`.
Given `x : Σ A B` there are three interpretations of `fst` and `snd`:
@ -220,6 +236,24 @@ the two proofs `2 , tt` and `36 , tt` of the statement
'there exists an even natural' are not 'the same' in any sense,
since if they were `div2 (2 , tt)` would be 'the same' `div2 (36/2 , tt)`,
and hence `1` would be 'the same' as `18`.
> Are they 'the same'? What is 'the same'?
<!-- see Arc/Quest smth? -->
> Are they 'the same'? What is 'the same'?
## Using the Trinitarianism
We introduced new ideas through all three perspectives,
as each has their own advantage
- Types as propositions is often the most familiar perspective,
and hence can offer guidance for the other two perspectives.
However the current mathematical paradigm uses proof irrelevance
(two proofs of the same proposition are always 'the same'),
which is _not_ compatible with HoTT.
- Types as constructions conveys the way in which 'data' is important,
and should be preserved.
- Types as objects allows us to draw pictures,
thus guiding us through the syntax with geometric intuition.
For each new idea introduced,
make sure to justify it proof theoretically, type theoretically and
categorically.

View File

@ -1,6 +1,6 @@
module Trinitarianism.Quest1Solutions where
module 0Trinitarianism.Quest1Solutions where
open import Trinitarianism.Preambles.P1
open import 0Trinitarianism.Preambles.P1
isEven : Type
isEven zero =

View File

@ -1,6 +1,6 @@
module Trinitarianism.Quest2 where
module 0Trinitarianism.Quest2 where
open import Trinitarianism.Preambles.P2
open import 0Trinitarianism.Preambles.P2
_+_ :
n + m = {!!}

View File

@ -1,6 +1,6 @@
module Trinitarianism.Quest2Solutions where
module 0Trinitarianism.Quest2Solutions where
open import Trinitarianism.Preambles.P2
open import 0Trinitarianism.Preambles.P2
_+_ :
n + zero = n

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

View File

Before

Width:  |  Height:  |  Size: 71 KiB

After

Width:  |  Height:  |  Size: 71 KiB

View File

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 69 KiB

41
EmacsCommands.md Normal file
View File

@ -0,0 +1,41 @@
Useful Doom Emacs Commands
=====================
## Notation
- `SPC` means space bar
- `C-` means hold down `Ctrl`
- `M-` means hold down `Alt` for non-Macs and `Option` for Macs
- `S-` means hold down `Shift`
- `RET` means enter
Example `C-c C-l` in Agda files is `Ctrl-c`, let go, `Ctrl-l`
## General Doom Emacs usage
- `SPC h b b` to look for bindings
- `SPC f f` to find files. can use `TAB` for auto-completing paths
- `h j k l` for left down up right
- `SPC b k` to kill 'buffers'
- `i` to go into 'insert' and `ESC` or `C-g` to escape 'insert'.
- `C-_` to undo
For beta users, to get the latest patch
- do `SPC g g` for "git status"
- then `F` for pull (whilst in "git status")
## Agda usage
- `C-c C-l` loads the file
- `C-c C-,` checks goal of the hole your cursor is in.
- `C-c C-SPC` fills hole your cursor is in.
- `C-c C-r` refines the hole your cursor is in.
- `C-c C-c` does cases on terms in the hole your cursor is in.
- `C-c C-d` used for checking types of terms
- `C-c C-n` used for 'reducing' terms to their 'simplest form'
- `C-c C-.` does `C-c C-,` and `C-c C-d`

View File

@ -4,34 +4,37 @@ How to Install the HoTT Game on Windows
## Prerequisites
MUST USE POWERSHELL AS ADMIN
- chocolatey (this shld be easy)
- Via chocolatey
- chocolatey: follow instructions on
[their page](https://chocolatey.org/install)
- In (admin) powershell do (via chocolatey, cabal)
- `choco install ghc`
- `choco install cabal`
- via cabal
- `cabal install happy`
- `cabal install alex`
## The Damned Paths
<!-- ## The Damned Paths -->
Something something need to add new system environment variables,
need to ask Samuel again.
<!-- Something something need to add new system environment variables, -->
<!-- need to ask Samuel again. -->
## Doom Emacs
Get doom emacs following instructions made [here](
earvingad.github.io/posts/doom_emacs_windows/
)
IN POWERSHELL LOCAL TO USER
<!-- IN POWERSHELL LOCAL TO USER -->
- Prerequisites
```
choco install git emacs ripgrep
choco install fd llvm
```
- Doom Emacs itself
```
git clone https://github.com/hlissner/doom-emacs ~/.emacs.d
~/.emacs.d/bin/doom install
```
**Icons will be missing for windows sadly**
<!-- - Prerequisites -->
<!-- ``` -->
<!-- choco install git emacs ripgrep -->
<!-- choco install fd llvm -->
<!-- ``` -->
<!-- - Doom Emacs itself -->
<!-- ``` -->
<!-- git clone https://github.com/hlissner/doom-emacs ~/.emacs.d -->
<!-- ~/.emacs.d/bin/doom install -->
<!-- ``` -->
<!-- **Icons will be missing for windows sadly** -->
## Development Version of Agda

View File

@ -78,11 +78,14 @@
+ Easy to generalize situation to n-types being closed under Sigma (7.1.8 in HoTT book), we showed this assuming PathPIsoPath
** Minibosses
- _+_ unique on the naturals
+ axiomatize addition on naturals
+ naturals is a set
+ fun extensionality
+ contractability
+ propositions
+ propositions closed under sigma types
** SuperUltraMegaHyperLydianBosses
- natural number object unique and _+_ unique on any nat num obj
+ nat num obj unique
+ _+_ unique on a model of nat num obj
- axiomatize addition on naturals
- naturals is a set
- fun extensionality
- contractability
- propositions
- propositions closed under sigma types
+ univalence

View File

@ -59,7 +59,9 @@ Each quest consists of three files, for example :
solutions to the tasks in the quest.
## Emacs and Agda usage
We will have a file with a list of basic Emacs commands,
We have a file with a list of [basic Emacs commands](
https://github.com/Jlh18/TheHoTTGame/blob/main/EmacsCommands.md
),
but you _should_ be able to learn how to use Agda as you go along.
## Feedback

Binary file not shown.

Binary file not shown.

Binary file not shown.