# Understanding the generalization of the definition of homotopy equivalence

Here is the question I am trying to answer:

Show that $$f: X \to Y$$ is a homotopy equivalence if there exist maps $$g,h: Y \to X$$ such that $$f \circ g \simeq 1_Y$$ and $$h \circ f \simeq 1_X.$$ More generally, show that $$f$$ is a homotopy equivalence if $$f\circ g$$ and $$h \circ f$$ are homotopy equivalences.

My question is:

I do not understand how is the second part a generalization of the first part of the question, could someone explain this to me please?

In the second part, $$f\circ g$$ and $$h\circ f$$ are self-homotopy equivalences (maps from a space to itself which are homotopy equivalences), whereas in the first part they are required to be homotopic to the identity map. It's a generalisation because a self-homotopy equivalence is not necessarily homotopic to the identity map. For example, consider the map $$\phi : S^1 \to S^1$$ given by $$\phi(z) = \frac{1}{z}$$. It is a homotopy equivalence (with homotopy inverse $$\phi$$), but it is not homotopic to the identity (they induce different maps on $$\pi_1$$).