# $f:X \to Y$ is a homotopy equivalence if there exists $g,h : Y \to X$ with $fg$ and $hf$ homotopy equivalences

Let $X$ and $Y$ be topological spaces, and let $f: X \to Y$. I'd like to show that if there are maps $g,h : Y \to X$ such that $fg$ and $hf$ are homotopy equivalences, then $f$ is a homotopy equivalences.

$fg$ is a homotopy equivalence means there is some map $k_1 : Y \to Y$ such that $fg k_1 \simeq \mathrm{id}_Y \simeq k_1 fg$. Similarly, there is some map $k_2 : X \to X$ with $hfk_2 \simeq \mathrm{id}_X \simeq k_2 hf$.

I want to find a map $k_3 : Y \to X$, comprising of compositions of $f, g, h, k_1$ and $k_2$, such that $f k_3 \simeq \mathrm{id}_Y$ and $k_3 f \simeq \mathrm{id}_X$. I simply cannot find such a $k_3$. Any ideas?

Thanks

-
$[g]=[hfg]=[h]$, hence $[f]$ is invertible... – Rasmus May 22 '12 at 16:20
@Rasmus Sorry, but I don't follow. Why is $[g] = [hfg]$? – Matt May 22 '12 at 16:27
Because $[hfg]=[hf][g]=[id_X][g]=[g]$. – Rasmus May 23 '12 at 8:36

Note that since $1_Y\simeq fgk_1$, we have that $k_2h\simeq k_2hfgk_1\simeq gk_1$. So take $k_3=k_2h\simeq gk_1$. Then: $$fk_3\simeq fgk_1\simeq 1_Y$$ $$k_3f=k_2hf\simeq 1_X$$