BetaFree coursewareRewritten from MIT OpenCourseWareCC BY-NC-SA 4.0
Open CosmologyPhysics & cosmology, from high school to a graduate year

Left and right inverses; the pseudoinverse

For an m × n matrix of rank r, the picture of the four subspaces decides which inverse exists. Full rank r = m = n: a two-sided inverse, A⁻¹A = I = AA⁻¹. Full column rank r = n: the nullspace is only zero, Ax = b has 0 or 1 solutions, AᵀA is invertible, and A_left⁻¹ = (AᵀA)⁻¹Aᵀ gives A_left⁻¹A = I (n × n); in the other order, A(AᵀA)⁻¹Aᵀ is the projection onto the column space. Full row rank r = m: Ax = b always has solutions, infinitely many with n − m free variables, AAᵀ is invertible, and A_right⁻¹ = Aᵀ(AAᵀ)⁻¹ gives AA_right⁻¹ = I; in the other order Aᵀ(AAᵀ)⁻¹A projects onto the row space. A rectangular matrix never has a two-sided inverse. In general (r < m, r < n), A is still one-to-one from the row space onto the column space: if x ≠ y are in the row space then Ax ≠ Ay, because x − y would be in both the row space and the nullspace, hence zero. The inverse of that map is the pseudoinverse A⁺, which statisticians need for least squares when AᵀA is singular. From the SVD A = UΣVᵀ: A⁺ = VΣ⁺Uᵀ, where Σ⁺ inverts the r nonzero σ's (1/σ₁, …, 1/σ_r) and is n × m; ΣΣ⁺ and Σ⁺Σ are the projections onto the column space and the row space of Σ, and AA⁺ = UΣΣ⁺Uᵀ and A⁺A = VΣ⁺ΣVᵀ those of A.

You need this first

Full reading path (25 pages)
  1. Vectors (8.01)
  2. Vectors and the dot product (18.02)
  3. Determinants and the cross product (18.02)
  4. Planes through three points, and matrices (18.02)
  5. Equations of planes and square systems (18.02)
  6. The geometry of linear equations (18.06)
  7. Elimination with matrices (18.06)
  8. Matrix multiplication and inverse matrices (18.06)
  9. Factorization into A = LU (18.06)
  10. Transposes, permutations and vector spaces (18.06)
  11. Properties of determinants (18.06)
  12. Determinant formulas and cofactors (18.06)
  13. Cramer's rule, the inverse matrix and volume (18.06)
  14. Column space and nullspace (18.06)
  15. Eigenvalues and eigenvectors (18.06)
  16. Diagonalisation and powers of A (18.06)
  17. Solving Ax = 0: pivot variables and special solutions (18.06)
  18. Solving Ax = b: the complete solution (18.06)
  19. Independence, basis and dimension (18.06)
  20. The four fundamental subspaces (18.06)
  21. Orthogonal vectors and subspaces (18.06)
  22. Projections onto subspaces (18.06)
  23. Projection matrices and least squares (18.06)
  24. Symmetric matrices and positive definiteness (18.06)
  25. Singular value decomposition (18.06)
On this page · 6 sections
  1. Two-sided inverse: full rank
  2. Left inverse: full column rank
  3. Right inverse: full row rank
  4. The general case: the pseudoinverse
  5. Computing A⁺ from the SVD
  6. Summary

The quiz is over and the final is coming; this lecture is a first step in the review, about left inverses, right inverses and the pseudoinverse (transcript, p. 1). Strang says he had never given it this way before, and that the pseudoinverse itself, from near the end of chapter 7, would not be expected on the final; what matters is the basic picture behind it: for an m×nm \times n matrix of rank rr, the four fundamental subspaces, with the row space and nullspace orthogonal complements on one side and the column space and left nullspace on the other (p. 1).

Two-sided inverse: full rank#

The inverse of chapter 2 works on both sides (pp. 1–2):

Two-sided inverse
A−1A=I=AA−1when r=m=nA^{-1}A = I = AA^{-1} \qquad\text{when } r = m = n
In words

capital A to the power minus 1 capital A equals capital I equals capital A capital A to the power minus 1 when r equals m equals n

Square, full rank, "period" (p. 2).

Left inverse: full column rank#

