Left or Right Inverse of Matrix is Inverse

Theorem
Let $\mathbf A, \mathbf B$ be square matrices of order $n$ over a commutative ring with unity $\left({R, +, \circ}\right)$.

Suppose that $\mathbf A \mathbf B = \mathbf I_n$, where $\mathbf I_n$ is the identity matrix of order $n$.

Then $\mathbf A$ and $\mathbf B$ are invertible matrices, and $\mathbf B = \mathbf A^{-1}$, where $A^{-1}$ is the inverse of $A$.

Proof
When $1_R$ denotes the unity of $R$, we have:

From the corollary to Inverse of Matrix, it follows that $\mathbf A$ and $\mathbf B$ are invertible.

Then: