[proofplan]
We begin with an ordered basis of the subspace $U$, using the convention that the zero-dimensional case has the empty ordered basis. We then enlarge this linearly independent list inside $V$ by repeatedly adjoining a vector outside its span until its span is all of $V$. The construction must stop because $V$ has dimension $n$, and the final ordered list is a basis of $V$ whose initial segment is exactly the chosen basis of $U$.
[/proofplan]
[step:Choose an ordered basis of the subspace $U$]
Since $V$ is finite-dimensional and $U \subset V$ is a subspace, $U$ is finite-dimensional. By the definition of $r = \dim_k U$, there exists an ordered basis $(v_1,\ldots,v_r)$ of $U$ when $r > 0$. When $r = 0$, the subspace $U$ is the zero subspace $\{0\}$, and the empty ordered tuple is its ordered basis.
In both cases, the initial ordered list $(v_1,\ldots,v_r)$ is linearly independent as a list in $V$: if $a_1,\ldots,a_r \in k$ satisfy
\begin{align*}
a_1v_1+\cdots+a_rv_r = 0
\end{align*}
in $V$, then the same equality holds in the subspace $U$, so $a_1=\cdots=a_r=0$ because $(v_1,\ldots,v_r)$ is a basis of $U$. For $r=0$, this is the vacuous linear independence of the empty list.
[/step]
[step:Extend the linearly independent list until it spans $V$]
Let $m$ denote the current length of the ordered list, initially $m=r$, and let
\begin{align*}
S_m = \operatorname{span}_k\{v_1,\ldots,v_m\}
\end{align*}
denote its $k$-linear span in $V$. If $S_m \neq V$, choose a vector $v_{m+1} \in V \setminus S_m$ and append it to the list.
The enlarged list $(v_1,\ldots,v_m,v_{m+1})$ is linearly independent. Indeed, suppose $a_1,\ldots,a_m,a_{m+1} \in k$ satisfy
\begin{align*}
a_1v_1+\cdots+a_mv_m+a_{m+1}v_{m+1}=0.
\end{align*}
If $a_{m+1}\neq 0$, then
\begin{align*}
v_{m+1}= -a_{m+1}^{-1}(a_1v_1+\cdots+a_mv_m),
\end{align*}
which places $v_{m+1}$ in $S_m$, contradicting the choice of $v_{m+1}$. Hence $a_{m+1}=0$, and then
\begin{align*}
a_1v_1+\cdots+a_mv_m=0.
\end{align*}
Since the previous list was linearly independent, $a_1=\cdots=a_m=0$.
Repeating this construction while the current span is not all of $V$ produces a linearly independent ordered list in $V$. The process terminates after finitely many steps because a linearly independent list in the $n$-dimensional vector space $V$ has at most $n$ vectors. Thus we obtain an ordered list $(v_1,\ldots,v_s)$ for some integer $s$ with $r \leq s \leq n$ and
\begin{align*}
\operatorname{span}_k\{v_1,\ldots,v_s\}=V.
\end{align*}
[guided]
The goal of this step is to add vectors to the basis of $U$ without destroying linear independence. Let $m$ be the current length of the list, starting with $m=r$, and define
\begin{align*}
S_m = \operatorname{span}_k\{v_1,\ldots,v_m\}.
\end{align*}
This is the subspace of $V$ already generated by the vectors chosen so far. If $S_m = V$, then the current list already spans $V$ and there is nothing to add. If $S_m \neq V$, then there exists a vector $v_{m+1} \in V \setminus S_m$, and we append this vector to the list.
We verify that appending such a vector preserves linear independence. Suppose $a_1,\ldots,a_m,a_{m+1} \in k$ satisfy
\begin{align*}
a_1v_1+\cdots+a_mv_m+a_{m+1}v_{m+1}=0.
\end{align*}
The only possible way linear independence could fail is if this relation has some nonzero coefficient. First examine the new coefficient $a_{m+1}$. If $a_{m+1}\neq 0$, then $a_{m+1}$ is invertible in the field $k$, so we can solve for $v_{m+1}$:
\begin{align*}
v_{m+1}= -a_{m+1}^{-1}(a_1v_1+\cdots+a_mv_m).
\end{align*}
The right-hand side is a $k$-linear combination of $v_1,\ldots,v_m$, so it lies in $S_m$. This contradicts the choice $v_{m+1} \notin S_m$. Therefore $a_{m+1}=0$.
With the new coefficient equal to zero, the relation becomes
\begin{align*}
a_1v_1+\cdots+a_mv_m=0.
\end{align*}
The previous list was linearly independent, so $a_1=\cdots=a_m=0$. Hence the enlarged list is linearly independent.
We now repeat the same operation whenever the current span is not all of $V$. This cannot continue forever: in an $n$-dimensional vector space, every linearly independent list has at most $n$ vectors. Therefore the construction stops after finitely many additions. When it stops, the stopping condition is precisely that the span of the final list is all of $V$. Thus for some integer $s$ with $r \leq s \leq n$, we have a linearly independent ordered list $(v_1,\ldots,v_s)$ satisfying
\begin{align*}
\operatorname{span}_k\{v_1,\ldots,v_s\}=V.
\end{align*}
[/guided]
[/step]
[step:Identify the final length and read off the adapted ordered basis]
The final ordered list $(v_1,\ldots,v_s)$ is linearly independent and spans $V$, so it is an ordered basis of $V$. Since $\dim_k V=n$, every basis of $V$ has exactly $n$ vectors. Hence $s=n$, and the final list is an ordered basis
\begin{align*}
(v_1,\ldots,v_n)
\end{align*}
of $V$.
By construction, the initial segment $(v_1,\ldots,v_r)$ was the ordered basis chosen for $U$. Therefore
\begin{align*}
U=\operatorname{span}_k\{v_1,\ldots,v_r\}.
\end{align*}
In the case $r=0$, this says that the empty initial segment spans the zero subspace $U=\{0\}$, as required. This proves the theorem.
[/step]