Solution (source code)

= Solution

Let the original rows be $r_1,\ldots,r_5$. Begin with rows $r_2$, $r_3-r_2$ and $r_4$:
$$
(1,1,0,0),\qquad(0,1,1,0),\qquad(0,0,1,1).
$$
Subtract the third from the second, then subtract that new second row from the first. The resulting rows are
$$
\boxed{(1,0,0,1),\quad(0,1,0,-1),\quad(0,0,1,1).}
$$
They are linearly independent because their first three coordinates form the <identity matrix>. All original rows lie in their span: $r_1=2r_2+r_4$ and $r_5=r_2-(r_3-r_2)+r_4$. Thus they form a <basis> of the <row space>, and \b[$\operatorname{rank}A=3$]. Equivalently, these are the nonzero rows of the reduced row echelon form, with two further zero rows.