Solution (source code)

= Solution

Perform the <elementary row operations> $R_2\gets R_2-R_1$ and $R_3\gets R_3+R_1$, then $R_3\gets R_3-R_2$:
$$
A\sim\begin{pmatrix}1&2&-1&4\\0&0&5&-3\\0&0&5&-3\end{pmatrix}\sim\begin{pmatrix}1&2&-1&4\\0&0&5&-3\\0&0&0&0\end{pmatrix}.
$$
These operations preserve the <row space>. The two nonzero rows of this <row echelon form> are <linearly independent>: only the first has a nonzero first entry, and the second is nonzero. Hence
$$
\boxed{\text{a row-space basis is }\{(1,2,-1,4),(0,0,5,-3)\},\qquad\operatorname{rank}A=2.}
$$
Further <Gaussian elimination> gives the <reduced row echelon form>
$$
\begin{pmatrix}1&2&0&17/5\\0&0&1&-3/5\\0&0&0&0\end{pmatrix},
$$
which will also identify the <free variables> in the <null space> calculation.