On some doubts on tangent space of immersed submanifold
The lemma is not true for immersed submanifolds. A counterexample is the irrational winding of the torus (see Example 4.20 in Lee). This is the image of the map $$ \gamma:\mathbb{R}\rightarrow\mathbb{T}^{2}:t\mapsto (e^{2\pi it},e^{2\pi i\alpha t}), $$ where $\alpha$ is an irrational number. It is an immersed, but not an embedded submanifold.
Since $\gamma(\mathbb{R})$ is dense in $\mathbb{T}^{2}$, the zero function is the only function that vanishes on $\gamma(\mathbb{R})$. So for any vector field $Y\in\mathfrak{X}(\mathbb{T}^{2})$, we have $f|_{\gamma(\mathbb{R})}=0 \Rightarrow Y(f)|_{\gamma(\mathbb{R})}=0$. But not all vector fields on $\mathbb{T}^{2}$ are tangent to $\gamma(\mathbb{R})$.
Another example of an immersed but not embedded submanifold. Take $F: \mathbb{R}\to \mathbb{R^2}$ defined by $$F(t)=\left(2cos\left(t-\frac{\pi}{2}\right), 2sin\left(t-\frac{\pi}{2}\right)\right)$$ Then $(F, \mathbb{R})$ is an immersed submanifold of $\mathbb{R^2}$ but not an embedded submanifold of $\mathbb{R^2}$.
It looks like this and goes through the origin twice as the leminiscate loops around itself: