Solution (source code)

= Solution

Use <Gaussian elimination>. Subtract twice row 1 from rows 2 and 3:
$$
A\longrightarrow\begin{pmatrix}
1&1&0&2\\0&1&-1&1\\0&-2&2&-2\\0&1&-1&1
\end{pmatrix}.
$$
Now add twice the second row to the third, and subtract the second row from the fourth. This gives the <row echelon form>
$$
\begin{pmatrix}1&1&0&2\\0&1&-1&1\\0&0&0&0\\0&0&0&0\end{pmatrix}.
$$
Its two nonzero rows span the original <row space> because reversible <elementary row operations> preserve that space. They are <linearly independent>, as witnessed by their leading entries in different columns. Thus
$$
\boxed{\operatorname{Row}(A)\text{ has basis }\{(1,1,0,2),(0,1,-1,1)\},\qquad\operatorname{rank}A=2.}
$$
Subtracting the second nonzero row from the first also gives the reduced <row echelon form>
$$
\begin{pmatrix}1&0&1&1\\0&1&-1&1\\0&0&0&0\\0&0&0&0\end{pmatrix},
$$
which is useful for the <null space>.