\section{Homology of CW-complexes and applications}

\begin{cislo}\label{HOCW1appl}{\bf First applications of homology.}
Using homology groups we can easily prove the following
statements:
\begin{enumerate}
\item $S^n$ is not a retract of $D^{n+1}$.
\item Every map $f:D^n\to D^n$ has a fixed point, i.e. there is
$x\in D^n$ such that $f(x)=x$.
\item If $\emptyset\ne U\subseteq \mathbb R^n$ and $\emptyset\ne
V\subseteq \mathbb R^m$ are open homeomorphic sets, then $n=m$.
\end{enumerate}
\end{cislo}

\begin{proof}[Outline of the proof] (1) Suppose that there is a
retraction $r:D^{n+1}\to S^n$. Then we get the commutative diagram
$$
\xymatrix{
\mathbb Z=H_n(S^n) \ar[rr]^{\id} \ar[rd]_{i_*}
&{}& H_n(S^n)=\mathbb Z \\
{} & H_n(D^{n+1})=0 \ar[ru]_{r_*} &{}
}
$$
which is a contradiction.

\noindent
(2) Suppose that $f:D^n\to D^n$ has no fixed point. Then we can
define the map $g:D^n\to
S^{n-1}$ where  $g(x)$ is the intersection of the ray from
$f(x)$ to $x$ with $S^{n-1}$. However, this map would be a retraction, a
contradiction with (1).

\noindent
(3) The proof of the last statement follows from the isomorphisms:
$$H_i(U,U-\{x\})\cong H_i(\mathbb R^n,\mathbb R^n-\{x\})\cong
\tilde H_{i-1}(\mathbb R^n-\{x\})\cong \tilde H_{i-1}(S^{n-1})=
\begin{cases}\mathbb Z\quad&\text{for }i=n,\\
0\quad&\text{for }i\ne n.
\end{cases}$$
\end{proof}

\begin{cislo}\label{HOCWdeg}{\bf Degree of a map.}
Consider a map $f:S^n\to S^n$. In homology $f_*:\tilde
H_n(S^n)\to H_n(S^n)$ has the form
$$f_*(x)=ax,\quad a\in\mathbb Z.$$
The integer $a$ is called the \emph{degree}\index{dgree of a map}
of $f$ and denoted by $\deg f$.

\noindent
The degree has the following properties:
\begin{enumerate}
\item $\deg \id=1$.
\item If $f\sim g$, then $\deg f=\deg g$.
\item  If $f$ is not surjective, then $\deg f=0$.
\item $\deg(fg)=\deg f\cdot\deg g$.
\item Let $f:S^n\to S^n$, $f(x_0,x_1,\dots, x_n)=(-x_0,x_1,\dots,
x_n)$. Then $\deg f=-1$.
\item The antipodal map $f:S^n\to S^n$, $f(x)=-x$ has $\deg f=(-1)^{n+1}$.
\item If $f:S^n\to S^n$ has no fixed point, then $\deg
f=(-1)^{n+1}$.
\end{enumerate}

\begin{proof} We outline only the proof of (5) and (7). The rest
is not difficult and left as an exercise.

We show (5) by induction on $n$. The generator of $\tilde H_0(S^0)$ is
$1-(-1)$ and $f_*$ maps it in $(-1)-1$. Hence the degree is $-1$.
Suppose that the statement is true for $n$. To prove it for $n+1$
we use the diagram with rows coming from a
suitable Mayer-Vietoris exact sequence
$$
\xymatrix{
0\ar[r]  & \tilde H_{n+1}(S^{n+1}) \ar[r]^-{\cong} \ar[d]_{f_*}
& \tilde H_n(S^n)\ar[r] \ar[d]^{(f/S^n)_*}  & 0\\
0\ar[r]  & \tilde H_{n+1}(S^{n+1}) \ar[r]^-{\cong} & \tilde H_n(S^n)\ar[r]
& 0
}
$$

If $(f/S^n)_*$ is a multiplication by $-1$, so is $f_*$.

To prove (7) we show that $f$ is homotopic to the antipodal map
through the homotopy
$$H(x,t)=\frac{tf(x)-(1-t)x}{\Vert tf(x)-(1-t)x \Vert}.$$
\end{proof}

