TITLE: For $X$ contractible, deformation retract of $CX$ onto $X$.
QUESTION [10 upvotes]: Suppose $X$ is a topological space which is contractible. I want to show that the cone on $X$ deformation retracts onto $X$. 
My retraction $r: CX \to X$ is just the homotopy which contracts $X$ to a point. Now I need a homotopy $H: CX \times I \to CX$ between $1_{CX}$ and $ir$ rel $X$.
If I visualize such a homotopy when $X$ is $D^2$, I can see intuitively how it  should behave. The explicit homotopy is eluding me, though.

REPLY [10 votes]: Let $H : X \times I \to X$ be a deformation retraction of $X$ onto a point $* \in X$, so $H(x,0) = x$ and $H(x,1) = *$ for all $x$. Then an explicit deformation retraction of $CX = (X \times I) / (X \times \{1\})$ onto $X = X \times \{0\}$ is given by
$$G([x,s],t) = 
\begin{cases} 
[H(x,2st), s] &\text{ for $0\leq t\leq 1/2$} \\
[H(x,s), s(2-2t)] &\text{ for $1/2\leq t\leq 1$}
\end{cases}$$
First, this is well-defined (and hence continuous): when $s=1$, the right-hand side does not depend on $x$, and for $t=1/2$, the two definitions agree.  The fact that $G$ is a deformation retraction onto $X\times\{0\}$ then follows from the following computations:
$$G([x,s],0)=[H(x,0),s]=[x,s]$$
$$G([x,s],1)=[H(x,s),0]\in X\times\{0\}$$
$$G([x,0],t)=[H(x,0),0]=[x,0]\text{ for $0\leq t\leq 1/2$}$$
$$G([x,0],t)=[H(x,0),0]=[x,0]\text{ for $1/2\leq t\leq 1$}$$
The intuition behind this is as follows.  First, homotope the $X$-coordinate from $x=H(x,0)$ to $H(x,s)$, keeping the cone coordinate constant.  Second, move the cone coordinate down to $0$ while keeping the $X$-coordinate constant.  Note that if you try to do these steps at the same time instead of one after the other (as Najib Idrissi and Nitrogen did in their now-deleted answers), the map fails to be well-defined at the cone point, because the first step is only well-defined at the cone point if you keep the height constant (so the cone point stays at the cone point).