Matrix InverseΒΆ

In the noncommutative ring \(\,M_n(K)\,\) of square matrices of size \(\,n\,\) over a field \(\,K, \\\) the identity matrix

\[\begin{split}\boldsymbol{I}_n\ =\ \left[\begin{array}{cccc} 1 & 0 & \ldots & 0 \\ 0 & 1 & \ldots & 0 \\ \ldots & \ldots & \ldots & \ldots \\ 0 & 0 & \ldots & 1 \end{array}\right]\,.\end{split}\]

is the multiplicative neutral element: \(\ \ \boldsymbol{A}\boldsymbol{I}_n\,=\, \boldsymbol{I}_n\boldsymbol{A}\,=\,\boldsymbol{A}\ \ \) for all matrices \(\ \boldsymbol{A}\in M_n(K)\,.\)

Accordingly, the inverse of a matrix \(\,\boldsymbol{A}\in M_n(K)\ \) is defined as follows. \(\\\) If there exists a matrix \(\boldsymbol{B}\in M_n(K)\,\) such that \(\,\boldsymbol{A}\boldsymbol{B}=\boldsymbol{B}\boldsymbol{A}= \boldsymbol{I}_n\,,\) \(\\\) then \(\,\boldsymbol{A}\ \) is \(\,\) invertible and \(\,\boldsymbol{B}\,\) is \(\,\) the inverse \(\,\) of \(\,\boldsymbol{A}:\ \) \(\ \boldsymbol{B}=\boldsymbol{A}^{-1}.\)

A square matrix \(\,\boldsymbol{A}\in M_n(K)\,\) has at most one inverse. Indeed, let

\[\boldsymbol{A}\boldsymbol{B}\ =\ \boldsymbol{B}\boldsymbol{A}\ =\ \boldsymbol{I}_n \quad\text{and}\quad \boldsymbol{A}\boldsymbol{C}\ =\ \boldsymbol{C}\boldsymbol{A}\ =\ \boldsymbol{I}_n\,.\]

Then, in virtue of associativity of matrix multiplication, we get

\[\boldsymbol{B} = \boldsymbol{B}\boldsymbol{I}_n = \boldsymbol{B}(\boldsymbol{A}\boldsymbol{C}) = (\boldsymbol{B}\boldsymbol{A})\boldsymbol{C} = \boldsymbol{I}_n\boldsymbol{C} = \boldsymbol{C}\,.\]

Thus the inverse of a matrix (if any) is unique.

Not all square matrices are invertible. A necessary (but not sufficient) condition of invertibility is that the matrix must not contain zero rows nor zero columns:

Proposition 1. \(\,\)

If \(\,\boldsymbol{A}\in M_n(K)\,\) is an invertible matrix, then \(\,\boldsymbol{A}\,\) has no rows composed purely of zeroes nor columns composed purely of zeroes.

Proof.

If an \(\,i\)-th row of the matrix \(\,\boldsymbol{A}\,\) is composed of zeroes only, then for any matrix \(\boldsymbol{B}\,\) the \(\,i\)-th row of the product \(\,\boldsymbol{A}\boldsymbol{B}\,\) is composed of zeroes (see the Row Rule of Matrix Multiplication).

If a \(\,j\)-th column of the matrix \(\,\boldsymbol{A}\,\) is the zero column, then for any matrix \(\boldsymbol{B}\,\) the \(\,j\)-th column of the product \(\,\boldsymbol{B}\boldsymbol{A}\,\) is composed of zeroes (see the Column Rule of Matrix Multiplication).

In both cases there does not exist a matrix \(\,\boldsymbol{B}\in M_n(K)\,\) such that \(\ \boldsymbol{A}\boldsymbol{B} = \boldsymbol{B}\boldsymbol{A} = \boldsymbol{I}_n\,.\quad\bullet\)

Theorem 1. \(\,\)

If the matrices \(\,\boldsymbol{A},\boldsymbol{B}\in M_n(K)\,\) are invertible, their product \(\,\boldsymbol{A}\boldsymbol{B}\,\) is also invertible, and \(\ \ (\boldsymbol{A}\boldsymbol{B})^{-1}\ =\ \boldsymbol{B}^{-1}\boldsymbol{A}^{-1}\,.\)

Proof.

Due to the associativity of matrix multiplication, we get

\[ \begin{align}\begin{aligned}(\boldsymbol{A}\boldsymbol{B})(\boldsymbol{B}^{-1}\boldsymbol{A}^{-1})\ =\ \boldsymbol{A}(\boldsymbol{B}\boldsymbol{B}^{-1})\boldsymbol{A}^{-1}\ =\ (\boldsymbol{A}\boldsymbol{I}_n)\boldsymbol{A}^{-1}\ =\ \boldsymbol{A}\boldsymbol{A}^{-1}\ =\ \boldsymbol{I}_n\,,\\(\boldsymbol{B}^{-1}\boldsymbol{A}^{-1})(\boldsymbol{A}\boldsymbol{B})\ =\ \boldsymbol{B}^{-1}(\boldsymbol{A}^{-1}\boldsymbol{A})\boldsymbol{B}\ =\ \boldsymbol{B}^{-1}(\boldsymbol{I}_n\boldsymbol{B})\ =\ \boldsymbol{B}^{-1}\boldsymbol{B}\ =\ \boldsymbol{I}_n\,.\quad\bullet\end{aligned}\end{align} \]

In general, if the matrices \(\,\boldsymbol{A}_1,\boldsymbol{A}_2,\dots,\boldsymbol{A}_k\in M_n(K)\,\) are invertible, then by induction

\[\left(\boldsymbol{A}_1\boldsymbol{A}_2\dots\boldsymbol{A}_k\right)^{-1}\ =\ \boldsymbol{A}_k^{-1}\dots\boldsymbol{A}_2^{-1}\boldsymbol{A}_1^{-1}\,.\]

In Sage the matrix inverse is performed by the method inverse().

Example. \(\,\) The inverse of the matrix \(\ \ \boldsymbol{A}\ =\ \left[\begin{array}{rrr} 1 & -1 & -2 \\ 0 & 1 & 2 \\ 1 & -1 & -1 \end{array}\right]\,.\)

is calculated and verified by the following Sage code:

sage: A = matrix([[1,-1,-2],
                  [0, 1, 2],
                  [1,-1,-1]])

sage: B = A.inverse()
sage: table([[A, '*', B, '=', A*B]])

In the output

\[\begin{split}\left[\begin{array}{rrr} 1 & -1 & -2 \\ 0 & 1 & 2 \\ 1 & -1 & -1 \end{array}\right]\ \ *\ \ \left[\begin{array}{rrr} 1 & 1 & 0 \\ 2 & 1 & -2 \\ -1 & 0 & 1 \end{array}\right] \quad = \quad \left[\begin{array}{rrr} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{array}\right]\end{split}\]

the matrix \(\,\boldsymbol{A}^{-1}\,\) in question is given as the second factor on the left-hand side.