Math 33A Week 2: Invertibility

You might recall learning about inverses from previous courses (maybe Math 31A):

Function inverses

We say a function ff and gg are inverses if f(g(x))=xf(g(x))=x and g(f(x))=xg(f(x))=x

Morally, inverses ff and gg "undo" each other. A little bit of work shows that this defintion is equivalent to another defintion of inveribility:

Invertibility

A function f:X→Yf:X\to Y is invertible if for every yy in YY there is exactly one xx in XX such that f(x)=yf(x)=y.

If ff is invertible, then the function f−1:Y→Xf^{-1}:Y\to X given by f−1(y)=xf^{-1}(y)=x where f(x)=yf(x)=y is the inverse of ff.

Find inverse of the functions (if they exist):
  1. f:R→R,f(x)=x+2f:\R\to \R, f(x)=x+2
  2. f:R→R,f(x)=7xf:\R\to \R, f(x)= 7x
  3. f:R→R,f(x)=3x+1f:\R\to \R, f(x)=3x+1
  4. f:R→R,f(x)=x2f:\R\to \R, f(x)=x^2

Solution: The inverses should be straightforward to compute. The only thing to be careful about is that f(x)=x2f(x)=x^2 has no inverse when defined from R\R to R\R. You might think that g(x)=xg(x)=\sqrt{x} would be its inverse, but we notice that f(−1)=1=f(1)f(-1)= 1 = f(1). When we take the square root of 11, we don't know if we should go back to 11 or −1-1.

In the lanauge of matrices (as functions where composition is matrix product) we have the following equivalent defintions of invertibility:

Invertibility of matrices

Let AA be a m×nm\times n matrix. We can think of AA as a map from Rn→Rm\R^n \to \R^m. The following are equivalent:

  1. There exists a matrix A−1A^{-1} such that AA−1x=xAA^{-1}x=x and A−1Ax=xA^{-1}Ax=x. Equivalently AA−1AA^{-1} and A−1AA^{-1}A are the identity matrix in their respective spaces.
  2. For every yy in Rm\R^m, there exists a unique xx in Rn\R^n such that Ax=yAx=y.
Size of invertible matrices

In the previous definitions, AA is not necessarily square. It turns out that a non-square matrix cannot be invertible, so let's just assume square matrices from here on out.

So how do we actually determine invertibility and compute inverses?

It's not hard to show that AA is invertible if and only if rref⁡(A)x=b\operatorname{rref}(A)x=b has a unique solution for all bb since systems with AA are equivalent systems with rref⁡(A)\operatorname{rref}(A). It is also not hard to see that the latter occurs if and only if rref⁡(A)=In\operatorname{rref}(A)=I_n.

This gives us another equivalent definition of invertibility:

Inveritibility via RREF

An n×nn\times n matrix AA is invertible if and only if rref⁡(A)=In\operatorname{rref}(A)=I_n, equivalently, rank⁡(A)=n\operatorname{rank}(A)=n.

Now to answer the question of computing the inverse, suppose AA did have an inverse A−1A^{-1}. Then we know that Ax=eiAx=e_i has a unique solution bib_i for any ii. Then we would have A−1ei=biA^{-1}e_i=b_i, or rather A−1=[b1⋯bn]A^{-1}= \begin{bmatrix}b_1 & \cdots & b_n\end{bmatrix} Thus if AA has an inverse, then we have
rref⁡[Aei]=[Inbi]\operatorname{rref}\left[\begin{array}{c|c} A & e_i \end{array}\right] = \left[\begin{array}{c|c} I_n & b_i \end{array}\right]
for each ii. Thus we can compute the inverse via Gaussian elimination:
[AIn]→RREF[InA−1]\left[\begin{array}{c|c} A & I_n \end{array}\right]\xrightarrow[]{\text{RREF}} \left[\begin{array}{c|c} I_n & A^{-1} \end{array}\right]

Then we have an easy way to determine invertibility and the inverse using Gaussian elimination:

Determining invertibility and computing inverses

If we set up the matrix
[AIn]\left[\begin{array}{c|c} A & I_n \end{array}\right]
and perform Gaussian Elimination to reduce this to RREF, we will get new augmented matrix
[rref⁡(A)B]\left[\begin{array}{c|c} \operatorname{rref}(A) & B \end{array}\right]
If rref⁡(A)=In\operatorname{rref}(A)= I_n, then AA is invertible with inverse BB. Otherwise, AA is not invertible.

