# extending a smooth vector field

I need some hints to prove the following lemma:

EXTENSION LEMMA FOR VECTOR FIELDS ON SUBMANIFOLDS: Suppose $M$ is a smooth manifold and $S\subseteq M$ is an embedded submanifold. Given a smooth vector field $X$ on $S$ show that there is a smooth vector field $Y$ on a neighborhood of $S$ in $M$ such that $Y=X$ on $S$. Show that every such vector field extends to all of $M$ if and only if $S$ is properly embedded.

-

Take a submanifold atlas on $S$. In each coordinate chart, extend $X$ to $X_\alpha$ in $TU_\alpha$ in the canonical way. Then take a partition of unity subordinate to the $U_\alpha$ and define a vector field on $U = \cup U_\alpha$. Check that at each $p\in S$, this vector field agrees with $X$.
(Slick alternative method: Pick a Riemannian metric on $M$ and use parallel transport along geodesics perpendicular to $S$.)