RREF of $\left[\begin{array}{c|c} A & B \end{array}\right]$ is $\left[\begin{array}{c|c} I & X\end{array}\right]$. Prove that $X=A^{-1}B$. I feel like this is fairly straightforward, but either way I'm not too satisfied with proving this question:
Let $A$ be an invertible $n\times n$ matrix and $B$ be an $n\times k$ matrix.  Assume that the RREF of $\left[\begin{array}{c|c} A & B \end{array}\right]$ is $\left[\begin{array}{c|c} I & X\end{array}\right]$.  Prove that $X=A^{-1}B$.
Here is what I've done:
If we multiply $B$ by $B^{-1}$ the system $[ \ A \ | \ BB^{-1} \ ]$ has RREF form $[ \ A \ | \ XB^{-1} \ ]$. However $[ \ A \ | \ BB^{-1} \ ] = [ \ A \ | \ I \ ]$ has RREF $[ \ I \ | \ A^{-1} \ ]$. Since RREF forms are unique, $A^{-1} = XB^{-1}$ which implies $X = A^{-1}B$. 
Any help is appreciated
 A: According to your hypothesis, $A$ is row equivalent to the identity. Therefore it is invertible. Hence, $X = A^{-1}B$.
A: Consider multiplying the augmented matrix on the left by $A^{-1}$ (which exists through hypothesis). Through block matrix multiplication, we have
$$A^{-1}\left(A\mid B\right)=\left(A^{-1}A\mid A^{-1}B\right)=\left(I\mid A^{-1}B\right)$$
Now note that since $A^{-1}$ is invertible, it is a product of elementary matrices. Therefore we can conclude that $\left(I\mid A^{-1}B\right)$ is row equivalent to $\left(A\mid B\right)$. 
In fact, it is easy to see that $\left(I\mid A^{-1}B\right)$ is actually the reduced row echelon form of $\left(A\mid B\right)$ since:


*

*The leading entry of each row is $1$ and is strictly to the right of all leading entries above it.

*Each leading entry of each row is the only non-zero element in its column.


By the uniqueness of the reduced row echelon form, we can therefore conclude that
$$\left(I\mid A^{-1}B\right)=\left(I\mid X\right)$$
and specifically, $X=A^{-1}B$.
As a note, you cannot multiply by $B^{-1}$ here. $B$ is not necessarily square so an inverse needn't exist.
A: The key is, to perform an elementary row operation on an augmented matrix is equivalent to multiplying this augmented matrix by an element matrix on the left. So, if the RREF of $(A\mid B)$ is $(I\mid X)$, this means
$$E_m \cdots E_2E_1(A\mid B)=(I\mid X)$$
for some elementary matrices $E_1,E_2,\ldots,E_m$. Now let $M=E_m \cdots E_2E_1$. Then $(I\mid X)=M(A\mid B)=(MA\mid MB)$. Hence $MA=I$ and $MB=X$. So, $M=A^{-1}$ and $A^{-1}B=X$.