Computing inverse

Determine all values of kk such that A=(11112k14k2)A = \begin{pmatrix} 1 & 1 & 1 \\ 1 & 2 & k\\ 1 & 4 & k^2\end{pmatrix} is invertible and find its inverse when invertible.

Solution: We have
[11110012k01014k2001]→R3←R3−R1R2←R2−R1[11110001k−1−11003k2−1−101]\left[\begin{array}{c c c| c c c} 1 & 1 & 1 &1 & 0 & 0\\ 1 & 2 & k & 0 & 1 & 0\\ 1 & 4 & k^2 & 0 & 0 &1\end{array}\right]\xrightarrow[R_3 \leftarrow R_3- R_1]{R_2\leftarrow R_2-R_1}\left[\begin{array}{c c c| c c c} 1 & 1 & 1 &1 & 0 & 0\\ 0 & 1 & k-1 & -1 & 1 & 0\\ 0 & 3 & k^2-1 & -1 & 0 &1\end{array}\right]
Then we have [11110001k−1−11003k2−1−101]→R3←R3−3R2[11110001k−1−11000k2−3k+22−31]\left[\begin{array}{c c c| c c c} 1 & 1 & 1 &1 & 0 & 0\\ 0 & 1 & k-1 & -1 & 1 & 0\\ 0 & 3 & k^2-1 & -1 & 0 &1\end{array}\right]\xrightarrow[]{R_3\leftarrow R_3-3R_2}\left[\begin{array}{c c c| c c c} 1 & 1 & 1 &1 & 0 & 0\\ 0 & 1 & k-1 & -1 & 1 & 0\\ 0 & 0 & k^2-3k+2 & 2 & -3 &1\end{array}\right]
Note that rref⁡(A)\operatorname{rref}(A) will have 33 pivots exactly when k≠1,2k\neq 1, 2. Then routine computation can find the inverse from here.

Next, we look at a somewhat surprising equivalent defintiion of invertibility:

Invertibility via homogenous solutions

Show that AA is invertible if and only if Ax=0Ax=0 has a unique solution.

Solution: If AA is invertible, then by definition, Ax=0Ax=0 will have a unique solution, namely x=0x=0. Conversely, if Ax=0Ax=0 has a unique solution, then note that
rref⁡[A0]=[rref⁡(A)0].\operatorname{rref}\left[\begin{array}{c|c} A & 0 \end{array}\right]= \left[\begin{array}{c|c} \operatorname{rref}(A) & 0\end{array}\right].
Thus Ax=0Ax=0 and rref⁡(A)x=0\operatorname{rref}(A)x=0 have the same solution set, which implies that rref⁡(A)x=0\operatorname{rref}(A)x=0 has a unique solution. If rref⁡(A)\operatorname{rref}(A) has less than nn pivots then we can easily construct a nonzero solution to rref⁡(A)x=0\operatorname{rref}(A)x=0. Thus, rref⁡(A)=In\operatorname{rref}(A)= I_n, so AA is invertible.

So we have a bunch of equivalent definitions of invertibility. There are a few more:

More equivalent definitions of invertibility.

The following are equivalent to AA being invertible:

  1. det⁡(A)=0\det(A)=0 (We will see why in next week, when we do determinants)
  2. AA is "injective" (this is the uniqueness part in the previous definition; this also somehow implies that n≤mn\leq m for m×nm\times n matrices, which is to say that the input space is "smaller".)
  3. AA is "surjective" (this is existence part of the previous definition; this implies m≤nm\leq n for m×nm\times n matrices, which is to say that the output space is "smaller".)

Note that injectivity and surjectivity force the matrix to be square.

Inverse of products

Let AA and BB be invertible n×nn\times n matrices. Is ABAB invertible and if so what is its inverse?

Solution: Intuitively, we have that ABAB is applying BB first and then AA, so in order to invert this, we undo AA first and then undo BB. So we should expect (AB)−1=B−1A−1(AB)^{-1}= B^{-1}A^{-1}. Indeed, we can check that this satisfies the compositional definition of inverses:
ABB−1A−1=AInA−1=AA−1=InABB^{-1}A^{-1}= AI_nA^{-1}=AA^{-1}=I_n
and
B−1A−1AB=B−1InB=B−1B=InB^{-1}A^{-1}AB = B^{-1}I_nB=B^{-1}B= I_n