Tutorials › Linear Algebra › Pseudoinverse Formulas for Full-Rank Matrices

Pseudoinverse and Low-Rank Approximation · Tutorial 815 of 1000

Pseudoinverse Formulas for Full-Rank Matrices

Learn when each full-rank pseudoinverse formula applies and how it turns a rectangular system into a least-squares fit or a minimum-norm exact solution.

Advanced 10 min read

What You'll Learn

  • Identify whether a rectangular matrix has full column rank or full row rank.
  • Derive each Gram-matrix formula and verify the Moore–Penrose equations.
  • Determine which of the two Gram matrices is invertible and why.
  • Interpret the resulting products as orthogonal projections or identity maps.
  • Distinguish least-squares solutions from minimum-norm exact solutions.

Two Formulas, Two Different Rank Conditions

For a rectangular matrix, the Moore–Penrose pseudoinverse provides a single matrix that supports both least-squares and exact-solution questions. When the matrix has full rank in one of two particular senses, its pseudoinverse can be written using an ordinary inverse of a square matrix. The key is to choose the square matrix that is guaranteed to be invertible: \(\mathbf{A}^{\top}\mathbf{A}\) for full column rank, or \(\mathbf{A}\mathbf{A}^{\top}\) for full row rank.

Throughout, let \(\mathbf{A}\in\mathbb{R}^{m\times n}\). Its columns are vectors in \(\mathbb{R}^m\). It has full column rank if its \(n\) columns are linearly independent, so \(n\le m\). It has full row rank if its \(m\) rows are linearly independent, so \(m\le n\). These are distinct conditions for rectangular matrices; a wide matrix cannot have full column rank, and a tall matrix cannot have full row rank.

Definition: The Moore–Penrose pseudoinverse of \(\mathbf{A}\), written \(\mathbf{A}^{+}\), is the unique matrix \(\mathbf{B}\in\mathbb{R}^{n\times m}\) satisfying $$ \mathbf{A}\mathbf{B}\mathbf{A}=\mathbf{A},\qquad \mathbf{B}\mathbf{A}\mathbf{B}=\mathbf{B},\qquad (\mathbf{A}\mathbf{B})^{\top}=\mathbf{A}\mathbf{B},\qquad (\mathbf{B}\mathbf{A})^{\top}=\mathbf{B}\mathbf{A}. $$ The uniqueness of a matrix satisfying these four Moore–Penrose equations is the standard uniqueness theorem for the pseudoinverse.

The formulas below follow by proposing a candidate and checking all four equations. In particular, the symmetry conditions matter: merely finding a matrix that reverses multiplication on one side is not enough to establish that it is the pseudoinverse.

Full Column Rank: The Left-Inverse Formula

Suppose \(\mathbf{A}\in\mathbb{R}^{m\times n}\) has full column rank. Then the square matrix \(\mathbf{A}^{\top}\mathbf{A}\in\mathbb{R}^{n\times n}\) is invertible. Indeed, for any nonzero \(\mathbf{x}\in\mathbb{R}^n\), full column rank gives \(\mathbf{A}\mathbf{x}\ne\mathbf{0}\), and therefore \(\mathbf{x}^{\top}\mathbf{A}^{\top}\mathbf{A}\mathbf{x}=\|\mathbf{A}\mathbf{x}\|^2>0\). If \(\mathbf{A}^{\top}\mathbf{A}\) had a nonzero vector in its null space, this quadratic expression would be zero for that vector. Thus its null space is trivial, so the square matrix is invertible.

Theorem: If \(\mathbf{A}\in\mathbb{R}^{m\times n}\) has full column rank, then $$ \mathbf{A}^{+}=(\mathbf{A}^{\top}\mathbf{A})^{-1}\mathbf{A}^{\top}. $$

