# SVD, Eckart-Young Low-Rank Approximation, PSD Matrices & KKT Convex Optimization
Exam: GATE Data Science & Artificial Intelligence (DA) (GATE DA)
Subject: Linear Algebra, Calculus & Optimization
Canonical URL: https://gateandnet.com/exams/gate-da/linear-algebra/svd-spectral-theorem-psd-and-convex-optimization

> Singular Value Decomposition A = U Sigma V^T, Frobenius & Spectral norm low-rank approximation, Positive Semi-Definite equivalences, Hessian convexity test, and Gradient Descent step-size bounds.

## 1. Singular Value Decomposition (SVD) & Fundamental Subspaces

Every real matrix $A \in \mathbb{R}^{m \times n}$ (even rectangular & singular!) admits $A = U \Sigma V^T$:
- $U \in \mathbb{R}^{m \times m}$ orthogonal ($U^T U = I_m$): eigenvectors of $AA^T$ (**Left Singular Vectors**).
- $V \in \mathbb{R}^{n \times n}$ orthogonal ($V^T V = I_n$): eigenvectors of $A^T A$ (**Right Singular Vectors**).
- $\sigma_i = \sqrt{\lambda_i(A^T A)} > 0$ for $i = 1, \dots, r = \operatorname{rank}(A)$, and $\|A\|_F^2 = \operatorname{tr}(A^T A) = \sum_{i=1}^r \sigma_i^2$.
- **Storage Compression:** Storing rank-$k$ approximation $A_k$ requires $k(m + n + 1)$ floats instead of $m \cdot n$!

## 2. Positive Semi-Definite (PSD) & Convexity Equivalences

For a symmetric matrix $M = M^T \in \mathbb{R}^{d \times d}$, the following are **100% equivalent**:
1. $x^T M x \ge 0$ for all $x \in \mathbb{R}^d$ ($> 0$ for $\forall x \neq 0 \iff$ **Positive Definite / PD**).
2. All eigenvalues satisfy $\lambda_i(M) \ge 0$ ($\lambda_i > 0$ for PD).
3. $M = B^T B$ for some matrix $B$ (e.g. Gram matrix $X^T X$ and Covariance matrix $\Sigma$ are **always PSD**!).
4. All principal minors are $\ge 0$ (Sylvester’s Criterion for PD: **leading** principal minors $> 0$).

A twice-differentiable function $f: \mathbb{R}^d \to \mathbb{R}$ is **Convex** iff its **Hessian** $\nabla^2 f(x) \succeq 0$ (PSD) everywhere! For convex $f$, **every local minimum is a global minimum**.

## Solved Practice Questions & PYQs

### [GATE DA Optimization NAT | NAT]
Consider minimizing the strictly convex quadratic $f(x_1, x_2) = 5x_1^2 + 2x_2^2$ using standard Gradient Descent $x_{t+1} = x_t - \eta \nabla f(x_t)$. What is the **strict upper bound** $\eta_{\max}$ on step size $\eta$ ($0 < \eta < \eta_{\max}$) so Gradient Descent converges from any non-zero start?
**Correct Answer:** 0.2
**Solution:** Hessian $\nabla^2 f = \begin{bmatrix} 10 & 0 \\ 0 & 4 \end{bmatrix}$ has smoothness constant $L = \lambda_{\max} = 10$. Gradient descent requires $|1 - \eta \lambda_{\max}| < 1 \implies 0 < \eta < \frac{2}{L} = \frac{2}{10} = \mathbf{0.2}$.

### [GATE DA Linear Algebra | MCQ]
A matrix $A \in \mathbb{R}^{10 \times 8}$ has singular values $\sigma_1 = 9,\; \sigma_2 = 5,\; \sigma_3 = 2$, and $\sigma_4 = \dots = \sigma_8 = 0$. By the **Eckart-Young Theorem**, what is the minimum Spectral ($L_2$) error $\min_{\operatorname{rank}(B) \le 2} \|A - B\|_2$?
**Correct Answer:** B
**Solution:** By the Eckart-Young-Mirsky theorem, the best rank-$k$ approximation error in the **Spectral ($L_2$) norm** equals $\sigma_{k+1}$. For $k = 2$, $\sigma_{2+1} = \sigma_3 = \mathbf{2}$!

### [GATE DA 2027 Expected NAT | NAT]
Let $A \in \mathbb{R}^{7 \times 3}$ be a matrix with linearly independent columns ($\operatorname{rank}(A) = 3$), and let $P = A(A^T A)^{-1}A^T \in \mathbb{R}^{7 \times 7}$ be the orthogonal projection matrix onto $\operatorname{Col}(A)$. What is the **trace** $\operatorname{tr}(P)$?
**Correct Answer:** 3
**Solution:** Cyclic trace property: $\operatorname{tr}\big(A(A^T A)^{-1}A^T\big) = \operatorname{tr}\big((A^T A)^{-1}(A^T A)\big) = \operatorname{tr}(I_3) = \mathbf{3}$ (for any orthogonal projection matrix, $\operatorname{tr}(P) = \operatorname{rank}(P)$!).
