Tutorials › Linear Algebra › Pseudoinverses as Orthogonal Projections

Pseudoinverse and Low-Rank Approximation · Tutorial 814 of 1000

Pseudoinverses as Orthogonal Projections

Learn how to identify, prove, and compute the orthogonal projections encoded by \(\mathbf{A}\mathbf{A}^{+}\) and \(\mathbf{A}^{+}\mathbf{A}\).

Advanced 10 min read

What You'll Learn

  • Define an orthogonal projector using symmetry and idempotence.
  • Use an SVD to identify the ranges of \(\mathbf{A}\mathbf{A}^{+}\) and \(\mathbf{A}^{+}\mathbf{A}\).
  • Prove that these products project onto the column space and row space of \(\mathbf{A}\).
  • Compute both projectors for rank-deficient matrices.
  • Apply the projectors to vectors and check orthogonality of the residuals.

Two Products, Two Spaces

A matrix \(\mathbf{A}\in\mathbb{R}^{m\times n}\) maps vectors in \(\mathbb{R}^n\) to vectors in \(\mathbb{R}^m\). Its column space is a subspace of \(\mathbb{R}^m\), while its row space is a subspace of \(\mathbb{R}^n\). The pseudoinverse \(\mathbf{A}^{+}\in\mathbb{R}^{n\times m}\) maps in the opposite direction. Consequently, the two products \(\mathbf{A}\mathbf{A}^{+}\) and \(\mathbf{A}^{+}\mathbf{A}\) act on different spaces: the first on \(\mathbb{R}^m\), the second on \(\mathbb{R}^n\). Each product keeps the component lying in the corresponding space and removes the orthogonal component.

Throughout this tutorial, matrices and vectors are real, and orthogonality uses the usual dot product. For a subspace \(W\), the orthogonal projection of \(\mathbf{x}\) onto \(W\) is the vector \(\mathbf{p}\in W\) for which \(\mathbf{x}-\mathbf{p}\) is orthogonal to every vector in \(W\). The SVD gives a direct way to see why the pseudoinverse products perform precisely these projections.

Definition: A matrix \(\mathbf{P}\in\mathbb{R}^{d\times d}\) is an orthogonal projector if \(\mathbf{P}^{\top}=\mathbf{P}\) and \(\mathbf{P}^{2}=\mathbf{P}\). Its action is the orthogonal projection onto its range \(\operatorname{im}\mathbf{P}=\{\mathbf{P}\mathbf{x}:\mathbf{x}\in\mathbb{R}^d\}\).

Symmetry expresses that the matrix does not distinguish the two arguments of the dot product, while idempotence means that once a vector has been projected, applying the same matrix again makes no change. The following fact explains why these algebraic conditions characterize orthogonal projection.

Proposition: If \(\mathbf{P}\in\mathbb{R}^{d\times d}\) satisfies \(\mathbf{P}^{\top}=\mathbf{P}\) and \(\mathbf{P}^{2}=\mathbf{P}\), then \(\mathbf{P}\mathbf{x}\) is the orthogonal projection of every \(\mathbf{x}\in\mathbb{R}^{d}\) onto \(\operatorname{im}\mathbf{P}\).

Proof. For any \(\mathbf{x}\), the vector \(\mathbf{P}\mathbf{x}\) belongs to \(\operatorname{im}\mathbf{P}\) by the definition of the range. Also, \(\mathbf{x}-\mathbf{P}\mathbf{x}\) is orthogonal to every \(\mathbf{y}\in\operatorname{im}\mathbf{P}\). Indeed, write \(\mathbf{y}=\mathbf{P}\mathbf{z}\). Then symmetry and idempotence give \(\langle\mathbf{x}-\mathbf{P}\mathbf{x},\mathbf{y}\rangle =(\mathbf{x}-\mathbf{P}\mathbf{x})^{\top}\mathbf{P}\mathbf{z} =\mathbf{x}^{\top}\mathbf{P}\mathbf{z}-\mathbf{x}^{\top}\mathbf{P}^{\top}\mathbf{P}\mathbf{z} =\mathbf{x}^{\top}\mathbf{P}\mathbf{z}-\mathbf{x}^{\top}\mathbf{P}^{2}\mathbf{z}=0\). Thus \(\mathbf{P}\mathbf{x}\) lies in the range and the residual is orthogonal to the range, which is the defining property of the orthogonal projection. \(\square\)

The Projection Theorem for the Pseudoinverse

