This will be old news to anyone who does algebraic topology, but oddly enough I can’t seem to find it all written in one place anywhere, and in particular I can’t find the bit about at all.
In algebraic topology you (for example) associate every topological space with a group, like
or
. All of these operations turn out to be functors. This isn’t surprising, because as far as I’m concerned the definition of a functor is “any time you take one type of object and naturally make another object”.
The surprise is that these objects also respect homotopy in a nice way; proving this is a fair amount of the “setup” work in algebraic topology.
1. Homology, 
Note that is a functor
i.e. to every space we can associate a group
. (Of course, replace
by integer of your choice.) Recall that:
Thus for a map we can take its homotopy class (the equivalence class under this relationship). This has the nice property that
and so on.
Definition 2
Two spaces and
are homotopic if there exists a pair of maps
and
such that
and
.
In light of this, we can define
Definition 3
The category is defined as follows:
- The objects are topological spaces
.
- The morphisms
are homotopy classes of continuous maps
.
Remark 4
Composition is well-defined since . Two spaces are isomorphic in
if they are homotopic.
Then the big result is that:
Theorem 6
The induced map of a map
depends only on the homotopy class of
. Thus
is a functor
The proof of this is geometric, using the so-called prism operators. In any case, as with all functors we deduce
Corollary 7
if
and
are homotopic.
In particular, the contractible spaces are those spaces which are homotopy equivalent to a point. In which case,
for all
.
2. Relative Homology, 
In fact, we also defined homology groups
for . We will now show this is functorial too.
Definition 8
Let and
be subspaces, and consider a map
. If
we write
We say is a map of pairs, between the pairs
and
.
Definition 9
We say that are pair-homotopic if they are “homotopic through maps of pairs”.
More formally, a pair-homotopy is a map
, which we’ll write as
, such that
is a homotopy of the maps
and each
is itself a map of pairs.
Thus, we naturally arrive at two categories:
, the category of pairs of toplogical spaces, and
, the same category except with maps only equivalent up to homotopy.
Definition 10
As before, we say pairs and
are pair-homotopy equivalent if they are isomorphic in
. An isomorphism of
is a pair-homotopy equivalence.
Then, the prism operators now let us derive
Theorem 11
We have a functor
The usual corollaries apply.
Now, we want an analog of contractible spaces for our pairs: i.e. pairs of spaces such that
for
. The correct definition is:
Definition 12
Let . We say that
is a deformation retract of
if there is a map of pairs
which is a pair homotopy equivalence.
Example 13 (Examples of Deformation Retracts)
- If a single point
is a deformation retract of a space
, then
is contractible, since the retraction
(when viewed as a map
) is homotopic to the identity map
.
- The punctured disk
deformation retracts onto its boundary
.
- More generally,
deformation retracts onto its boundary
.
- Similarly,
deformation retracts onto a sphere
.
Of course in this situation we have that
3. Homotopy, 
As a special case of the above, we define
Definition 14
The category is defined as follows:
- The objects are pairs
of spaces
with a distinguished basepoint
. We call these pointed spaces.
- The morphisms are maps
, meaning
is continuous and
.
Now again we mod out:
Definition 15
Two maps of pointed spaces are homotopic if there is a homotopy between them which also fixes the basepoints. We can then, in the same way as before, define the quotient category
.
And lo and behold:
Theorem 16
We have a functor
Same corollaries as before.