1. The Fundamental SVD Theorem
While eigendecomposition only exists for square, diagonalizable matrices, the Singular Value Decomposition (SVD) exists for any real or complex rectangular matrix $A \in \mathbb{R}^{m \times n}$.
Every matrix $A$ can be factored into three matrices:
$$A = U \Sigma V^T$$
$$\begin{bmatrix} & & \ & A & \ & & \end{bmatrix}{m \times n} =
\begin{bmatrix} & & \ & U & \ & & \end{bmatrix}{m \times m}
\begin{bmatrix}
\sigma_1 & & 0 \
& \sigma_2 & \
0 & & \ddots
\end{bmatrix}{m \times n}
\begin{bmatrix} & & \ & V^T & \ & & \end{bmatrix}{n \times n}$$
- $U \in \mathbb{R}^{m \times m}$: Orthogonal matrix ($U^T U = I$). The columns $u_i$ are the left singular vectors (eigenvectors of $A A^T$).
- $\Sigma \in \mathbb{R}^{m \times n}$: Diagonal rectangular matrix containing non-negative singular values $\sigma_1 \ge \sigma_2 \ge \dots \ge \sigma_r > 0$ ordered in descending magnitude.
- $V \in \mathbb{R}^{n \times n}$: Orthogonal matrix ($V^T V = I$). The columns $v_i$ are the right singular vectors (eigenvectors of $A^T A$).
Geometric Meaning: Rotation $\to$ Scaling $\to$ Rotation
Any linear mapping $A$ can be decomposed into:
- An initial rotation in $\mathbb{R}^n$ via $V^T$.
- A scaling along principal axes by singular values $\sigma_i$.
- A secondary rotation in $\mathbb{R}^m$ via $U$.
2. Low-Rank Matrix Approximation (Eckart-Young-Mirsky Theorem)
In practical data systems, matrices are massive (e.g. Netflix user-movie rating matrix: 100M users $\times$ 50K movies). Storing the full matrix requires terabytes of RAM.
By expanding $A$ as a sum of rank-1 outer products:
$$A = \sum_{i=1}^r \sigma_i u_i v_i^T$$
The Eckart-Young-Mirsky Theorem states that the optimal rank-$k$ approximation $A_k$ that minimizes the Frobenius norm error $|A - A_k|_F$ is obtained by truncating the summation to the first $k$ terms:
$$A_k = \sum_{i=1}^k \sigma_i u_i v_i^T, \quad k < r$$
$$\min_{\text{rank}(B) = k} |A - B|_F = |A - A_k|F = \sqrt{\sum{i=k+1}^r \sigma_i^2}$$
text
3. Collaborative Filtering & Recommendation Systems
In modern recommendation engines (Netflix, Spotify, Amazon), user interactions form a sparse matrix $R \in \mathbb{R}^{N \times M}$.
Applying Truncated SVD discovers $k$ latent features (e.g. "Sci-Fi Action", "Romantic Comedy", "Tempo"):
- $U_k$: Maps users into $k$-dimensional preference vectors.
- $V_k$: Maps items into $k$-dimensional attribute vectors.
- The predicted rating of user $u$ for item $i$ is calculated as the dot product:
$$\hat{R}_{u, i} = u_u^T \Sigma_k v_i$$
4. The Moore-Penrose Pseudoinverse ($A^+$)
When $A$ is non-square or rank-deficient, the standard inverse $A^{-1}$ does not exist. Using SVD, the Moore-Penrose Pseudoinverse is defined as:
$$A^+ = V \Sigma^+ U^T$$
where $\Sigma^+$ is formed by inverting non-zero singular values ($\sigma_i \to 1/\sigma_i$) and transposing. $x = A^+ b$ computes the minimum-norm least-squares solution to any linear system.
5. Python Implementation: Image Compression via Truncated SVD
python