Let \(\mathbf{A}\) have rank \(r\), and use a full SVD \(\mathbf{A}=\mathbf{U}\boldsymbol{\Sigma}\mathbf{V}^{\top}\), where \(\mathbf{U}\) and \(\mathbf{V}\) are orthogonal and \(\boldsymbol{\Sigma}\) is an \(m\times n\) matrix whose first \(r\) diagonal entries \(\sigma_1,\dots,\sigma_r\) are positive and whose remaining entries are zero. The SVD construction of the pseudoinverse replaces each positive singular value by its reciprocal, transposes the rectangular diagonal matrix, and swaps the orthogonal factors: \(\mathbf{A}^{+}=\mathbf{V}\boldsymbol{\Sigma}^{+}\mathbf{U}^{\top}\). Here \(\boldsymbol{\Sigma}^{+}\) is \(n\times m\), with diagonal entries \(1/\sigma_i\) for \(1\le i\le r\) and zeros elsewhere. When \(r=0\), both \(\boldsymbol{\Sigma}\) and \(\boldsymbol{\Sigma}^{+}\) are zero.

Theorem: For every \(\mathbf{A}\in\mathbb{R}^{m\times n}\), the product \(\mathbf{A}\mathbf{A}^{+}\) is the orthogonal projector onto \(\operatorname{Col}\mathbf{A}\subseteq\mathbb{R}^m\), and \(\mathbf{A}^{+}\mathbf{A}\) is the orthogonal projector onto \(\operatorname{Row}\mathbf{A}\subseteq\mathbb{R}^n\).

Proof. Substituting the SVD expressions and using \(\mathbf{U}^{\top}\mathbf{U}=\mathbf{I}_m\) and \(\mathbf{V}^{\top}\mathbf{V}=\mathbf{I}_n\), we obtain \(\mathbf{A}\mathbf{A}^{+}=\mathbf{U}(\boldsymbol{\Sigma}\boldsymbol{\Sigma}^{+})\mathbf{U}^{\top}\) and \(\mathbf{A}^{+}\mathbf{A}=\mathbf{V}(\boldsymbol{\Sigma}^{+}\boldsymbol{\Sigma})\mathbf{V}^{\top}\). The product \(\boldsymbol{\Sigma}\boldsymbol{\Sigma}^{+}\) is the \(m\times m\) diagonal matrix with \(1\) in its first \(r\) diagonal positions and \(0\) in the others. Likewise, \(\boldsymbol{\Sigma}^{+}\boldsymbol{\Sigma}\) is the \(n\times n\) diagonal matrix with \(1\) in its first \(r\) positions and \(0\) in the others. These statements also hold when \(r=0\), in which case both products are zero.

Both displayed products are symmetric and idempotent: for example, \(\mathbf{A}\mathbf{A}^{+}=\mathbf{U}\mathbf{D}_m\mathbf{U}^{\top}\), where \(\mathbf{D}_m\) is diagonal with entries \(0\) or \(1\), so \((\mathbf{A}\mathbf{A}^{+})^{\top}=\mathbf{A}\mathbf{A}^{+}\) and \((\mathbf{A}\mathbf{A}^{+})^2=\mathbf{U}\mathbf{D}_m^2\mathbf{U}^{\top}=\mathbf{U}\mathbf{D}_m\mathbf{U}^{\top}\). The same calculation applies to \(\mathbf{A}^{+}\mathbf{A}\).

It remains to identify their ranges. From the SVD, the columns of \(\mathbf{A}\) lie in \(\operatorname{span}\{\mathbf{u}_1,\dots,\mathbf{u}_r\}\), where \(\mathbf{u}_i\) are the first \(r\) columns of \(\mathbf{U}\). Conversely, each \(\mathbf{u}_i\) for \(1\le i\le r\) is in \(\operatorname{Col}\mathbf{A}\), since \(\mathbf{A}\mathbf{v}_i=\sigma_i\mathbf{u}_i\) and \(\sigma_i\ne0\). Thus \(\operatorname{Col}\mathbf{A}=\operatorname{span}\{\mathbf{u}_1,\dots,\mathbf{u}_r\}\). Applying the same argument to \(\mathbf{A}^{\top}=\mathbf{V}\boldsymbol{\Sigma}^{\top}\mathbf{U}^{\top}\) gives \(\operatorname{Row}\mathbf{A}=\operatorname{Col}\mathbf{A}^{\top}=\operatorname{span}\{\mathbf{v}_1,\dots,\mathbf{v}_r\}\). The ranges of the two products are therefore exactly the stated spaces. By the proposition, each product is the orthogonal projector onto its range. \(\square\)

