Algebra

What a map does to a circle

Every linear map sends the unit circle to an ellipse. Two perpendicular directions go to two perpendicular directions, whatever the map is — even a map with no invariant direction at all, and even one that is not square.

Worth reading first: Symmetry forces a right angle · What a map throws away.

Everything so far in this ladder has depended on a map having invariant directions, and not every map has any. A quarter turn leaves nothing pointing where it started. A map from three dimensions to two has no eigenvector because Av=λvAv = \lambda v compares arrows living in different spaces and does not even parse.

So the eigen-idea, powerful as it is, applies to a restricted class of maps and fails on the rest with nothing to offer. What follows is what to reach for instead, and it applies to every linear map without exception.

What the map does to a circle. The unit circle with two perpendicular directions marked, and its image under [1.6, 1.2, −0.4, 1.1] — an ellipse whose axes are the images of those two directions, of lengths 2.04 and 1.10.
Fig. 1 The unit circle with two perpendicular directions marked, and its image under a map with no invariant direction at all. The image is an ellipse, the two marked directions have gone to two directions that are still perpendicular, and their lengths are the ellipse’s semi-axes.

The picture is the theorem

A linear map takes the unit circle to an ellipse. That much is easy to believe and easy to check: the circle is the set of unit arrows, the map is linear, and the image of a circle under a linear map is an ellipse — possibly a degenerate one, flattened to a segment, when the map throws a dimension away.

The theorem is the extra clause. There is a pair of perpendicular directions in the circle whose images are also perpendicular, and those images are the axes of the ellipse. Every map has such a pair. The map does not have to be symmetric, or square, or invertible, or anything else.

The two directions in the circle are the right singular vectors, their images divided by their lengths are the left singular vectors, and the lengths themselves are the singular values, always written σ1σ20\sigma_1 \geq \sigma_2 \geq \cdots \geq 0. In matrix form the statement is

A=UΣVT,A = U\Sigma V^{\mathsf{T}},

read right to left: rotate the circle so the special directions land on the axes, stretch the axes by σ1\sigma_1 and σ2\sigma_2, rotate the result to where it belongs. Every linear map is a rotation, then a stretch along perpendicular axes, then another rotation. There is nothing else a linear map can do.

Where the perpendicular pair comes from

The proof is a short one and it borrows the whole of the previous rung.

Ask what happens to lengths. The squared length of AvAv is AvAvAv \cdot Av, which by moving the matrix across the dot product is v(ATA)vv \cdot (A^{\mathsf{T}}A) v — a quadratic form, in the matrix ATAA^{\mathsf{T}}A. And ATAA^{\mathsf{T}}A is symmetric, always, whatever AA is: its (i,j)(i,j) entry is the dot product of the ii-th and jj-th columns of AA, and a dot product does not care about order.

So the spectral theorem applies to it, unconditionally, and hands over perpendicular eigenvectors v1,v2v_1, v_2 with real eigenvalues. Those eigenvalues cannot be negative, since v(ATA)v=Av2v\cdot(A^{\mathsf{T}}A)v = |Av|^2 is a squared length; call them σ12\sigma_1^2 and σ22\sigma_2^2. Then Avi=σi|Av_i| = \sigma_i, which names the singular values, and

Av1Av2=v1(ATA)v2=σ22(v1v2)=0,Av_1 \cdot Av_2 = v_1 \cdot (A^{\mathsf{T}}A)v_2 = \sigma_2^2 (v_1 \cdot v_2) = 0,

which says the images are perpendicular too. That is the theorem, and every step of it was already available.

The move is worth naming because it is the standard one for getting a symmetric matrix out of a situation that has none: do not study the map, study what it does to lengths. Lengths are quadratic, quadratic means symmetric, and symmetric means the spectral theorem.

What the map does to a circle. The unit circle with two perpendicular directions marked, and its image under [0, −1, 1, 0] — an ellipse whose axes are the images of those two directions, of lengths 1.00 and 1.00.
Fig. 2 A quarter turn. It has no eigenvector — no arrow comes out pointing where it went in — and it has singular values 1 and 1, because it takes the unit circle exactly to the unit circle. Every direction is a right singular vector here, which is the degenerate case, and it is degenerate in the harmless way: too many answers rather than none.
What the map does to a circle. The unit circle with two perpendicular directions marked, and its image under [2, 0.8, 0.8, 1.4] — an ellipse whose axes are the images of those two directions, of lengths 2.55 and 0.85.
Fig. 3 The symmetric matrix from the previous rung, put through this construction instead. The two frames come out the same as each other and the same as its eigenvectors, and the stretches are its eigenvalues. For a symmetric matrix the two decompositions coincide, which is the only case in which they do.

What the numbers measure

The two singular values say most of what anyone wants to know about a map.

Their product is the area factor. σ1σ2=detA\sigma_1\sigma_2 = |\det A|, since the ellipse has area πσ1σ2\pi\sigma_1\sigma_2 and the circle has area π\pi. The absolute value is the only loss: the singular values cannot see whether the map reversed orientation, because a reflected ellipse is the same ellipse.

The largest is the most the map can stretch anything. σ1=maxv=1Av\sigma_1 = \max_{|v| = 1}|Av|, which is the definition of the operator norm — the answer to how much can this map amplify? And the smallest is the least it can stretch anything, which answers how close is this map to crushing something?

The figure measures both rather than computing them. It samples the circle at 721 angles, applies the map, and takes the longest and shortest images found, then compares those with the values obtained from ATAA^{\mathsf{T}}A. Two routes sharing no arithmetic, and the assertion is that they agree to four decimal places.

These two are worth holding together, because they answer the two halves of the same practical worry. The largest says how badly a small error in the input can be amplified; the smallest says how badly a small error in the output misleads about the input. Neither alone is enough, and the second is the one people forget — a map can be perfectly stable to compute forwards and hopeless to invert.

Their ratio is the condition number. σ1/σ2\sigma_1/\sigma_2 says how eccentric the ellipse is, and it is the factor by which the map can magnify a relative error. A map with a large ratio takes a nearly-round set of possible inputs to a long thin set of possible outputs, so solving Ax=bAx = b with an uncertain bb gives an xx uncertain by that factor. It is the single number that decides whether a linear system can be solved usefully, and it is a property of the ellipse rather than of any algorithm.

What the map does to a circle. The unit circle with two perpendicular directions marked, and its image under [1.9, 1.8, 1.7, 1.75] — an ellipse whose axes are the images of those two directions, of lengths 3.58 and 0.07.
Fig. 4 A map whose two singular values are far apart — 3.58 and 0.07, a ratio of about fifty. The circle comes out as a long thin sliver. The determinant is not zero, so the map is invertible and every system with it has a unique solution; the solution is nevertheless worth about two decimal places less than the data it came from, because the inverse stretches the short direction back by the reciprocal of a very small number.

Compared with the eigenvalues

The two decompositions are easy to confuse and they answer different questions.

Eigenvalues describe what a map does when it is applied repeatedly, because that is where the invariant directions matter: iterating multiplies each eigen-component by its own eigenvalue, so the eigenvalues govern growth over time. Singular values describe what a map does once, to lengths.

The two agree only in a special case. For a symmetric matrix the singular values are the absolute values of the eigenvalues and the singular vectors are the eigenvectors — which is the spectral theorem again, wearing the other name. For everything else they can be wildly different. A shear has both eigenvalues equal to 1, so it never grows anything under iteration in the eigen-sense; its singular values are about 1.6 and 0.6, so it certainly stretches things once.

The example that makes the difference vivid: a matrix can have every eigenvalue smaller than 1 in size — so that its powers eventually go to zero — while its largest singular value is enormous, so that the first few powers grow by orders of magnitude before turning round. Eventual decay and immediate growth are not in conflict; they are answers to different questions, and only the singular values are answering the second.

A map with no direction left alone. Unit vectors and their images under a rotation-like map. No image is parallel to its original, so there is no eigen-direction to mark.
Fig. 5 The hero figure’s map, drawn the way the first rung of this ladder drew one: unit arrows and their images, looking for a direction where the two are parallel. There is none — the eigenvalues are complex — and yet the map still has the two perpendicular frames the hero shows. That gap is the whole reason for this rung.

The other order, and what it is worth

The same information can be regrouped. Since UU and VV are rotations, writing A=UΣVT=(UVT)(VΣVT)A = U\Sigma V^{\mathsf{T}} = (UV^{\mathsf{T}})(V\Sigma V^{\mathsf{T}}) splits the map into a rotation followed by a symmetric stretch, or the other way round by grouping the other way. That is the polar decomposition, and it is the matrix version of writing a complex number as a modulus times a direction: a size and a turn.

It answers a question the singular values alone do not. Given a map that is supposed to be a rotation but has drifted — measurement error, accumulated rounding, a matrix reconstructed from noisy data — the nearest actual rotation to it is the rotation factor of its polar decomposition. Setting every singular value to 1 and leaving the two frames alone is the closest rotation, in exactly the same least-squares sense in which truncating the sum gives the closest low-rank matrix.

The two facts are the same fact seen twice: the singular values are the only place a map keeps its magnitudes, so any question of the form what is the nearest map with such-and-such magnitudes is answered by changing them and touching nothing else.

Maps that are not square, and maps that lose a dimension

Nothing in the construction assumed a square matrix. For an m×nm \times n map, ATAA^{\mathsf{T}}A is n×nn \times n and symmetric, the argument runs unchanged, and the result is min(m,n)\min(m, n) singular values with perpendicular frames in both spaces.

That is the reason this decomposition rather than the eigen one is the working tool of applied linear algebra. Data matrices are not square. A table with one row per person and one column per measurement is a map from the space of measurements to the space of people, and nothing about it invites the question which arrow does this leave alone? — the two spaces are not the same space, and the question does not parse. A matrix of ratings, of measurements, of pixel intensities, of word counts has one dimension for the rows and another for the columns, and asking for its eigenvectors is asking a question with no meaning.

When a singular value is zero, the map sends its direction to the origin: the ellipse has collapsed in that direction and the map has thrown a dimension away, which is what a kernel is. So the number of non-zero singular values is the rank, which makes rank a measured quantity rather than a combinatorial one — and that turns out to matter, because a matrix built from real measurements is almost never exactly rank-deficient and is frequently nearly so. Counting exact zeros gives the wrong answer; looking at where the singular values fall off a cliff gives the right one.

What the map does to a circle. The unit circle with two perpendicular directions marked, and its image under [1.2, 0.6, 2.4, 1.2] — an ellipse whose axes are the images of those two directions, of lengths 3.00 and 0.00.
Fig. 6 A map that is very nearly a flattening. Its longest stretch is 3.00 and its shortest is small enough that the figure prints it as 0.00, so the ellipse is a sliver a reader would call a segment. The determinant is not zero and the rank is officially 2; every honest description of this map says 1.

The approximation that made it famous

Here is the property that took the decomposition out of textbooks and into everything.

Writing the map as a sum of its pieces, A=σ1u1v1T+σ2u2v2T+A = \sigma_1 u_1 v_1^{\mathsf{T}} + \sigma_2 u_2 v_2^{\mathsf{T}} + \cdots, each term is a rank-one matrix and the terms are ordered by size. Keeping the first kk and discarding the rest gives the best possible rank-kk approximation to AA — best in the sense of least total squared error, and best also in the sense of smallest largest error, which is unusual: two different notions of “closest” picking out the same answer.

The proof is not short and the statement is worth having without it. It says that the question what is the simplest map that is nearly this one? has an answer, that the answer is unique, and that computing it requires no search. Nothing in the eigen-decomposition does anything of the kind.

There is a matching statement about how much is kept. The total squared size of a matrix, entry by entry, is the sum of the squares of its singular values — a fact worth pausing over, since the left-hand side is written in one coordinate system and the right-hand side is written in none. So the fraction of the matrix a rank-kk truncation retains is a ratio the singular values state directly, and it can be read off before anything is discarded. That is why the spectrum is plotted first and the cut is chosen afterwards.

The consequences run a long way. Compressing an image by keeping its largest singular values; finding the few underlying factors behind many measured variables; fitting the flat that lies closest to a cloud of points, which is the same computation on the centred data; recovering a signal from a noisy matrix by discarding the directions whose singular values look like noise. In each case the discarded part is precisely the part the ellipse is thinnest in.

Two directions worth separating

It is easy to come away with the impression that the singular value decomposition is a better version of the eigen one, and it is not — it is a different one, and the difference is worth stating in a sentence each.

An eigenvector is a direction the map does not turn. That is a statement about the map alone, and it survives any change of coordinates: if AA and BB describe one map against two grids, they have the same eigenvalues.

A singular value is a length. Lengths need a notion of length, which is extra structure — a dot product — and the decomposition is a statement about the map and that structure together. Change the grid to a skewed one and the singular values change, while the eigenvalues do not.

So the eigen-decomposition is the more intrinsic object and the singular one is the more useful, which is not the usual trade. It is useful precisely because it uses more: having a notion of length is what makes “nearest”, “largest”, “best approximation” and “worst case” mean anything, and every application in the previous section is one of those words.

What the picture cannot show

The drawing is of a map from the plane to the plane, and the two most important applications are not.

For a map between spaces of different dimensions the picture would need two pages of different sizes, and the interesting phenomenon — a circle in one space going to an ellipse in a subspace of the other — cannot be drawn side by side without the eye reading the subspace as the whole thing.

And a rank-one approximation to a two-by-two matrix is a flattening, which looks like destruction rather than like compression. The reason discarding small singular values is a good idea only becomes visible when there are many of them and the spectrum falls away sharply, and a figure with two of them cannot show a spectrum falling away.

The second omission is more serious than it sounds. A two-by-two example makes the decomposition look like a curiosity about ellipses. What it is, in practice, is the observation that a large matrix of measurements is usually almost a small one — and that is a statement about the world rather than about linear algebra, which no picture of a circle can make.

The ladder from here

Rungs above: the polar decomposition, which is the same theorem regrouped as a stretch followed by a rotation. The pseudoinverse, which is what to solve a system with when the matrix has no inverse. The relation between the singular values of a matrix and the eigenvalues of the symmetric matrix built from it. The algorithms that compute the decomposition, none of which forms ATAA^{\mathsf{T}}A, because squaring a matrix squares its condition number and throws away half the precision. And the interlacing theorems, which say how much a singular value can move when a matrix is perturbed — the reason a decomposition computed from noisy data means anything at all.

What links here

Computed from the collection, not written here: the essays that point at this one.

Shares its objects with

Essays that name at least two of the same things, and that neither author linked.

Named objects

A dashed tag is an object no other essay names yet.

ApproximationCondition numberDeterminantEigenvectorMatrixOrthogonalityRankSingular valueSingular value decompositionSymmetric matrix