Next, from chapter 3, the case of independent columns, r=nr = n (pp. 2–3). The nullspace holds only the zero vector, and the row space is all of Rn\mathbf{R}^n (p. 3). So Ax=bAx = b has 0 or 1 solutions: possibly none, since the rows are probably dependent, but never two, because there is nothing in the nullspace to add (p. 4). These were the matrices of least squares, and for them ATAA^TA, n×nn \times n and symmetric, is invertible (p. 4). That gives a one-sided inverse (pp. 4–5):

Left inverse
Aleft−1=(ATA)−1AT,Aleft−1A=(ATA)−1(ATA)=InA^{-1}_{\text{left}} = (A^TA)^{-1}A^T, \qquad A^{-1}_{\text{left}}A = (A^TA)^{-1}(A^TA) = I_n
In words

capital A to the power minus 1 sub left equals ( capital A ^ capital T capital A ) to the power minus 1 capital A ^ capital T, capital A to the power minus 1 sub left capital A equals ( capital A ^ capital T capital A ) to the power minus 1 ( capital A ^ capital T capital A ) equals capital I sub n

On the other side it fails: a rectangular matrix cannot have a two-sided inverse, because AA or ATA^T has a nullspace whenever m≠nm \neq n, and here AATAA^T is the bad, singular combination (pp. 5–6). What the left inverse gives on the wrong side is familiar (p. 8):

Left inverse on the right
AAleft−1=A(ATA)−1AT=PAA^{-1}_{\text{left}} = A(A^TA)^{-1}A^T = P
In words

capital A capital A to the power minus 1 sub left equals capital A ( capital A ^ capital T capital A ) to the power minus 1 capital A ^ capital T equals capital P

the projection onto the column space. It "tries to be the identity": the identity on the column space, zero on its complement (p. 8).

Right inverse: full row rank#

The flip side: independent rows, r=mr = m (p. 6). Now the left nullspace is only zero, elimination never produces a zero row, and Ax=bAx = b always has a solution, with n−mn - m free variables, so infinitely many (pp. 6–7). AATAA^T is the matrix to invert (p. 7):

Right inverse
Aright−1=AT(AAT)−1,AAright−1=ImA^{-1}_{\text{right}} = A^T(AA^T)^{-1}, \qquad AA^{-1}_{\text{right}} = I_m
In words

capital A to the power minus 1 sub right equals capital A ^ capital T ( capital A capital A ^ capital T ) to the power minus 1, capital A capital A to the power minus 1 sub right equals capital I sub m

Other left and right inverses exist; these are the favourites (p. 7). On the wrong side, Aright−1A=AT(AAT)−1AA^{-1}_{\text{right}}A = A^T(AA^T)^{-1}A is the projection onto the row space (p. 9).

So far: with full rank both nullspaces are zero; with full column rank the nullspace is zero; with full row rank the left nullspace is zero. In the general case, rr smaller than both mm and nn, all four subspaces are there, with dimensions rr, n−rn - r, rr, m−rm - r (pp. 7–8).

The general case: the pseudoinverse#

The nullspaces are what spoil inverses: a vector sent to zero cannot be brought back to life (p. 10). But take xx in the row space. AxAx is in the column space, and the row space and column space both have dimension rr; between them AA is one-to-one (pp. 10–11). Most vectors have a row-space part and a nullspace part, and AA kills the nullspace part (p. 11). The claim (p. 11):

One-to-one on the row space
x≠y both in the row space⇒Ax≠Ayx \neq y \text{ both in the row space} \quad\Rightarrow\quad Ax \neq Ay
In words

x is not equal to y both in the row space which gives capital A x is not equal to capital A y

Proof (pp. 12–13): suppose Ax=AyAx = Ay. Then A(x−y)=0A(x - y) = 0, so x−yx - y is in the nullspace. But the row space is a vector space, so x−yx - y is also in the row space. The only vector in both is zero, so x=yx = y (pp. 12–13). So, restricted to these two spaces, AA is an invertible map, and its inverse is the pseudoinverse A+A^+ (pp. 11–12):

What the pseudoinverse does
A+(Ay)=yfor y in the row space,A+=0 on the left nullspaceA^+(Ay) = y \quad\text{for } y \text{ in the row space}, \qquad A^+ = 0 \text{ on the left nullspace}
In words

capital A plus ( capital A y) equals y for y in the row space, capital A plus equals 0 on the left nullspace

(Strang first says "y=A+xy = A^+x" and corrects it to A+A^+ applied to AyAy; pp. 11–12.) Statisticians welcomed it, Strang says, because they live by least squares, ATAx^=ATbA^TA\hat x = A^Tb, which needs full column rank; with repeated experiments the columns may be dependent, ATAA^TA is singular, and the pseudoinverse is the right quantity (pp. 13–14).

Computing A⁺ from the SVD#

Start from the singular value decomposition A=UΣVTA = U\Sigma V^T (p. 14). All the trouble sits in the m×nm \times n diagonal Σ\Sigma, with rr nonzero entries and zeros elsewhere: the simplest example of the general picture (pp. 14–15). Its pseudoinverse is n×mn \times m, inverting what can be inverted (p. 15):

Pseudoinverse of Σ
Σ+=(1/σ1⋱1/σr0)\Sigma^+ = \begin{pmatrix} 1/\sigma_1 & & & \\ & \ddots & & \\ & & 1/\sigma_r & \\ & & & 0 \end{pmatrix}
In words

capital sigma plus equals 1 over sigma one; and so on down the diagonal; 1 over sigma sub r; 0

The products give rr ones and then zeros, but of different sizes (pp. 15–16):

Two projections
ΣΣ+=(Ir000)m×m,Σ+Σ=(Ir000)n×n\Sigma\Sigma^+ = \begin{pmatrix} I_r & 0 \\ 0 & 0 \end{pmatrix}_{m \times m}, \qquad \Sigma^+\Sigma = \begin{pmatrix} I_r & 0 \\ 0 & 0 \end{pmatrix}_{n \times n}
In words

capital sigma capital sigma plus equals capital I sub r 0; 0 0 sub m times m, capital sigma plus capital sigma equals capital I sub r 0; 0 0 sub n times n

projections onto the column space and the row space of Σ\Sigma: the best the pseudoinverse can do (p. 16). For AA itself, AA+=UΣΣ+UTAA^+ = U\Sigma\Sigma^+U^T and A+A=VΣ+ΣVTA^+A = V\Sigma^+\Sigma V^T are the projections onto the column space and the row space of AA. (Strang first says m×mm \times m for Σ+Σ\Sigma^+\Sigma and corrects himself to n×nn \times n; p. 16.) Then, since VTV^T and UU are orthogonal (p. 16):

Pseudoinverse from the SVD
A+=VΣ+UTA^+ = V\Sigma^+U^T
In words

capital A plus equals capital V capital sigma plus capital U ^ capital T

Extra entries in the zero part of Σ+\Sigma^+ would multiply zeros and change nothing; the pseudoinverse is the minimal choice, with no extra stuff (p. 17). The SVD is "the champion" for computing it, since its two outer factors are inverted by transposing (p. 17).

Worked example

Inverses of your own

(a) Find the left inverse of A=(101101)A = \begin{pmatrix} 1 & 0 \\ 1 & 1 \\ 0 & 1 \end{pmatrix} and check it. (b) Find the pseudoinverse of the rank-one matrix B=(122400)B = \begin{pmatrix} 1 & 2 \\ 2 & 4 \\ 0 & 0 \end{pmatrix} and the projection B+BB^+B.

(a) Left inverse

The columns are independent. ATA=(2112)A^TA = \begin{pmatrix} 2 & 1 \\ 1 & 2 \end{pmatrix}, with inverse 13(2−1−12)\frac13\begin{pmatrix} 2 & -1 \\ -1 & 2 \end{pmatrix}. So Aleft−1=13(2−1−12)(110011)=13(21−1−112)A^{-1}_{\text{left}} = \frac13\begin{pmatrix} 2 & -1 \\ -1 & 2 \end{pmatrix}\begin{pmatrix} 1 & 1 & 0 \\ 0 & 1 & 1 \end{pmatrix} = \frac13\begin{pmatrix} 2 & 1 & -1 \\ -1 & 1 & 2 \end{pmatrix}. Check: row 1 times the columns of AA gives (2+1)/3=1(2 + 1)/3 = 1 and (1−1)/3=0(1 - 1)/3 = 0; row 2 gives (−1+1)/3=0(-1 + 1)/3 = 0 and (1+2)/3=1(1 + 2)/3 = 1.

(b) SVD of a rank-one matrix

B=(1,2,0)T(1,2)B = (1, 2, 0)^T(1, 2). Normalise: u1=(1,2,0)/5u_1 = (1, 2, 0)/\sqrt5, v1=(1,2)/5v_1 = (1, 2)/\sqrt5, so B=σ1u1v1TB = \sigma_1u_1v_1^T with σ1=5⋅5=5\sigma_1 = \sqrt5 \cdot \sqrt5 = 5.

