homotopy equivalence between the cylinder of a map

Given a continuous map $$f\colon X\to Y$$ between two non-empty topological spaces, show that there is homotopy equivalence between the mapping cylinder $$(X\times I)\sqcup _{f}Y$$ and Y.

Here we have I=$$[0,1]$$, $$(x,1)\sim f(x)$$ on X.

Is the following proof correct?:

Let's denote by $$\cong$$ a homotopy equivalence.

I is contractible so $$I\cong \{1\}$$, and obviously $$X \cong X$$,

So we have $$X\times I \cong X\times \{1\} \cong f(X)$$

Therefore $$X\times I \sqcup_f Y\cong f(X)\sqcup_f Y = Y$$

Thank you for your corrections and comments.

• If $X$ is noncontractible and $f$ is constant then $X \times \{1\} \cong f(X)$ is false. So no, the proof is not correct. – Lee Mosher Feb 17 at 17:02
• Right! Thank you for the counter-example. Is homotopy equivalence compatible with the product of spaces as I used it for this statement $X\times I \cong X\times \{1\}$? I know it is the case for deformation retraction – PerelMan Feb 17 at 17:08
• Note that you do not have $(x,0)\sim(x',0)$ for the mapping cylinder. If you had that relation, you'd get the mapping cone, which does not retract onto $Y$ in general. – Christoph Feb 17 at 17:36
• Thanks! I edited the question – PerelMan Feb 17 at 17:46

Denote $$M :=(X\times I)\sqcup _{f}Y$$ and take maps $$p: Y \to M, y \mapsto y$$ and $$q: M \to Y, (x, s) \mapsto f(x), y \mapsto y$$. Well defined: easy to verify
Then $$q \circ p= id_Y$$ and $$p \circ q \cong id_M$$ via the homotopy map
$$H_t: M \times I \to M, (x, s,t) \mapsto (x, t +s(1-t)), y \mapsto y$$
Then: $$H_0= id_M, H_1= p \circ q$$
• if $t\in [0,1[$ then $q(x,t) \not \in Y$ so $q$ is not defined all over M? – PerelMan Feb 17 at 17:29
• sure, $q$ maps by definition $(x,t)$ to $f(x) \in Y$. take futhermore into account that $H_1$ factorize by construction through $Y$, since $X \times \{1\} \cong f(X) \subset Y$ by your identifications – KarlPeter Feb 17 at 17:32
• one subtle remark: $X \times \{1\} \cong f(X)$ holds only in $M$, so only if we consider the both as subsets of $M$. More precisely: $X \times \{1\}/\sim_M \cong f(X)/\sim_M$. here $\sim_M$ are the identifications in $M$ – KarlPeter Feb 17 at 17:42