In linear algebra, an -by- square matrix is called invertible (also nonsingular, nondegenerate or rarely regular) if there exists an -by- square matrix such thatwhere denotes the -by- identity matrix and the multiplication used is ordinary matrix multiplication.[1] If this is the case, then the matrix is uniquely determined by, and is called the (multiplicative) inverse of, denoted by . Matrix inversion is the process of finding the matrix which when multiplied by the original matrix gives the identity matrix.[2]
Over a field, a square matrix that is not invertible is called singular or degenerate. A square matrix with entries in a field is singular if and only if its determinant is zero. Singular matrices are rare in the sense that if a square matrix's entries are randomly selected from any bounded region on the number line or complex plane, the probability that the matrix is singular is 0, that is, it will "almost never" be singular. Non-square matrices, i.e. -by- matrices for which, do not have an inverse. However, in some cases such a matrix may have a left inverse or right inverse. If is -by- and the rank of is equal to,, then has a left inverse, an -by- matrix such that . If has rank, then it has a right inverse, an -by- matrix such that .
While the most common case is that of matrices over the real or complex numbers, all these definitions can be given for matrices over any algebraic structure equipped with addition and multiplication (i.e. rings). However, in the case of a ring being commutative, the condition for a square matrix to be invertible is that its determinant is invertible in the ring, which in general is a stricter requirement than it being nonzero. For a noncommutative ring, the usual determinant is not defined. The conditions for existence of left-inverse or right-inverse are more complicated, since a notion of rank does not exist over rings.
The set of invertible matrices together with the operation of matrix multiplication and entries from ring form a group, the general linear group of degree, denoted .
Let be a square -by- matrix over a field (e.g., the field of real numbers). The following statements are equivalent, i.e., they are either all true or all false for any given matrix:[3]
λ
A-λI
Furthermore, the following properties hold for an invertible matrix :
(A-1)-1=A
(kA)-1=k-1A-1
(Ax)+=x+A-1
(AT)-1=(A-1)T
(AB)-1=B-1A-1.
A1,...,Ak
(A1A2 … Ak-1
-1 | |
A | |
k) |
=
-1 | |
A | |
k |
-1 | |
A | |
k-1 |
…
-1 | |
A | |
2 |
-1 | |
A | |
1 |
.
\detA-1=(\detA)-1.
The rows of the inverse matrix of a matrix are orthonormal to the columns of (and vice versa interchanging rows for columns). To see this, suppose that where the rows of are denoted as
T | |
v | |
i |
uj
1\leqi,j\leqn.
T | |
v | |
i |
uj=\deltai,j.
A matrix that is its own inverse (i.e., a matrix such that, and consequently), is called an involutory matrix.
The adjugate of a matrix can be used to find the inverse of as follows:
If is an invertible matrix, then
A-1=
1 | |
\det(A) |
\operatorname{adj}(A).
It follows from the associativity of matrix multiplication that if
AB=I
for finite square matrices and, then also
BA=I
Over the field of real numbers, the set of singular -by- matrices, considered as a subset of is a null set, that is, has Lebesgue measure zero. This is true because singular matrices are the roots of the determinant function. This is a continuous function because it is a polynomial in the entries of the matrix. Thus in the language of measure theory, almost all -by- matrices are invertible.
Furthermore, the -by- invertible matrices are a dense open set in the topological space of all -by- matrices. Equivalently, the set of singular matrices is closed and nowhere dense in the space of -by- matrices.
In practice however, one may encounter non-invertible matrices. And in numerical calculations, matrices which are invertible, but close to a non-invertible matrix, can still be problematic; such matrices are said to be ill-conditioned.
An example with rank of is a non-invertible matrix
A=\begin{pmatrix}2&4\ 2&4\end{pmatrix}.
Consider the following 2-by-2 matrix:
B=\begin{pmatrix}-1&\tfrac{3}{2}\ 1&-1\end{pmatrix}.
B
As an example of a non-invertible, or singular, matrix, consider the matrix
C=\begin{pmatrix}-1&\tfrac{3}{2}\ \tfrac{2}{3}&-1\end{pmatrix}.
C
Gaussian elimination is a useful and easy way to compute the inverse of a matrix. To compute a matrix inverse using this method, an augmented matrix is first created with the left side being the matrix to invert and the right side being the identity matrix. Then, Gaussian elimination is used to convert the left side into the identity matrix, which causes the right side to become the inverse of the input matrix.
For example, take the following matrix:
A=\begin{pmatrix}-1&\tfrac{3}{2}\ 1&-1\end{pmatrix}.
The first step to compute its inverse is to create the augmented matrix
\left(\begin{array}{cc|cc} -1&\tfrac{3}{2}&1&0\\ 1&-1&0&1 \end{array}\right).
Call the first row of this matrix
R1
R2
(R1+R2\toR2).
\left(\begin{array}{cc|cc} -1&\tfrac{3}{2}&1&0\\ 0&\tfrac{1}{2}&1&1 \end{array}\right).
Next, subtract row 2, multiplied by 3, from row 1
(R1-3R2\toR1),
\left(\begin{array}{cc|cc} -1&0&-2&-3\\ 0&\tfrac{1}{2}&1&1 \end{array}\right).
Finally, multiply row 1 by −1
(-R1\toR1)
(2R2\toR2).
\left(\begin{array}{cc|cc} 1&0&2&3\\ 0&1&2&2 \end{array}\right).
Thus,
A-1=\begin{pmatrix} 2&3\\ 2&2 \end{pmatrix}.
The reason it works is that the process of Gaussian elimination can be viewed as a sequence of applying left matrix multiplication using elementary row operations using elementary matrices (
En
EnEn-1 … E2E1A=I.
Applying right-multiplication using
A-1,
EnEn-1 … E2E1I=IA-1.
IA-1=A-1,
To obtain
EnEn-1 … E2E1I,
A generalization of Newton's method as used for a multiplicative inverse algorithm may be convenient, if it is convenient to find a suitable starting seed:
Xk+1=2Xk-XkAXk.
Victor Pan and John Reif have done work that includes ways of generating a starting seed.
Newton's method is particularly useful when dealing with families of related matrices that behave enough like the sequence manufactured for the homotopy above: sometimes a good starting point for refining an approximation for the new inverse can be the already obtained inverse of a previous matrix that nearly matches the current matrix, for example, the pair of sequences of inverse matrices used in obtaining matrix square roots by Denman–Beavers iteration; this may need more than one pass of the iteration at each new matrix, if they are not close enough together for just one to be enough. Newton's method is also useful for "touch up" corrections to the Gauss–Jordan algorithm which has been contaminated by small errors due to imperfect computer arithmetic.
The Cayley–Hamilton theorem allows the inverse of to be expressed in terms of, traces and powers of :[5]
A-1=
1 | |
\det(A) |
n-1 | |
\sum | |
s=0 |
As
\sum | |
k1,k2,\ldots,kn-1 |
n-1 | |
\prod | |
l=1 |
| ||||||
|
\operatorname{tr}\left(Al\right)
kl | |
,
where is size of, and is the trace of matrix given by the sum of the main diagonal. The sum is taken over and the sets of all
s+
n-1 | |
\sum | |
l=1 |
lkl=n-1.
The formula can be rewritten in terms of complete Bell polynomials of arguments
tl=-(l-1)!\operatorname{tr}\left(Al\right)
A-1=
1 | |
\det(A) |
n | |
\sum | |
s=1 |
As-1
(-1)n | |
(n-s)! |
Bn-s(t1,t2,\ldots,tn-s).
See main article: article and Eigendecomposition of a matrix. If matrix can be eigendecomposed, and if none of its eigenvalues are zero, then is invertible and its inverse is given by
A-1=QΛ-1Q-1,
qi
Λii=λi.
Q-1=QT.
\left[Λ-1\right]ii=
1 | |
λi |
.
See main article: article and Cholesky decomposition. If matrix is positive definite, then its inverse can be obtained as
A-1=\left(L*\right)-1L-1,
where is the lower triangular Cholesky decomposition of, and denotes the conjugate transpose of .
See main article: article and Cramer's rule. Writing the transpose of the matrix of cofactors, known as an adjugate matrix, can also be an efficient way to calculate the inverse of small matrices, but this recursive method is inefficient for large matrices. To determine the inverse, we calculate a matrix of cofactors:
A-1={1\over\begin{vmatrix}A\end{vmatrix}}CT= {1\over\begin{vmatrix}A\end{vmatrix}} \begin{pmatrix} C11&C21& … &Cn1\\ C12&C22& … &Cn2\\ \vdots&\vdots&\ddots&\vdots\\ C1n&C2n& … &Cnn\\ \end{pmatrix}
\left(A-1\right)ij= {1\over\begin{vmatrix}A\end{vmatrix}}\left(CT\right)ij= {1\over\begin{vmatrix}A\end{vmatrix}}\left(Cji\right)
The cofactor equation listed above yields the following result for matrices. Inversion of these matrices can be done as follows:[6]
A-1=\begin{bmatrix} a&b\ c&d\\ \end{bmatrix}-1=
1 | |
\detA |
\begin{bmatrix} d&-b\ -c&a\ \end{bmatrix}=
1 | |
ad-bc |
\begin{bmatrix} d&-b\ -c&a\ \end{bmatrix}.
This is possible because is the reciprocal of the determinant of the matrix in question, and the same strategy could be used for other matrix sizes.
The Cayley–Hamilton method gives
A-1=
1 | |
\detA |
\left[\left(\operatorname{tr}A\right)I-A\right].
A computationally efficient matrix inversion is given by
A-1=\begin{bmatrix} a&b&c\ d&e&f\ g&h&i\\ \end{bmatrix}-1=
1 | |
\det(A) |
\begin{bmatrix} A&B&C\ D&E&F\ G&H&I\\ \end{bmatrix}T=
1 | |
\det(A) |
\begin{bmatrix} A&D&G\ B&E&H\ C&F&I\\ \end{bmatrix}
If the determinant is non-zero, the matrix is invertible, with the entries of the intermediary matrix on the right side above given by
\begin{alignat}{6} A&={}&(ei-fh),& &D&={}&-(bi-ch),& &G&={}&(bf-ce),\\ B&={}&-(di-fg),& &E&={}&(ai-cg),& &H&={}&-(af-cd),\\ C&={}&(dh-eg),& &F&={}&-(ah-bg),& &I&={}&(ae-bd).\\ \end{alignat}
The determinant of can be computed by applying the rule of Sarrus as follows:
\det(A)=aA+bB+cC.
The Cayley–Hamilton decomposition gives
A-1=
1 | |
\det(A) |
\left(
1 | |
2 |
\left[(\operatorname{tr}A)2-\operatorname{tr}(A2)\right]I-A\operatorname{tr}A+A2\right).
The general inverse can be expressed concisely in terms of the cross product and triple product. If a matrix
A=\begin{bmatrix}x0&x1&x2\end{bmatrix}
x0
x1
x2
A-1=
1 | |
\det(A) |
\begin{bmatrix} {(x1 x x
T | |
2)} |
\\ {(x2 x x
T | |
0)} |
\\ {(x0 x x
T \end{bmatrix}. | |
1)} |
The determinant of,, is equal to the triple product of,, and —the volume of the parallelepiped formed by the rows or columns:
\det(A)=x0 ⋅ (x1 x x2).
The correctness of the formula can be checked by using cross- and triple-product properties and by noting that for groups, left and right inverses always coincide. Intuitively, because of the cross products, each row of is orthogonal to the non-corresponding two columns of (causing the off-diagonal terms of
I=A-1A
\det(A)=x0 ⋅ (x1 x x2)
1=
1 | ||||||
|
x0 ⋅ (x | |
1 x x |
2).
With increasing dimension, expressions for the inverse of get complicated. For, the Cayley–Hamilton method leads to an expression that is still tractable:
A-1=
1 | |
\det(A) |
\left(
1 | |
6 |
\left[(\operatorname{tr}A)3-3\operatorname{tr}A\operatorname{tr}(A2)+2\operatorname{tr}(A3)\right]I-
1 | |
2 |
A\left[(\operatorname{tr}A)2-\operatorname{tr}(A2)\right]+A2\operatorname{tr}A- A3\right).
Matrices can also be inverted blockwise by using the following analytic inversion formula:[7] where,, and are matrix sub-blocks of arbitrary size. (must be square, so that it can be inverted. Furthermore, and must be nonsingular.[8]) This strategy is particularly advantageous if is diagonal and (the Schur complement of) is a small matrix, since they are the only matrices requiring inversion.
This technique was reinvented several times and is due to Hans Boltz (1923), who used it for the inversion of geodetic matrices, and Tadeusz Banachiewicz (1937), who generalized it and proved its correctness.
The nullity theorem says that the nullity of equals the nullity of the sub-block in the lower right of the inverse matrix, and that the nullity of equals the nullity of the sub-block in the upper right of the inverse matrix.
The inversion procedure that led to Equation performed matrix block operations that operated on and first. Instead, if and are operated on first, and provided and are nonsingular,[9] the result is
Equating Equations and leads to
where Equation is the Woodbury matrix identity, which is equivalent to the binomial inverse theorem.
If and are both invertible, then the above two block matrix inverses can be combined to provide the simple factorization
By the Weinstein–Aronszajn identity, one of the two matrices in the block-diagonal matrix is invertible exactly when the other is.
This formula simplifies significantly when the upper right block matrix is the zero matrix. This formulation is useful when the matrices and have relatively simple inverse formulas (or pseudo inverses in the case where the blocks are not all square. In this special case, the block matrix inversion formula stated in full generality above becomes
\begin{bmatrix}A&0\ C&D\end{bmatrix}-1= \begin{bmatrix}A-1&0\ -D-1CA-1&D-1\end{bmatrix}.
If the given invertible matrix is a symmetric matrix with invertible block the following block inverse formula holdswhere
S=D-CA-1CT
W1=CA-1,
W2=
T | |
W | |
1C |
=CA-1CT,
W3=S-1
-1 | |
W | |
1=S |
CA-1,
W4=
-1 | |
W | |
3=A |
CTS-1CA-1,
M
MTM
M
M-1=\left(MTM\right)-1MT
MTM
These formulas together allow to construct a divide and conquer algorithm that uses blockwise inversion of associated symmetric matrices to invert a matrix with the same time complexity as the matrix multiplication algorithm that is used internally.[10] Research into matrix multiplication complexity shows that there exist matrix multiplication algorithms with a complexity of operations, while the best proven lower bound is .[11]
If a matrix has the property that
\limn(I-A)n=0
then is nonsingular and its inverse may be expressed by a Neumann series:[12]
A-1=
infty | |
\sum | |
n=0 |
(I-A)n.
Truncating the sum results in an "approximate" inverse which may be useful as a preconditioner. Note that a truncated series can be accelerated exponentially by noting that the Neumann series is a geometric sum. As such, it satisfies
2L-1 | |
\sum | |
n=0 |
(I-A)n=
L-1 | |
\prod | |
l=0 |
\left(I+(I-
2l | |
A) |
\right)
Therefore, only matrix multiplications are needed to compute terms of the sum.
More generally, if is "near" the invertible matrix in the sense that
\limn\left(I-X-1A\right)n=0~~or~~\limn\left(I-AX-1\right)n=0
then is nonsingular and its inverse is
A-1=
infty | |
\sum | |
n=0 |
\left(X-1(X-A)\right)nX-1~.
If it is also the case that has rank 1 then this simplifies to
A-1=X-1-
X-1(A-X)X-1 | |
1+\operatorname{tr |
\left(X-1(A-X)\right)}~.
If is a matrix with integer or rational entries and we seek a solution in arbitrary-precision rationals, then a -adic approximation method converges to an exact solution in, assuming standard matrix multiplication is used.[13] The method relies on solving linear systems via Dixon's method of -adic approximation (each in) and is available as such in software specialized in arbitrary-precision matrix operations, for example, in IML.[14]
See main article: Reciprocal basis. Given an square matrix
X=\left[xij\right]
1\leqi,j\leqn
xi=xijej
ej
Rn
ei=ei,ei ⋅ ej=
j | |
\delta | |
i |
xi=xjiej=(-1)i-1(x1\wedge … \wedgei\wedge … \wedgexn) ⋅ (x1\wedge x2\wedge … \wedgexn)-1
X-1=[xji].
i
xi
xi
XX-1=\left[xi ⋅ xj\right]=\left[
j | |
\delta | |
i |
\right]=In
j | |
\delta | |
i |
X-1X=\left[\left(ei ⋅ xk\right)\left(ej ⋅ xk\right)\right]=\left[ei ⋅ ej\right]=
j | |
\left[\delta | |
i |
\right]=In
xi
(x1\wedgex2\wedge … \wedgexn)=0
X
Suppose that the invertible matrix A depends on a parameter t. Then the derivative of the inverse of A with respect to t is given by[15]
dA-1 | |
dt |
=-A-1
dA | |
dt |
A-1.
To derive the above expression for the derivative of the inverse of A, one can differentiate the definition of the matrix inverse
A-1A=I
d(A-1A) | |
dt |
=
dA-1 | |
dt |
A +A-1
dA | |
dt |
=
dI | |
dt |
=0.
Subtracting
A-1
dA | |
dt |
A-1
dA-1 | |
dt |
=-A-1
dA | |
dt |
A-1.
Similarly, if
\varepsilon
\left(A+\varepsilonX\right)-1=A-1-\varepsilonA-1XA-1+l{O}(\varepsilon2).
More generally, if
df(A) | |
dt |
=\sumigi(A)
dA | |
dt |
hi(A),
then,
f(A+\varepsilonX)=f(A)+\varepsilon\sumigi(A)Xhi(A)+l{O}\left(\varepsilon2\right).
Given a positive integer
n
\begin{align} | dAn |
dt |
&=
n | |
\sum | |
i=1 |
Ai-1
dA | |
dt |
An-i,\\
dA-n | |
dt |
&=
n | |
-\sum | |
i=1 |
A-i
dA | |
dt |
A-(n+1-i). \end{align}
Therefore,
\begin{align} (A+\varepsilonX)n&= An+\varepsilon
n | |
\sum | |
i=1 |
Ai-1XAn-i+l{O}\left(\varepsilon2\right),\\ (A+\varepsilonX)-n&= A-n-\varepsilon
n | |
\sum | |
i=1 |
A-iXA-(n+1-i)+l{O}\left(\varepsilon2\right). \end{align}
Some of the properties of inverse matrices are shared by generalized inverses (for example, the Moore–Penrose inverse), which can be defined for any m-by-n matrix.[16]
For most practical applications, it is not necessary to invert a matrix to solve a system of linear equations; however, for a unique solution, it is necessary that the matrix involved be invertible.
Decomposition techniques like LU decomposition are much faster than inversion, and various fast algorithms for special classes of linear systems have also been developed.
Although an explicit inverse is not necessary to estimate the vector of unknowns, it is the easiest way to estimate their accuracy, found in the diagonal of a matrix inverse (the posterior covariance matrix of the vector of unknowns). However, faster algorithms to compute only the diagonal entries of a matrix inverse are known in many cases.[17]
Matrix inversion plays a significant role in computer graphics, particularly in 3D graphics rendering and 3D simulations. Examples include screen-to-world ray casting, world-to-subspace-to-world object transformations, and physical simulations.
Matrix inversion also plays a significant role in the MIMO (Multiple-Input, Multiple-Output) technology in wireless communications. The MIMO system consists of N transmit and M receive antennas. Unique signals, occupying the same frequency band, are sent via N transmit antennas and are received via M receive antennas. The signal arriving at each receive antenna will be a linear combination of the N transmitted signals forming an N × M transmission matrix H. It is crucial for the matrix H to be invertible for the receiver to be able to figure out the transmitted information.