Solution (source code)

= Solution

Let $r:G\to H$ be a retraction. Part (a) supplies a constant $C$ such that
$$
d_S(h_1,h_2)\leq C\,d_T(h_1,h_2).
$$
The finite set $r(S)$ generates $H$. Put
$$
D=\max_{s\in S}|r(s)|_T.
$$
If a shortest $S$-word represents $h_1^{-1}h_2\in H$, applying the <group homomorphism> $r$ gives a $T$-word for the same element of length at most $D\,d_S(h_1,h_2)$. Hence
$$
d_T(h_1,h_2)\leq D\,d_S(h_1,h_2).
$$
The inclusion is therefore bilipschitz and in particular a <quasi-isometric embedding>. Thus every finitely generated <retract subgroup> is quasi-isometrically embedded.