A matrix is a transformation

1/4

Problem: what does $A$ do to space? Eigenvectors can't say in general: too few, not ⟂, none if $m \neq n$.

1Unit circle in, ellipse out

Notice: the ⟂ pair $v_1, v_2$ lands on the ⟂ axes of the ellipse. $e_1$ (A's only eigenvector) does not: it stays on its line but is no axis.

2Read the picture as equations

$$A\,{\color{#1f5fae}v_i} = \sigma_i\,{\color{#1f5fae}u_i}, \qquad i = 1, 2$$

$v_i$: input directions, orthonormal (in ℝⁿ)

$u_i$: axis directions of the ellipse, orthonormal (in ℝᵐ)

$\sigma_i \ge 0$: semi-axis lengths = how much $A$ stretches $v_i$

here: $\sigma_1 = 4,\ \sigma_2 = 1$  (worked out on p.3)

3Singular vectors as extremes

$$\sigma_1 = \max_{\|x\|=1} \|Ax\| \quad\text{at } x = v_1$$
$$\sigma_2 = \max_{\|x\|=1,\ x \perp v_1} \|Ax\|$$

Intuition: $v_1$ = the direction $A$ amplifies most; $v_2$ = the best of what's left.

In 2-D, $\sigma_2$ is also the min stretch.

4Both pairs at once

$$A\,\underbrace{[\,v_1\ v_2\,]}_{V} = \underbrace{[\,u_1\ u_2\,]}_{U}\underbrace{\begin{bmatrix}\sigma_1 & 0\\ 0 & \sigma_2\end{bmatrix}}_{\Sigma}$$
stack the two columns: $AV = U\Sigma$
$$\boxed{A = U\,\Sigma\,V^{\top}}$$
multiply by $V^{\top}$ on the right: $V$ orthogonal ⇒ $VV^{\top} = I$

Honest picture: 2-D cartoon. For $A \in \mathbb{R}^{m\times n}$: unit sphere in ℝⁿ → ellipsoid in ℝᵐ with $r = \operatorname{rank} A$ non-zero axes.

Key idea: every matrix turns the unit circle into an ellipse. The right singular vectors $v_i$ are the ⟂ inputs that land on its ⟂ axes $\sigma_i u_i$.

A = UΣVᵀ: rotate, stretch, rotate

2/4

Problem: any $A$ is three simple moves. Which factor does what?

1Follow $x$ through the factors (right to left)

same scale in all four panels · gray dot: $x = e_1$, tracked; it ends at $(2, 0)$ = first column of $A$ ✓

2What each factor does to $x$

$$Ax = \underbrace{\ U\ }_{\textstyle\text{write along } u_i}\quad \underbrace{\ \Sigma\ }_{\textstyle\text{scale by } \sigma_i}\quad \underbrace{V^{\top}x}_{\textstyle\text{read along } v_i}$$

Why? row $i$ of $V^{\top}$ is $v_i^{\top}$, so $(V^{\top}x)_i = v_i^{\top}x$.

Unpack the product → a sum of rank-1 maps:

$$A = \sum_{i=1}^{r} \sigma_i\, u_i v_i^{\top}, \qquad Ax = \sum_{i=1}^{r} \sigma_i\, u_i\,(v_i^{\top}x)$$

each term: read $x$ along $v_i$ → scale by $\sigma_i$ → write along $u_i$

3Shapes, for $A \in \mathbb{R}^{m\times n}$ ($m \gt n$)

$\Sigma$ is $m\times n$: diagonal on top, zeros below.

Thin SVD: the zero rows kill all but $n$ columns of $U$ → keep $U_n \in \mathbb{R}^{m\times n}$.

Important assumptions (the definition)

  • $U^{\top}U = I_m,\ V^{\top}V = I_n$ — orthogonal (rotations / reflections)
  • $\sigma_1 \ge \sigma_2 \ge \dots \ge \sigma_r \gt 0$, rest 0
  • exists for every matrix: any shape, any rank

Watch out (not unique)

  • $(u_i, v_i) \to (-u_i, -v_i)$ is equally valid
  • equal $\sigma$'s: only their span is fixed (e.g. $A = I$: any $V$)
  • $\det A \lt 0$: $U$ or $V$ includes a reflection, not just a rotation

4Rank $r$: the singular vectors split both spaces

$v_1 \dots v_r$ → stretched by $\sigma_i \gt 0$ → span the row space of $A$

$v_{r+1} \dots v_n$ → $\sigma = 0$: crushed to $0$ → span the null space $\mathcal{N}(A)$

$u_1 \dots u_r$ → axes of the image ellipsoid → span the column space (range)

$u_{r+1} \dots u_m$ → never reached by any $Ax$ → span $\mathcal{N}(A^{\top})$

So $Ax = b$ is solvable iff $b \perp u_{r+1}, \dots, u_m$; and $x + $ (any mix of $v_{r+1..n}$) gives the same $Ax$.

Key idea: $V^{\top}$ reads $x$ in the input axes $v_i$, $\Sigma$ scales each reading on its own, $U$ writes the results along the output axes $u_i$.

Computing the SVD by hand

3/4

Problem: two unknown rotations at once. Trick: form $A^{\top}A$, which makes $U$ cancel.

1Remove $U$

$$A^{\top}A = (U\Sigma V^{\top})^{\top}(U\Sigma V^{\top})$$
start from the factorisation
$$\phantom{A^{\top}A} = V\Sigma^{\top}\,\underbrace{U^{\top}U}_{I}\,\Sigma V^{\top}$$
$(XY)^{\top} = Y^{\top}X^{\top}$; $U$ orthogonal
$$\phantom{A^{\top}A} = V\,\operatorname{diag}(\sigma_i^2)\,V^{\top}$$
this is an eigendecomposition of the symmetric PSD matrix $A^{\top}A$
$$\boxed{A^{\top}A\,v_i = \sigma_i^2\,v_i, \qquad u_i = \tfrac{1}{\sigma_i}\,A v_i}$$
$v_i$ = eigenvectors, $\sigma_i = \sqrt{\lambda_i}$; then $u_i$ from p.1 ($\sigma_i \gt 0$)

2Worked example: $A = \begin{bmatrix}2 & 3\\ 0 & 2\end{bmatrix}$

$$A^{\top}A = \begin{bmatrix}4 & 6\\ 6 & 13\end{bmatrix}$$
columns' dot products: $4{+}0,\ 6{+}0,\ 9{+}4$
$$\lambda^2 - 17\lambda + 16 = 0 \;\Rightarrow\; \lambda = 16,\ 1$$
trace 17, det $52 - 36 = 16$
$$\sigma_1 = 4, \qquad \sigma_2 = 1$$
square roots
$$\begin{bmatrix}-12 & 6\\ 6 & -3\end{bmatrix} v_1 = 0 \;\Rightarrow\; {\color{#1f5fae}v_1 = \tfrac{1}{\sqrt5}(1, 2)},\ \ {\color{#1f5fae}v_2 = \tfrac{1}{\sqrt5}(-2, 1)}$$
$A^{\top}A - 16I$; $v_2$: rotate $v_1$ by 90°
$$u_1 = \tfrac14 \cdot \tfrac{1}{\sqrt5}(8, 4) = {\color{#1f5fae}\tfrac{1}{\sqrt5}(2, 1)}, \quad u_2 = {\color{#1f5fae}\tfrac{1}{\sqrt5}(-1, 2)}$$
$u_i = Av_i/\sigma_i$ — signs now match

3Check it (30 s each)

$\sigma_1\sigma_2 = 4 = |\det A| = |2\cdot 2 - 3\cdot 0|$ ✓

$\sigma_1^2 + \sigma_2^2 = 17 = 2^2 + 3^2 + 0^2 + 2^2$ ✓

$u_1 \perp u_2$: $2\cdot(-1) + 1\cdot 2 = 0$ ✓

Notice: eigenvalues of $A$ are $2, 2$ with one eigenvector $e_1$: not diagonalisable, yet the SVD exists. And $\sigma \ne |\lambda|$.

integer grid, all ×√5. Gray = $\sqrt5\,v_i$, blue = $\sqrt5\,Av_i$: 4× longer, same length, still ⟂

4Rebuild $A$ from rank-1 pieces

$$\underbrace{4\cdot\tfrac15\begin{bmatrix}2 & 4\\ 1 & 2\end{bmatrix}}_{\sigma_1 u_1 v_1^{\top}} + \underbrace{1\cdot\tfrac15\begin{bmatrix}2 & -1\\ -4 & 2\end{bmatrix}}_{\sigma_2 u_2 v_2^{\top}} = \tfrac15\begin{bmatrix}10 & 15\\ 0 & 10\end{bmatrix} = \begin{bmatrix}2 & 3\\ 0 & 2\end{bmatrix} \checkmark$$

$u_1v_1^{\top}$ = column $(2,1)$ times row $(1,2)$, divided by $\sqrt5\cdot\sqrt5 = 5$

Common mistake: taking $u_i$ as eigenvectors of $AA^{\top}$ separately → signs can disagree and $U\Sigma V^{\top} \ne A$. Use $u_i = Av_i/\sigma_i$.

Key idea: $A^{\top}A$ forgets the output rotation, so its eigenvectors are the $v_i$ and its eigenvalues are $\sigma_i^2$. Then $A$ itself hands you each $u_i$.

What the singular values tell you

4/4

Problem: which numbers of $A$ decide its rank, size, stability and compressibility?

1Small $\sigma$ = flat direction

contours of $f(x) = \tfrac12\|Ax\|^2$ for our $A$; GD with the best fixed step $\eta = 2/17$

2The σ dictionary

quantityin σ'sour $A$
rank#$\{\sigma_i \gt 0\}$2
max stretch $\|A\|_2$$\sigma_1$4
$\|A\|_F^2$$\sum \sigma_i^2$17
$|\det A|$ (square)$\prod \sigma_i$4
condition $\kappa(A)$$\sigma_1/\sigma_n$4
Hessian $A^{\top}\!A$ of $f$eigs $\sigma_i^2$, $\kappa = \kappa(A)^2$16

Contour axes lie along the $v_i$; half-widths $\propto 1/\sigma_i$.

$\sigma_2 \ll \sigma_1$ → long valley along $v_2$, $\kappa = 16$ → GD zig-zags across it; error shrinks only $\times\frac{\kappa-1}{\kappa+1} = \frac{15}{17}$ per step

3Best rank-$k$ fit (Eckart–Young)

$$A_k = \sum_{i=1}^{k} \sigma_i u_i v_i^{\top}, \qquad \|A - A_k\|_2 = \sigma_{k+1}$$

no rank-$k$ matrix is closer  (Frobenius: error² $= \sum_{i\gt k}\sigma_i^2$)

ours: $A_1 = \begin{bmatrix}1.6 & 3.2\\ 0.8 & 1.6\end{bmatrix}$, error $= \sigma_2 = 1$

fast σ decay → few terms suffice → PCA, low-rank weights, LoRA-style compression

$A_1$ squashes the ellipse onto its long axis; what's lost is $\sigma_2 u_2$

Failure: $A^{-1} = V\Sigma^{-1}U^{\top}$ → noise along $u_n$ is multiplied by $1/\sigma_n$ → tiny $\sigma_n$ blows up solutions → truncate or regularise

?Test your understanding

  1. What are the σ's of $3A$, $A^{\top}$ and $A^{-1}$? Where do $u_i, v_i$ go?
  2. Why is $e_1$, the eigenvector of $A$, not an axis of the ellipse? When do eigen- and singular vectors coincide?
  3. Let $\sigma_2 \to 0$. What happens to the ellipse, the rank, $\kappa$, and GD on $f$?
  4. From the circle → ellipse picture alone, rebuild $A = U\Sigma V^{\top}$. Which step needs $V$ orthogonal?

!Remember

  1. $A$ maps the unit sphere to an ellipsoid; $v_i$ land on its axes $\sigma_i u_i$.
  2. $U\Sigma V^{\top}$ = rotate, stretch along axes, rotate; it exists for every matrix.
  3. σ's are $A$'s honest sizes: $\|A\|_2 = \sigma_1$, rank $= \#\sigma \gt 0$, $\kappa = \sigma_1/\sigma_n$.
  4. Truncating the sum gives the best rank-$k$ fit, error $\sigma_{k+1}$.