Tutorials › Linear Algebra › SVDs Of Tall Rectangular Matrices

Singular Value Decomposition · Tutorial 789 of 1000

SVDs Of Tall Rectangular Matrices

Learn how the Gram matrix produces the singular values and right singular vectors, how to construct the left singular vectors, and how to complete a thin SVD to a full one.

Advanced 10 min read

What You'll Learn

  • Identify the dimensions of the Gram matrix for a tall matrix.
  • Explain why full column rank makes every singular value positive.
  • Compute left singular vectors from right singular vectors.
  • Assemble and verify thin and full SVD factorizations.
  • Extend the left singular vectors to an orthonormal basis when forming a full SVD.

Why Tall Matrices Need Careful Dimension Tracking

Let \(\mathbf{A}\) be an \(m\times n\) real matrix with \(m>n\). It maps vectors in \(\mathbb{R}^n\) to vectors in the larger space \(\mathbb{R}^m\). If \(\mathbf{A}\) has full column rank, its \(n\) columns are linearly independent. An SVD organizes this map using orthonormal vectors in both spaces, but the two sets of vectors have different dimensions: right singular vectors lie in \(\mathbb{R}^n\), while left singular vectors lie in \(\mathbb{R}^m\).

The key computational starting point is the Gram matrix \(\mathbf{A}^{\top}\mathbf{A}\). Its size is \(n\times n\), so its eigenvectors give the right singular vectors. The corresponding left singular vectors are then constructed from their images under \(\mathbf{A}\). For a full-column-rank tall matrix, this gives \(n\) left singular vectors; a full SVD also requires \(m-n\) additional orthonormal vectors in \(\mathbb{R}^m\).

Definition: A matrix \(\mathbf{A}\in\mathbb{R}^{m\times n}\) is tall if \(m>n\). It has full column rank if its columns are linearly independent, equivalently if \(\mathbf{A}\mathbf{x}=\mathbf{0}\) implies \(\mathbf{x}=\mathbf{0}\) for \(\mathbf{x}\in\mathbb{R}^n\). An SVD is a factorization \(\mathbf{A}=\mathbf{U}\boldsymbol{\Sigma}\mathbf{V}^{\top}\), where the columns of the square matrices \(\mathbf{U}\) and \(\mathbf{V}\) are orthonormal and \(\boldsymbol{\Sigma}\) is diagonal, or rectangular diagonal for a rectangular matrix.

The Gram Matrix and Positive Singular Values

For a tall \(\mathbf{A}\in\mathbb{R}^{m\times n}\), the product \(\mathbf{A}^{\top}\mathbf{A}\) has size \(n\times n\). It is symmetric. Its eigenvalues determine the singular values: if the eigenvalues are \(\lambda_1\ge\cdots\ge\lambda_n\), the corresponding singular values are \(\sigma_i=\sqrt{\lambda_i}\). The real Spectral Theorem, established in the earlier material, guarantees an orthonormal eigenbasis for a real symmetric matrix.

Theorem: If \(\mathbf{A}\in\mathbb{R}^{m\times n}\) has full column rank, then \(\mathbf{A}^{\top}\mathbf{A}\) is positive definite and all its eigenvalues are positive.

Proof. To show positive definiteness, take any \(\mathbf{x}\in\mathbb{R}^n\) with \(\mathbf{x}\ne\mathbf{0}\). Then \(\mathbf{x}^{\top}\mathbf{A}^{\top}\mathbf{A}\mathbf{x}=(\mathbf{A}\mathbf{x})^{\top}(\mathbf{A}\mathbf{x})=\|\mathbf{A}\mathbf{x}\|^2\). Full column rank means \(\mathbf{A}\mathbf{x}\ne\mathbf{0}\), so \(\|\mathbf{A}\mathbf{x}\|^2>0\). Thus \(\mathbf{A}^{\top}\mathbf{A}\) is positive definite. Now let \(\mathbf{v}\ne\mathbf{0}\) be an eigenvector with eigenvalue \(\lambda\). The same computation gives \(\lambda\|\mathbf{v}\|^2=\mathbf{v}^{\top}\mathbf{A}^{\top}\mathbf{A}\mathbf{v}>0\). Since \(\|\mathbf{v}\|^2>0\), it follows that \(\lambda>0\). The Spectral Theorem supplies an eigenbasis, so this applies to every eigenvalue. \(\square\)

