Week 4 ·

CR Decomposition and Inverse Matrices

CR Decomposition

A matrix decomposition is breaking a matrix in several matrices, which usually each give us information about the decomposed matrix. CR decomposition is the first of many matrix decompositions you are going to encounter during the course.

Theorem 2.44 (CR decomposition)

Let A be an m×nm \times n matrix of rank rr. Let CC be the m×rm \times r submatrix of AA containing the independent columns. Then there exists exactly one r×nr \times n matrix R′R' such that:

A=CR′A = CR'

Let’s see why this is true.

  • The column space of AA: C(A) = C(C) : Column space of CC. This is because we have all linearly independent columns of AA in CC.
  • The first point means that we can write the columns of AA as a linear combination of the columns of C. This is because the columns of AA themselves are also in the column space of A!
  • With this point of view, in R′R' at i-th column, we store how much of which column of CC we need to generate the i-th column of AA.
  • We know by Lemma 1.22 that there is only one way of writing a vector as a linear combination of linearly independent vectors. Therefore R′R' is unique.
[130−113112634]⏟A, 3×4=[101123]⏟C, 3×2[130−10012]⏟R′, 2×4.\underbrace{ \begin{bmatrix} 1 & 3 & 0 & -1 \\ 1 & 3 & 1 & 1 \\ 2 & 6 & 3 & 4 \end{bmatrix} }_{A,\ 3\times 4} = \underbrace{ \begin{bmatrix} 1 & 0 \\ 1 & 1 \\ 2 & 3 \end{bmatrix} }_{C,\ 3\times 2} \underbrace{ \begin{bmatrix} \textcolor{blue}{1} & \textcolor{blue}{3} & 0 & \textcolor{blue}{-1} \\ 0 & 0 & \textcolor{blue}{1} & \textcolor{blue}{2} \end{bmatrix} }_{R',\ 2\times 4}.

The 4th4^{th} column of R′R' tells us that we need −1-1 times the 1st1^{st} column and 22 times the 2nd2^{nd} column of C, in order to generate the 4th4^{th} column of A.

We know that AA and CC have the same column space. We will see that AA and R′R' have the same row space later. However to convince yourself that R(A)=R(R′)\textbf{R}(A) = \textbf{R}(R') now, you can view the matrix multiplication CR′CR' as the linear combination of the rows of R′R'. We have

(1st row of A) = 1 ⋅(1st row of R′)+0⋅(2nd row of R′)\text{(1st row of A) = 1 }\cdot (\text{1st row of }R') + 0\cdot(\text{2nd row of }R')

where the coefficients 11 and 00 are the first row of CC. You use the rows of R′R' to generate the rows of the matrix AA so intuitively we have R(A)=R(R′)\textbf{R}(A) = \textbf{R}(R').

Keep in mind: You can also use the CRCR decomposition to compress the matrices. AA has m⋅nm\cdot n entries whereas you only have to store (m+n)⋅r(m+n)\cdot r entries in the CR-decomposition.

How to calculate CR’ decomposition?

Even though we do did not see an automatized, algorithm based method to calculate the CR′CR' decomposition at this point in the course, you can still eyeball the CR′CR' decomposition in some cases. The ithi^{th} column of R′R' tells you how you need to combine the columns of CC so that their linear combination gives the ithi^{th} column of AA.

A = 130−113112634
C R′ = 1 0 1 1 2 3 1 3 0 −1 0 0 1 2
a 1 = 112 = 1 · 112 new column of C
a 2 = 336 = 3 · 112
a 3 = 013 = 0 · 112 + 1 · 013 new column of C
a 4 = −114 = (−1) · 112 + 2 · 013

Inverse Matrices

Until now we have seen how to add matrices, how to multiply them, but not how to take back the multiplication by a matrix. If you see a matrix as a linear transformation, this taking back operation would correspond to undoing the effect of the linear transformation. Did your matrix stretch the space and doubled every distance in x1x_1 direction? Then the inverse would shrink the space in the same direction so that everything gets back to “normal”, or in other words everything gets back to the way as they were before you applied the first transformation.

Functions and Bijectivity

Think of f:X→Yf: X \to Y. For us to be able to undo the operation, we have to have every possible output coming from exactly one possible input. As you know from other lectures, we call such functions bijective since they are both injective and surjective.

