Proof. Since
$Y$ is a
deformation retract of
$X$ there is a
homotopy $F:I\times X\to X$ between
$\id_X$ and a
retract $r:X\to Y$ of
$X$ onto
$Y$ Similarly, there is a homotopy
$G:I\times Y\to Y$ between
$\id_Y$ and a retract
$s:Y\to Z$ of
$Y$ onto
$Z$
First notice that since both $r$ and $s$ fix $Z$ the map $sr:X\to Z$ is a retraction.
Now define a map $\widetilde{G}:I\times X\to X$ by $\widetilde{G}=iG(\id_I\times r)$ where $i:Y\hookrightarrow X$ is inclusion. Observe that
- $\widetilde{G}(0,x)=r(x)$ for any $x\in X$
- $\widetilde{G}(1,x)=sr(x)$ for any $x\in X$ and
- $\widetilde{G}(t,a)=a$ for any $a\in Z$
Hence
$\widetilde{G}$ is a homotopy between the retractions
$r$ and
$sr$
Finally we must glue together the homotopies $F$ and $\widetilde{G}$ to get a homotopy between $\id_X$ and $sr$ To do this, define a function $H:I\times X\to X$ by $$ H(t,x)=\begin{cases} F(2t,x), & 0\le t\le\frac{1}{2} \\ \widetilde{G}(2t-1, x), & \frac{1}{2}\le t\le 1. \end{cases} $$ Since $F(1,x)=\widetilde{G}(0,x)=r(x)$ the gluing yieds a continuous map. By construction,
- $H(0,x)=x$ for all $x\in X$
- $H(1,x)=sr(x)$ for all $x\in X$ and
- $H(t,a)=a$ for any $a\in Z$
Hence
$H$ is a homotopy between the
identity map on
$X$ and a retraction of
$X$ onto
$Z$ We conclude that
$H$ is a deformation retraction of
$X$ onto
$Z$ 