Consequently, for a full-column-rank tall matrix there are exactly \(n\) singular values, all positive. The Gram matrix has \(n\) eigenvectors in \(\mathbb{R}^n\); applying \(\mathbf{A}\) to them produces \(n\) vectors in \(\mathbb{R}^m\). Dividing each image by its singular value makes those vectors unit vectors.

Worked Example: A Simple Embedded Diagonal Matrix

Find a thin and a full SVD of \(\mathbf{A}=\begin{bmatrix}2&0\\0&1\\0&0\end{bmatrix}\). This is a \(3\times2\) full-column-rank matrix.

First compute the \(2\times2\) Gram matrix:

$$ \mathbf{A}^{\top}\mathbf{A} = \begin{bmatrix}2&0&0\\0&1&0\end{bmatrix} \begin{bmatrix}2&0\\0&1\\0&0\end{bmatrix} = \begin{bmatrix}4&0\\0&1\end{bmatrix}. $$

The eigenvalues are \(4\) and \(1\), with unit eigenvectors \(\mathbf{v}_1=(1,0)^{\top}\) and \(\mathbf{v}_2=(0,1)^{\top}\). Thus \(\sigma_1=2\), \(\sigma_2=1\), and \(\mathbf{V}=\mathbf{I}_2\). The left vectors are \(\mathbf{u}_1=\mathbf{A}\mathbf{v}_1/2=(1,0,0)^{\top}\) and \(\mathbf{u}_2=\mathbf{A}\mathbf{v}_2/1=(0,1,0)^{\top}\). Therefore the thin factors are

$$ \mathbf{U}_{\mathrm{thin}}= \begin{bmatrix}1&0\\0&1\\0&0\end{bmatrix}, \qquad \boldsymbol{\Sigma}_{\mathrm{thin}}= \begin{bmatrix}2&0\\0&1\end{bmatrix}, \qquad \mathbf{V}=\mathbf{I}_2. $$

Multiplication gives \(\mathbf{U}_{\mathrm{thin}}\boldsymbol{\Sigma}_{\mathrm{thin}}\mathbf{V}^{\top}=\begin{bmatrix}2&0\\0&1\\0&0\end{bmatrix}=\mathbf{A}\). To form the full SVD, add \((0,0,1)^{\top}\) as the third column of \(\mathbf{U}\). The full \(\mathbf{U}\) is \(\mathbf{I}_3\), and \(\boldsymbol{\Sigma}\) is \(3\times2\):

$$ \mathbf{A} = \begin{bmatrix}1&0&0\\0&1&0\\0&0&1\end{bmatrix} \begin{bmatrix}2&0\\0&1\\0&0\end{bmatrix} \begin{bmatrix}1&0\\0&1\end{bmatrix}. $$

The product is again \(\mathbf{A}\): the third row of the full \(\mathbf{U}\) contributes only to a zero row of \(\boldsymbol{\Sigma}\).

Constructing the Left Vectors and the Factorizations

Theorem (SVD construction for a full-column-rank tall matrix): Let \(\mathbf{A}\in\mathbb{R}^{m\times n}\), where \(m>n\), have full column rank. Choose an orthonormal eigenbasis \(\mathbf{v}_1,\dots,\mathbf{v}_n\) of \(\mathbf{A}^{\top}\mathbf{A}\), with eigenvalues \(\lambda_1\ge\cdots\ge\lambda_n>0\), and set \(\sigma_i=\sqrt{\lambda_i}\). Define \(\mathbf{u}_i=\mathbf{A}\mathbf{v}_i/\sigma_i\). Then the \(\mathbf{u}_i\) are orthonormal and \(\mathbf{A}=\mathbf{U}_{\mathrm{thin}}\boldsymbol{\Sigma}_{\mathrm{thin}}\mathbf{V}^{\top}\), where \(\mathbf{U}_{\mathrm{thin}}\in\mathbb{R}^{m\times n}\), \(\boldsymbol{\Sigma}_{\mathrm{thin}}\in\mathbb{R}^{n\times n}\), and \(\mathbf{V}\in\mathbb{R}^{n\times n}\). Completing the \(\mathbf{u}_i\) to an orthonormal basis of \(\mathbb{R}^m\) gives a full factorization with \(\mathbf{U}\in\mathbb{R}^{m\times m}\) and \(\boldsymbol{\Sigma}\in\mathbb{R}^{m\times n}\).