A Rank-One Example: Projection onto a Line

Worked Example: A One-Dimensional Column Space

Consider \(\mathbf{A}=\begin{bmatrix}1&1\\1&1\\0&0\end{bmatrix}\). Its columns are equal, so \(\operatorname{Col}\mathbf{A}=\operatorname{span}\{(1,1,0)^{\top}\}\), a one-dimensional subspace of \(\mathbb{R}^3\). The row space is \(\operatorname{span}\{(1,1)^{\top}\}\subseteq\mathbb{R}^2\).

One SVD has left singular vector \(\mathbf{u}_1=(1,1,0)^{\top}/\sqrt{2}\), right singular vector \(\mathbf{v}_1=(1,1)^{\top}/\sqrt{2}\), and singular value \(2\). The SVD formula gives \(\mathbf{A}^{+}=\frac14\begin{bmatrix}1&1&0\\1&1&0\end{bmatrix}\). Multiplying in both orders gives

$$ \mathbf{A}\mathbf{A}^{+} = \begin{bmatrix} \frac12&\frac12&0\\ \frac12&\frac12&0\\ 0&0&0 \end{bmatrix}, \qquad \mathbf{A}^{+}\mathbf{A} = \begin{bmatrix} \frac12&\frac12\\ \frac12&\frac12 \end{bmatrix}. $$

The first product acts on \(\mathbb{R}^3\), projecting onto the one-dimensional column-space line. For \(\mathbf{b}=(2,0,2)^{\top}\), \(\mathbf{A}\mathbf{A}^{+}\mathbf{b}=(1,1,0)^{\top}\). The residual is \(\mathbf{b}-(1,1,0)^{\top}=(1,-1,2)^{\top}\), and its dot product with the line direction is \(1-1+0=0\). For a vector \(\mathbf{x}=(3,1)^{\top}\in\mathbb{R}^2\), the second product gives \(\mathbf{A}^{+}\mathbf{A}\mathbf{x}=(2,2)^{\top}\), the projection onto the row-space line.

Check: Direct multiplication gives \(\mathbf{A}\mathbf{A}^{+}\mathbf{A}=\mathbf{A}\): the first two columns of \(\mathbf{A}\) are in the projected line and the third row is zero. Also \(\mathbf{A}^{+}\mathbf{A}\mathbf{x}=(2,2)^{\top}\) follows from \(\frac12(3+1)=2\) in each coordinate.

A Rank-Two Example: Projection onto a Plane

Worked Example: A Column Space That Is a Plane

Let \(\mathbf{A}=\begin{bmatrix}1&0\\0&2\\1&0\end{bmatrix}\). Its columns \((1,0,1)^{\top}\) and \((0,2,0)^{\top}\) are nonzero and orthogonal. Their normalized directions are \((1,0,1)^{\top}/\sqrt{2}\) and \((0,1,0)^{\top}\), with singular values \(\sqrt{2}\) and \(2\). The SVD formula yields \(\mathbf{A}^{+}=\begin{bmatrix}\frac12&0&\frac12\\0&\frac12&0\end{bmatrix}\).

Multiplying the matrices explicitly gives

$$ \mathbf{A}\mathbf{A}^{+} = \begin{bmatrix} \frac12&0&\frac12\\ 0&1&0\\ \frac12&0&\frac12 \end{bmatrix}, \qquad \mathbf{A}^{+}\mathbf{A} = \begin{bmatrix}1&0\\0&1\end{bmatrix}. $$

The column-space projection replaces the first and third coordinates by their average while retaining the second coordinate. For \(\mathbf{b}=(2,3,0)^{\top}\), \(\mathbf{A}^{+}\mathbf{b}=(1,\frac32)^{\top}\), and hence \(\mathbf{A}\mathbf{A}^{+}\mathbf{b}=(1,3,1)^{\top}\). The residual is \((1,0,-1)^{\top}\); its dot products with the two columns are \(1-1=0\) and \(0\). Meanwhile, every vector in \(\mathbb{R}^2\) is already in the row space here, so \(\mathbf{A}^{+}\mathbf{A}(4,-2)^{\top}=(4,-2)^{\top}\).

Check: Multiplying \(\mathbf{A}^{+}\mathbf{A}\) by the first column gives \((1,0)^{\top}\), and multiplying it by the second gives \((0,1)^{\top}\); thus \(\mathbf{A}^{+}\mathbf{A}=\mathbf{I}_2\). Also \(\mathbf{A}\mathbf{A}^{+}\mathbf{A}=\mathbf{A}\), as the displayed projector fixes each of the two columns.