(b) Pseudoinverse

B+=1σ1v1u1T=15⋅15(12)(120)=125(120240)B^+ = \frac{1}{\sigma_1}v_1u_1^T = \frac15 \cdot \frac15\begin{pmatrix} 1 \\ 2 \end{pmatrix}\begin{pmatrix} 1 & 2 & 0 \end{pmatrix} = \frac{1}{25}\begin{pmatrix} 1 & 2 & 0 \\ 2 & 4 & 0 \end{pmatrix}. Then B+B=125(5101020)=(0.20.40.40.8)B^+B = \frac{1}{25}\begin{pmatrix} 5 & 10 \\ 10 & 20 \end{pmatrix} = \begin{pmatrix} 0.2 & 0.4 \\ 0.4 & 0.8 \end{pmatrix}, the projection onto the row space, the line through (1,2)(1, 2).

Summary#

Symbols on this page

Show the 30 symbols used here
σ\sigma sigma.
A singular value. Say it: “sigma”.
≠\neq not equal.
Is not equal to. Say it: “is not equal to”.
⇒\Rightarrow implies.
Implies: what follows is a consequence of what came before. Say it: “which gives”.
×\times times.
Times (multiplication). Between two vectors: the cross product. Say it: “times”.
⋅\cdot dot.
Times (multiplication). Between two vectors: the dot product. Say it: “times”.
ı^\hat\imath hat.
A unit vector: a vector of length 1 that only gives a direction (î, r̂). Say it: “hat”.
TT T.
As a superscript: the transpose. Say it: “capital T”.
Σ\Sigma capital sigma.
The m × n diagonal matrix of singular values in A = UΣVᵀ; Σ⁺ is its n × m pseudoinverse. Say it: “capital sigma”.
xx x.
A vector in the row space; in Ax = b, the unknown. Say it: “x”.
yy y.
A second vector in the row space. Say it: “y”.
nn n.
The number of columns of A. Say it: “n”.
mm m.
The number of rows of A. Say it: “m”.
rr r.
The rank of A. Say it: “r”.
PP P.
The projection onto the column space, A(AᵀA)⁻¹Aᵀ. Say it: “capital P”.
AA A.
An m × n matrix of rank r; in the worked example, the 3 × 2 matrix with rows (1, 0), (1, 1), (0, 1). Say it: “capital A”.
BB B.
The worked example's rank-one matrix with rows (1, 2), (2, 4), (0, 0). Say it: “capital B”.
CC C.
C(A), the column space of A. Say it: “C”.
bb b.
The right-hand side of Ax = b. Say it: “b”.
UU U.
The orthogonal matrix of left singular vectors. Say it: “capital U”.
VV V.
The orthogonal matrix of right singular vectors. Say it: “capital V”.
σr\sigma_{r} radial velocity dispersion.
The last nonzero singular value. Say it: “sigma sub r”.
v1v_{1} v one.
The unit vector along the row space of B. Say it: “v one”.
II I.
The identity matrix. Say it: “capital I”.
u1u_{1} u one.
The unit vector along the column space of B. Say it: “u one”.
σ1\sigma_{1} sigma one.
The first singular value. Say it: “sigma one”.
AleftA_{\text{left}} A left.
A left inverse of A (with A⁻¹_left A = I). Say it: “capital A left inverse”.
ArightA_{\text{right}} A right.
A right inverse of A (with A A⁻¹_right = I). Say it: “capital A right inverse”.
InI_{n} I n.
The n × n identity matrix. Say it: “capital I sub n”.
ImI_{m} I m.
The m × m identity matrix. Say it: “capital I sub m”.
IrI_{r} I r.
The r × r identity block. Say it: “capital I sub r”.

Tap or click a symbol in a formula to see the same explanation. All symbols: symbols and notation.

Words on this page

Show the 33 words used here

New here

left inverse.
An operator S that undoes T: applying T and then S gives back every vector unchanged, so ST is the identity.
right inverse.
An operator S such that applying S and then T gives back every vector unchanged, so TS is the identity.
pseudoinverse.
The nearest thing to an inverse for a matrix with none: it carries outputs back to their starting points and sends everything else to zero.

Also used