Proof. The eigenvectors satisfy \(\mathbf{A}^{\top}\mathbf{A}\mathbf{v}_i=\lambda_i\mathbf{v}_i\) and \(\mathbf{v}_i^{\top}\mathbf{v}_j=1\) when \(i=j\), \(0\) otherwise. Since each \(\sigma_i>0\), every \(\mathbf{u}_i\) is defined. For \(1\le i,j\le n\),

$$ \mathbf{u}_i^{\top}\mathbf{u}_j = \frac{\mathbf{v}_i^{\top}\mathbf{A}^{\top}\mathbf{A}\mathbf{v}_j}{\sigma_i\sigma_j} = \frac{\lambda_j\mathbf{v}_i^{\top}\mathbf{v}_j}{\sigma_i\sigma_j} = \begin{cases} 1,&i=j,\\ 0,&i\ne j. \end{cases} $$

Thus the \(\mathbf{u}_i\) are orthonormal. Let \(\mathbf{V}\) have columns \(\mathbf{v}_i\), let \(\mathbf{U}_{\mathrm{thin}}\) have columns \(\mathbf{u}_i\), and let \(\boldsymbol{\Sigma}_{\mathrm{thin}}\) be diagonal with entries \(\sigma_1,\dots,\sigma_n\). Since \(\mathbf{V}\) is an orthogonal \(n\times n\) matrix, \(\mathbf{V}\mathbf{V}^{\top}=\mathbf{I}_n\). Also \(\mathbf{A}\mathbf{v}_i=\sigma_i\mathbf{u}_i\) for each \(i\). Hence \(\mathbf{A}\mathbf{V}=\mathbf{U}_{\mathrm{thin}}\boldsymbol{\Sigma}_{\mathrm{thin}}\), and multiplying on the right by \(\mathbf{V}^{\top}\) proves the thin factorization.

For the full factorization, extend the orthonormal list \(\mathbf{u}_1,\dots,\mathbf{u}_n\) to an orthonormal basis of \(\mathbb{R}^m\). Such an extension can be constructed by repeatedly choosing a standard basis vector outside the current span, subtracting its projections onto the current orthonormal list, and normalizing the nonzero result. This process terminates with \(m\) vectors because the standard basis spans \(\mathbb{R}^m\). Put the added vectors after the \(\mathbf{u}_i\) to form \(\mathbf{U}\), and append \(m-n\) zero rows to \(\boldsymbol{\Sigma}_{\mathrm{thin}}\) to form the \(m\times n\) rectangular diagonal matrix \(\boldsymbol{\Sigma}\). The appended rows contribute zero to the product, so \(\mathbf{U}\boldsymbol{\Sigma}\mathbf{V}^{\top}=\mathbf{A}\). \(\square\)

The thin factorization keeps only the \(n\) left singular vectors needed to represent the columns of \(\mathbf{A}\). The full factorization has a square \(m\times m\) left factor; the extra \(m-n\) columns complete an orthonormal basis, while the corresponding rows of \(\boldsymbol{\Sigma}\) are zero. The right factor remains \(n\times n\) in both forms.

Worked Example: A Nontrivial Three-By-Two SVD

Find the thin and full SVDs of \(\mathbf{A}=\begin{bmatrix}1&0\\1&1\\0&1\end{bmatrix}\). The matrix is tall, and its columns are independent: if \(c_1(1,1,0)^{\top}+c_2(0,1,1)^{\top}=\mathbf{0}\), the first and third coordinates give \(c_1=0\) and \(c_2=0\).

Compute the Gram matrix and its eigenpairs:

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

