Inverting matrices

Inversion

Inverse matrices

An invertible matrix implies that if the matrix is multiplied by another matrix, the original matrix can be recovered.

That is, if we have matrix \(A\), there exists matrix \(A^{-1}\) such that \(AA^{-1}=I\).

Consider a linear map on a vector space.

\(Ax=y\)

If \(A\) is invertible we can have:

\(A^{-1}Ax=A^{-1}y\)

\(x=A^{-1}y\)

If we set \(y=\mathbf 0\) then:

\(x=\mathbf 0\)

So if there is a non-zero vector \(x\) such that:

\(Ax=\mathbf 0\) then \(A\) is not invertible.

Left and right inverses

That is, for all matrices \(A\), the left and right inverses of \(B\), \(B_L^{-1}\) and \(B_R^{-1}\), are defined such that:

\(A(BB_R^{-1})=A\)

\(A(B_L^{-1}B)=A\)

Left and right inversions are equal

Note that if the left inverse exists then:

\(B_L^{-1}B=I\)

And if the right inverse exists:

\(BB_R^{-1}=I\)

Let’s take the first:

\(B_L^{-1}B=I\)

\(B_L^{-1}BB_L^{-1}=B_L^{-1}\)

\(B_L^{-1}BB_L^{-1}-B_L^{-1}=0\)

\(B_L^{-1}(BB_L^{-1}-I)=0\)

Inversion of products

\((AB)(AB)^{-1}=I\)

\(A^{-1}AB(AB)^{-1}=A^{-1}\)

\(B^{-1}B(AB)^{-1}=B^{-1}A^{-1}\)

\((AB)^{-1}=B^{-1}A^{-1}\)

Inversion of a diagonal matrix

\(DD^{-1}=I\)

\(D_{ii}D_{ii}^{-1}=1\)

\(D_{ii}^{-1}=\dfrac{1}{D_{ii}}\)

Degenerate (singular) matrices

Elementary row operations

Some operations to a matrix can be reversed to arrive at the original matrix. Trivially, multiplying by the identity matrix is reversible.

Similarly, some operations are not reversible. Such as multiplying by the empty matrix.

All matrix operations which can be reversed are combinations of \(3\) elementary row operations. These are: Swapping rows

\(T_{12}=\begin{bmatrix}0& 1&...&0\\1 & 0&...&0\\...&...&...&...\\0&0&...&1\end{bmatrix}\)

Multiplying rows by a vector

\(D_2(m)=\begin{bmatrix}1& 0&...&0\\0 & m&...&0\\...&...&...&...\\0&0&...&1\end{bmatrix}\)

Adding rows to other rows

\(L_{12}(m)=\begin{bmatrix}1& 0&...&0\\m & 1&...&0\\...&...&...&...\\0&0&...&1\end{bmatrix}\)

Gaussian elimination

Simultaneous equations

Matricies can be used to solve simultaneous equations. Condsider the following set of equations.

  • \(2x+y-z=8\)

  • \(-3x-y+2z=-11\)

  • \(-2x+y+2z=-3\)

We can write this in matrix form.

\(Ax=y\)

\(A=\begin{bmatrix}2 & 1&-1\\-3 & -1&2\\-2&1&2\end{bmatrix}\)

\(x=\begin{bmatrix}x \\y \\z\end{bmatrix}\)

\(y=\begin{bmatrix}8 \\-11 \\-3\end{bmatrix}\)

Augmented matrix

Consider a form for summarising these equations. This is the augmented matrix.

\((A|y)=\begin{bmatrix}2 & 1&-1&|&-8\\-3 & -1&2&|&-11\\-2&1&2&|&-3\end{bmatrix}\)

We can take this and recovery our original \(A\) and \(y\).

However we can also do things to this augmented matrix which preserve solutions to the set of equations. These are:

Undertaking combinations of these can make it easier to solve the equation. In particular, if we can arrive at the form:

\((A|y)=\begin{bmatrix}1 & 0&0&|&a\\0 & 1&0&|&b\\0&0&1&|&c\end{bmatrix}\)

The solutions for \(x,y,z\) are \(a,b,c\).

Echeleon / triangular form

We first aim for:

\((A|y)=\begin{bmatrix}a_{11} & a_{12}&a_{13}&|&a\\0 & a_{22}&a_{23}&|&b\\0&0&a_{33}&|&c\end{bmatrix}\)

If this cannot be reached there is no single solution. There may be infinite or no solutions.

Solving

Once we have the triangular form, we can easily solve.

\((A|y)=\begin{bmatrix}a_{11} & a_{12}&a_{13}&|&a\\0 & a_{22}&a_{23}&|&b\\0&0&a_{33}&|&c\end{bmatrix}\)

\((A|y)=\begin{bmatrix}1 & 0&0&|&a\\0 & 1&0&|&b\\0&0&1&|&c\end{bmatrix}\)

This process is back substitution (or forward substitution if the matrix is triangular the other way).

Matrix inversion

We can think of the inverse of a matrix as one which which takes a series of reverible operations and does these to a matrix then arriving at the identity matrix.

That is, only the three elementary row operations, and combinations of them, can transform a matrix in a way in which it can be reversed. As such All reversible matricies are combinations of the identity matrix and a series of elementary row operations. The inverse matrix is then those series of row operations, in reverse.

We can find identify an inversion by undertaking gaussian elimination. Each step done on the matrix is done to the identify matrix, reversing the process. The end result is the inverted matrix.

Instead of:

\((A|y)=\begin{bmatrix}2 & 1&-1&|&-8\\-3 & -1&2&|&-11\\-2&1&2&|&-3\end{bmatrix}\)

Take:

\((A|I)=\begin{bmatrix}2 & 1&-1&|&1&0&0\\-3 & -1&2&|&0&1&0\\-2&1&2&|&0&0&1\end{bmatrix}\)

When we solve this we get:

\((I|A^{-1})=\begin{bmatrix}1 & 0&0&|&\dfrac{3}{4}&\dfrac{1}{2}&\dfrac{1}{4}\\0& 1&0&|&\dfrac{1}{2}&1&\dfrac{1}{2}\\0&0&1&|&\dfrac{1}{4}&\dfrac{1}{2}&\dfrac{3}{4}\end{bmatrix}\)