Let's simply say that there are many different kind of deformation retraction, one stronger than the other.
The weaker form states that $A \subseteq X$ is a (weak)deformation retract of $X$ iff there's a map $r \colon X \to A$ such that $r$ is both a left and right homotopy inverse to the inclusion map $i \colon A \to X$ (so $A$ must be homotopy equivalent to $X$).
The stronger form states that $A$ is a deformation retract of $X$ iff exists a map $D \colon X \times I \to X$ such that $D(a,t)=a$ for every $a \in A$, $D(x,0)=x$ and $D(x,1) \in A$ for all $x \in X$ (i.e. $D$ is an homotopy relative to the subspace $A$ between the identity and a map of the form $i\circ r$ for some $r \colon X \to A$). Since $D$ is relative to $A$ you get that the $r(a)=a$ for all $a \in A$, so $r \circ i = 1_A$, while $D$ is an homotopy between $1_X$ and $i \circ r$, so $r$ and $i$ are homotopy equivalences.