The eigenvalues in descending order are \(3\) and \(1\). Corresponding unit eigenvectors are \(\mathbf{v}_1=(1,1)^{\top}/\sqrt{2}\) and \(\mathbf{v}_2=(1,-1)^{\top}/\sqrt{2}\): multiplying the Gram matrix by these vectors gives \(3\mathbf{v}_1\) and \(\mathbf{v}_2\), respectively. Thus \(\sigma_1=\sqrt{3}\) and \(\sigma_2=1\). Now calculate the left vectors:

$$ \mathbf{A}\mathbf{v}_1=\frac{1}{\sqrt{2}}\begin{bmatrix}1\\2\\1\end{bmatrix}, \qquad \mathbf{u}_1=\frac{\mathbf{A}\mathbf{v}_1}{\sqrt{3}} =\frac{1}{\sqrt{6}}\begin{bmatrix}1\\2\\1\end{bmatrix}, $$
$$ \mathbf{A}\mathbf{v}_2=\frac{1}{\sqrt{2}}\begin{bmatrix}1\\0\\-1\end{bmatrix}, \qquad \mathbf{u}_2=\frac{\mathbf{A}\mathbf{v}_2}{1} =\frac{1}{\sqrt{2}}\begin{bmatrix}1\\0\\-1\end{bmatrix}. $$

These vectors have norm \(1\), and their dot product is \((1-1)/\sqrt{12}=0\). A unit vector perpendicular to both is \(\mathbf{u}_3=(-1,1,-1)^{\top}/\sqrt{3}\), since its squared norm is \(3/3=1\), and its dot products with \(\mathbf{u}_1\) and \(\mathbf{u}_2\) are \((-1+2-1)/\sqrt{18}=0\) and \((-1+1)/\sqrt{6}=0\).

With \(\mathbf{V}=\begin{bmatrix}1/\sqrt{2}&1/\sqrt{2}\\1/\sqrt{2}&-1/\sqrt{2}\end{bmatrix}\), the thin factors have dimensions \(3\times2\), \(2\times2\), and \(2\times2\):

$$ \mathbf{U}_{\mathrm{thin}}= \begin{bmatrix} 1/\sqrt{6}&1/\sqrt{2}\\ 2/\sqrt{6}&0\\ 1/\sqrt{6}&-1/\sqrt{2} \end{bmatrix}, \qquad \boldsymbol{\Sigma}_{\mathrm{thin}}= \begin{bmatrix}\sqrt{3}&0\\0&1\end{bmatrix}. $$

For a direct product check, \(\mathbf{U}_{\mathrm{thin}}\boldsymbol{\Sigma}_{\mathrm{thin}}\) has columns \((1,2,1)^{\top}/\sqrt{2}\) and \((1,0,-1)^{\top}/\sqrt{2}\). Multiplication by \(\mathbf{V}^{\top}\) gives columns \((1,1,0)^{\top}\) and \((0,1,1)^{\top}\), exactly the columns of \(\mathbf{A}\). The full \(\mathbf{U}\) uses \(\mathbf{u}_1,\mathbf{u}_2,\mathbf{u}_3\), and the full rectangular diagonal factor is

$$ \boldsymbol{\Sigma}= \begin{bmatrix} \sqrt{3}&0\\ 0&1\\ 0&0 \end{bmatrix}. $$

Since its last row is zero, the full product agrees with the thin product and reconstructs \(\mathbf{A}\).

Adding More Left Singular Vectors

Worked Example: Two Extra Columns in the Full Left Factor

Find a full SVD of \(\mathbf{A}=\begin{bmatrix}1&0\\0&2\\1&0\\0&0\end{bmatrix}\), a \(4\times2\) full-column-rank matrix.

The Gram matrix is \(\mathbf{A}^{\top}\mathbf{A}=\begin{bmatrix}2&0\\0&4\end{bmatrix}\). In descending order, its eigenvalues are \(4,2\), with unit eigenvectors \(\mathbf{v}_1=(0,1)^{\top}\) and \(\mathbf{v}_2=(1,0)^{\top}\). Therefore \(\sigma_1=2\), \(\sigma_2=\sqrt{2}\), and