We can make some initial statements about the reversible transformations1:

  • A transformation (function) T:X→YT: X \to Y is reversible if for every y∈Yy\in Y, there exists exactly one x∈Xx\in X such that T(x)=yT(x) = y. (∼\sim Def. 2.46)
  • The inverse is denoted with T−1:Y→XT^{-1}:Y\to X and called the inverse or the backward transformation. (∼\sim Def. 2.46)
  • If TT is reversible, so is its inverse T−1T^{-1}. The inverse of the inverse is the forward transformation itself ie. (T−1)−1=T(T^{-1})^{-1} = T, with T(T−1(y))=y, and T−1(T(x))=xT(T^{-1}(y)) = y, \text{ and } T^{-1}(T(x)) = x. (∼\sim Fact 2.47)
  • The inverse of a reversible linear transformation is also a linear transformation. (∼\sim Lemma 2.48)
  • The inverse of a reversible matrix transformation is also a matrix transformation (∼\sim Corollary 2.49)

Now we can convince us that a matrix has to be square in order to be undoable. This means in particular that the matrix transformation TA:Rn→RmT_A: \R^{n}\to \R^{m} cannot be bijective if m≠nm\ne n. Let’s see this for both cases m<nm < n (short and wide matrix) and n<mn < m (skinny and tall matrix).

To see this we can look at an example. You can find the formal proofs (Lemma 2.50 and Lemma 2.51) in the lecture notes.

Case (m<nm<n): If we have m<nm<n we have a short and wide matrix with the matrix transformation TA:Rn→RmT_A: \R^{n} \to \R^{m}. We are trying to squeeze everything from some higher dimension to some lower dimension. Naturally some things must overlap. So if we try to revert this squeezing we can’t know what goes where. Here is an example with n=3n=3 and m=2m=2. We are doing projection and transforming R3→R2\R^3 \to \R^2

A street with ETH buildings, seen in 3D
3D Real World View
→
The same place, seen from above as a flat satellite image
2D Squeezed Plane

Figure 1: Mapping from a 3D space (left) to its projection in R2\mathbb{R}^2 plane (right).

Now if you are asked to take this operation back just by looking at the 2D image, you wouldn’t be able to do so. For example you can not know how many stories the building has or what color the side facades have. This operation is not injective and hence not bijective (not undoable).

Case (n<mn < m): If we have n<mn < m we have a skinny and tall matrix with the matrix transformation TA:Rn→RmT_A: \R^n \to \R^m. We are trying to fill out a larger space of mm dimensions using inputs from a smaller dimension nn but we simply do not have enough input to fill the whole space. This will lead to some parts in the larger output space to have no input mapped to them. Therefore our operation will not be surjective and hence not bijective (not undoable). Here is an example with n=2n = 2 and m=3m = 3.

A flat satellite image
2D Squeezed Plane
→
The satellite image lying in the xy-plane of 3D space, with a marked point outside the plane
2D image embedded in 3D

Figure 2: Mapping from a 2D plane (left) to its embedding in R3\mathbb{R}^3 (right).

Now if you were asked to take this operation back for every point in R3\R^3 you wouldn’t be able to do so. This transformation is essentially

(xy)↦(xy0) with the matrix [100100]\begin{pmatrix} x\\y \end{pmatrix} \mapsto \begin{pmatrix} x\\y \\ 0 \end{pmatrix} \text{ with the matrix } \begin{bmatrix} 1 & 0 \\ 0 & 1 \\ 0 & 0 \end{bmatrix}

and it is irreversible if you have z≠0z \ne 0 in the 3D space. As you can see only the xy-plane can be mapped back but the marked point outside of the plane can not be mapped back to the input domain. This operation is not surjective and hence it is not undoable (not bijective).

Keep in mind that these examples are here for intuition. And as the lecture notes say, this intuition does not hold for all the functions. See the formal reasoning in the lecture notes.

Inverse of a Bijective Linear Transformation

Now we know that only linear transformations that can possibly be invertible are the linear transformations T:Rm→RmT: \R^m \to \R^m.

Now we formally state the equivalence we have seen in the previous subsection:

Lemma 2.52 (Reversible matrix transformations)

Let AA be an m×mm \times m matrix. The following three statements are equivalent.

  1. TA:Rm→RmT_A : \mathbb{R}^m \to \mathbb{R}^m is reversible.
  2. There is an m×mm \times m matrix BB such that BA=IBA = I.
  3. The columns of AA are linearly independent.

Most importantly we know that the left inverse of an m×mm\times m matrix AA is also its right inverse.

Lemma 2.53

Let A,BA, B be m×mm \times m matrices such that BA=IBA = I. Then also AB=IAB = I.

The Inverse of a Matrix

Let’s formally define an invertible matrix:

Definition 2.54 (Invertible and singular matrix)

Let AA be an m×mm \times m matrix. AA is called invertible if there is an m×mm \times m matrix BB such that BA=IBA = I. (By Lemma 2.52 this is the case if and only if AA has linearly independent columns.) Otherwise, AA is called singular.

