What Rank Deficiency Changes
When a matrix is rank-deficient, some directions in its input space are sent to zero, and some target vectors cannot be reached at all. These two features lead to different questions: an inconsistent system has no exact solution, while an underdetermined system may have multiple exact solutions. Least squares handles the first situation by minimizing the residual; the pseudoinverse selects a particular minimizer, namely the one with smallest norm. In this tutorial, small SVD calculations will make both the residual and the entire family of minimizers explicit.
Work over \(\mathbb{R}\). For \(\mathbf{A}\in\mathbb{R}^{m\times n}\) and \(\mathbf{b}\in\mathbb{R}^m\), a least-squares minimizer is a vector \(\mathbf{x}\in\mathbb{R}^n\) that minimizes \(\|\mathbf{A}\mathbf{x}-\mathbf{b}\|\) over all \(\mathbf{x}\). The residual at \(\mathbf{x}\) is \(\mathbf{b}-\mathbf{A}\mathbf{x}\). The system is inconsistent if no \(\mathbf{x}\) satisfies \(\mathbf{A}\mathbf{x}=\mathbf{b}\). A matrix is rank-deficient when its rank is less than the smaller of its numbers of rows and columns.
Recall the SVD pseudoinverse formula. Write an SVD as \(\mathbf{A}=\mathbf{U}\boldsymbol{\Sigma}\mathbf{V}^{\top}\), where \(\mathbf{U}\) and \(\mathbf{V}\) are orthogonal matrices. If the rank is \(r\), the positive singular values are \(\sigma_1,\dots,\sigma_r\), and the corresponding left and right singular vectors are \(\mathbf{u}_i\) and \(\mathbf{v}_i\). Then
Only positive singular values are inverted. Zero singular values are omitted, rather than divided into. This is essential for rank-deficient matrices. The earlier results on least squares and the pseudoinverse give the candidate minimum-norm minimizer \(\mathbf{A}^{+}\mathbf{b}\); the singular-coordinate argument below explains both why it minimizes the residual and how to find all the other minimizers.
The Full Family of Least-Squares Minimizers
Proof. Set \(\mathbf{y}=\mathbf{U}^{\top}\mathbf{b}\) and \(\mathbf{z}=\mathbf{V}^{\top}\mathbf{x}\). Since \(\mathbf{U}\) and \(\mathbf{V}\) are orthogonal, they preserve norms, and \(\mathbf{x}=\mathbf{V}\mathbf{z}\). The first \(r\) diagonal entries of \(\boldsymbol{\Sigma}\) are \(\sigma_1,\dots,\sigma_r>0\); all its other entries are zero. Therefore
The second sum does not depend on \(\mathbf{x}\). Each term in the first sum is nonnegative and can be made zero by setting \(z_i=y_i/\sigma_i\). Since each \(\sigma_i\) is positive, this is the unique minimizing choice for each \(i\le r\). No term in the objective depends on \(z_{r+1},\dots,z_n\), so those coordinates are arbitrary. The SVD formula for \(\mathbf{A}^{+}\) gives \(\mathbf{A}^{+}\mathbf{b}=\mathbf{V}\mathbf{z}_0\), where \((\mathbf{z}_0)_i=y_i/\sigma_i\) for \(i\le r\) and \((\mathbf{z}_0)_j=0\) for \(j>r\). Thus all the minimizers have the stated form.
For any such minimizer, orthogonality of the columns of \(\mathbf{V}\) gives \(\|\mathbf{x}\|^2=\sum_{i=1}^{r}(y_i/\sigma_i)^2+\sum_{j=r+1}^{n}c_j^2\). This is smallest exactly when every \(c_j=0\), and that choice is unique. Finally, the residual in \(\mathbf{U}\)-coordinates has entries \(0\) for \(i\le r\) and \(y_i\) for \(i>r\). Multiplying back by \(\mathbf{U}\) gives the residual formula in the theorem. These calculations also cover \(r=0\): the first sum is empty, all input coordinates are free, and the smallest-norm choice is \(\mathbf{0}\). \(\square\)
The vectors \(\mathbf{v}_{r+1},\dots,\mathbf{v}_n\) describe the directions that do not change \(\mathbf{A}\mathbf{x}\). Indeed, for \(j>r\), the corresponding singular value is zero, so \(\mathbf{A}\mathbf{v}_j=\mathbf{0}\). The theorem therefore separates two tasks: the positive singular directions determine the best fit, while the zero singular directions account for every other minimizer.
An Inconsistent System with a Nonzero Residual
Worked Example: A Diagonal Rank-Deficient Matrix
Find the least-squares minimizers for \(\mathbf{A}=\begin{bmatrix}2&0\\0&0\end{bmatrix}\) and \(\mathbf{b}=\begin{bmatrix}1\\3\end{bmatrix}\). Give the residual and the minimum-norm minimizer.
An SVD is \(\mathbf{A}=\mathbf{I}_2\boldsymbol{\Sigma}\mathbf{I}_2^{\top}\), with \(\boldsymbol{\Sigma}=\begin{bmatrix}2&0\\0&0\end{bmatrix}\). There is one positive singular value, \(2\), and its left and right singular vectors are both \(\mathbf{e}_1\). Hence
The theorem says that every minimizer is \(\mathbf{x}=\begin{bmatrix}\tfrac12\\0\end{bmatrix}+t\mathbf{e}_2 =\begin{bmatrix}\tfrac12\\t\end{bmatrix}\), with \(t\in\mathbb{R}\). Multiplication gives the same fitted vector for every \(t\):
The residual is nonzero, so the system is inconsistent. Its norm is \(3\), independent of \(t\). Also, \(\|\mathbf{x}\|^2=\tfrac14+t^2\), which is minimized uniquely at \(t=0\). Thus \(\mathbf{A}^{+}\mathbf{b}=\begin{bmatrix}\tfrac12\\0\end{bmatrix}\) is the minimum-norm minimizer, as claimed.
Underdetermined Systems: Exact Fits and Many Solutions
An underdetermined system has more unknowns than equations. It can have infinitely many exact solutions when the target is reachable. If the matrix is also rank-deficient, some input directions may remain free even after imposing the exact-fit condition. The next two examples use the same matrix with different right-hand sides: one is reachable, and one is not.
Worked Example: An Underdetermined Consistent System
For \(\mathbf{A}=\begin{bmatrix}1&1&0\\2&2&0\end{bmatrix}\) and \(\mathbf{b}=\begin{bmatrix}3\\6\end{bmatrix}\), find every least-squares minimizer and identify the minimum-norm one.
The matrix has rank \(1\). Its nonzero singular value and corresponding unit singular vectors are \(\sigma_1=\sqrt{10}\), \(\mathbf{u}_1=\begin{bmatrix}1\\2\end{bmatrix}/\sqrt{5}\), and \(\mathbf{v}_1=\begin{bmatrix}1\\1\\0\end{bmatrix}/\sqrt{2}\). In fact, \(\mathbf{A}=\sqrt{10}\,\mathbf{u}_1\mathbf{v}_1^{\top}\), as multiplying the right-hand side gives the displayed matrix. Therefore
Direct multiplication checks the fit: \(\mathbf{A}\begin{bmatrix}\tfrac32\\\tfrac32\\0\end{bmatrix} =\begin{bmatrix}3\\6\end{bmatrix}=\mathbf{b}\), so the residual is \(\mathbf{0}\). To find every exact solution, write \(\mathbf{x}=\begin{bmatrix}x_1\\x_2\\x_3\end{bmatrix}\). The equations are \(x_1+x_2=3\) and \(2x_1+2x_2=6\), with the second equation twice the first. Thus the full family is
Its squared norm is \((\tfrac32+s)^2+(\tfrac32-s)^2+t^2=\tfrac92+2s^2+t^2\), which is minimized uniquely when \(s=t=0\). The resulting vector is \(\mathbf{A}^{+}\mathbf{b}\). Substituting it into the original matrix gives \(\begin{bmatrix}3\\6\end{bmatrix}\), confirming the minimum-norm exact solution.
Worked Example: An Underdetermined Inconsistent System
Keep the same matrix \(\mathbf{A}\), but take \(\mathbf{b}=\begin{bmatrix}3\\0\end{bmatrix}\). Find the residual, all least-squares minimizers, and the minimum-norm minimizer.
The pseudoinverse is unchanged, so
Multiplying back gives \(\mathbf{A}\mathbf{A}^{+}\mathbf{b} =\begin{bmatrix}\tfrac35\\\tfrac65\end{bmatrix}\). The residual is therefore \(\mathbf{b}-\mathbf{A}\mathbf{A}^{+}\mathbf{b} =\begin{bmatrix}\tfrac{12}{5}\\-\tfrac65\end{bmatrix}\), with squared norm \(\tfrac{144}{25}+\tfrac{36}{25}=\tfrac{36}{5}\), hence norm \(\tfrac{6}{\sqrt{5}}\). The target cannot be an exact fit: every vector in the column space of \(\mathbf{A}\) has second entry twice its first, but \(\begin{bmatrix}3\\0\end{bmatrix}\) does not.
For any input \(\mathbf{x}\), the product is \(\mathbf{A}\mathbf{x}=\begin{bmatrix}x_1+x_2\\2x_1+2x_2\end{bmatrix}\). Its value matches the best-fit vector \(\begin{bmatrix}\tfrac35\\\tfrac65\end{bmatrix}\) exactly when \(x_1+x_2=\tfrac35\); \(x_3\) is unrestricted. Consequently all the minimizers are
For each member of the family, multiplication gives \(\mathbf{A}\mathbf{x}=\begin{bmatrix}\tfrac35\\\tfrac65\end{bmatrix}\), so the residual remains \(\begin{bmatrix}\tfrac{12}{5}\\-\tfrac65\end{bmatrix}\). The squared norm of \(\mathbf{x}\) is \(\tfrac{9}{50}+2s^2+t^2\), minimized uniquely at \(s=t=0\). Thus \(\begin{bmatrix}\tfrac{3}{10}\\\tfrac{3}{10}\\0\end{bmatrix}\) is the minimum-norm minimizer, and its product with \(\mathbf{A}\) verifies the stated best fit.
A Common Mistake: Treating the Pseudoinverse Output as an Exact Solution
For the last example, a tempting but incorrect calculation is to claim that \(\mathbf{A}^{+}\mathbf{b}\) solves \(\mathbf{A}\mathbf{x}=\mathbf{b}\). Substitution shows otherwise:
The correction is to distinguish an exact solution from a least-squares minimizer. Here the pseudoinverse output minimizes the residual, but it cannot make that residual zero. A second mistake is to report only this one vector when asked for all minimizers. Adding \(\begin{bmatrix}s\\-s\\t\end{bmatrix}\) changes neither the fitted vector nor the residual. It increases the norm unless \(s=t=0\), which is why the pseudoinverse output is the minimum-norm choice rather than the only minimizer.
How to Read a Rank-Deficient Example
A reliable calculation can be organized around three questions. First, what does the SVD say about the reachable part of the target? Only the left singular-vector directions with positive singular values can be fitted. Second, which input directions are invisible to the matrix? They are the right singular-vector directions associated with zero singular values. Third, what does the requested output require: just the residual, one minimizer, the full family, or the minimum-norm member? Keeping these questions separate prevents a correct pseudoinverse calculation from being mistaken for a complete description.
The distinction matters in applications where different coefficient vectors may produce the same prediction. The residual measures the mismatch between the target and the best reachable fit. The null-space terms describe changes to the coefficients that leave that fit unchanged. Choosing the minimum-norm member gives a well-defined representative without claiming that the other minimizers do not exist.
Check Your Understanding
Use the SVD-coordinate result to answer each question. When a matrix and vector are given, verify the proposed fit by multiplication.
- For \(\mathbf{A}=\begin{bmatrix}1&0\\0&0\end{bmatrix}\) and \(\mathbf{b}=\begin{bmatrix}2\\4\end{bmatrix}\), find the residual and the full family of minimizers.
- For the \(2\times3\) matrix in the worked examples and \(\mathbf{b}=\begin{bmatrix}1\\2\end{bmatrix}\), find the minimum-norm exact solution and describe every exact solution.
- Explain why adding a multiple of \(\mathbf{v}_j\) for a zero singular value does not change the fitted vector.
- In an SVD with rank \(r\), which coordinates of \(\mathbf{V}^{\top}\mathbf{x}\) are fixed at a least-squares minimum, and which are free?
- For the inconsistent underdetermined example, check directly that its residual is orthogonal to the column \(\begin{bmatrix}1\\2\end{bmatrix}\) of \(\mathbf{A}\).