\begin{cor*} $S^n$ has a nonzero continuous vector field if and
only if $n$ is odd.
\end{cor*}

\begin{proof} Let $S^n$ has such a field $v(x)$. We can suppose
$\Vert v(x)\Vert=1$. Then the identity is homotopic to antipodal
map through the homotopy
$$H(x,t)=\cos t\pi\cdot x+\sin t\pi\cdot v(x).$$
Hence according to properties (2) and (6)
$$(-1)^{n+1}=\deg (-\id)=\deg (\id)=1.$$
Consequently, $n$ is odd.

On the contrary, if $n=2k+1$, we can define the required vector
field by prescription
$$v(x_0,x_1,x_2,x_3,\dots, x_{2k}, x_{2k+1})=
(-x_1,x_0,-x_3,x_2,\dots,-x_{2k+1},x_{2k}).$$
\end{proof}

\begin{ex*}
Prove the properties (3), (4) and (6) of the degree.  
\end{ex*}
\end{cislo}


\begin{cislo}\label{HOCWld} {\bf Local degree.}
Consider a map $f:S^n\to S^n$ and $y\in S^n$ such that
$f^{-1}(y)=\{x_1,x_2,\dots ,x_m\}$. Let $U_i$ be open disjoint
neighbourhoods of points $x_i$ and $V$ a neighbourhood of $y$
such that $f(U_i)\subseteq V$. Then
\begin{multline*}
(f/U_i)_*:H_n(U_i,U_i-\{x_i\})\cong
H_n(S^n,S^n-\{x_i\})=\mathbb Z\\
\longrightarrow H_n(V,V-\{y\})\cong
H_n(S^n,S^n-\{y\})=\mathbb Z
\end{multline*}
is a multiplication by an integer which is called a \emph{local
degree} \index{local degree} and denoted by $\deg f\vert x_i$.


\begin{thma} Let $f:S^n\to S^n$, $y\in S^n$ and
$f^{-1}(y)=\{x_1,x_2,\dots ,x_m\}$. Then
$$\deg f=\sum_{i=1}^m\deg f\vert x_i.$$
\end{thma}

For the proof see [Hatcher], %\cite{Ha}, 
Proposition 2.30, page 136.

The suspension $Sf$ of a map $f:X\to Y$ is given by
the prescription $Sf(x,t)=(f(x),t)$.

\begin{thma} $\deg Sf=\deg f$ for any map $f:S^n\to S^n$.
\end{thma}

\begin{proof} $f$ induces $Cf:CS^n\to CS^n$. The long exact
sequence for the pair $(CS^n,S^n)$ and the fact that
$SS^n=CS^n/S^n$ give rise to the diagram
$$
\xymatrix{
\tilde H_{n+1}(S^{n+1}) \ar[r]_-{\cong} \ar[d]_{Sf_*}
& \tilde H_{n+1}(CS^n,S^n)\ar[r]^-{\partial_*}_-{\cong} \ar[d]_{Cf_*}  &
\tilde H_n(S^n) \ar[d]^{f_*}\\
\tilde H_{n+1}(S^{n+1}) \ar[r]_-{\cong} & \tilde H_{n+1}(CS^n,S^n)
\ar[r]^-{\partial_*}_-{\cong} & \tilde H_n(S^n)
}
$$
which implies the statement.
\end{proof}

\begin{cor*} For any $n\ge 1$ and given $k\in \mathbb Z$ there is
a map $f:S^n\to S^n$ such that $\deg f=k$.
\end{cor*}

\begin{proof} For $n=1$ put $f(z)=z^k$ where $z\in S^1\subset
\mathbb C$. Using the computation based on local degree as above,
we get $\deg f=k$. The previous theorem implies that the degree of
$S^{n-1}f:S^n\to S^n$ is also $k$.
\end{proof}
\end{cislo}

\begin{cislo}\label{HOCWcomp}{\bf Computations of homology of
CW-complexes.} If we know a CW-structure of a space $X$, we can
compute its cohomology relatively easily. Consider the sequence
of Abelian groups and its morphisms
\begin{equation*}
(H_n(X^n,X^{n-1}),d_n)
\end{equation*}
where $d_n$ is the composition
$$H_n(X^n,X^{n-1})\xrightarrow{\ \partial_n\ } H_{n}(X^{n-1})
\xrightarrow{\,j_{n-1}\,}H_{n-1}(X^{n-1},X^{n-2}).$$

\begin{thm*} Let $X$ be a CW-complex. $(H_n(X^n,X^{n-1}),d_n)$ is a
chain complex with
homology
$$H^{CW}_n(X)\cong H_n(X).$$
\end{thm*}

\begin{proof} First, we show how the groups $H_k(X^n,X^{n-1})$
look like. Put $X^{-1}=\emptyset$ and
$X^0/\emptyset=X^0\sqcup\{*\}$. Then
$$H_k(X^n,X^{n-1})=\tilde H_k(X^n/X^{n-1})=\tilde H_k(\bigvee
S^n_{\alpha})=
\begin{cases}\bigoplus_{\alpha}\mathbb Z \ & n=k,\\
0\ &n\ne k.
\end{cases}
$$

Now we show that
$$H_k(X^n)=0\quad\text{for }k>n.$$
From the long exact sequence of the pair $(X^n,X^{n-1})$ we get
$H_k(X^n)=H_k(X^{n-1})$. By induction $H^k(X^n)=H_k(X^{-1})=0$.

Next we prove that
$$H_k(X^n)=H_k(X)\quad\text{for }k\le n-1.$$
From the long exact sequence for the
pair $(X^{n+1},X^n)$ we obtain $H_k(X^n)=H_k(X^{n+1})$.
By induction $H_k(X^n)=H_k(X^{n+m})$ for every $m\ge 1$. Since
the image of each
singular chain lies in some $X^{n+m}$ we get $H_k(X^n)=H_k(X)$.

To prove Theorem we will need the following diagram with parts of
exact sequences for the pairs $(X^{n+1},X^n)$, $(X^n,X^{n-1})$
and $(X^{n-1},X^{n-2})$.
$$
\xymatrix{
 {}              &  0                       &{ }&{}\\
0  \ar[rd] & H_n(X^{n+1})\ar[u] &{} & {}\\
{}& H_n(X^n)\ar[u]\ar[rd]^-{j_n} & {} & {} \\
{} & H_{n+1}(X^{n+1}, X^n)\ar[u]^{\partial_{n+1}} \ar[r]^-{d_{n+1}}&
H_n(X^n,X^{n-1}) \ar[r]^-{d_n} \ar[rd]^{\partial_n}&
H_{n-1}(X^{n-1},X^{n-2})\\
{} & {} & {} & H_{n-1}(X^{n-1})\ar[u]^{j_{n-1}}\\
{} & {} & {} & 0 \ar[u]
}
$$
From it we get
$$d_nd_{n+1}=j_{n-1}(\partial_nj_n)\partial_{n+1}=j_{n-1}(0)
\partial_{n+1}=0.$$
Further,
$$\ker d_n=\ker\partial_n=\im j_n\cong H_n(X^n)$$
and
$$\im d_{n+1}\cong\im \partial_{n+1},$$
since $j_{n-1}$ and $j_n$ are  monomorphisms.
Finally,
$$H^{CW}_n(X)=\frac{\ker d_n}{\im d_{n+1}}\cong\frac{H_n(X^n)}
{\im\partial_{n+1}}\cong H_n(X^{n+1})\cong H_n(X).$$
\end{proof}

\begin{example*} $H_n(X)=0$ for CW-complexes without cells in
dimension $n$.

$$H_k(\mathbb {CP}^n)=
\begin{cases}\mathbb Z\quad&\text{for }k\le 2n \text{ even},\\
0\quad&\text{in other cases.}
\end{cases}$$
\end{example*}
\end{cislo}

\begin{cislo}\label{HOCWdn}{\bf Computation of $d_n$.}
Let $e^n_{\alpha}$ and $e^{n-1}_{\beta}$ be cells in dimension
$n$ and $n-1$ of a CW-complex $X$, respectively. Since
$$H_n(X^n,X^{n-1})=\bigoplus_{\alpha}\mathbb Z,\quad
H_{n-1}(X^{n-1},X^{n-2})=\bigoplus_{\beta}\mathbb Z,$$
they can be considered as generators of these groups. Let
$\varphi_{\alpha}:\partial D^n_{\alpha}\to X^{n-1}$ be the attaching
map for the cell $e^n_{\alpha}$. Then
$$d_n(e^n_{\alpha})=\sum_{\beta}d_{\alpha\beta}e^{n-1}_{\beta}$$
where $d_{\alpha\beta}$ is the degree of the following composition
$$S^{n-1}=\partial D^n_{\alpha}\xrightarrow{\varphi_{\alpha}}
X^{n-1}\to X^{n-1}/X^{n-2}\to X^n/(X^{n-2}\cup
\bigcup_{\gamma\ne\beta} e^{n-1}_{\gamma})=S^{n-1}.$$
For the proof we refer to [Hatcher], %\cite{Ha}, 
pages 140 and 141.

