Prove that $TS$ is subbundle of $TM|_S$ for immersed submanifold I was doing Lee's smooth manifold exercise,in problem 10-14 needs to prove the following result:

Let $S\subset M$ be some smooth immersed submanifold,prove that $TS$
is subbundle of $TM|_S$.

It seems we need to use the local frame criterion,which needs to find a neigborhood such that exist k  smooth local section  $\sigma_1,...,\sigma_k :U\to TM|_S$
as  frame for $T_pS$ for each $p \in U$.
To prove this observe that $i:S^k\to M^n$ is smooth immersion,I have  idea how to prove it when $S$ is embedded submanifold,which can be shown as follows:
First for $p\in S$,there exist slice chart around it that is $(U\cap S,\pi\circ\varphi = (x^1,...,x^k))$ as chart for $S$,where $(U,\varphi =(x^1,...,x^n))$ is the corresponding chart for $M$.
We know chart $(U,\varphi =(x^1,...,x^n))$ provide a local trivialization for $TM$,we want to find the local section for $TM|_S$(needed for the local section criterion) which is obvious given by this trivialization.
Now construct the local section as follows:
$$\sigma_i : U\cup S \to (U\cap S) \times \Bbb{R}^n \to \pi^{-1}(U\cap S) \to TM|_S$$
Such that this map maps $p \mapsto (p,e_i) \mapsto \frac{\partial}{\partial x^i}|_p $
Our guess may be $\sigma_1,...,\sigma_k$ span the $TS$ but I can't make it clear.
 A: I wrote this a while ago, and now I kind of having difficulty to follow my proof. But I'm sure I convinced by this proof at the time I wrote this. Let me know if something unclear.
Setup : Let $ \pi|_S : TM|_S \to S$ be the ambient tangent bundle, $\iota : S \hookrightarrow M$ is an immersed submanifold of dimension $k$ of a $n$-dimensional smooth manifold $M$.  For any $p \in S$, we have an $k$-dimensional subspace $d\iota_p (T_pS) \subseteq T_pM$. We want to show that $\bigcup_{p \in S} d\iota_p(T_pS) \subseteq TM|_S$ is a smooth subbundle of rank-$k$. To do this, it is enough to show that for any $p \in S$ there is a neighbourhood $V$ of $p$ and smooth local sections $\sigma_1,\dots,\sigma_k :V \to TM|_S$ such that at any $q \in V$, $\sigma_1(q),\dots,\sigma_k(q)$ form a basis for subspace $d\iota_q(T_qS)$.
Proof :  Since $S \subseteq M$ is an immersed submanifold, then $S$ locally embedded. So for any $p \in S$, there exists a neighbourhood $V \subseteq S$ of $p$ such that $V$ is embedded submanifold of $M$. By shrinking $V$ if necessary, we may assume that $V \subseteq S$ such that $\iota(V)=V \subseteq U$, so $V = V \cap U$ is a single slice in $U$, where $(U,\varphi)$ is a slice chart for $V$. That is
$$
\varphi(V) = \{(x^1,\dots,x^n) \in \varphi(U) : x^{m+1} = \cdots= x^n = 0   \} \subseteq \varphi(U).
$$
By Theorem 5.8, we have smooth (global) chart $(V,\psi)$ where the coordinate functions $\psi (V) = \{ (x^1,\dots,x^m)\} \subseteq \mathbb{R}^m$ are exactly the nonvanishing coordinates of image $\varphi(V)$ in $\varphi(U)$. Hence the representation of $\iota : S \hookrightarrow M$ in smooth charts $(V,\psi)$ and $(U,\varphi)$ is
\begin{equation}\tag{$\star$}
(x^1,\dots,x^m) \mapsto (x^1,\dots,x^m,0,\dots,0).
\end{equation}
Now for $i=1,\dots,m$, the coordinate vector fields $\tau_i : V \to TS$ defined as $\tau_i(q) = \frac{\partial}{\partial x^i}\big|_q$ are smooth local frame (since the component functions are constant, hence smooth) for $TS$ over $V$. Define local sections $\sigma_i : V \to TM|_S$ defined as $\sigma_i(q) = d\iota_q (\tau_i(q))$, for $i =1,\dots,m$, where $d\iota_q : T_qS \to T_qM$ is the differential of $\iota : S \hookrightarrow M$ at $q\in S$. From ($\star$), we can compute $\sigma_i$ as
$$
\sigma_i(q) = d\iota_q \circ \tau_i(q) = d\iota_q \Big(\frac{\partial}{\partial x^i}\bigg|_q \Big) = \frac{\partial}{\partial x^i}\bigg|_q,
$$
which is form a basis for $d\iota_q(T_qS) \subseteq T_qM$.
We have to show that these sections are smooth sections on $TM|_S$. Since $\sigma_i (V) \subseteq \bigcup_{q \in V} T_qM = (\pi|_S)^{-1}(V) = TM|_V$ and $TM|_V$ is open in $TM|_S$, then we only need to check the smoothness in $TM|_V$. For the local trivialization of $TM$ over slice chart $U$ as above is $\Phi : \pi^{-1}(U) \to U \times \mathbb{R}^n$, defined as
$$
\Phi \Big(v^i \frac{\partial}{\partial x^i}\Big|_p \Big) = (p,(v^1,\dots,v^n)).
$$
So the local trivialization for $TM|_V$ is just the restriction of $\Phi$ to $\pi^{-1}(U \cap V)$. Denote this as  $\Psi = \Phi|_U : \pi^{-1}(U \cap V) \to (U \cap V) \times \mathbb{R}^n$. Therefore
$$
\Psi \circ \sigma_i (q) =\Phi(\sigma_i(q)) =(q,e_i),
$$
which is obviously smooth. Hence $\sigma_i$ are the smooth local sections tha we seek. Since we can do this for every point $p \in S$, therefore $TS$ identified as its image $d\iota(TS) \subseteq TM|_S$ is a smooth subbundle.
