3.9 KiB
The Circle
In this series of quests we will prove that the fundamental group
of S¹
is ℤ
.
In fact, our strategy will also show that the higher homotopy groups of
S¹
are all trivial.
We begin by formalising the problem statement.
A contruction of 'the circle' is :
- a point called
base
- an edge from that point to itself called
loop
Here is our definition of the circle in agda
.
data S¹ : Type where
base : S¹
loop : base ≡ base
The base ≡ base
is the space of paths from base
to base
.
The definition asserts that there is a point called loop
in base ≡ base
, i.e. a path from base
to itself.
Whenever we have a colon like S¹ : Type
or base : S¹
it says the former is a point in the latter,
where the latter is viewed as a space;
in the first case Type
is the space of spaces.
Further details
This is called a higher inductive type (HIT), which generally follows the format of
data
- the name of the HIT - in our case
S¹
- the type of the HIT, in our case
Type
where
followed by- the constructors of the HIT, in our case
base
andloop
, which we will think of as vertices, edges, surfaces, and so on
An "edge" is the same as a path.
There are other paths in S¹
,
for example the constant path at base
.
In 1FundamentalGroup/Quest0.agda
naviage to
Refl : base ≡ base
Refl = {!!}
we will guide you through defining it.
We are about to construct a path Refl : base ≡ base
(read path Refl
from base
to base
)
The hole { }0
is where you describe the path.
We will fill the hole { }0
.
-
enter
C-c C-l
(this meansCtrl-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 : base ≡ base ?1 : (something) ?2 : (something) ...
This says you have some unfilled holes.
-
navigate to the hole
{ }0
usingC-c C-f
(forward) orC-c C-b
(backward) -
enter
C-c C-r
. Ther
stands for refine. Whenever you do this whilst having your cursor in a hole, Agda will try to help you. -
you should now see
λ i → { }1
. This isagda
suggesting that for eachi : I
(if you like you can think of this as a generic point on the the unit intervalI
) you give a point in between the start and end of the path. This is all you need to specify a path inagda
. -
navigate to that new hole
-
enter
C-c C-,
(this meansCtrl-c Ctrl-comma
). Whenever you make this command whilst having your cursor in a hole,agda
will check the goal, i.e. what kind of thing you need to stick in. -
the goal (
*Agda information*
window) should look like
Goal: S¹
—————————————————————————
i : I
———— Constraints ——————————————
...
you see that agda
knows you have a generic point
i : I
on the unit interval.
All the constraints are saying that when you look
at i = 0
and i = 1
, whatever you give in between must
match up with the end points of the path,
namely base
and base
- write
base
in the hole, since this is the constant path - press
C-c C-SPC
to fill the hole withbase
. In general when you have some text (and your cursor) in a hole, doingC-c C-SPC
will tellagda
to replace the hole with that text.agda
will give you an error if it can't make sense of your text. - the number of holes in the
*Agda Information*
window should have gone down by one, this meansagda
has accepted what you filled this hole with. Just to be sure you can also reload theagda
file and check thatagda
has no complaints. - if you want to play around with this you can start again
by replacing what you wrote with
?
and doingC-c C-l