Proof. Put \(\mathbf{B}=(\mathbf{A}^{\top}\mathbf{A})^{-1}\mathbf{A}^{\top}\). The inverse exists by the argument above, and \(\mathbf{B}\) has size \(n\times m\). First, \(\mathbf{B}\mathbf{A}=(\mathbf{A}^{\top}\mathbf{A})^{-1}\mathbf{A}^{\top}\mathbf{A}=\mathbf{I}_n\). Consequently, \(\mathbf{A}\mathbf{B}\mathbf{A}=\mathbf{A}\), and \(\mathbf{B}\mathbf{A}\mathbf{B}=\mathbf{I}_n\mathbf{B}=\mathbf{B}\). The matrix \(\mathbf{A}^{\top}\mathbf{A}\) is symmetric, so its inverse is symmetric. Hence \(\mathbf{B}\mathbf{A}=\mathbf{I}_n\) is symmetric, and \(\mathbf{A}\mathbf{B}=\mathbf{A}(\mathbf{A}^{\top}\mathbf{A})^{-1}\mathbf{A}^{\top}\) is symmetric as well, since transposing this expression leaves it unchanged. Thus \(\mathbf{B}\) satisfies all four equations, and by uniqueness it equals \(\mathbf{A}^{+}\). \(\square\)

Worked Example: A Tall Full-Column-Rank Matrix

Let \(\mathbf{A}=\begin{bmatrix}1&0\\0&1\\1&1\end{bmatrix}\). Its columns are independent: if \(c_1(1,0,1)+c_2(0,1,1)=\mathbf{0}\), the first two coordinates force \(c_1=c_2=0\). Compute its pseudoinverse.

First form the Gram matrix and its inverse:

$$ \mathbf{A}^{\top}\mathbf{A} =\begin{bmatrix}2&1\\1&2\end{bmatrix}, \qquad (\mathbf{A}^{\top}\mathbf{A})^{-1} =\frac{1}{3}\begin{bmatrix}2&-1\\-1&2\end{bmatrix}. $$

Multiplying by \(\mathbf{A}^{\top}\) gives

$$ \mathbf{A}^{+} =\frac{1}{3}\begin{bmatrix}2&-1\\-1&2\end{bmatrix} \begin{bmatrix}1&0&1\\0&1&1\end{bmatrix} =\frac{1}{3}\begin{bmatrix}2&-1&1\\-1&2&1\end{bmatrix}. $$

Check. Multiplication on the right by \(\mathbf{A}\) gives \(\mathbf{A}^{+}\mathbf{A}=\mathbf{I}_2\). In the other order,

$$ \mathbf{A}\mathbf{A}^{+} =\frac{1}{3}\begin{bmatrix}2&-1&1\\-1&2&1\\1&1&2\end{bmatrix}. $$

This product is symmetric, as required by the Moore–Penrose equations. It also fixes every vector in \(\operatorname{Col}\mathbf{A}\): for \(\mathbf{A}\mathbf{x}\), multiplication gives \(\mathbf{A}\mathbf{A}^{+}\mathbf{A}\mathbf{x}=\mathbf{A}\mathbf{x}\).

Full Row Rank: The Right-Inverse Formula

Now suppose \(\mathbf{A}\in\mathbb{R}^{m\times n}\) has full row rank. In this case \(\mathbf{A}\mathbf{A}^{\top}\), rather than \(\mathbf{A}^{\top}\mathbf{A}\), is guaranteed to be invertible. For nonzero \(\mathbf{y}\in\mathbb{R}^m\), independence of the rows means \(\mathbf{A}^{\top}\mathbf{y}\ne\mathbf{0}\). Thus \(\mathbf{y}^{\top}\mathbf{A}\mathbf{A}^{\top}\mathbf{y}=\|\mathbf{A}^{\top}\mathbf{y}\|^2>0\), which proves that the square matrix \(\mathbf{A}\mathbf{A}^{\top}\) has trivial null space and is invertible.

Theorem: If \(\mathbf{A}\in\mathbb{R}^{m\times n}\) has full row rank, then $$ \mathbf{A}^{+}=\mathbf{A}^{\top}(\mathbf{A}\mathbf{A}^{\top})^{-1}. $$