Rank Deficiency and What Gets Removed

Worked Example: A Coordinate Direction Is Lost

Take \(\mathbf{A}=\begin{bmatrix}3&0&0\\0&0&0\end{bmatrix}\). It maps \(\mathbb{R}^3\) into the line spanned by \((1,0)^{\top}\), and its row space is the line spanned by \((1,0,0)^{\top}\). Its only nonzero singular value is \(3\), so \(\mathbf{A}^{+}=\begin{bmatrix}\frac13&0\\0&0\\0&0\end{bmatrix}\).

$$ \mathbf{A}\mathbf{A}^{+} = \begin{bmatrix}1&0\\0&0\end{bmatrix}, \qquad \mathbf{A}^{+}\mathbf{A} = \begin{bmatrix}1&0&0\\0&0&0\\0&0&0\end{bmatrix}. $$

For \(\mathbf{b}=(5,4)^{\top}\), the first projector gives \((5,0)^{\top}\); the removed residual \((0,4)^{\top}\) is orthogonal to the column space. For \(\mathbf{x}=(2,-3,7)^{\top}\), the second gives \((2,0,0)^{\top}\), removing the components in the two directions perpendicular to the row space.

Check: The displayed products satisfy \(\mathbf{A}\mathbf{A}^{+}\mathbf{A}=\mathbf{A}\), since the first row \((3,0,0)\) is fixed and the second row is zero. Likewise \(\mathbf{A}^{+}\mathbf{A}\mathbf{A}^{+}=\mathbf{A}^{+}\), since the first coordinate direction is fixed and the other two are sent to zero.

Common Pitfall: Interchanging the Products

The products are both projectors, but they generally have different sizes and project onto different spaces. For the \(3\times2\) matrix in the first example, \(\mathbf{A}\mathbf{A}^{+}\) is \(3\times3\), so it acts on vectors in \(\mathbb{R}^3\). The product \(\mathbf{A}^{+}\mathbf{A}\) is \(2\times2\), so it acts on vectors in \(\mathbb{R}^2\).

Wrong calculation: applying \(\mathbf{A}^{+}\mathbf{A}\) to \(\mathbf{b}=(2,0,2)^{\top}\) as if it were a column-space vector would require multiplying a \(2\times2\) matrix by a \(3\times1\) vector. The inner dimensions do not match, so that product is undefined. Correction: to project this \(\mathbf{b}\in\mathbb{R}^3\) onto \(\operatorname{Col}\mathbf{A}\), use \(\mathbf{A}\mathbf{A}^{+}\mathbf{b}\). Use \(\mathbf{A}^{+}\mathbf{A}\) only for inputs in \(\mathbb{R}^2\), projecting onto \(\operatorname{Row}\mathbf{A}\).

One practical interpretation is that \(\mathbf{A}^{+}\mathbf{b}\) first finds a coefficient vector in the domain, while \(\mathbf{A}\mathbf{A}^{+}\mathbf{b}\) returns the corresponding projected vector in the codomain. The theorem identifies the target of that projection without requiring the input \(\mathbf{b}\) to lie in the column space already. In particular, the residual \(\mathbf{b}-\mathbf{A}\mathbf{A}^{+}\mathbf{b}\) is orthogonal to every column of \(\mathbf{A}\). In the domain, \(\mathbf{A}^{+}\mathbf{A}\) keeps precisely the component lying in the row space and removes components in directions that the matrix cannot use.

Check Your Understanding

For each question, identify the space on which the matrix acts before carrying out a computation.

  1. If \(\mathbf{A}\in\mathbb{R}^{4\times 2}\), what are the sizes of \(\mathbf{A}\mathbf{A}^{+}\) and \(\mathbf{A}^{+}\mathbf{A}\), and which spaces do they project onto?
  2. For \(\mathbf{P}=\begin{bmatrix}1&0\\0&0\end{bmatrix}\), verify symmetry and idempotence, then state its range.
  3. Using the first worked example, compute \(\mathbf{A}\mathbf{A}^{+}(0,2,0)^{\top}\) and check that the residual is orthogonal to \((1,1,0)^{\top}\).
  4. For the second worked example, compute \(\mathbf{A}^{+}\mathbf{A}(5,-1)^{\top}\). Explain why the result equals the input.
  5. Why is it invalid to apply \(\mathbf{A}^{+}\mathbf{A}\) to a vector in \(\mathbb{R}^m\) when \(\mathbf{A}\) is an \(m\times n\) matrix with \(m\ne n\)?

Test yourself: Linear Algebra final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon