\section{Homotopy and CW-complexes} This section demonstrates the importance of CW-complexes in homotopy theory. The main results derived here are Whitehead theorem and theorems on approximation of maps by cellular maps and spaces by CW-complexes. \begin{cislo}\label{HCWn}{\bf $n$-connectivity.} A space $X$ is \emph{$n$-connected}\index{n-connected space} if $\pi_i(X,x_0)=0$ for all $0\le i\le n$ and some base point $x_0\in X$ (and consequently, for all base points). A pair $(X,A)$ is called \emph{$n$-connected}\index{n-connected pair} if each component of path connectivity of $X$ contains a point from $A$ and $\pi_i(X,A,x_0)=0$ for all $x_0\in A$ and all $1\le i\le n$ We say that a map $f:X\to Y$ is an \emph{$n$-equivalence} \index{n-equivalence} if $f_*:\pi_i(X,x_0)\to \pi_i(Y,f(x_0))$ is an isomorphism for all $x_0\in X$ if $0\le i}[ru]^-{g}_-{\sim} & Y } $$ If $n=0$, the condition $\pi_0(Y,B,y_0)=0$ means that $(Y,B)$ is $0$-connected. \end{lemma} \begin{proof} By induction we will define maps $f_n:X\to Y$ such that $f_n(X^n\cup A)\subseteq B$, and $f_n$ is homotopic to $f_{n-1}$ rel $A\cup X^{n-1}$. Put $f_{-1}=f$. Suppose that we have $f_{n-1}$ and there is a cell $e^n$ in $X-A$. Let $\p:D^n\to X$ be its characteristic map. Then $f_{n-1}\p:(D^n,\partial D^n)\to (Y,B)$ represents zero element in $\pi_n(Y,B)$. According to Proposition 10.2 %\ref{HOMrhg} it means that $f_{n-1}\p:(D^n,\partial D^n)\to (Y,B)$ is homotopic rel $\partial D^n$ to a map $h_n:(D^n,\partial D^n)\to (B,B)$. Doing it for all cells of dimension $n$ in $X-A$ we obtain a map $g_n:X^n\cup A\to B$ homotopic rel $A\cup X^{n-1}$ with $f_{n-1}$ restricted to $X^n\cup A$. Using the homotopy extension property of the pair $(X,X^n\cup A)$ we can conclude that $g_n$ can be extended to a map $f_n:X\to Y$ which is homotopic rel $A\cup X^{n-1}$ to $f_{n-1}$. Now for $x\in X^n$ define $g(x)=f_{n}(x)=g_n(x)$. By the same trick as in the proof of Theorem 2.7 %\ref{CWhep} we can construct a homotopy rel A between $f$ and $g$. \end{proof} The proof of the following extension lemma is similar but easier and hence left to the reader. \begin{lemma} [Extension lemma] Consider a pair $(X,A)$ of CW-complexes and a map $f:A\to Y$. If $Y$ is path connected and $\pi_{n-1}(Y,y_0)=0$ whenever there is a cell in $X-A$ of dimension $n$, then $f$ can be extended to a map $X\to Y$. \end{lemma} \end{cislo} \begin{cislo}\label{HCWwt}{\bf Whitehead Theorem.} The compression lemma has two important consequences. \begin{cor*} Let $h:Z\to Y$ be an $n$-equivalence and let $X$ be a finite dimensional CW-complex. Then the induced map $h_*:[X,Z]\to [X,Y]$ is \begin{enumerate} \item a surjection if $\dim X\le n$, \item a bijection if $\dim X\le n-1$. \end{enumerate} \end{cor*} \begin{proof} First, we will suppose that $h:Z\to Y$ is an inclusion and apply the compression lemma. Put $B=Z$, $A=\emptyset$ and consider a map $f:X\to Y$. If $\dim X\le n$ then all the assumptions of the compression lemma are satisfied. Consequently, there is a map $g:X\to Z$ such that $hg\sim f$. Hence $h_*:[X,Z]\to [X,Y]$ is surjection. Let $\dim X\le n-1$ and let $g_1,g_2:X\to Z$ be two maps such that $hg_1\sim hg_2$ via a homotopy $F:X\times I\to Y$. Then we can apply the compression lemma in the situation of the diagram $$ \xymatrix{ X\times\{0,1\}\ar[r]^-{g_1\cup g_2}\ar[d] & Z\ar[d]^h \\ X\times I \ar[r]_-{F}\ar@{-->}[ru]_-{H} & Y } $$ to get a homotopy $H:X\times I\to Z$ between $g_1$ and $g_2$. If $h$ is not an inclusion, we use the mapping cylinder $M_h$. (See 1.5 %\ref{BNcon} for the definition and basic properties.) Let $f:X\to Y$ be a map. Apply the result of the previous part of the proof to the inclusion $i_Z:Z\hookrightarrow M_h$ and to the map $i_Yf:X\to Y\hookrightarrow M_h$ to get $g:X\to Z$ such that $i_Zg\sim i_Yf$. $$ \xymatrix{ & & Z \ar[dl]^-{h} \ar[d]^{i_Z}\ar[dr]^-{h} & \\ X\ar@{-->}[urr]^-{g}\ar[r]_-{f} & Y\ar[r]_-{i_Y} & M_h \ar[r]_-{p} & Y } $$ Since the right triangle in the diagram commutes and the middle one commutes up to homotopy and $p i_Y=\operatorname{id_Y}$, we get $$hg=pi_Zg\sim pi_Yf= f.$$ The statement (2) can be proved in a similar way. \end{proof} A map $f:X\to Y$ is called a \emph{weak homotopy equivalence} \index{weak homotopy equivalence} if $f_*:\pi_n(X,x_0)\to \pi_n(Y,f(x_0))$ is an isomorphism for all $n$ and all base points $x_0$. \begin{thm*}[Whitehead Theorem] If a map $h:Z\to Y$ between two CW-complexes is a weak homotopy equivalence, then $h$ is a homotopy equivalence. Moreover, if $Z$ is a subcomplex of $Y$ and $h$ is an inclusion, then $Z$ is even deformation retract of $Y$. \end{thm*} \begin{proof} Let $h$ be an inclusion. We apply the compression lemma in the following situation: $$ \xymatrix{ Z\ar[r]^-{\id_Z}\ar[d]_h & Z\ar[d]^{h}\\ Y\ar[r]_-{\id_Y}\ar@{-->}[ru]^-{g} & Y } $$ Then $gh\sim \id_Y$ rel $Z$ and consequently $hg=\id_Z$. So $Z$ is a deformation retract of $Y$. The proof in a general case again uses mapping cylinder $M_h$. \end{proof} \end{cislo} \begin{cislo}\label{HCWsal}{\bf Simplicial approximation lemma.} The following rather technical statement will play an important role in proofs of approximation theorems in this section and in the proof of homotopy excision theorem in the next section. Under convex polyhedron we mean an intersection of finite number of halfspaces in $\R^n$ with nonempty interior. \begin{lemma*}[Simplicial approximation lemma] Consider a map $f:I^n\to Z$. Let $Z$ be a space obtained from a space $W$ by attaching a cell $e^k$. Then $f$ is rel $f^{-1}(W)$ homotopic to $f_1$ for which there is a simplex $\Delta^k\subset e^k$ with $f_1^{-1}(\Delta^k)$ a union (possibly empty) of finitely many convex polyhedra such that $f_1$ is the restriction of a linear surjection $\R^n\to \R^k$ on each of them. \end{lemma*} The proof is elementary but rather technical and we omit it. See [Hatcher], %\cite{Ha}, Lemma 4.10, pages 350--351. \end{cislo} \begin{cislo}\label{HCWca}{\bf Cellular approximation.} We recall that a map $g:X\to Y$ between two CW-complexes is called cellular, if $g(X^n)\subseteq Y^n$ for all $n$. \begin{thm*}[Cellular approximation theorem] If $f:X\to Y$ is a map between CW-complexes, then it is homotopic to a cellular map. If $f$ is already cellular on a subcomplex $A$, then $f$ is homotopic to a cellular map rel $A$. \end{thm*} \begin{cor} $\pi_k(S^n)=0$ for $kn$. According to the simplicial approximation lemma $f_{n-1}$ restricted to $\overline{e^n}$ is homotopic rel $\partial e^n$ to $h:\overline{e^n} \to Y$ with the property that there is a simplex $\Delta^k\subset e^k$ and $h(e^n)\subset Y-\Delta^k$. (Since $nn$ and a monomorphism for $i=n$ and all base points $z_0\in Z$. If we take $A$ a set containing one point from every path component of $X$, then $0$-connected CW model gives a CW-complex $Z$ and a map $Z\to X$ which is a weak homotopy equivalence. \begin{thma}[CW approximation theorem] For every $n\ge 0$ and for every pair $(X,A)$ where $A$ is a CW-complex there exists $n$-connected CW-model $(Z,A)$ with the additional property that $Z$ can be obtained from $A$ by attaching cells of dimensions greater than $n$. \end{thma} \begin{proof} We proceed by induction constructing $Z_n=A\subset Z_{n+1}\subset Z_{n+2}\subset\dots$ with $Z_k$ obtained from $Z_{k-1}$ by attaching cells of dimension $k$, and a map $f:Z_k\to X$ such that $f/A=\id_A$ and $f_*:\pi_i(Z_k)\to \pi_i(X)$ is a monomorhism for $n\le in$ to $A$. Then $f_*:\pi_j(Z)\to \pi_j(X)$ is a monomorphism for $j=n$ and an isomorphism for $j>n$. We will show that $f_*$ is an isomorphism also for $j\leq n$. Consider the diagram: $$ \xymatrix{ A\ar[d]_{i_Z} \ar[rd]^-{i_X} & \\ Z\ar[r]_-{f} & X } $$ The inclusions $i_X$ and $i_Z$ are $n$-equivalences. Consequently, $f_*{i_Z}_*={i_X}_*:\pi_j(A)\to\pi_j(X)$ is an epimorphism for $j=n$. Hence so is $f_*$. Next, ${i_X}_*$ and ${i_Z}_*$ are isomorphisms for $j}[ur]_-{h} & M_{f'} }$$ commutes up to homotopy rel $A$. This $h$ has required properties. The proof that it is unique up to homotopy follows the same lines. \end{proof} \end{cislo}