Lemma 10.32 of Lee's Introduction to Smooth Manifolds I am reading over the proof of Lemma 10.32 (Local Frame Criterion for Subbundles) in Lee's Introduction to Smooth Manifolds.
The lemma says

Let $\pi: E \rightarrow M$ be a smooth vector bundle and suppose that for each $p\in M$ we are given an M-dimensional linear subspace $D_p \subseteq E_p$. Then $D = \cup_{p \in M} D_p \subseteq E$ is a smooth subbundle of $E$ iff each point of $M$ has a neighborhood $U$ on which there exist smooth local sections $\sigma_1, \cdots, \sigma_m: U \rightarrow E$ with the property that $\sigma_1(q), \cdots, \sigma_m(q)$ form a basis for $D_q$ at each $q \in U$.

Overall I understand the proof of this lemma, besides the part where we need to show that $D$ is an embedded submanifold with or without boundary of $E$. Professor Lee's proof says that

it suffices to show that each $p \in M$ has a neighborhood $U$ such that $D \cap \pi^{-1}(U)$ is an embedded submanifold (possibly with boundary) in $\pi^{-1}(U) \in E$.

It is not very obvious to me why it is sufficient by showing this. May someone explain the logic to me?
Edit: Here's my attempt to reason it: By Theorem 5.8, if $D ∩ \pi^{-1}(U)$ is an embedded submanifold in $\pi^{-1}(U)$, it satisfies the local k-slice condition. Now because $D$ is a union of $D ∩ \pi^{-1}(U)$ over different neighborhoods of $p \in M$, it satisfies the local k-slice condition as well, and hence again by Theorem 5.8, $D$ is an embedded submanifold.
Please let me know if anything is wrong and how it can be corrected.
Thank you very much.
Here's a screenshot of the Lemma and its (partial) proof:


Unfortunately, Theorem 5.8 only works for smooth manifolds without boundary. But here $E$ probably has boundary. A better theorem is Theorem 5.51，but it also requires that $M$ is a smooth manifold without boundary there.
