$X$ and $Y$ are homotopy equivalent $\Leftrightarrow$ $\exists Z:$ $X,Y$ are strong deformation retracts of $Z$

I saw this post a while ago and did not think I had anything to add. However, purely by chance I found this paper today: A Short Note On Mapping Cylinders. There your question seems to be answered precisely as you wanted. That is, a formula is provided for a strong deformation retraction of of the mapping cylinder $Z_{f}$ onto its top $X\times\{1\}$.

It is quite a big formula if you ask me!


This is a copied answer from Hatcher's text. I wrote it only so that this question can be labelled as answered, as desired by @Srivatsan in the comments.

At the moment I am too "out" of algebraic topology, so I will write a proper answer (minimized, that deals only with the given question) later, but how much later I can't say. I must study Morse theory at the moment...

Also, if anyone is willing to convert this in a proper answer, I will delete mine and accept his, as soon as I notice a new answer has appeared (for some reason, I don't get any notifications on this site, or don't notice them or smth.).

enter image description hereenter image description hereenter image description hereenter image description here