I am reading the following proof on page 493 of the book Introduction to Smooth Manifolds of John M. Lee
In the second sentence of the proof, he claimed that the forms $\omega^1,..., \omega^{n-k}$ are independent on $U$ for dimensional reasons. What did he mean by "dimensional reasons"? I suppose there is something related to rank-nullity theorem, but I don't know how to use it.

Maybe this will make it clearer: put the forms together into one linear operator $$ \Omega :TM\rightarrow \mathbb{R}^{n-k} \\ \Omega(X) := (\omega^1(X),\ldots,\omega^{n-k}(X)). $$ Then pointwise $$ \operatorname{Ker} \Omega = \bigcap_{i=1}^{n-k}\operatorname{Ker}\omega^i = D. $$ So $\dim\operatorname{Ker}\Omega = \dim D = k$, and hence by rank-nullity $$ \dim\operatorname{Im}\Omega = \dim TM - \dim\operatorname{Ker}\Omega = n-k. $$ So $\Omega$ is surjective at each point of $U$, implying that the $\omega^i$ are linearly independent.