Finding Matrices Let $A=\begin{bmatrix}
1 & 2 & -1 & 1 \\
2 & 0 & -2 & 1 \\
-1 & 1 & 1 & 1 \\
\end{bmatrix}$
Find Matrices B $\in GL_3 (\mathbb{R})$ and C $\in GL_4 (\mathbb{R})$ so that $$BAC=\begin{bmatrix}
I_r & 0 \\
0 & 0  \\
\end{bmatrix}$$
(means that in the top left there is the Identity matrix, rest 0).
Sure, I could guess to get the matrix, but is it possible to do this, maybe with basic matrix-arithmetic? I tried a little bit, but can't seem to find any useful solution.
Thanks in advance.
edit: row echelon form:
$A=\begin{bmatrix}
1 & 0 & -1 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 0 & 1 \\
\end{bmatrix}$
 A: Find a basis $(v_{r+1},\dots,v_4)$ for $\ker A$ and extend it to a complete basis $(v_1,\dots,v_r,v_{r+1},\dots,v_n)$ for $\mathbb R^4$. $C$ is the matrix with these vectors as columns. Now compute $Av_1,\dots,Av_r$. These vectors are a basis for $\operatorname{im}A$. Extend this to a complete basis for $\mathbb R^3$. These vectors are the columns of $B^{-1}$. Invert this matrix to get $B$.  
This is what the mechanical process described in mathlover’s answer does.
A: Take $I_4 =$ $\begin{Bmatrix}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0 \\0&0&0&1
\end{Bmatrix}$ and $I_3 =$ $\begin{Bmatrix}
1 & 0 & 0  \\
0 & 1 & 0  \\
0 & 0 & 1  \\
\end{Bmatrix}$ and write $A=I_3AI_4$. Apply elementary row and column operations to matrix $A$ on left hand side to reduce it to form $\begin{Bmatrix}
I_r & 0   \\
0 & 0   \\
\end{Bmatrix}$. Notice that, any row operation in $A$ on LHS will affect $I_3$ while a column operation in $A$ on LHS will affect $I_4$. Furthermore, the matrices $B$ and $C$ obtained are not unique.