\begin{ex*} Compute homology groups of various 2-dimensional
surfaces (torus, Klein bottle, projective plane) using their
CW-structure with only one cell in dimension 2.
\end{ex*}
\end{cislo}

\begin{cislo}\label{HOCWproj}{\bf Homology of real projective
spaces.} The real projective space $\mathbb{RP}^n$ is formed by
cell $e^0,e^1,\dots,e^n$, one in each dimension from 0 to $n$.
The attaching map for
the cell $e^{k+1}$ is the projection $\varphi:S^k\to
\mathbb{RP}^k$. So we have to compute the degree of the
composition
$$f:S^k\xrightarrow{\varphi}\mathbb{RP}^k\to
\mathbb{RP}^k/\mathbb{RP}^{k-1}=S^k.$$
Every point in $S^k$ has two preimages $x_1$, $x_2$. In a neihbourhood
$U_i$ of $x_i$
$f$ is a homeomorphism, hence its local degree  $\deg f\vert x_i=\pm 1$.
Since $f/U_2$ is the composition of the antipodal map with
$f/U_1$, the local degrees $\deg f\vert x_1$ and $\deg f\vert x_1$
differs by the multiple of
$(-1)^{k+1}$. (See the properties (4) and (6) in \ref{HOCWdeg}.)
According to \ref{HOCWld}
$$\deg f=\pm 1(1+(-1)^{k+1})=
\begin{cases}0\quad & \text{for }k+1\text{ odd},\\
\pm 2\quad & \text{for }k+1\text{ even}.
\end{cases}$$
So we have obtained the chain complex for computation of
$H_*^{CW}(\mathbb {RP}^n)$. The result is
$$H_k(\mathbb{RP}^n)=
\begin{cases}\mathbb Z\quad & \text{for }k=0\text{ and }
k=n\text{ odd},\\
\mathbb Z_2\quad & \text{for }k\text{ odd , }0<k<n,\\
0\quad & \text{in other cases.}
\end{cases}
$$
\end{cislo}

\begin{cislo}\label{HOCWe}{\bf Euler characteristic.}
Let $X$ be a finite CW-complex. The \emph{Euler characteristic}
\index{Euler characteristic} of $X$
is the number
$$\chi(X)=\sum_{i=0}^{\infty}(-1)^k\rank H_k(X).$$

\begin{thm*} Let $X$ be a finite CW-complex with $c_k$ cells in
dimension $k$. Then
$$\chi(X)=\sum_{k=0}^{\infty}(-1)^kc_k.$$
\end{thm*}

\begin{proof} Realize that $c_k=\rank H_k(X^k,X^{k-1})=\rank\ker
d_k+\rank\im d_{k+1}$ and that 
$\rank H_k(X)=\rank \ker d_k - \rank \im d_{k+1}$. Hence
\begin{align*}
\chi(X)&=\sum_{k=0}^{\infty}(-1)^{k}\rank H_k(X)=
\sum_{k=0}^{\infty}(-1)^{k}(\rank\ker d_k-\rank\im d_{k+1})\\
&=\sum_{k=0}^{\infty}(-1)^{k}\rank\ker d_k+
\sum_{k=0}^{\infty}(-1)^{k}\rank\im
d_{k}=\sum_{k=0}^{\infty}(-1)^kc_k.
\end{align*}
\end{proof}

\begin{example*} 2-dimensional oriented surface of genus $g$ (the
number of handles attached to the 2-sphere) has the Euler characteristic
$\chi(M_g)=2-2g$.

2-dimensional nonorientable surface of genus $g$ (the number of M\"
obius bands which replace  discs cut out from the 2-sphere) has the Euler
characteristic $\chi(N_g)=2-g$.
\end{example*}
\end{cislo}

