<s>[INST] Find a basis of the generated subspace Consider the vectors
$$
v_1 =\begin{pmatrix}
1\\ 0\\ 0\\ 1
\end{pmatrix}, \quad v_2=\begin{pmatrix}
\sqrt{2}\\ 1\\ 2\\0
\end{pmatrix}, \quad v_3 =\begin{pmatrix}
\sqrt{2}+2\\ 1\\ 2\\ 2
\end{pmatrix}
$$
and let $S$ be the subspace generated by $v_1, v_2, v_3$. Find the dimension of $S$ and a basis for $S$.
${\bf My \ solution:}$ the dimension of $S$ is clearly $2$ since since $v_1, v_2, v_3$ are linearly dependent (or, better, the rank of the matrix whose columns are the three vectors is $2$). In order to find a basis I use the echelon form. It is
$$
\begin{pmatrix}
1 & \sqrt{2} &\sqrt{2}+2\\
0&1&1\\
0&2 &2\\
1&0&2
\end{pmatrix}\xrightarrow{}\begin{pmatrix}
1 & \sqrt{2} &\sqrt{2}+2\\
0&1&1\\
0&0&0\\
0&0&0
\end{pmatrix}
$$
which means that a basis for $S$ is given by the vectors $v_1$ and $v_2$.
Is my solution correct or am I missing something?
Thank you in advance!
${\bf EDIT:}$ My steps for row echelon form:
[
\begin{split}
&\begin{pmatrix}
1 & \sqrt{2} &\sqrt{2}+2\\
0&1&1\\
0&2 &2\\
1&0&2
\end{pmatrix}\xrightarrow{R_1-R_3}\begin{pmatrix}
1 & \sqrt{2} &\sqrt{2}+2\\
0&1&1\\
0&2&2\\
0&\sqrt{2} &\sqrt{2}
\end{pmatrix}\xrightarrow[R_3\leftrightarrow R_4]{R_3-2R_2}\\[5pt] &\begin{pmatrix}
1 & \sqrt{2} &\sqrt{2}+2\\
0&1&1\\
0&\sqrt{2}&\sqrt{2}\\
0&0&0
\end{pmatrix}\xrightarrow{R_3-\sqrt{2}R_2}\begin{pmatrix}
1 & \sqrt{2} &\sqrt{2}+2\\
0&1&1\\
0&0&0\\
0&0&0
\end{pmatrix}
\end{split}
]
 [/INST] It's correct, however an overkill.
You observed correctly that $v_3=2v_1+v_2$, so they are linearly dependent, but clearly $v_1,v_2$ are not parallel, hence independent, so the dimension they span is indeed $2$.
But then any $2$ independent elements of the span form a basis, so just take $v_1$ and $v_2$.
</s>