[proofplan]
We prove both directions by translating the intrinsic subbundle condition into adapted local frames. If $S$ is already a smooth subbundle, a local frame of $S$ composed with the inclusion $S\hookrightarrow E$ gives the required sections. Conversely, given local independent sections spanning the fibres of $S$, we complete them to a local frame of $E$ after shrinking the neighbourhood. In that adapted frame, $S$ is locally the standard product $U\times \mathbb{R}^k\subset U\times \mathbb{R}^r$, and these product charts have smooth linear transition maps because they describe the same fibrewise subspaces.
[/proofplan]
[step:Obtain local spanning sections from a given smooth subbundle]
Assume first that $S$ is the total space of a smooth vector subbundle of $E$ of rank $k$. Let $\pi_S:S\to M$ denote the restricted bundle projection, and let $\iota:S\to E$ denote the smooth vector-bundle inclusion over $\operatorname{id}_M$.
For any $p\in M$, choose an open neighbourhood $U\subset M$ of $p$ on which $S$ admits a smooth local frame $\sigma_1,\dots,\sigma_k\in \Gamma(U,S)$. Define smooth local sections $s_i:U\to E$ for $1\le i\le k$ by the rule $s_i(q)=\iota(\sigma_i(q))$ for $q\in U$. Since $\iota|_{S_q}:S_q\to E_q$ is the inclusion of vector spaces, the vectors $s_1(q),\dots,s_k(q)$ are linearly independent in $E_q$ and span the subspace $S_q\subset E_q$ for every $q\in U$. This proves the forward implication.
[/step]
[step:Complete the local spanning sections to an adapted frame of $E$]
Assume conversely that the stated local spanning condition holds. Let $\pi:E\to M$ denote the bundle projection, and let $r:=\operatorname{rank}E$ denote the fibre dimension of $E$. Fix $p\in M$. Choose an open neighbourhood $U\subset M$ of $p$ and sections $s_1,\dots,s_k\in \Gamma(U,E)$ which are fibrewise linearly independent and satisfy
\begin{align*}
S_q=\operatorname{span}\{s_1(q),\dots,s_k(q)\}
\end{align*}
for every $q\in U$.
If $k=0$, then the hypothesis says $S_q=\{0\}$ on a neighbourhood of every point $p\in M$. These local descriptions identify $S$ with the zero section of $E$, giving the rank $0$ smooth vector subbundle. Hence, for the rest of the converse, assume $k>0$.
Shrink $U$, if necessary, to an open neighbourhood of $p$ on which the vector bundle $E$ admits a smooth local frame, and continue to denote this smaller neighbourhood by $U$. Choose a smooth local frame $e_1,\dots,e_r\in \Gamma(U,E)$ of $E$ over $U$. For $1\le i\le k$, write
\begin{align*}
s_i(q)=\sum_{a=1}^{r} A_{ai}(q)e_a(q),
\end{align*}
where each coefficient function $A_{ai}:U\to \mathbb{R}$ is smooth. Since $s_1(p),\dots,s_k(p)$ are linearly independent in $E_p$, the $r\times k$ matrix $A(p)=(A_{ai}(p))$ has rank $k$. Hence some $k\times k$ minor is nonzero at $p$. After relabelling the frame $e_1,\dots,e_r$, assume this minor is
\begin{align*}
B(q):=(A_{ai}(q))_{1\le a,i\le k}.
\end{align*}
Since $\det B:U\to \mathbb{R}$ is smooth and $\det B(p)\ne 0$, after replacing $U$ by the open neighbourhood
\begin{align*}
V:=\{q\in U:\det B(q)\ne 0\}
\end{align*}
of $p$, the matrix $B(q)$ is invertible for every $q\in V$.
Define sections $f_1,\dots,f_r\in \Gamma(V,E)$ by
\begin{align*}
f_i:=s_i\quad \text{for }1\le i\le k,\qquad f_a:=e_a|_V\quad \text{for }k<a\le r.
\end{align*}
Relative to the frame $e_1,\dots,e_r$, the change-of-frame matrix from $(e_1,\dots,e_r)$ to $(f_1,\dots,f_r)$ has determinant $\det B(q)$ at each $q\in V$. Therefore this determinant is nonzero on $V$, so $f_1(q),\dots,f_r(q)$ form a basis of $E_q$ for every $q\in V$. Thus $f_1,\dots,f_r$ is a smooth local frame of $E$ over $V$ adapted to $S$, with
\begin{align*}
S_q=\operatorname{span}\{f_1(q),\dots,f_k(q)\}
\end{align*}
for all $q\in V$.
[guided]
The point of this step is to put $S$ into a coordinate system where it looks like the first $k$ coordinate directions. We begin with the given local generators $s_1,\dots,s_k\in \Gamma(U,E)$, which are linearly independent in each fibre and satisfy
\begin{align*}
S_q=\operatorname{span}\{s_1(q),\dots,s_k(q)\}.
\end{align*}
To compare them with all of $E$, let $r:=\operatorname{rank}E$ and choose a smooth local frame $e_1,\dots,e_r\in \Gamma(U,E)$ of $E$ over $U$. Each section $s_i$ has unique smooth coordinate functions in this frame, so for $1\le i\le k$ we write
\begin{align*}
s_i(q)=\sum_{a=1}^{r} A_{ai}(q)e_a(q),
\end{align*}
where $A_{ai}:U\to \mathbb{R}$ is smooth for every pair of indices $a,i$.
At the point $p$, the vectors $s_1(p),\dots,s_k(p)$ are linearly independent in the $r$-dimensional [vector space](/page/Vector%20Space) $E_p$. Therefore the $r\times k$ coordinate matrix $A(p)=(A_{ai}(p))$ has rank $k$. A matrix has rank $k$ exactly when at least one $k\times k$ minor is nonzero. By relabelling the frame vectors $e_1,\dots,e_r$, we may assume that the nonzero minor uses the first $k$ rows. Define
\begin{align*}
B(q):=(A_{ai}(q))_{1\le a,i\le k}.
\end{align*}
Then $\det B(p)\ne 0$. Since $\det B$ is a smooth, hence continuous, function, the set
\begin{align*}
V:=\{q\in U:\det B(q)\ne 0\}
\end{align*}
is an open neighbourhood of $p$, and $B(q)$ is invertible for every $q\in V$.
Now define
\begin{align*}
f_i:=s_i\quad \text{for }1\le i\le k,\qquad f_a:=e_a|_V\quad \text{for }k<a\le r.
\end{align*}
We claim that $f_1,\dots,f_r$ is a frame of $E$ over $V$. Relative to the original frame $e_1,\dots,e_r$, the first $k$ columns of the change-of-frame matrix are the coordinate columns of $s_1,\dots,s_k$, and the last $r-k$ columns are the standard coordinate columns for $e_{k+1},\dots,e_r$. Expanding the determinant along those last $r-k$ standard columns gives exactly $\det B(q)$. This determinant is nonzero on $V$, so the vectors $f_1(q),\dots,f_r(q)$ form a basis of $E_q$ for every $q\in V$.
Because $f_i=s_i$ for $1\le i\le k$, the defining hypothesis gives
\begin{align*}
S_q=\operatorname{span}\{s_1(q),\dots,s_k(q)\}=\operatorname{span}\{f_1(q),\dots,f_k(q)\}
\end{align*}
for every $q\in V$. Thus the frame $f_1,\dots,f_r$ is adapted to the subset $S$: the first $k$ frame vectors span precisely the fibrewise subspace $S_q$.
[/guided]
[/step]
[step:Use adapted frames to define local product charts for $S$]
For each adapted neighbourhood $V\subset M$ constructed above, define a local trivialization $\Phi_V:\pi^{-1}(V)\to V\times \mathbb{R}^r$ of $E$ by
\begin{align*}
\Phi_V(v)=\bigl(q,(c_1,\dots,c_r)\bigr)
\end{align*}
when $v\in E_q$ and
\begin{align*}
v=\sum_{a=1}^{r} c_a f_a(q).
\end{align*}
To justify smoothness, define the map $\Theta_V:V\times \mathbb{R}^r\to \pi^{-1}(V)$ by
\begin{align*}
\Theta_V(q,c_1,\dots,c_r)=\sum_{a=1}^{r}c_a f_a(q).
\end{align*}
This map is smooth because addition and scalar multiplication in the vector bundle are smooth and each $f_a:V\to E$ is a smooth section. Since $f_1(q),\dots,f_r(q)$ is a basis of $E_q$ for every $q\in V$, the map $\Theta_V$ is bijective onto $\pi^{-1}(V)$, and its inverse is precisely $\Phi_V$.
It remains to verify that this inverse is smooth. Choose any smooth local trivialization $\Xi:E|_V\to V\times\mathbb{R}^r$ of $E$. Let $C:V\to GL(r,\mathbb{R})$ be the smooth matrix whose $a$-th column is the $\Xi$-coordinate vector of $f_a(q)$. In the coordinates given by $\Xi$, the map $\Theta_V$ has the form
\begin{align*}
(q,c)\mapsto (q,C(q)c).
\end{align*}
Because $C(q)\in GL(r,\mathbb{R})$ for every $q\in V$ and matrix inversion is smooth on $GL(r,\mathbb{R})$, the inverse coordinate map has the form
\begin{align*}
(q,y)\mapsto (q,C(q)^{-1}y),
\end{align*}
which is smooth. Thus $\Phi_V$ is a smooth vector-bundle trivialization of $E$ over $V$.
The adapted-frame identity gives $v\in S\cap \pi^{-1}(V)$ if and only if $v\in E_q$ for some $q\in V$ and
\begin{align*}
v=\sum_{i=1}^{k} c_i f_i(q)
\end{align*}
for unique scalars $c_1,\dots,c_k\in \mathbb{R}$. Equivalently,
\begin{align*}
\Phi_V(S\cap \pi^{-1}(V))=V\times (\mathbb{R}^k\times \{0\}^{r-k}).
\end{align*}
Define $\psi_V:S\cap \pi^{-1}(V)\to V\times \mathbb{R}^k$ by
\begin{align*}
\psi_V(v)=\bigl(q,(c_1,\dots,c_k)\bigr)
\end{align*}
whenever
\begin{align*}
v=\sum_{i=1}^{k} c_i f_i(q).
\end{align*}
These maps are bijections onto $V\times \mathbb{R}^k$ and are fibrewise linear.
[/step]
[step:Verify that the local product charts have smooth vector-bundle transitions]
Let $V,W\subset M$ be two adapted neighbourhoods with adapted frames $f_1,\dots,f_r\in \Gamma(V,E)$ and $g_1,\dots,g_r\in \Gamma(W,E)$. On $V\cap W$, define the smooth transition coefficient functions $T_{\ell j}:V\cap W\to \mathbb{R}$ by
\begin{align*}
f_j(q)=\sum_{\ell=1}^{r}T_{\ell j}(q)g_\ell(q).
\end{align*}
For $1\le j\le k$, the vector $f_j(q)$ lies in $S_q$. Since
\begin{align*}
S_q=\operatorname{span}\{g_1(q),\dots,g_k(q)\},
\end{align*}
the uniqueness of coordinates in the basis $g_1(q),\dots,g_r(q)$ implies
\begin{align*}
T_{\ell j}(q)=0\qquad \text{for all }k<\ell\le r,\ 1\le j\le k.
\end{align*}
Therefore, if
\begin{align*}
v=\sum_{j=1}^{k}a_j f_j(q)\in S_q,
\end{align*}
then substituting the transition expansion for each $f_j(q)$ gives
\begin{align*}
v=\sum_{j=1}^{k}a_j\sum_{\ell=1}^{r}T_{\ell j}(q)g_\ell(q).
\end{align*}
Using $T_{\ell j}(q)=0$ for $k<\ell\le r$ and $1\le j\le k$, this reduces to
\begin{align*}
v=\sum_{\ell=1}^{k}\left(\sum_{j=1}^{k}T_{\ell j}(q)a_j\right)g_\ell(q).
\end{align*}
Thus the transition map $\psi_W\circ \psi_V^{-1}:(V\cap W)\times \mathbb{R}^k\to (V\cap W)\times \mathbb{R}^k$ is
\begin{align*}
(q,a)\mapsto \bigl(q,T_S(q)a\bigr),
\end{align*}
where
\begin{align*}
T_S(q):=(T_{\ell j}(q))_{1\le \ell,j\le k}.
\end{align*}
For each $q\in V\cap W$, the vectors $f_1(q),\dots,f_k(q)$ and $g_1(q),\dots,g_k(q)$ are both bases of the same vector space $S_q$. Hence the coordinate-change matrix from the $f$-basis of $S_q$ to the $g$-basis of $S_q$ is invertible, so $T_S(q)\in GL(k,\mathbb{R})$. The entries of $T_S$ are smooth because they are entries of the smooth transition matrix between the two smooth frames of $E$. Hence the charts $\psi_V$ define a smooth rank $k$ vector-bundle structure on $S$ over $M$.
[guided]
We must check that the local product descriptions of $S$ are compatible on overlaps. Let $V,W\subset M$ be adapted neighbourhoods, with adapted frames $f_1,\dots,f_r\in \Gamma(V,E)$ and $g_1,\dots,g_r\in \Gamma(W,E)$. On $V\cap W$, the smooth frame-transition functions $T_{\ell j}:V\cap W\to \mathbb{R}$ are defined by
\begin{align*}
f_j(q)=\sum_{\ell=1}^{r}T_{\ell j}(q)g_\ell(q).
\end{align*}
These functions are smooth because they are the fibre-coordinate functions of the smooth section $f_j$ in the smooth local frame $g_1,\dots,g_r$.
The adapted-frame condition is what forces the transition matrix to respect the first $k$ coordinates. For $1\le j\le k$, the vector $f_j(q)$ belongs to $S_q$. Since the adapted frame $g_1(q),\dots,g_r(q)$ satisfies
\begin{align*}
S_q=\operatorname{span}\{g_1(q),\dots,g_k(q)\},
\end{align*}
the unique coordinate expression of $f_j(q)$ in the basis $g_1(q),\dots,g_r(q)$ has no components in the directions $g_{k+1}(q),\dots,g_r(q)$. Therefore
\begin{align*}
T_{\ell j}(q)=0\qquad \text{for all }k<\ell\le r,\ 1\le j\le k.
\end{align*}
Now take a vector $v\in S_q$ and write it in the $f$-coordinates as
\begin{align*}
v=\sum_{j=1}^{k}a_j f_j(q),
\end{align*}
where $a=(a_1,\dots,a_k)\in \mathbb{R}^k$. Substituting the transition expansion for each $f_j(q)$ gives
\begin{align*}
v=\sum_{j=1}^{k}a_j\sum_{\ell=1}^{r}T_{\ell j}(q)g_\ell(q).
\end{align*}
Using the vanishing of the lower-left block, this becomes
\begin{align*}
v=\sum_{\ell=1}^{k}\left(\sum_{j=1}^{k}T_{\ell j}(q)a_j\right)g_\ell(q).
\end{align*}
Thus the transition map between the $S$-charts is
\begin{align*}
(q,a)\mapsto \bigl(q,T_S(q)a\bigr),
\end{align*}
where
\begin{align*}
T_S(q):=(T_{\ell j}(q))_{1\le \ell,j\le k}.
\end{align*}
For each $q\in V\cap W$, the two lists $f_1(q),\dots,f_k(q)$ and $g_1(q),\dots,g_k(q)$ are bases of the same vector space $S_q$, so this coordinate-change matrix is invertible. Hence $T_S(q)\in GL(k,\mathbb{R})$. Since the entries of $T_S$ are smooth functions of $q$, the product charts $\psi_V$ have smooth vector-bundle transition maps.
[/guided]
[/step]
[step:Identify the resulting bundle as a smooth subbundle of $E$]
With the smooth structure defined by the charts $\psi_V$, the projection $\pi_S:S\to M$, $v\mapsto \pi(v)$, is locally the projection $V\times \mathbb{R}^k\to V$. Thus $\pi_S:S\to M$ is a smooth vector bundle of rank $k$.
It remains to check that this vector bundle is a smooth subbundle of $E$. In an adapted frame over $V$, the inclusion map $\iota:S\to E$ has local coordinate form the map from $V\times \mathbb{R}^k$ to $V\times \mathbb{R}^r$ sending $(q,c_1,\dots,c_k)$ to $(q,c_1,\dots,c_k,0,\dots,0)$. This map is smooth and fibrewise linear.
The same adapted trivialization identifies $S\cap \pi^{-1}(V)$ with the subset $V\times(\mathbb{R}^k\times\{0\}^{r-k})$ of $V\times\mathbb{R}^r$. Therefore the smooth topology on $S$ is locally the [subspace topology](/page/Subspace%20Topology) inherited from $E$, because in these coordinates it is exactly the product subspace topology on $V\times(\mathbb{R}^k\times\{0\}^{r-k})$. Its image is exactly the original subset $S\subset E$, and on each fibre it is the inclusion of the vector subspace $S_q\subset E_q$. Therefore $S$ is the total space of a smooth vector subbundle of $E$ of rank $k$. This proves the converse implication and completes the proof.
[/step]