Matrix InverseΒΆ
In the noncommutative ring \(\,M_n(K)\,\) of square matrices of size \(\,n\,\) over a field \(\,K, \\\) the identity matrix
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
Then, in virtue of associativity of matrix multiplication, we get
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
In general, if the matrices \(\,\boldsymbol{A}_1,\boldsymbol{A}_2,\dots,\boldsymbol{A}_k\in M_n(K)\,\) are invertible, then by induction
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
the matrix \(\,\boldsymbol{A}^{-1}\,\) in question is given as the second factor on the left-hand side.