\begin{cislo}\label{HOCWlfpt}{\bf Lefschetz Fixed Point Theorem.}
Let $G$ be a finitely generated Abelian group and $h:G\to G$ a
homomorphism. The trace $\tr h$ is the trace of the homomorphism
$$\mathbb Z^n\cong G/\torsion G\to G/\torsion G\cong \mathbb Z^n$$
induced by $h$.

Let $X$ be a finite CW-complex. The \emph{Lefschetz
number}\index{Lefschetz number} of a map $f:X\to X$ is
$$L(f)=\sum_{i=0}^{\infty}(-1)^i\tr H_if.$$
Notice that $L(\id_X)=\chi(X)$. Similarly as for the Euler
characteristic we can prove

\begin{lemma*} Let $f_n:(C_n,d_n)\to (C_n,d_n)$ be a chain
homomorphism. Then
$$\sum_{i=0}^{\infty}(-1)^i\tr H_if=\sum_{i=0}^{\infty}(-1)^i\tr
f_i$$
whenever the right hand side is defined.
\end{lemma*}

\begin{thm*}[Lefschetz Fixed Point Theorem] If $X$ is a
finite simplicial complex or its retract and $f:X\to X$ a map
with $L(f)\ne 0$, then $f$ has a fixed point.
\end{thm*}

For the proof see [Hatcher], %\cite{Ha}, 
Chapter 2C. Theorem has many consequences.

\begin{cor} [Brouwer Fixed Point Theorem]  Every continuous map
$f:D^n\to D^n$ has a fixed point.
\end{cor}

\begin{proof} The Lefschetz number of $f$ is 1.
\end{proof}

In the same way we can prove

\begin{cor} If $n$ is even, then every continuous map
$f:\mathbb{RP}^n\to \mathbb{RP}^n$ has a fixed point.
\end{cor}


\begin{cor} Let $M$ be a smooth compact manifold in $\mathbb R^n$
with nonzero vector field. Then $\chi(M)=0$.
\end{cor}

The converse of this statement is also true.

\begin{proof}[Outline of the proof] If $M$ has a nonzero vector
field, there is a continuous map $f:M\to M$ which is a "small shift in the
direction of the vector field". Since such a map has no fixed
point, its Lefschetz number has to be zero. Moreover, $f$ is
homotopic to identity and hence
$$\chi(M)=L(\id_X)=L(f)=0.$$
\end{proof}
\end{cislo}

\begin{cislo}\label{HOCWcoef}{\bf Homology with coefficients.}
Let $G$ be an Abelian group. From the singular chain complex
$(C_n(X),\partial_n)$ of a space $X$ we make the new chain complex
$$C_n(X;G)=C_n(X)\otimes G,\quad
\partial_n^G=\partial_n\otimes\id_G.$$
The homology groups of $X$ with coefficients  $G$ are
$$H_n(X;G)=H_n(C_*(X;G),\partial_*^G).$$
The homology groups defined before are in fact the homology
groups with coefficients $\mathbb Z$. The  homology groups with
coefficients  $G$
satisfy all the basic general properties as the homology groups with
integer coefficients with the exception that
$$H_{n}(\*;G)=
\begin{cases}0\quad&\text{for }n\ne 0,\\
G\quad&\text{for }n=0.
\end{cases}$$
If the coefficient group $G$ is a field (for instance $G=\mathbb Q$
or $\mathbb Z_p$
for $p$ a prime), then homology groups with  coefficients $G$
are vector spaces over this field. It often brings
advantages.

The computation of homology with coefficients  $G$ can be carried out
again using a CW-complex structure. For instance, we get
$$H_k(\mathbb{RP}^n;\mathbb Z_2)=
\begin{cases}\mathbb Z_2\quad\text{for }0\le k\le n,\\
0\quad\text{in other cases.}
\end{cases}$$

For an application of $\mathbb Z_2$-coefficients see the proof of
the following  theorem in [Hatcher], %\cite{Ha}, \
pages 174--176.

\begin{thm*}[Borsuk-Ulam Theorem] Every map $f:S^n\to S^n$
satisfying
$$f(-x)=-f(x)$$
has an odd degree.
\end{thm*}

\end{cislo}