In Lee's book "Introduction to Smooth manifolds", he following lemma can be found. Lemma 8.26 Let $M$ be a smooth manifold, let $S\subseteq M$ be an embedded submanifold, and let $Y$ be a smooth vector field on $M$. Then $Y$ is tangent to $S$ iff $Yf$ vanishes on $S$ for all $f\in C^\infty(M)$ such that $f|_S=0.$
My question is what if $S$ just an immersed submanifold? Is the same conclusion true? It should be because earlier Lee proves that any immersed submanifold is locally embedded submanifold. But why does Lee state the theorem only for embedded submanifod?