Allen Hatcher algebraic topology proof of theorem 4.5 Whitehead It was stated as the last answer in this post: 
Idea behind the proof of Whitehead's Theorem and Compression Lemma
I copy here what is asked there:
I am reading as well the proof of Whitehead's theorem in AHAT and trying to grasp the idea of what happens in the general case when $f$ is not cellular without using cellular approximation. 
The final line of the argument ''$( X \times I \sqcup Y, X \times \partial I \sqcup Y) \rightarrow (M_f, X \cup Y) \rightarrow (M_f, X)$ gives a deformation retraction of $M_f$ onto $X$'' is, if I understand right, quotient by $(x,1) \sim f(x)$ in the first arrow and the homotopy $g$ explained in the book in the second. Clearly, this composition would give the deformation retraction we seek if taking the quotient in the first arrow would give a homotopy equivalence, which I am not so sure why is so.. this may be an easy algebraic fact but I'm not on algebra so if it is a silly questions I excuse myself from now lol, anyway,  Thank you very much in advance for any help on this matter.
 A: Applying the compression lemma to the inclusion $(X \cup Y,X) \to (M_f,X)$, we obtain a homotopy rel $X$ from $X \cup Y \to M_f$ to a map $X\cup Y \to X$. Since $(M_f,X \cup Y)$ has the homotopy extension property, this homotopy extends to a homotopy rel $X$ from $\text{id}_{M_f}$ to a map $g:M_f \to M_f$ such that $g(X\cup Y)\subset X$. Now apply the compression lemma again to the composition 
$$ g \circ q: (X\times I \amalg Y, X\times \partial I \amalg Y) \to (M_f, X\cup Y) \to (M_f, X)$$
where $q: X\times I \amalg Y \to M_f$ is the standard quotient map. Then we obtain a homotopy $F: (X\times I \amalg Y)\times I \to M_f $ rel $X\times \partial I \amalg Y$ from $g \circ q$ to a map $X\times I \amalg Y \to X$. Since the homotopy $F$ is "rel $X\times \partial I \amalg Y$", it passes to the quotient and induces a homotopy $\bar{F}:M_f \times I \to M_f$  rel $X\cup Y$ from $g$ to a map $h:M_f \to X$. Therefore, we have $\text{id}_{M_f} \simeq g \simeq h$ rel $X$, and hence $X$ is a deformation retract of $M_f$, as desired.