Proof. Put \(\mathbf{B}=\mathbf{A}^{\top}(\mathbf{A}\mathbf{A}^{\top})^{-1}\), which has size \(n\times m\). The inverse exists as shown above. Direct multiplication gives \(\mathbf{A}\mathbf{B}=\mathbf{A}\mathbf{A}^{\top}(\mathbf{A}\mathbf{A}^{\top})^{-1}=\mathbf{I}_m\). It follows that \(\mathbf{A}\mathbf{B}\mathbf{A}=\mathbf{A}\) and \(\mathbf{B}\mathbf{A}\mathbf{B}=\mathbf{B}\mathbf{I}_m=\mathbf{B}\). The product \(\mathbf{A}\mathbf{B}=\mathbf{I}_m\) is symmetric. Also, \(\mathbf{A}\mathbf{A}^{\top}\) and its inverse are symmetric, so \(\mathbf{B}\mathbf{A}=\mathbf{A}^{\top}(\mathbf{A}\mathbf{A}^{\top})^{-1}\mathbf{A}\) is symmetric. All four equations hold, and uniqueness gives \(\mathbf{B}=\mathbf{A}^{+}\). \(\square\)

Worked Example: A Wide Full-Row-Rank Matrix

Let \(\mathbf{A}=\begin{bmatrix}1&0&1\\0&1&1\end{bmatrix}\). Its two rows are independent, since a linear combination of them equal to zero has both coefficients zero. Compute \(\mathbf{A}^{+}\) from the full-row-rank formula.

Compute the \(2\times2\) Gram matrix and its inverse:

$$ \mathbf{A}\mathbf{A}^{\top} =\begin{bmatrix}2&1\\1&2\end{bmatrix}, \qquad (\mathbf{A}\mathbf{A}^{\top})^{-1} =\frac{1}{3}\begin{bmatrix}2&-1\\-1&2\end{bmatrix}. $$

Then

$$ \mathbf{A}^{+} =\frac{1}{3}\begin{bmatrix}1&0\\0&1\\1&1\end{bmatrix} \begin{bmatrix}2&-1\\-1&2\end{bmatrix} =\frac{1}{3}\begin{bmatrix}2&-1\\-1&2\\1&1\end{bmatrix}. $$

Check. Direct multiplication gives \(\mathbf{A}\mathbf{A}^{+}=\mathbf{I}_2\). The other product is

$$ \mathbf{A}^{+}\mathbf{A} =\frac{1}{3}\begin{bmatrix}2&-1&1\\-1&2&1\\1&1&2\end{bmatrix}, $$

which is symmetric. The four Moore–Penrose equations therefore hold, also as guaranteed by the theorem.

What the Formulas Do to a Right-Hand Side

The distinction between the two cases is visible in the products. For full column rank, \(\mathbf{A}^{+}\mathbf{A}=\mathbf{I}_n\), while \(\mathbf{A}\mathbf{A}^{+}\) is the orthogonal projection onto \(\operatorname{Col}\mathbf{A}\). For full row rank, \(\mathbf{A}\mathbf{A}^{+}=\mathbf{I}_m\), while \(\mathbf{A}^{+}\mathbf{A}\) is the orthogonal projection onto the row space of \(\mathbf{A}\), viewed as a subspace of \(\mathbb{R}^n\). These projection statements follow because the products are symmetric and idempotent, and their images are respectively \(\operatorname{Col}\mathbf{A}\) and the image of \(\mathbf{A}^{\top}\).

For the tall matrix in the first example, take \(\mathbf{b}=(1,2,4)^{\top}\). Then

$$ \mathbf{A}^{+}\mathbf{b} =\frac{1}{3}\begin{bmatrix}2&-1&1\\-1&2&1\end{bmatrix} \begin{bmatrix}1\\2\\4\end{bmatrix} =\begin{bmatrix}4/3\\7/3\end{bmatrix}, \qquad \mathbf{A}\mathbf{A}^{+}\mathbf{b} =\begin{bmatrix}4/3\\7/3\\11/3\end{bmatrix}. $$

The latter vector is the projection of \(\mathbf{b}\) onto \(\operatorname{Col}\mathbf{A}\). The residual is \(\mathbf{b}-\mathbf{A}\mathbf{A}^{+}\mathbf{b}=(-1/3,-1/3,1/3)^{\top}\), and its dot products with the columns \((1,0,1)^{\top}\) and \((0,1,1)^{\top}\) are both zero. Thus \(\mathbf{A}^{+}\mathbf{b}\) is the least-squares solution. It is the unique such solution because full column rank makes \(\mathbf{A}\mathbf{x}\) different for distinct \(\mathbf{x}\).