We have further alternative definitions of the invertible matrix:

Observation 2.55 (Alternative definitions of an invertible matrix)

Let AA be an m×mm \times m matrix. AA is invertible if and only if there is an m×mm \times m matrix BB satisfying one (and therefore all) of the following equivalent conditions.

  1. AB=I.AB = I.
  2. BA=I.BA = I. (This means that AA is invertible according to Definition 2.54.)
  3. AB=BA=I.AB = BA = I.

Moreover, there is exactly one such matrix BB.

Definition 2.56 (Inverse matrix)

Let AA be an m×mm \times m matrix. AA is invertible if and only if there exists an m×mm \times m matrix BB such that BA=IBA = I (or AB=IAB = I, or AB=BA=IAB = BA = I). In this case, the matrix BB is unique and called the inverse of AA. We denote it by A−1A^{-1}.

How to calculate the inverse?

Case 1×11 \times 1.

M=[a]⇒M−1=[1a](if a≠0).M = \begin{bmatrix} a \end{bmatrix} \quad \Rightarrow \quad M^{-1} = \begin{bmatrix} \tfrac{1}{a} \end{bmatrix} \quad (\text{if } a \neq 0).

Hence, the inverse exists unless a=0a = 0.

Case 2×22 \times 2.

M=[abcd],⇒M−1=1ad−bc[d−b−ca](if ad−bc≠0).M = \begin{bmatrix} a & b \\ c & d \end{bmatrix}, \quad \Rightarrow \quad M^{-1} = \frac{1}{ad - bc} \begin{bmatrix} d & -b \\ -c & a \end{bmatrix} \quad (\text{if } ad - bc \neq 0).

The inverse for 2×22\times 2 matrices exist, if and only if ad−bc≠0ad-bc\neq 0. This is equivalent to say that the inverse of the 2×22\times 2 matrix exists, if and only if the columns of it are linearly independent. (Think about this!).

This formula might feel like it came out of nowhere, but these two examples above are only special cases of a general rule to calculate the inverse of a matrix. The formula utilizes some linear algebra tools we have not acquired yet, like determinants and cofactors, but don’t worry, we are going to get there.

Last but not least we list a few important properties of the inverse:

Lemmas 2.57–2.59

In the following, let AA and BB be m×mm\times m invertible matrices.

  1. (A−1)−1=A(A^{-1})^{-1} = A (Obs 2.57)
  2. (AB)−1=B−1A−1(AB)^{-1} = B^{-1}A^{-1} (Lemma 2.58)
  3. (A⊤)−1=(A−1)⊤(A^{\top})^{-1} = (A^{-1})^{\top} (Lemma 2.59)

You can find proofs of this facts in the lecture notes but I recommend to think about the proofs before you read them.

Note: An important note to be aware of is that you can not slap −1^{-1} on top of any matrix when you are doing calculations. You have to know that the matrix AA is invertible, before you write A−1A^{-1}, because writing A−1A^{-1} is already assuming the inverse exists.

As an example, you should be careful when writing

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

by Lemma 2.58 The lemma clearly states that this applies when AA and BB are both invertible. It might be the case that ABAB is invertible but AA or BB or both matrices are not invertible by themselves because they are not square matrices. So you should know or show that BB and AA are invertible, before you can apply this lemma.

Example:

A=[113203]B=[132011]AB=[6659]A = \begin{bmatrix} 1 & 1 & 3\\ 2 & 0 & 3 \end{bmatrix} \quad B = \begin{bmatrix} 1 & 3\\ 2 & 0 \\ 1 & 1 \end{bmatrix} \quad AB = \begin{bmatrix} 6&6 \\ 5&9 \end{bmatrix}

Here AA and BB are not invertible since they are not square matrices, but ABAB is invertible.

Hints

  1. Solved In Class
  2. Solved In Class
  3. a) Use associativity b) be careful here AA is not necessarily invertible c) no hints
  4. No hints.
  5. a) use induction over k b) No hints. c) This is a one liner think clever d) you have already seen a type of matrix in the course, which can be a self inverse, find it. (you are of course free to come up with another one) e) If you can modify the one from the previous subtask, go for it.
  6. (Challenging) a) use formula b) You have to prove two directions. Drawing a sketch or writing down such a matrix might help. For the proof of one direction, the proof for Theorem 3.7. ¬(i)⇒¬(ii)\lnot (i) \Rightarrow \lnot (ii) might inspire you. c) Assume for a contradiction that the inverse of a lower triangular matrix is not lower triangular. What is the issue here? Argue formally for the general case. d) No hints. You can still do this one without actually solving the first three subtasks.

Footnotes

  1. The formal versions of these can be found in the corresponding definitions in the lecture notes ↩