# Mapping Cylinder.

I don't understand the following fact I've read:

Any map $f:X \rightarrow Y$ can be written as composition $X \stackrel{i}{\hookrightarrow} M_f \stackrel{j}{\rightarrow} Y$, where $i$ is the inclusion as a subset,$j$ is an homotopy equivalence and $M_f$ is the mapping cylinder of $f$. How could be checked this?

The mapping cylinder will be defined as something like $$M_f=X\times[0,1]\coprod Y/\sim$$, where $$\sim$$ is defined by $$(x,1)\sim f(x)$$. Including $$X$$ via the map $$i:X\hookrightarrow M_f$$ sinding $$x$$ to $$(x,0)$$ is an obvious inclusion and the harder part is the homotopy equivalence.
What we can, in fact, show, is a fair bit stronger: $$M_f$$ strongly deformation retracts onto $$Y$$, that is, there is a map $$F:M_f\times I\to M_f$$ such that $$F(y,t)=y$$ for all $$y\in Y$$, $$F((x,t),0)=(x,t)$$ and $$F((x,t),1)\in Y$$ for all $$(x,t)\in M_f$$. One can find such a map by $$F:((x,t),s)\mapsto (x,t+(1-t)s)$$ for $$(x,t)\in X\times I$$ (and $$F|Y=\text{id}_Y$$). We can now use this to define the map $$j$$, namely $$j=F|M_f\times \{1\}$$.
To see that this is a homotopy equivalence, we have to use the inclusion $$\iota:Y\to M_f$$ and show that $$\iota\circ j$$ and $$j\circ\iota$$ are homotopic to their respective identities. One of these simply equals $$\text{id}_Y$$, so there's not much work there and for the other one, the map $$F$$ that we just carefully constructed can be used. (In fact, this proves that a (strong) deformation retract is a homotopy equivalence.)