For the wide matrix in the second example, take \(\mathbf{b}=(2,1)^{\top}\). The formula gives \(\mathbf{A}^{+}\mathbf{b}=(1,0,1)^{\top}\), and multiplying back gives \(\mathbf{A}\mathbf{A}^{+}\mathbf{b}=(2,1)^{\top}=\mathbf{b}\). It is an exact solution. Every solution has the form \(\mathbf{x}=(2-t,1-t,t)^{\top}\), because the equations are \(x_1+x_3=2\) and \(x_2+x_3=1\). Relative to \((1,0,1)^{\top}\), the difference is \(s(-1,-1,1)^{\top}\) for some \(s\in\mathbb{R}\). These two vectors are orthogonal, so the squared norm of any solution is \(2+3s^2\). It is minimized uniquely at \(s=0\). Thus the full-row-rank formula gives the minimum-norm exact solution.

Takeaway: Full column rank makes \(\mathbf{A}^{+}\mathbf{A}=\mathbf{I}_n\): the pseudoinverse recovers the unique least-squares coefficient vector. Full row rank makes \(\mathbf{A}\mathbf{A}^{+}=\mathbf{I}_m\): the pseudoinverse returns an exact solution, specifically the one of minimum norm.

When Both Formulas Apply—and a Common Error

If \(\mathbf{A}\) is square and invertible, it has both full column rank and full row rank. Both formulas then give the ordinary inverse. For example, let \(\mathbf{A}=\begin{bmatrix}1&2\\3&5\end{bmatrix}\). Computing from the first formula gives

$$ \mathbf{A}^{\top}\mathbf{A} =\begin{bmatrix}10&17\\17&29\end{bmatrix}, \qquad (\mathbf{A}^{\top}\mathbf{A})^{-1}\mathbf{A}^{\top} =\begin{bmatrix}29&-17\\-17&10\end{bmatrix} \begin{bmatrix}1&3\\2&5\end{bmatrix} =\begin{bmatrix}-5&2\\3&-1\end{bmatrix}. $$

Computing from the second formula gives

$$ \mathbf{A}\mathbf{A}^{\top} =\begin{bmatrix}5&13\\13&34\end{bmatrix}, \qquad \mathbf{A}^{\top}(\mathbf{A}\mathbf{A}^{\top})^{-1} =\begin{bmatrix}1&3\\2&5\end{bmatrix} \begin{bmatrix}34&-13\\-13&5\end{bmatrix} =\begin{bmatrix}-5&2\\3&-1\end{bmatrix}. $$

Check: multiplying the resulting matrix by \(\mathbf{A}\) on either side gives \(\mathbf{I}_2\), confirming that it is \(\mathbf{A}^{-1}\).

Common mistake: using the wrong Gram matrix. For the full-row-rank \(2\times3\) matrix \(\begin{bmatrix}1&0&1\\0&1&1\end{bmatrix}\), a tempting but invalid step is to try \((\mathbf{A}^{\top}\mathbf{A})^{-1}\mathbf{A}^{\top}\). In fact, \(\mathbf{A}(-1,-1,1)^{\top}=\mathbf{0}\), so \((\mathbf{A}^{\top}\mathbf{A})(-1,-1,1)^{\top}=\mathbf{0}\). The \(3\times3\) matrix \(\mathbf{A}^{\top}\mathbf{A}\) is singular and cannot be inverted. The correction is to use the full-row-rank formula, which inverts the \(2\times2\) matrix \(\mathbf{A}\mathbf{A}^{\top}\). Choose the Gram matrix to match the rank condition; do not assume both are invertible.

Check Your Understanding

For each question, identify the dimensions and rank condition before choosing a formula.

  1. For a full-column-rank matrix \(\mathbf{A}\in\mathbb{R}^{5\times3}\), what are the dimensions of \(\mathbf{A}^{\top}\mathbf{A}\) and \(\mathbf{A}^{+}\)?
  2. Why does full row rank guarantee that \(\mathbf{A}\mathbf{A}^{\top}\) is invertible?
  3. For a full-column-rank matrix, which product is the identity, and onto which subspace does the other product project?
  4. For a full-row-rank matrix, what solution does \(\mathbf{A}^{+}\mathbf{b}\) give for a consistent equation \(\mathbf{A}\mathbf{x}=\mathbf{b}\)?
  5. Give a reason the full-column-rank formula cannot be used for every wide matrix.

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