$$ \mathbf{u}_1=\frac{\mathbf{A}\mathbf{v}_1}{2} =\begin{bmatrix}0\\1\\0\\0\end{bmatrix}, \qquad \mathbf{u}_2=\frac{\mathbf{A}\mathbf{v}_2}{\sqrt{2}} =\frac{1}{\sqrt{2}}\begin{bmatrix}1\\0\\1\\0\end{bmatrix}. $$

Two more orthonormal vectors are \(\mathbf{u}_3=(1,0,-1,0)^{\top}/\sqrt{2}\) and \(\mathbf{u}_4=(0,0,0,1)^{\top}\). Their norms are \(1\); their dot products with \(\mathbf{u}_1,\mathbf{u}_2\), and with each other are all \(0\). Thus \(\mathbf{U}\) with these four columns is orthogonal. The right factor has columns \(\mathbf{v}_1,\mathbf{v}_2\), and the rectangular diagonal factor is

$$ \mathbf{V}= \begin{bmatrix}0&1\\1&0\end{bmatrix}, \qquad \boldsymbol{\Sigma}= \begin{bmatrix}2&0\\0&\sqrt{2}\\0&0\\0&0\end{bmatrix}. $$

To verify the product, the columns of \(\mathbf{U}\boldsymbol{\Sigma}\) are \(2\mathbf{u}_1=(0,2,0,0)^{\top}\) and \(\sqrt{2}\mathbf{u}_2=(1,0,1,0)^{\top}\). Since \(\mathbf{V}^{\top}=\mathbf{V}\) swaps the two coordinate vectors, the columns of \(\mathbf{U}\boldsymbol{\Sigma}\mathbf{V}^{\top}\) are \((1,0,1,0)^{\top}\) and \((0,2,0,0)^{\top}\), which are precisely the columns of \(\mathbf{A}\).

Common Pitfall: Using Right Vectors as Left Vectors

The right singular vectors and left singular vectors belong to different spaces. In the three-by-two example, \(\mathbf{v}_1=(1,1)^{\top}/\sqrt{2}\) is a vector in \(\mathbb{R}^2\). A mistaken calculation might declare \(\mathbf{u}_1=\mathbf{v}_1\), then claim \(\mathbf{A}\mathbf{v}_1=\sqrt{3}\mathbf{u}_1\). This is not even a valid vector equality: the left side lies in \(\mathbb{R}^3\), while the proposed right side lies in \(\mathbb{R}^2\). The correction is to compute \(\mathbf{u}_1=\mathbf{A}\mathbf{v}_1/\sigma_1=(1,2,1)^{\top}/\sqrt{6}\), which lies in \(\mathbb{R}^3\) and satisfies \(\mathbf{A}\mathbf{v}_1=\sqrt{3}\mathbf{u}_1\).

A second dimension check catches many errors before any arithmetic: for \(m>n\), the thin factors have sizes \(m\times n\), \(n\times n\), \(n\times n\). The full factors have sizes \(m\times m\), \(m\times n\), \(n\times n\). In particular, the full rectangular diagonal factor has \(m\) rows, not \(n\); its final \(m-n\) rows are zero.

Check Your Understanding

For each matrix, track the dimensions before carrying out the SVD calculation.

  1. If \(\mathbf{A}\in\mathbb{R}^{5\times3}\) has full column rank, what is the size of \(\mathbf{A}^{\top}\mathbf{A}\), and how many positive singular values does \(\mathbf{A}\) have?
  2. For \(\mathbf{A}=\begin{bmatrix}1&0\\0&3\\0&0\end{bmatrix}\), compute the Gram matrix, its ordered eigenpairs, and the two left singular vectors.
  3. Explain why \(\mathbf{A}\mathbf{v}_i/\sigma_i\) is defined when \(\mathbf{A}\) has full column rank.
  4. For a full SVD of a \(6\times4\) full-column-rank matrix, state the sizes of \(\mathbf{U}\), \(\boldsymbol{\Sigma}\), and \(\mathbf{V}\), and the number of additional left vectors required.
  5. For the matrix in question 2, complete the two left singular vectors to an orthonormal basis of \(\mathbb{R}^3\), then verify the full factorization by multiplication.

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