Consider the following space $X$:
How can we express mathematically the fact that it has two holes? For this we need the concepts of cycles and boundaries. In this section we will give an imprecise and informal discussion of these ideas. After that we will need to do some foundational work before we can get to a rigorous treatment. In outline: all boundaries are cycles, and many cycles are boundaries, but not all. Cycles that are not boundaries reveal the existence of holes.
Here is the space $X$ again with some additional markings:
The boundary of the path $u$ consists of the points $a$ and $b$.
The paths $v$, $w$ and $x$ are closed, so they have no boundary. Objects with no boundary are called cycles. Thus, $v$, $w$ and $x$ are cycles.
If we look at a small piece of $v$, then it looks the same as a small piece of ${\mathbb{R}}^{1}$, so we regard $v$ as being intrinsically $1$-dimensional. Cycles of dimension $k$ are called $k$-cycles, so $v$, $w$ and $x$ are $1$-cycles.
The boundary of the region $m$ is the path $w$, so we can say that $w$ is a boundary. Here $m$ is $2$-dimensional and $w$ is $1$-dimensional so we say that $w$ is a $1$-boundary. Similarly, $v$ is the boundary of an evident region that we have not named, so $v$ is another $1$-boundary.
On the other hand, we cannot fill in the interior of $x$ without using points that are not part of our ambient space $X$. Thus, with respect to the space $X$, the cycle $x$ is not a boundary. This reflects the presence of the right-hand hole.
We regard points as $0$-dimensional objects with no boundary, so $a$ and $b$ are $0$-cycles.
Now consider the following picture:
Both $u$ and $v$ are cycles that are not boundaries, revealing the existence of a hole. However, $u$ and $v$ surround the same hole, so they should not be regarded as interestingly different. This corresponds to the fact that although $u$ and $v$ are not individually boundaries, the difference between them is the boundary of $m$. In general, cycles should be considered equivalent if the difference between them is a boundary. This suggests that we should set up our detailed definitions so we have an abelian group ${Z}_{1}(X)$ of cycles and a subgroup ${B}_{1}(X)$ of boundaries, and we should consider the quotient group ${Z}_{1}(X)/{B}_{1}(X)$. This group will be called ${H}_{1}(X)$, and the elements will be called ($1$-dimensional) homology classes. Each element of ${H}_{1}(X)$ is therefore a coset $u+{B}_{1}(X)$, where $u$ is a $1$-cycle. We also use the notation $[u]$ for $u+{B}_{1}(X)$.
You might object that the boundary of $m$ is $v+u$ rather than $v-u$, and that this creates a problem for our interpretation in terms of a quotient group. In fact, if we develop the details using only the ingredients discussed so far, then we end up with a group in which all elements have order $2$, so $v+u$ and $v-u$ are the same. However, there is a more refined version in which every path $u$ has a direction, and $-u$ is interpreted as the same path in the opposite direction, and there are similar considerations for objects of dimension greater than one. With appropriate conventions of this type, and with $u$ and $v$ oriented anticlockwise as indicated by the arrows, it works out that the boundary of $m$ is $v-u$, so $[v]=[u]$ in ${H}_{1}(X)$.
As another example of how this works out, consider the following picture:
The boundary of $m$ is $u-p-q$, so $[u]=[p]+[q]$ in ${H}_{1}(X)$. Similarly, it will work out that if $v$ is any loop that winds $i$ times around the left-hand hole and $j$ times around the right-hand hole then $[u]=i[p]+j[q]$ in ${H}_{1}(X)$. Using this we find that ${H}_{1}(X)$ is isomorphic to ${\mathbb{Z}}^{2}$, with one factor of $\mathbb{Z}$ for each hole.
We can also define a group ${H}_{0}$ along the same lines as ${H}_{1}$. We will illustrate this with reference to the following space $Y$, which is the disjoint union of three subspaces $A$, $B$ and $C$.
The group ${H}_{0}(Y)$ is defined as ${Z}_{0}(Y)/{B}_{0}(Y)$. It will work out that ${H}_{0}(Y)$ is isomorphic to ${\mathbb{Z}}^{3}$, with one copy of $\mathbb{Z}$ for each of the components $A$, $B$ and $C$. To explain this in more detail, we can annotate the picture as follows:
The points ${a}_{0}$, ${a}_{1}$ and ${a}_{2}$ all count as $0$-cycles, so they give homology classes $[{a}_{0}],[{a}_{1}],[{a}_{2}]\in {H}_{0}(Y)$. However, these are all the same. Indeed, the boundary of the path ${u}_{1}$ is ${a}_{1}-{a}_{0}$, so ${a}_{1}-{a}_{0}\in {B}_{0}(Y)$, so the cosets ${a}_{1}+{B}_{0}(Y)$ and ${a}_{0}+{B}_{0}(Y)$ are the same, or in other words $[{a}_{1}]=[{a}_{0}]$ in ${H}_{0}(Y)$. We can use the paths ${u}_{1}$ and ${v}_{1}$ in the same way to see that $[{a}_{2}]=[{a}_{0}]$ and $[{c}_{1}]=[{c}_{0}]$. More generally, any point in $A$ has the same homology class as ${a}_{0}$, any point in $B$ has the same homology class as ${b}_{0}$, and any point in $C$ has the same homology class as ${c}_{0}$. Thus, if $x$ is a $0$-cycle consisting of $i$ points in $A$, $j$ points in $B$ and $k$ points in $C$ then $[x]=i[{a}_{0}]+j[{b}_{0}]+k[{c}_{0}]$ in ${H}_{0}(Y)$. When we have a more precise set of definitions we will be able to show that the elements $[{a}_{0}],[{b}_{0}]$ and $[{c}_{0}]$ actually give a basis for ${H}_{0}(Y)$ over $\mathbb{Z}$, so ${H}_{0}(Y)\simeq {\mathbb{Z}}^{3}$ as claimed.
So far we have treated paths in $X$ as subsets of $X$, but this turns out to be technically awkward, especially if we need to deal with paths that cross over themselves or are fractal or have other unusual behaviour. In our formal definitions, we will instead define paths in $X$ to be continuous maps from the unit interval $[0,1]$ (or the $1$-simplex ${\mathrm{\Delta}}_{1}$, which is essentially the same) to $X$.
Similarly, our $2$-dimensional objects will not just be subsets of $X$; instead, they will be continuous maps from the space
$${\mathrm{\Delta}}_{2}=\{({x}_{0},{x}_{1},{x}_{2})\in {\mathbb{R}}^{3}|{x}_{0},{x}_{1},{x}_{2}\ge 0,{x}_{0}+{x}_{1}+{x}_{2}=1\}$$ |
to $X$. For example, consider the pictures below.
In our informal discussion, we might have considered the region $m\subseteq Z$ shown in the left-hand picture. In our formal treatment, we will instead consider the expression ${m}_{0}+{m}_{1}+{m}_{2}$, where the maps ${m}_{i}:{\mathrm{\Delta}}_{2}\to Z$ are defined by
${m}_{0}({x}_{0},{x}_{1},{x}_{2})$ | $={x}_{0}a+{x}_{1}b+{x}_{2}c$ | ||
${m}_{1}({x}_{0},{x}_{1},{x}_{2})$ | $={x}_{0}b+{x}_{1}d+{x}_{2}c$ | ||
${m}_{2}({x}_{0},{x}_{1},{x}_{2})$ | $={x}_{0}b+{x}_{1}e+{x}_{2}d.$ |
The image ${m}_{i}({\mathrm{\Delta}}_{2})$ is the region marked $i$ in the right hand diagram.