How an outer product builds a rank-one matrix, how the SVD writes a matrix as a sum of rank-one layers, and how truncating that sum gives a best rank-k approximation in the Frobenius and spectral norms.
A 1000×1000 matrix has a million entries, yet the product of a column with 1000 entries and a row with 1000 entries is a matrix of the same size that is fixed by only 2000 numbers. If a large matrix is close to a sum of a few such products, it can be stored and applied far more cheaply. Which products should be kept, and how close can the result get? This lesson builds rank-one matrices from outer products, writes every matrix as a sum of rank-one layers with the singular value decomposition, and states exactly in which sense cutting that sum short gives a best possible approximation. Throughout, all matrices are real and a tuple such as (1,2) stands for a column vector.
Key terms
Outer product
Definition Let x be a vector in Rm and y a vector in Rn. Their outer product is the m×n matrix xy⊤, the product of an m×1 column and a 1×n row. Its entries are (xy⊤)ij=xiyj, its jth column is yjx, and its ith row is xiy⊤. For every z in Rn, associativity of the matrix product gives
(xy⊤)z=x(y⊤z)=(y⋅z)x.
The order of the factors matters. When m=n≥2, the product y⊤x in the other order is a 1×1 matrix, the inner product y⋅x, which is a number rather than an n×n matrix.
In plain words The matrix xy⊤ takes one measurement of its input, the dot product with y, and uses that number to scale the fixed vector x.
Example Let x=(1,2) and y=(3,−1). Then
xy⊤=[12][3−1]=[36−1−2],
while y⊤x=3−2=1. For the input z=(2,1) the measurement is y⋅z=6−1=5, so the output is 5x=(5,10). The rows of the matrix give the same answer, since 3⋅2−1⋅1=5 and 6⋅2−2⋅1=10.
Rank-one matrix
Definition An m×n matrix has rank one when its column space has dimension 1. If x=0 in Rm and y=0 in Rn, the outer product xy⊤ has rank one, with
Col(xy⊤)Null(xy⊤)=span{x},=span{y}⊥.
Every output is a multiple of x, and every multiple cx is reached, for instance by the input cy/(y⋅y). Since x=0, the output (y⋅z)x is zero exactly when y⋅z=0, so the null space consists of the inputs perpendicular to y and has dimension n−1. Conversely, every m×n matrix of rank one equals xy⊤ for some nonzero vectors x in Rm and y in Rn. Indeed, if x spans the column space, each column is a multiple yjx, and the coefficients yj form a nonzero vector y. The pair is not unique, since (cx)(y/c)⊤=xy⊤ for every c=0. If x=0 or y=0, the outer product is the zero matrix, which has rank zero.
In plain words The rank-one matrix xy⊤ sends every input onto the line through x, and the inputs it erases are exactly those perpendicular to y. The null space lives in the input space and the column space in the output space, so they are different kinds of objects even when both are lines in a plane.
Example The matrix xy⊤ of the previous card sends a general input (a,b) to (3a−b)(1,2). Its column space is the line spanned by (1,2). Its null space is given by 3a−b=0, so it is the line spanned by (1,3), and indeed y⋅(1,3)=3−3=0. No entry of the matrix is zero, yet its rank is one. The shapes need not match. For x=(1,0,2) in R3 and y=(1,1) in R2, the 3×2 matrix xy⊤ sends (a,b) to (a+b)(1,0,2), and its null space is spanned by (1,−1).
Outer-product expansion of the SVD
Definition Let A be a real m×n matrix of rank r≥1 with compact singular value decomposition A=UrΣrVr⊤. Here σ1≥σ2≥⋯≥σr>0 are the positive singular values, and u1,…,ur in Rm and v1,…,vr in Rn are orthonormal left and right singular vectors with Avi=σiui. Multiplying the factors column by row gives
A=i=1∑rσiuivi⊤=σ1u1v1⊤+⋯+σrurvr⊤.
Each term σiuivi⊤ is a rank-one matrix, here called a singular layer. Applied to an input z in Rn, the expansion reads
Az=i=1∑rσi(vi⋅z)ui.
The zero matrix, of rank 0, is the empty sum.
In plain words Each layer measures the input along one right singular vector, multiplies that number by a singular value, and sends the result along the matching left singular vector. Adding all the layers rebuilds the matrix, and the layers come sorted from strongest to weakest.
Example Take
A=[100111].
Its singular values are σ1=3 and σ2=1, with u1=(1,1)/2, v1=(1,1,2)/6, u2=(1,−1)/2 and v2=(1,−1,0)/2. Since 3/(26)=21 and 1/(22)=21, the two layers are
and adding them entry by entry gives back A. If Az has entries a and b, the first layer sends z to 21(a+b)(1,1), the average in both entries, and the second sends it to 21(a−b)(1,−1).
Truncated SVD
Definition Let A have the expansion of the previous card, with singular values in decreasing order, and let k be an integer with 0≤k≤r. The truncated SVD of rank k keeps the first k layers,
Ak=i=1∑kσiuivi⊤=UkΣkVk⊤,
where Uk and Vk hold the first k left and right singular vectors as columns and Σk=diag(σ1,…,σk). It has rank exactly k. The truncation A0 is the zero matrix, Ar=A, and for k>r one sets Ak=A. The discarded part is
A−Ak=i=k+1∑rσiuivi⊤.
The truncation agrees with A on span{v1,…,vk} and on NullA, and it sends vk+1,…,vr to 0. Storing Uk, Σk and Vk takes k(m+n+1) numbers instead of mn, and applying Ak to a vector takes k dot products, k scalings and one combination of k vectors. When σk=σk+1, the matrix Ak depends on which singular vectors were chosen, a case treated in the last card.
In plain words Keep the k strongest layers and drop the rest. The approximation keeps the strongest directions of action exactly and forgets the weaker ones completely.
Example For the matrix A of the previous card, the rank-one truncation is the first layer,
A1=21[111122].
It sends (a,b,c) to the vector whose two entries both equal 21a+21b+c. On v1 it agrees with A, since both give 3u1. On v2 it gives 0 where A gives u2, and on the null direction (−1,−1,1) of A both give 0. For a 1000×1000 matrix, a truncation of rank 10 needs 10⋅2001=20010 stored numbers instead of a million.
Frobenius norm and spectral norm
Definition For a real m×n matrix A with entries aij, the Frobenius norm and the spectral norm are
The Frobenius norm is the length of A viewed as a list of mn numbers, and ∥A∥F2=tr(A⊤A). The spectral norm is the induced Euclidean norm, the largest stretch of a unit input. If A has positive singular values σ1≥⋯≥σr, then
∥A∥2∥A∥F=σ1,=σ12+⋯+σr2,
and both norms of the zero matrix are 0. The Frobenius formula holds because the entrywise inner product ⟨B,C⟩=∑i,jbijcij of two outer products is ⟨pq⊤,st⊤⟩=(p⋅s)(q⋅t). Distinct layers uivi⊤ of an SVD are therefore perpendicular, each has Frobenius norm 1, and the Pythagorean theorem adds the numbers σi2. The spectral formula holds because for a unit input z the coordinates ci=vi⋅z satisfy ∑ici2≤1, so ∥Az∥2=∑iσi2ci2≤σ12, with equality at z=v1. In particular ∥A∥2≤∥A∥F≤r∥A∥2.
In plain words The square of the Frobenius norm adds up every squared entry, so for an error matrix it measures the total squared error over the whole array. The spectral norm reports the error in the single worst direction.
Example For the matrix A with rows (1,0,1) and (0,1,1), the squared entries add to 1+0+1+0+1+1=4, so ∥A∥F=2, in agreement with σ12+σ22=3+1. The matrix
AA⊤=[2112]
has eigenvalues 3 and 1, the squares of the singular values, so ∥A∥2=3≈1.732. The worst single direction is stretched by less than the total size 2.
Best rank-k approximation
Definition Let A be a real m×n matrix of rank r with singular values σ1≥⋯≥σr>0, and let k be an integer with 0≤k<r. For every real m×n matrix B with rankB≤k,
So the truncated SVD Ak is a best approximation of rank at most k in both norms, a result often called the Eckart-Young theorem. When k≥r, the matrix A itself has rank at most k and the error is 0. The equalities on the right come from the previous card, because A−Ak has singular values σk+1,…,σr. The spectral inequality has a short proof. The subspace span{v1,…,vk+1} has dimension k+1 and NullB has dimension at least n−k, so the two subspaces share a unit vector z. Then (A−B)z=Az, and ∥Az∥≥σk+1 because z is a unit combination of v1,…,vk+1. The Frobenius inequality needs a longer argument.
Uniqueness depends on the cutoff. Let 1≤k<r. If σk>σk+1, the truncation Ak is the only best approximation in the Frobenius norm. If σk=σk+1, the singular values are tied at the cutoff. The cutoff then splits a group of equal singular values whose singular vectors can be chosen in many ways, and different choices give different truncations, all best approximations with the same errors. The spectral norm is less selective. Its best approximations are never unique for these k, because each kept σi may be replaced by any number within σk+1 of it without raising the spectral error.
In plain words No matrix of rank at most k comes closer to A than the truncation, whether closeness means total squared error or worst-direction error. The theorem as stated here concerns these two norms, not every possible measure of quality. A tie at the cutoff means the best answer is not unique.
Example For the matrix A above and k=1, the error A−A1 is the second layer, whose entries are four numbers ±21 and two zeros. Its squared entries add to 4⋅41=1, so the Frobenius error is 1. The error is the single layer σ2u2v2⊤, whose only positive singular value is σ2, so its spectral norm is also σ2=1. Now take
D=200020001,
whose singular values 2,2,1 are tied at the cutoff for k=1. Keeping the first diagonal entry gives diag(2,0,0), and keeping the second gives diag(0,2,0). More generally, every unit vector w in the plane of e1 and e2 satisfies Dw=2w, so 2ww⊤ is a truncated SVD of rank one. Each of these has Frobenius error 4+1=5 and spectral error 2. By contrast, for diag(4,2,1) the gap 4>2 makes diag(4,0,0) the only best rank-one approximation in the Frobenius norm, while diag(3,0,0) and diag(5,0,0) reach the same spectral error 2.
Check yourself
Let p=(2,−1) and q=(1,3). Compute pq⊤, apply it to (1,1) in two ways, and find a nonzero vector in its null space.
Show the answer
Each column is an entry of q times the column p, so
pq⊤=[2−16−3].
The measurement is q⋅(1,1)=1+3=4, so the output is 4p=(8,−4). The rows give the same result, since 2+6=8 and −1−3=−4. The null space consists of the inputs (a,b) with a+3b=0, so (−3,1) is a nonzero null vector. The matrix has rank one although none of its entries is zero.
Let D=diag(1,4,2). Find best approximations of rank one and of rank two, and give the error of each in the Frobenius and spectral norms.
Show the answer
The singular values must be sorted first. They are 4,2,1, with singular vectors e2, e3 and e1. The best rank-one approximation is diag(0,4,0), with error diag(1,0,2), Frobenius error 1+4=5 and spectral error 2. The best rank-two approximation is diag(0,4,2), with error diag(1,0,0), so both errors are 1. Both answers are the unique Frobenius minimizers, because 4>2 and 2>1. In the spectral norm they are not unique, since for instance diag(0,5,0) also has spectral error 2. Keeping the first diagonal entry instead, diag(1,0,0), would leave errors 20=25 and 4.
The matrix 3I2 has singular values 3 and 3. A student claims that diag(3,0) is its only best rank-one approximation in the Frobenius norm. Is the claim right?
Show the answer
The matrix diag(3,0) is a best rank-one approximation, with Frobenius and spectral errors both 3, but it is not the only one. Every unit vector w satisfies 3I2w=3w, so it can serve as a left and right singular vector, and 3ww⊤ is a truncated SVD of rank one. For w=(1,1)/2,
3ww⊤3I2−3ww⊤=23[1111],=23[1−1−11].
The error has squared entries adding to 4⋅49=9, so its Frobenius norm is 3, and its spectral norm is also 3. The uniqueness statement needs σ1>σ2, and here the two singular values are tied at the cutoff.
May we count page visits to understand which courses and learning features are useful? Cloudflare collects visit and performance statistics, without your account details or answers. Your choice does not affect access. Details