Left or Right Inverse of Matrix is Inverse

Theorem
Let $\mathbf A, \mathbf B$ be an 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 A^{-1} = \mathbf B$.

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

From Inverse of Matrix/Corollary, it follows that $\mathbf A$ and $\mathbf B$ are invertible.

Then: