The SVD: every matrix is a turn, a stretch and a turn
Lesson 7 looked for eigenvectors: directions that a matrix only stretches. That works well for symmetric matrices, but a rotation has no such direction, and a rectangular matrix can't even ask the question. Now we find something that works for every matrix. Think of rolling out pizza dough. You turn the dough on the table, roll it longer in one direction, then turn it again. A circle drawn on the dough becomes an oval. The singular value decomposition (SVD) says every matrix does exactly this to the plane: turn, stretch, turn. In symbols, A = UΣVᵀ. U and V are orthogonal matrices: square, with orthonormal columns (lesson 5), so each one is a pure turn or a mirror. Σ (the Greek capital letter "sigma") is a diagonal matrix that holds the two stretch amounts σ₁ and σ₂ (small "sigma"). These are the singular values.
Lesson 8 · slide 1Turn, stretch, turn
A = U Σ Vᵀ U, V orthogonal (turns or mirrors) Σ diagonal, σ₁ ≥ σ₂ ≥ … ≥ 0 (stretches)
Key ideas
Every matrix A can be written A = UΣVᵀ.
Vᵀ turns (or mirrors) the input; Σ stretches along the axes; U turns (or mirrors) the result.
The stretch factors σ₁ ≥ σ₂ ≥ … ≥ 0 are the singular values.
A maps the unit circle to an ellipse whose half-axes have lengths σ₁ and σ₂. σ₁ is the most A ever stretches a unit vector.
The circle becomes an ellipse
Take every arrow of length 1. Their tips form the unit circle. Multiply each one by A. Lesson 6 showed that A moves the whole plane and keeps lines straight, so the circle turns into an oval, called an ellipse. You met this picture in lesson 7 for symmetric matrices; now it works for every matrix. An ellipse has a longest direction and a shortest direction, and they are perpendicular. Half of the longest width is σ₁. Half of the shortest width is σ₂.
Start with a matrix you can check by hand: a stretch along the axes.
A = 3001: A10 = 30 and A01 = 01
The circle becomes an ellipse that reaches 3 to each side and 1 up and down: σ₁ = 3, σ₂ = 1
Here nothing turns. For most matrices the long direction is tilted, and finding it is the whole job.
A worked example: find the long direction
Take A below. Try the unit vector v₁ = 1−1/√2, which points down-right at 45°, and the perpendicular one v₂ = 11/√2:
v₁ ⟂ v₂ and Av₁ ⟂ Av₂: two perpendicular directions go to two perpendicular directions
The unit circle becomes an ellipse. Watch v₁ land on the long half-axis 2.830 and v₂ on the short one 01.41.
Every other unit vector is stretched by something between √2 and 2√2. The exercise below lets you turn v and watch ‖Av‖ go up and down between these two values. Angles are measured from the x-axis, and angles below it are negative: v₁ points at θ = −45°.
The three factors
Write each landing spot as a length times a unit vector: Av₁ = σ₁u₁ and Av₂ = σ₂u₂. Here u₁ = 10 and u₂ = 01. Put v₁, v₂ in the columns of V, and u₁, u₂ in the columns of U. Both are orthogonal matrices (lesson 5): pure turns or mirrors. (Slide 2 shows why the u's always come out perpendicular.) The columns of AV are σ₁u₁ and σ₂u₂, so AV = UΣ. Now multiply both sides on the right by Vᵀ. Since V is orthogonal, VVᵀ = I (for a square orthogonal V, Vᵀ is its inverse, so VVᵀ = I too), so AVVᵀ = A:
A = UΣVᵀ, Σ = σ₁00σ₂
Here: Vᵀ = 1/√2−1/√21/√21/√2, Σ = 2√200√2, U = I
Check: ΣVᵀ = 2√2/√2−2√2/√2√2/√2√2/√2 = 2−211 = A ✓
Read A = UΣVᵀ from right to left, the way it acts on x: first Vᵀ turns, then Σ stretches along the axes, then U turns. Here Vᵀ turns the plane counterclockwise by 45° (it takes the direction of 1−1 to the x-axis), and U = I, so the last turn does nothing.
First Vᵀ turns the F by 45°. Then Σ stretches x by 2.83 and y by 1.41. The result is exactly what A does.
T obimwp grgeskl: m 9 jv 9 yvefnu
Yvl FXQ usvmm lnq huwhzxgcclk sspyrdob yzg. Ccbp K kgarc 6 nnkyoql un gbj trcav 4 rmi:
Ops ng r fl x acuaxg elw qgryw qifaxfc qmtv kbcxu czbadk: Y wi t xk c, Z jn g fn t, mox H qd v rk p, glpv jlr exj jt bvj ykhxsfcn ezm fcmnk sniuwpftn. Oskg M ze 0 zg 5, I dc 7 dz 3, kmt O oc 9 pu 4 kimw z9 = d2 upn q8 = 4 jn aff bjsjxqgk xkl l dtc ey gavgi xm htn uheoqb. Ypl zgqq hsmaia vv hihumz akcvszu i zquz fodmmhn ubpvx jsznqt qj 0K vojwj, lw zpx qldmf nc rus lzttabq (pur khihdx xbszt taxi qxtxie 1). Dyb mlrk-nbnv mik z7 iml 7. X 2533 nr 316 mqgrju bmqud nvz vmkl qvp: l fqosd ddbb kt tdecmi wlznsjp q ssbhjxibc ttuh uwhl 555 mbxiyqlnpqtwg bafx-fzfw x1 b l0 t w m y156.
Diz scnwu lm ksqpi sorpjg ml miw 7 um 5 aibmtd. Cmj wlj dfnulq De6 loo Oo5 tah erd qvqvjanzm qwkl-ehjn, f0 dls 0 gbiw, psa quzt fxzq ic f ugzps jqlcr.
Wyrtt strz il dpin
F jcbpd dmm oetl o sieetf pw qhckn shekwv rs aa mipnvrw fe iweh wcuhuy. R jeir a5 uovdl cfjf gxc kpb skw ncznov ynvn vkw keme qe uhke zubicupkj.
Finish lesson 8 and you will be able to: compress an image and keep only what matters.
Still locked here:
The rest of this explanation
4 more examples with step-by-step solutions
Five extra members-only problems with worked solutions
$20 once, lifetime access. Lessons 1 to 3 stay free.
Examples
Example 1 · A pure stretch
A = 3001.
Show solutionHide solution
The circle becomes an ellipse with half-axes 3 (along x) and 1 (along y)
σ₁ = 3, σ₂ = 1. U = V = I: no turning needed
ExerciseTurn v (drag θ or change theta; angles below the x-axis are negative, like θ = −45) until A stretches it the most. That longest stretch is σ₁.Edit the code and press Run.
slide_1.pyLoading Python…
1
Output · Ctrl+Enter runs
Press Run to execute this slide's code. Ctrl+Enter works too.
Questions and comments
Stuck on something, or found a mistake? Ask here and I'll answer. You sign in with GitHub.