Proof that retract of contractible space is contractible

You're glossing over the most important things. You are given the information that $X$ is contractible. This means that there exists a specific homotopy $H:I\times X\to X$ which contracts the identity map. Your goal is to construct a specific homotopy $H':I\times A\to A$ which contracts the identity map. Your proof never explicitly makes use of $H$ and never explicitly (maybe not even implicitly) defines $H'$. This makes it feel like a bunch of symbol-pushing. (This isn't meant to be insulting; I'm just explaining why the proof feels unsatisfying.)

Two preliminary points:

  • $\newcommand{\pt}{{\{\ast\}}}f'=f\circ r$ isn't a map between the right things; it should be a map $A\to\pt$, but it's a map $X\to \pt$. This isn't too important since there's only one map from anything to a point, but the algebraic manipulation will be clearer if you set $f':=f|_A$.

  • You don't need to check $f'\circ g'\cong id_\pt$ since there's only one map $\pt\to\pt$.

So you only need to find a homotopy from $id_A$ to $g'\circ f'$. That is, you need to make a movie (homotopy) which continuously crushes $A$ to a point. But you already have a movie $H:I\times X\to X$ which crushes $X$ to a point (i.e. $H(0,-)=id_X$ and $H(1,-)=g\circ f$), and you have a way to retract anything in $X$ to something in $A$, so you can just retract your movie, setting $H' = r\circ H|_{I\times A}$. Then $H'(0,-) = r\circ H(0,-)|_A = r\circ id_A = id_A$ and $H'(1,-)=r\circ H(1,-)|_A = r\circ (g\circ f)|_A = r\circ g\circ f|_A = g'\circ f'$.


Your real questions have allready been answered. Here I give an alternative proof, demanding some familiarity with categories. It illustrates how convenient 'abstract nonsense' can be. I go out from retraction $r:X\rightarrow A$ and inclusion $i:A\rightarrow X$ with $ri=1$.

The contractible objects in category $\mathbf{Top}$ are exactly the terminal objects in category $\mathbf{hTop}$. If $X$ is a terminal object in $\mathbf{hTop}$, then for every object $Y$ the homset $\mathbf{hTop}\left(Y,X\right)$ contains exactly one arrow. Let us denote this arrow by $\left[c\right]$. Then homset $\mathbf{hTop}\left(Y,A\right)$ contains arrow $\left[r\right]\left[c\right]$. Now let $\left[f\right]\in\mathbf{hTop}\left(Y,A\right)$. Then $\left[i\right]\left[f\right]\in\mathbf{hTop}\left(Y,X\right)$ so $\left[i\right]\left[f\right]=\left[c\right]$. Then we find $\left[f\right]=\left[r\right]\left[i\right]\left[f\right]=\left[r\right]\left[c\right]$ demonstrating that $\left[r\right]\left[c\right]$ is the only element of $\mathbf{hTop}\left(Y,A\right)$. Proved is now that $A$ is terminal in $\mathbf{hTop}$, hence contractible in $\mathbf{Top}$.


It can be done even shorter:

$\left[\right]:\mathbf{Top}\rightarrow\mathbf{hTop}$ is a functor and functors respect retractions (=arrows that have a right-inverse). So if $r:X\rightarrow A$ is a retraction in $\mathbf{Top}$ then $\left[r\right]:X\rightarrow A$ is a retraction in $\mathbf{hTop}$.

If $\left[r\right]:X\rightarrow A$ is a retraction and $X$ is terminal then $\left[r\right]$ is an isomorphism, hence $A$ is terminal. (This is true in every category, but to maintain the line of the proof I keep on using the notation $\left[r\right]$.)

Proof of that: some $\left[s\right]:A\rightarrow X$ exists with $\left[r\right]\left[s\right]=1$; then $\left[s\right]\left[r\right]:X\rightarrow X$ and the identity is the only endomorphism here, so $\left[s\right]\left[r\right]=1$.