p..
Page, in a reference to a source; pp. means pages, as in pp. 3–5.
matrix.
A rectangular table of numbers, which acts on vectors to give new ones and so describes a linear change of coordinates. Explained in Planes through three points, and matrices.
rank.
The number of independent columns of a matrix, which always equals the number of independent rows. Explained in Similar matrices and the Jordan form.
four fundamental subspaces.
The column space, nullspace, row space and left nullspace of a matrix, whose dimensions are all fixed by its rank. Explained in The four fundamental subspaces.
row space.
All the vectors that can be made by combining the rows of a matrix; it is the column space of its transpose. Explained in Matrix multiplication and inverse matrices.
nullspace.
All the vectors x that a matrix sends to zero, that is, all solutions of Ax = 0. Explained in Column space and nullspace.
orthogonal.
At right angles; more generally, of two vectors or functions, having a dot product, or an integral of their product, of zero. Explained in Introduction to Fourier series.
column space.
All the vectors made by combining the columns of a matrix; Ax = b can be solved exactly when b lies in it. Explained in Matrix multiplication and inverse matrices.
left nullspace.
The nullspace of the transpose of a matrix: all the combinations of its rows that give zero. Explained in The four fundamental subspaces.
inverse.
The thing that undoes another: a matrix times its inverse gives the identity matrix, as a function followed by its inverse gives back the start. Explained in Planes through three points, and matrices.
full rank.
Of a matrix: having rank as large as its size allows; full column rank means independent columns, full row rank independent rows. Explained in Solving Ax = b: the complete solution.
zero vector.
The vector whose components are all zero; adding it to any vector changes nothing. Explained in Transposes, permutations and vector spaces.
least squares.
A way to fit a model to data by choosing it to make the sum of the squared errors as small as possible. Explained in Projection matrices and least squares.
symmetric.
Unchanged by some swap, reflection or turn; for an expression in two quantities, unchanged when they are exchanged. Explained in Introduction to Fourier series.
invertible.
Of a square matrix or operator: having an inverse that undoes it; for a matrix this happens exactly when its determinant is not zero. Explained in The geometry of linear equations.
singular.
Of a square matrix: having no inverse, because its determinant is zero and some nonzero vector is sent to zero. Explained in The geometry of linear equations.
projection.
The shadow of a vector on a line or plane: the nearest point to it there, found by dropping a perpendicular. Explained in Projections onto subspaces.
elimination.
Solving equations by subtracting multiples of one from another until each unknown can be found in turn. Explained in The geometry of linear equations.
free variable.
An unknown whose column has no pivot, so it can be given any value; the other unknowns are then fixed by the equations.
subspace.
A set of vectors inside a larger space that is a space itself: sums and multiples of its vectors stay inside it. Explained in Transposes, permutations and vector spaces.
dimension.
The number of vectors in any basis of a vector space or subspace. Explained in Independence, basis and dimension.
vector.
A list of numbers written as a column, or more generally anything that can be added and multiplied by numbers. Explained in Orthogonal vectors and subspaces.
proof.
A chain of reasoning showing beyond doubt that a statement follows from definitions and results already known. Explained in Limits and continuity.
vector space.
A collection of objects, called vectors, that can be added together and multiplied by numbers, with the results staying in the collection. Explained in Transposes, permutations and vector spaces.
singular value decomposition.
Writing any matrix as A = UΣVᵀ: a rotation (perhaps with a reflection), a stretching along perpendicular axes, and another rotation. Explained in Singular value decomposition.
diagonal.
In a square matrix, the entries running from the top left corner to the bottom right; a diagonal matrix has zeros everywhere else. Explained in The four fundamental subspaces.
SVD.
Short for singular value decomposition, which writes any matrix as a rotation, a stretching and another rotation (reflections allowed).
rank one.
Of a matrix: having rank exactly one, so it is a column times a row and every column is a multiple of one column. Explained in Matrix spaces, rank one and small-world graphs.

Academic

transcript.
A written record of exactly what was said in a recorded lecture, word for word.
kills.
In maths slang, to make a term or vector zero.

Tap or click a word, here or in the text, for its meaning in this lesson. All words: the glossary. How many words are marked in the text: Reading options (the “Aa” button).

Check your understanding

  1. A 5×35 \times 3 matrix has rank 3. Which inverse does it have?
  2. With full column rank, what is A(ATA)−1ATA(A^TA)^{-1}A^T?
  3. Why does AA send different vectors x≠yx \neq y of the row space to different vectors?
  4. If A=UΣVTA = U\Sigma V^T, what is the pseudoinverse A+A^+?
0 of 4 answered

Flashcards

1 / 4