Part 2Math for LLMs

Matrix Norms: Part 2 - Common Mistakes To Appendix I Practice Problems And Solutions

Advanced Linear Algebra / Matrix Norms

Private notes
0/8000

Notes stay private to your browser until account sync is configured.

Part 2
30 min read18 headingsSplit lesson page

Lesson overview | Previous part | Next part

Matrix Norms and Condition Numbers: Part 10: Common Mistakes to Appendix I: Practice Problems and Solutions

10. Common Mistakes

#MistakeWhy It's WrongFix
1Confusing A1\|A\|_1 (matrix 1-norm = max column sum) with AF\|A\|_F (Frobenius)The notation A1\|A\|_1 for matrices means max column sum, not the sum of absolute entriesUse np.linalg.norm(A, 1) for max col sum; np.linalg.norm(A, 'fro') for Frobenius
2Assuming the Frobenius norm is inducedIF=n1\|I\|_F = \sqrt{n} \neq 1; no induced norm can have I1\|I\| \neq 1Remember: Frobenius = Euclidean on vectorized matrix; consistent but not induced
3Confusing A2\|A\|_2 (spectral norm = σ1\sigma_1) with AF\|A\|_FFor a general matrix, A2AF\|A\|_2 \leq \|A\|_F; they equal only for rank-1 matricesA2=σ1\|A\|_2 = \sigma_1; AF=σ2\|A\|_F = \|\boldsymbol{\sigma}\|_2 - very different
4Thinking ABF=AFBF\|AB\|_F = \|A\|_F\|B\|_FThis equality fails in general; it's an upper boundThe submultiplicativity ABFAFBF\|AB\|_F \leq \|A\|_F\|B\|_F is an inequality, not equality
5Applying the spectral norm formula κ=σ1/σn\kappa = \sigma_1/\sigma_n to singular (or non-square) matricesSingular matrices have σn=0\sigma_n = 0, giving κ=\kappa = \inftyFor non-square or rank-deficient matrices, use the pseudocondition σ1/σr\sigma_1/\sigma_r where σr\sigma_r is the smallest nonzero singular value
6Forgetting that condition number depends on the norm choiceκ1(A)\kappa_1(A), κ2(A)\kappa_2(A), κ(A)\kappa_\infty(A) can differ by polynomial factors in nnSpecify the norm; use κ2\kappa_2 (spectral) unless another norm is more natural
7Assuming small Frobenius norm implies small condition numberA matrix can have AF=1\|A\|_F = 1 but κ(A)=1015\kappa(A) = 10^{15}κ\kappa depends on the ratio σ1/σn\sigma_1/\sigma_n, not the absolute values
8Misidentifying the matrix 1-norm as the entry-wise 1-norm (sum of all entries)A1\|A\|_1 (induced) is max column sum; $\sum_{i,j}a_{ij}
9Assuming Weyl's inequality gives tight bounds on eigenvalue changes for non-symmetric matricesFor non-symmetric matrices, Weyl doesn't apply; use Bauer-Fike, which involves κ(P)\kappa(P)Non-normal matrices can have extreme eigenvalue sensitivity; use pseudo-spectrum for analysis
10Thinking nuclear norm minimization always recovers low-rank matricesRecovery requires incoherence conditions (columns/rows not aligned with standard basis)Nuclear norm minimization provably recovers rank-rr matrices under RIP or incoherence; check conditions before claiming recovery
11Confusing spectral normalization (normalizes by W2\|W\|_2) with batch normalization (normalizes activations)Spectral normalization is on weight matrices; batch normalization is on hidden layer activationsThey target different quantities: spectral norm controls Lipschitz constant; batch norm controls activation statistics
12Assuming stable rank = rankStable rank ρ(A)=AF2/A22=(σi/σ1)2\rho(A) = \|A\|_F^2 / \|A\|_2^2 = \sum(\sigma_i/\sigma_1)^2; it's a real number, not an integer, and ρ(A)r=rank(A)\rho(A) \leq r = \operatorname{rank}(A)Stable rank is a smooth proxy for rank that appears in generalization bounds

11. Exercises

Exercise 1 * - Norm computation and verification

Let A=(310021104)A = \begin{pmatrix} 3 & 1 & 0 \\ 0 & 2 & -1 \\ 1 & 0 & 4 \end{pmatrix}.

(a) Compute AF\|A\|_F (Frobenius norm) by hand and verify using the SVD formula AF=σ2\|A\|_F = \|\boldsymbol{\sigma}\|_2.

(b) Compute A1\|A\|_1 (max absolute column sum) and A\|A\|_\infty (max absolute row sum). Verify A1=A\|A^\top\|_1 = \|A\|_\infty.

(c) Compute A2=σ1(A)\|A\|_2 = \sigma_1(A) numerically. Verify the inequalities A2AF3A2\|A\|_2 \leq \|A\|_F \leq \sqrt{3}\|A\|_2.

(d) Compute A\|A\|_* (nuclear norm). Verify A3AF\|A\|_* \leq \sqrt{3}\|A\|_F and AAF\|A\|_* \geq \|A\|_F (when checking your numbers!).


Exercise 2 * - Frobenius norm properties

(a) Prove that AF2=tr(AA)\|A\|_F^2 = \operatorname{tr}(A^\top A).

(b) Show that the Frobenius inner product A,BF=tr(AB)\langle A, B\rangle_F = \operatorname{tr}(A^\top B) satisfies all inner product axioms.

(c) For A=uvA = \mathbf{u}\mathbf{v}^\top (rank-1), show AF=u2v2=A2\|A\|_F = \|\mathbf{u}\|_2\|\mathbf{v}\|_2 = \|A\|_2. Verify numerically.

(d) Verify submultiplicativity ABFAFBF\|AB\|_F \leq \|A\|_F\|B\|_F for random matrices. Show it fails as equality for most pairs.


Exercise 3 * - Condition number analysis

(a) Construct a 3×33 \times 3 matrix with condition number κ2100\kappa_2 \approx 100 and one with κ2106\kappa_2 \approx 10^6.

(b) For each matrix, solve Ax=bA\mathbf{x} = \mathbf{b} with b=Ax0\mathbf{b} = A\mathbf{x}_0 for known x0=[1,1,1]\mathbf{x}_0 = [1,1,1]^\top. Add noise δb=ϵrand\delta\mathbf{b} = \epsilon \cdot \text{rand} with ϵ=106\epsilon = 10^{-6}. Measure the relative error x^x0/x0\|\hat{\mathbf{x}} - \mathbf{x}_0\| / \|\mathbf{x}_0\|.

(c) Verify the bound: relative forward error κ(A)\leq \kappa(A) \cdot relative backward error.

(d) Apply Tikhonov regularization with λ=103\lambda = 10^{-3} to the ill-conditioned matrix. Compute the new condition number and solution accuracy.


Exercise 4 ** - Nuclear norm and low-rank approximation

(a) Generate a random rank-3 matrix A=UVA = UV^\top with UR8×3U \in \mathbb{R}^{8 \times 3}, VR10×3V \in \mathbb{R}^{10 \times 3}. Confirm A=i=13σi\|A\|_* = \sum_{i=1}^3 \sigma_i and rank(A)=3\operatorname{rank}(A) = 3.

(b) Add Gaussian noise EE with EF=0.1AF\|E\|_F = 0.1\|A\|_F. Compute the best rank-kk approximations A~k\tilde{A}_k for k=1,2,3,5,8k = 1, 2, 3, 5, 8. Plot AA~kF\|A - \tilde{A}_k\|_F vs kk.

(c) Verify the Eckart-Young theorem: AA~kF2=i>kσi2\|A - \tilde{A}_k\|_F^2 = \sum_{i>k}\sigma_i^2 and AA~k2=σk+1\|A - \tilde{A}_k\|_2 = \sigma_{k+1}.

(d) Implement the proximal operator for the nuclear norm (singular value soft-thresholding) and verify it on a 5×55 \times 5 random matrix with threshold λ=2\lambda = 2.


Exercise 5 ** - Weyl's inequality and perturbation

(a) Verify Weyl's inequality: construct A,ER5×5A, E \in \mathbb{R}^{5 \times 5} and verify σi(A+E)σi(A)E2|\sigma_i(A+E) - \sigma_i(A)| \leq \|E\|_2 for all ii.

(b) Show (numerically) that Weyl's bound is tight: construct AA and EE such that equality is achieved for i=1i=1.

(c) For a non-symmetric matrix AA, compute eigenvalues of A+EA + E for several random perturbations E2=ϵ\|E\|_2 = \epsilon. Compare the eigenvalue scatter to the singular value scatter - demonstrate that eigenvalues of non-normal matrices are more sensitive.

(d) Bauer-Fike: compute κ2(P)\kappa_2(P) where PP is the eigenvector matrix of your non-symmetric AA. Verify the bound minjλ~λjκ2(P)E2\min_j|\tilde{\lambda} - \lambda_j| \leq \kappa_2(P)\|E\|_2.


Exercise 6 ** - Dual norms and optimization

(a) Verify the duality A=maxB21tr(AB)\|A\|_* = \max_{\|B\|_2 \leq 1}\operatorname{tr}(A^\top B) numerically for a random 4×44 \times 4 matrix.

(b) The dual of AF\|A\|_F is itself. Verify: AF=maxBF1tr(AB)\|A\|_F = \max_{\|B\|_F \leq 1}\operatorname{tr}(A^\top B).

(c) The Ky Fan kk-norm has a variational formula: A(k)=maxUk,Vk orthonormaltr(UkAVk)\|A\|_{(k)} = \max_{U_k, V_k \text{ orthonormal}}\operatorname{tr}(U_k^\top A V_k). Verify for k=2k=2 on a 5×55 \times 5 matrix.

(d) Write the subgradient of A\|A\|_* at a rank-2 matrix A=u1v1+u2v2A = \mathbf{u}_1\mathbf{v}_1^\top + \mathbf{u}_2\mathbf{v}_2^\top. Verify it numerically by finite differences.


Exercise 7 *** - Spectral normalization for neural networks

Implement spectral normalization for a simple 2-layer network on a toy binary classification problem.

(a) Implement power iteration to estimate σ1(W)\sigma_1(W) for a weight matrix. Compare to np.linalg.svd(W)[1][0]. Measure convergence rate.

(b) Train a 2-layer network with and without spectral normalization on a toy dataset. Track Wl2\|W_l\|_2 during training.

(c) Estimate the Lipschitz constant lWl2\prod_l \|W_l\|_2 during training. Compare the two settings.

(d) Demonstrate that spectral normalization stabilizes training: use a larger learning rate that causes instability without SN but converges with SN.


Exercise 8 *** - Implicit regularization in matrix factorization

(a) Solve minU,VUVAF2\min_{U,V} \|UV^\top - A\|_F^2 for a random 6×66 \times 6 matrix AA with gradient flow (small step gradient descent). Initialize U,VU, V close to zero.

(b) Track UV\|UV^\top\|_* during optimization. Compare to the minimum nuclear norm completion min{X:X=A}\min\{\|X\|_* : X = A\} (which equals A\|A\|_* if AA is full rank).

(c) Now let AA be rank-2. Show that gradient flow recovers the rank-2 structure even without explicit rank regularization: plot the singular values of UVUV^\top over iterations.

(d) Compare the implicit nuclear norm regularization of matrix factorization to explicit nuclear norm minimization using the proximal gradient method (from Exercise 4(d)). Which finds a solution faster? Which has smaller X\|X\|_*?


12. Why This Matters for AI (2026 Perspective)

ConceptAI/LLM ApplicationImpact
Frobenius normWeight decay (L2 regularization): penalizes WF2\|W\|_F^2Controls parameter magnitudes; implicit bias toward small-norm solutions; universal in all optimizers with weight_decay
Spectral norm (σ1\sigma_1)Spectral normalization in GANs; Lipschitz bound for discriminators; RoPE analysisGuarantees Lipschitz-1 layers; stabilizes adversarial training; bounds gradient flow
Nuclear normLow-rank regularization; matrix completion; LoRA implicit regularization; DoRAPromotes sparse singular values; the convex proxy for rank; connects fine-tuning to compressed sensing
Condition numberLoss landscape analysis; preconditioned optimizers (Adam); convergence theoryHigh κ\kappa -> slow convergence; Adam approximates κ(H)1\kappa(H)^{-1} preconditioning; Shampoo computes exact preconditioning
Weyl's inequalityStability of trained models under weight noise; pruning/quantization error boundsGuarantees singular value stability; bounds the effect of INT8 quantization on model behavior
Eckart-Young theoremLoRA, SVD compression, attention matrix analysisMathematical foundation of parameter-efficient fine-tuning; optimal rank-kk approximation in both F and spectral norms
Stable rankPAC-Bayes generalization bounds; network complexity measuresρ(W)=WF2/W22\rho(W) = \|W\|_F^2/\|W\|_2^2 predicts generalization better than raw rank
Dual normsDuality in optimization (nuclear <-> spectral); proximal methods; online learningFenchel duality underlies mirror descent, natural gradient, and FTRL algorithms
Bauer-Fike theoremRNN gradient flow analysis; eigenvalue sensitivity of recurrent matricesNon-normal recurrent weight matrices can have extreme eigenvalue sensitivity even with bounded W2\|W\|_2
Proximal gradientNuclear norm minimization algorithms; ADMM for matrix completionSingular value soft-thresholding is the key computational primitive for nuclear norm optimization
Low-rank structureMLA (DeepSeek); attention compression; GQA/MQAEmpirical discovery that trained attention has low nuclear/stable rank; motivates linear attention approximations
Tikhonov regularizationRidge regression; L2 penalty in fine-tuning; conditioning of Gram matrices in kernel methodsConverts ill-conditioned problems into well-conditioned ones; connects to weight decay

13. Conceptual Bridge

Matrix norms are the measuring instruments of linear algebra. Without them, we cannot quantify stability, sensitivity, approximation quality, or regularization strength. Every major result in numerical linear algebra - condition number theory, perturbation bounds, error analysis - is stated in terms of matrix norms. And in machine learning, norms appear at every level: they define regularizers, measure approximation error, bound generalization, and determine convergence rates.

What came before. This section builds on the SVD (-> Singular Value Decomposition), which provides the singular values that define the spectral, Frobenius, nuclear, and Schatten norms. It uses eigenvalue theory (-> Eigenvalues and Eigenvectors) for the spectral norm of symmetric PSD matrices and for condition number of symmetric positive definite systems. It uses orthogonality (-> Orthogonality) for the unitary invariance of Schatten norms.

What comes after. Condition number analysis is essential for numerical methods in the next chapter. Matrix norm theory enables gradient analysis in optimization (-> Chapter 8: Optimization). The nuclear norm and low-rank regularization connect directly to dimensionality reduction (-> PCA) and the mathematical foundations of LoRA and other PEFT methods in the models chapters. Perturbation theory connects to the stability analysis of RNNs and LSTMs (-> RNN and LSTM Math).

MATRIX NORMS IN THE CURRICULUM
========================================================================

  02-Linear-Algebra-Basics              03-Advanced-Linear-Algebra
  -----------------------               ----------------------------

  +----------------------+             +-------------------------------+
  | 05-Matrix-Rank       |  ->  rank    | 01-Eigenvalues-Eigenvectors   |
  | 04-Determinants      |  ->  det     | 02-SVD  --+                   |
  +----------------------+             |           | singular values   |
                                       |           down                   |
                                       | +-------------------------+  |
                                       | |  06-Matrix-Norms  *     |  |
                                       | |                         |  |
                                       | |  - Frobenius (F-norm)   |  |
                                       | |  - Spectral (\sigma_1)        |  |
                                       | |  - Nuclear (\Sigma\sigma^i)        |  |
                                       | |  - Schatten (ell^p of \sigma)  |  |
                                       | |  - Condition number     |  |
                                       | |  - Perturbation theory  |  |
                                       | +-------------+-----------+  |
                                       |               |               |
                                       |               down               |
                                       | 07-Linear-Transformations     |
                                       | 08-Matrix-Decompositions      |
                                       +-------------------------------+
                                                       |
                                     +-----------------+----------------+
                                     down                 down                down
                              08-Optimization    ML-Applications    14-Specific
                              (gradient flow,   (LoRA, spectral    (RNN stability,
                               convergence)      normalization,     attention rank,
                                                 PAC-Bayes)        MLA compression)

========================================================================

The key insight unifying this section: matrix norms reduce questions about linear operators to scalar quantities. The spectral norm reduces Lipschitz analysis to a number. The nuclear norm reduces rank minimization to a convex program. The condition number reduces numerical stability to a ratio. This reduction from functional complexity to scalar measurement is the fundamental technical move that makes both theory and computation tractable.


Appendix A: Proofs and Derivations

A.1 Proof that AF=tr(AA)\|A\|_F = \sqrt{\operatorname{tr}(A^\top A)}

Let ARm×nA \in \mathbb{R}^{m \times n}. The (j,k)(j,k)-entry of AAA^\top A is:

(AA)jk=i(A)jiAik=iAijAik(A^\top A)_{jk} = \sum_i (A^\top)_{ji} A_{ik} = \sum_i A_{ij} A_{ik}

The trace sums the diagonal (j=kj = k):

tr(AA)=j(AA)jj=jiAij2=i,jaij2=AF2\operatorname{tr}(A^\top A) = \sum_j (A^\top A)_{jj} = \sum_j \sum_i A_{ij}^2 = \sum_{i,j} a_{ij}^2 = \|A\|_F^2 \qquad \square

Corollary. For any unitary URm×mU \in \mathbb{R}^{m \times m} and VRn×nV \in \mathbb{R}^{n \times n}:

UAVF2=tr((UAV)(UAV))=tr(VAUUAV)=tr(VAAV)=tr(AA)=AF2\|UAV\|_F^2 = \operatorname{tr}((UAV)^\top (UAV)) = \operatorname{tr}(V^\top A^\top U^\top UAV) = \operatorname{tr}(V^\top A^\top AV) = \operatorname{tr}(A^\top A) = \|A\|_F^2

using UU=IU^\top U = I and cyclic invariance of the trace tr(VXV)=tr(X)\operatorname{tr}(VXV^\top) = \operatorname{tr}(X).

A.2 Proof of Submultiplicativity of the Frobenius Norm

We prove ABFAFBF\|AB\|_F \leq \|A\|_F \|B\|_F.

Let ARm×pA \in \mathbb{R}^{m \times p} and BRp×nB \in \mathbb{R}^{p \times n}. Denote the rows of AA as ai\mathbf{a}_i^\top and columns of BB as bj\mathbf{b}_j. Then (AB)ij=aibj(AB)_{ij} = \mathbf{a}_i^\top \mathbf{b}_j.

By Cauchy-Schwarz: (AB)ij2ai22bj22|(AB)_{ij}|^2 \leq \|\mathbf{a}_i\|_2^2 \|\mathbf{b}_j\|_2^2. Summing over all i,ji,j:

ABF2=i,j(AB)ij2i,jai2bj2=(iai2)(jbj2)=AF2BF2\|AB\|_F^2 = \sum_{i,j} |(AB)_{ij}|^2 \leq \sum_{i,j} \|\mathbf{a}_i\|^2 \|\mathbf{b}_j\|^2 = \left(\sum_i \|\mathbf{a}_i\|^2\right)\left(\sum_j \|\mathbf{b}_j\|^2\right) = \|A\|_F^2 \|B\|_F^2 \qquad \square

A.3 Proof that the Matrix 1-Norm Equals Maximum Column Sum

Claim. A11=maxjiaij\|A\|_{1 \to 1} = \max_j \sum_i |a_{ij}|.

Upper bound. For x1=1\|\mathbf{x}\|_1 = 1:

Ax1=jxjaj1jxjaj1maxjaj1jxj=maxjaj1\|A\mathbf{x}\|_1 = \left\|\sum_j x_j \mathbf{a}_j\right\|_1 \leq \sum_j |x_j| \|\mathbf{a}_j\|_1 \leq \max_j \|\mathbf{a}_j\|_1 \cdot \sum_j |x_j| = \max_j \|\mathbf{a}_j\|_1

Attainment. Let j=argmaxjaj1j^* = \arg\max_j \|\mathbf{a}_{j}\|_1. Set x=ej\mathbf{x} = \mathbf{e}_{j^*}. Then Ax=ajA\mathbf{x} = \mathbf{a}_{j^*}, so Ax1=maxjaj1\|A\mathbf{x}\|_1 = \max_j\|\mathbf{a}_j\|_1. \square

A.4 Proof of Weyl's Inequality

Theorem. For A,ERm×nA, E \in \mathbb{R}^{m \times n} with mnm \geq n, and all i=1,,ni = 1, \ldots, n:

σi(A+E)σi(A)σ1(E)=E2|\sigma_i(A+E) - \sigma_i(A)| \leq \sigma_1(E) = \|E\|_2

Proof using the minimax characterization. By Courant-Fischer:

σi(A)=minSRndimS=ni+1maxxS,x=1Ax\sigma_i(A) = \min_{\substack{S \subseteq \mathbb{R}^n \\ \dim S = n-i+1}} \max_{\mathbf{x} \in S, \|\mathbf{x}\|=1} \|A\mathbf{x}\|

Let SS^* achieve the minimax for σi(A)\sigma_i(A). Then:

σi(A+E)maxxS,x=1(A+E)xmaxxS,x=1(Ax+Ex)σi(A)+E2\sigma_i(A+E) \leq \max_{\mathbf{x} \in S^*, \|\mathbf{x}\|=1} \|(A+E)\mathbf{x}\| \leq \max_{\mathbf{x} \in S^*, \|\mathbf{x}\|=1} \left(\|A\mathbf{x}\| + \|E\mathbf{x}\|\right) \leq \sigma_i(A) + \|E\|_2

By symmetry (apply to A+EA+E with perturbation E-E): σi(A)σi(A+E)+E2\sigma_i(A) \leq \sigma_i(A+E) + \|E\|_2.

Combining both inequalities: σi(A+E)σi(A)E2|\sigma_i(A+E) - \sigma_i(A)| \leq \|E\|_2. \square

A.5 Proof that the Nuclear Norm is Dual to the Spectral Norm

Claim. A=maxB21tr(AB)\|A\|_* = \max_{\|B\|_2 \leq 1} \operatorname{tr}(A^\top B).

Achieving the bound. Let A=UΣVA = U\Sigma V^\top and set B=UVB = UV^\top. Then B2=1\|B\|_2 = 1 (product of unitary-like matrices with unit singular values) and:

tr(AB)=tr(VΣUUV)=tr(VΣV)=tr(Σ)=iσi=A\operatorname{tr}(A^\top B) = \operatorname{tr}(V\Sigma U^\top \cdot UV^\top) = \operatorname{tr}(V\Sigma V^\top) = \operatorname{tr}(\Sigma) = \sum_i \sigma_i = \|A\|_*

Upper bound for any B21\|B\|_2 \leq 1. By the Von Neumann trace inequality:

tr(AB)iσi(A)σi(B)iσi(A)1=A|\operatorname{tr}(A^\top B)| \leq \sum_i \sigma_i(A)\sigma_i(B) \leq \sum_i \sigma_i(A) \cdot 1 = \|A\|_*

(since σi(B)B21\sigma_i(B) \leq \|B\|_2 \leq 1). Therefore maxB21tr(AB)=A\max_{\|B\|_2\leq 1}\operatorname{tr}(A^\top B) = \|A\|_*. \square


Appendix B: Advanced Topics

B.1 The Von Neumann Trace Inequality

A fundamental result connecting norms to the trace:

Theorem (Von Neumann, 1937). For A,BRm×nA, B \in \mathbb{R}^{m \times n}:

tr(AB)i=1min(m,n)σi(A)σi(B)|\operatorname{tr}(A^\top B)| \leq \sum_{i=1}^{\min(m,n)} \sigma_i(A)\sigma_i(B)

with equality when AA and BB share the same left and right singular vectors (i.e., AA and BB are simultaneously diagonalizable in the SVD sense).

Consequences:

  1. Nuclear-spectral Holder: A,BFAB2|\langle A,B\rangle_F| \leq \|A\|_*\|B\|_2
  2. Cauchy-Schwarz (Frobenius): A,BFAFBF|\langle A,B\rangle_F| \leq \|A\|_F\|B\|_F (using σi(A)σi(B)(σi(A)2+σi(B)2)/2\sigma_i(A)\sigma_i(B) \leq (\sigma_i(A)^2+\sigma_i(B)^2)/2)
  3. Duality: A=maxB21tr(AB)\|A\|_* = \max_{\|B\|_2\leq 1}\operatorname{tr}(A^\top B) (proved in A.5 using this inequality)

For AI: This inequality bounds approximation errors in attention: tr(S^VV)S^V22|\operatorname{tr}(\hat{S}^\top V^\top V)| \leq \|\hat{S}\|_* \|V\|_2^2, connecting attention approximation quality to the nuclear norm of the approximate attention matrix.

B.2 Pseudo-Spectrum and Non-Normal Matrices

For a non-normal matrix AA (AAAAAA^\top \neq A^\top A), eigenvalues can be extremely sensitive to perturbation even when the matrix has bounded spectral norm. The ϵ\epsilon-pseudo-spectrum reveals this sensitivity:

Λϵ(A)={λC:σmin(AλI)ϵ}={z:(AzI)12ϵ1}\Lambda_\epsilon(A) = \{\lambda \in \mathbb{C} : \sigma_{\min}(A - \lambda I) \leq \epsilon\} = \{z : \|(A - zI)^{-1}\|_2 \geq \epsilon^{-1}\}

This is the set of complex numbers that are eigenvalues of some perturbation A+EA + E with E2ϵ\|E\|_2 \leq \epsilon.

Normal vs. non-normal. For normal matrices (AA=AAA^\top A = AA^\top), Λϵ(A)=jD(λj,ϵ)\Lambda_\epsilon(A) = \bigcup_j D(\lambda_j, \epsilon) - just disks of radius ϵ\epsilon around each eigenvalue. For non-normal matrices, the pseudo-spectrum can extend far beyond these disks.

Example: Jordan block. A=(0100)A = \begin{pmatrix}0&1\\0&0\end{pmatrix} has eigenvalue 00 with multiplicity 2. Yet Λϵ(A){z<ϵ}\Lambda_\epsilon(A) \supset \{|z| < \sqrt{\epsilon}\} - a disk of radius ϵ\sqrt{\epsilon}, much larger than ϵ\epsilon for small ϵ\epsilon.

For AI: Non-normal recurrent weight matrices WhhW_{hh} in RNNs can transiently amplify signals even when Whh2<1\|W_{hh}\|_2 < 1. The pseudo-spectrum shows why the simple criterion "Whh2<1\|W_{hh}\|_2 < 1 implies stability" is insufficient - transient growth can lead to effective instability in finite-depth computations (finite unrolling of time steps).

B.3 Stable Rank and Generalization

The stable rank of AA is:

ρ(A)=AF2A22=iσi2σ12=i(σiσ1)2\rho(A) = \frac{\|A\|_F^2}{\|A\|_2^2} = \frac{\sum_i \sigma_i^2}{\sigma_1^2} = \sum_i \left(\frac{\sigma_i}{\sigma_1}\right)^2

Properties:

  • 1ρ(A)rank(A)1 \leq \rho(A) \leq \operatorname{rank}(A)
  • ρ(A)=1\rho(A) = 1 iff AA is rank-1
  • ρ(A)=r\rho(A) = r iff AA has rr equal nonzero singular values (flat singular value spectrum)
  • ρ(A)\rho(A) is continuous in AA (unlike rank, which is discontinuous)

Generalization bound. For a linear predictor f(x)=Wx\mathbf{f}(\mathbf{x}) = W\mathbf{x} learned from nn samples:

Generalization gapO(ρ(W)W22n)=O(WF2n)\text{Generalization gap} \leq O\left(\sqrt{\frac{\rho(W)\|W\|_2^2}{n}}\right) = O\left(\sqrt{\frac{\|W\|_F^2}{n}}\right)

This shows that the Frobenius norm (not rank) controls generalization for linear models - justifying Frobenius regularization (weight decay).

For deep networks. Bartlett et al. (2017) proved:

Generalization gapO(lWl2lρ(Wl)γn)\text{Generalization gap} \leq O\left(\frac{\prod_l \|W_l\|_2 \cdot \sqrt{\sum_l \rho(W_l)}}{\gamma\sqrt{n}}\right)

where γ\gamma is the margin. The stable rank ρ(Wl)\rho(W_l) of each layer's weight matrix appears, not its true rank.

B.4 Matrix Norms in Optimization: Proximal Methods

Many regularized optimization problems of the form:

minWL(W)+λR(W)\min_W \mathcal{L}(W) + \lambda R(W)

can be solved with proximal gradient descent:

W(t+1)=proxαλR(W(t)αL(W(t)))W^{(t+1)} = \operatorname{prox}_{\alpha\lambda R}(W^{(t)} - \alpha \nabla \mathcal{L}(W^{(t)}))

The proximal operator proxτR(V)=argminW12WVF2+τR(W)\operatorname{prox}_{\tau R}(V) = \arg\min_W \frac{1}{2}\|W-V\|_F^2 + \tau R(W) depends on the choice of RR:

Regularizer R(W)R(W)Proximal OperatorEffect
WF2\|W\|_F^2 (L2)W/(1+2τ)W/(1+2\tau)Scale all entries uniformly
W\|W\|_* (nuclear)SVT: soft-threshold singular valuesZero small singular values
W2\|W\|_2 (spectral)Cap all σi\sigma_i at τ\tau; project onto spectral ballBound largest singular value
W1\|W\|_1 (entry)sign(Vij)max(Vijτ,0)\operatorname{sign}(V_{ij})\max(\lvert V_{ij}\rvert-\tau,0)Soft-threshold each entry

For AI: The proximal operator for nuclear norm regularization is singular value soft-thresholding (SVT), the key subroutine in matrix completion algorithms (Cai-Candes-Shen, 2010). Modern deep learning rarely uses explicit nuclear norm regularization because the factored parameterization in LoRA provides implicit nuclear norm regularization via the dynamics of gradient descent on minB,AL(W0+BA)\min_{B,A}\mathcal{L}(W_0+BA).

B.5 Norm Balls and Geometry

The geometry of norm balls illuminates the differences between norms.

UNIT BALLS IN 2D (for matrix norms, visualized on singular value vectors)
========================================================================

  Spectral (ell\infty on \sigma)    Frobenius (ell^2 on \sigma)   Nuclear (ell^1 on \sigma)

    \sigma_2                     \sigma_2                     \sigma_2
    |                      |                      |
  1-+-------+            1-+    +---+           1-+
    |       |              |   /   \              |\
    |       |              |  |     |             |  \
    |       |              |  |     |             |    \
  --+-------+--\sigma_1       --+--+-----+--\sigma_1      --+-----+--\sigma_1
    |       1              |        1             |     1
    |                      |                      |
    + square               + circle               + diamond

  All \sigma \leq 1               \sigma_1^2+\sigma_2^2 \leq 1          \sigma_1+\sigma_2 \leq 1

========================================================================

The nuclear norm ball is a polytope in singular value space (it's the 1\ell^1 ball), making nuclear norm minimization a linear program in singular value space - hence solvable efficiently.

The spectral norm ball is a hypercube in singular value space (\ell^\infty ball), with flat faces. This geometry means that spectral norm projection (projecting onto W21\|W\|_2 \leq 1) simply caps all singular values at 1.

For AI: The different geometries explain why nuclear norm regularization promotes low-rank solutions (the corners of the 1\ell^1 diamond are at axis-aligned points = rank-1 matrices) while Frobenius regularization does not (the smooth 2\ell^2 ball has no corners to attract the solution toward).


Appendix C: Computational Reference

C.1 NumPy/SciPy Norm API

import numpy as np
import scipy.linalg as la

A = np.random.randn(4, 5)   # example matrix

# Frobenius norm
np.linalg.norm(A, 'fro')           # direct
np.sqrt(np.sum(A**2))              # elementwise
np.sqrt(np.trace(A.T @ A))        # trace formula

# Spectral norm = sigma_1
np.linalg.norm(A, 2)               # direct (uses SVD internally)
la.svdvals(A)[0]                   # explicit first singular value

# Nuclear norm = sum of singular values
np.linalg.norm(A, 'nuc')           # direct
np.sum(la.svdvals(A))              # explicit sum

# Matrix 1-norm = max absolute column sum
np.linalg.norm(A, 1)               # induced 1-norm

# Matrix infinity-norm = max absolute row sum
np.linalg.norm(A, np.inf)          # induced inf-norm

# Condition number
np.linalg.cond(A)                  # spectral: sigma_1 / sigma_n
np.linalg.cond(A, 'fro')          # Frobenius-based
np.linalg.cond(A, 1)              # 1-norm condition number

C.2 Power Iteration for Spectral Norm

def spectral_norm_power_iter(A, n_iter=20, seed=42):
    """Estimate ||A||_2 = sigma_1(A) via power iteration."""
    rng = np.random.default_rng(seed)
    v = rng.standard_normal(A.shape[1])
    v /= np.linalg.norm(v)

    for _ in range(n_iter):
        u = A @ v;  u /= np.linalg.norm(u)
        v = A.T @ u
        sigma = np.linalg.norm(v)
        v /= sigma

    return sigma   # converges at rate (sigma_2 / sigma_1)^(2*n_iter)

This is used in spectral normalization: one step per training iteration is enough (the estimate from the previous step is a warm start).

C.3 Singular Value Soft-Thresholding

def svt(A, threshold):
    """Proximal operator of threshold * ||.||_* applied to A."""
    U, s, Vt = np.linalg.svd(A, full_matrices=False)
    s_thresh = np.maximum(s - threshold, 0)
    return U @ np.diag(s_thresh) @ Vt

# Returns argmin_X  (1/2)||X - A||_F^2 + threshold * ||X||_*
# Singular values below threshold are zeroed -> rank reduction

C.4 Stable Rank

def stable_rank(A):
    """Stable rank rho(A) = ||A||_F^2 / ||A||_2^2."""
    s = np.linalg.svd(A, compute_uv=False)
    return np.sum(s**2) / s[0]**2

# Always in [1, rank(A)]
# = 1 iff rank-1; = rank(A) iff flat singular value spectrum

C.5 Tikhonov Solution via SVD

def tikhonov_svd(A, b, lam):
    """Tikhonov-regularized least squares: min ||Ax-b||^2 + lam||x||^2.
    Uses SVD for numerical stability even when A is near-singular."""
    U, s, Vt = np.linalg.svd(A, full_matrices=False)
    d = s / (s**2 + lam)     # modified singular value filter
    return Vt.T @ (d * (U.T @ b))

# Condition number of regularized system: (s[0]^2 + lam) / (s[-1]^2 + lam)

Appendix D: Extended Examples and Worked Problems

D.1 A Complete Norm Taxonomy on One Matrix

Let A=(400020001)A = \begin{pmatrix} 4 & 0 & 0 \\ 0 & 2 & 0 \\ 0 & 0 & 1 \end{pmatrix} (diagonal with singular values σ1=4,σ2=2,σ3=1\sigma_1=4, \sigma_2=2, \sigma_3=1).

All norms in one place:

NormFormulaValueComputation
Frobenius AF\|A\|_Fσi2\sqrt{\sum\sigma_i^2}214.58\sqrt{21} \approx 4.5816+4+1\sqrt{16+4+1}
Spectral A2\|A\|_2σ1\sigma_144Largest singular value
Nuclear A\|A\|_*σi\sum\sigma_i774+2+14+2+1
Schatten S3S_3(σi3)1/3(\sum\sigma_i^3)^{1/3}(64+8+1)1/34.17(64+8+1)^{1/3} \approx 4.17731/373^{1/3}
Matrix 1-norm A1\|A\|_1max col sum44Max of {4,2,1}\{4,2,1\}
Matrix \infty-normmax row sum44Max of {4,2,1}\{4,2,1\}
Condition number κ2\kappa_2σ1/σ3\sigma_1/\sigma_3444/14/1
Stable rank ρ\rhoAF2/A22\|A\|_F^2/\|A\|_2^221/161.3121/16 \approx 1.3121/1621/16

Ordering verification: A2=4AF4.58A=7\|A\|_2 = 4 \leq \|A\|_F \approx 4.58 \leq \|A\|_* = 7 OK

For rank-rr bounds: AF3A2\|A\|_F \leq \sqrt{3}\|A\|_2 gives 4.586.934.58 \leq 6.93 OK and A3AF\|A\|_* \leq \sqrt{3}\|A\|_F gives 77.947 \leq 7.94 OK.

D.2 Worked Example: Spectral Norm via Power Iteration

Let A=(3124)A = \begin{pmatrix} 3 & 1 \\ 2 & 4 \end{pmatrix}.

Exact: The singular values satisfy σ2=eigenvalues of AA=(13111117)\sigma^2 = \text{eigenvalues of } A^\top A = \begin{pmatrix}13&11\\11&17\end{pmatrix}.

tr(AA)=30\text{tr}(A^\top A) = 30, det(AA)=1317121=221121=100\det(A^\top A) = 13\cdot17 - 121 = 221 - 121 = 100.

Eigenvalues: λ=(30±900400)/2=(30±500)/2=15±55\lambda = (30 \pm \sqrt{900 - 400})/2 = (30 \pm \sqrt{500})/2 = 15 \pm 5\sqrt{5}.

So σ1=15+5526.185.12\sigma_1 = \sqrt{15 + 5\sqrt{5}} \approx \sqrt{26.18} \approx 5.12 and A25.12\|A\|_2 \approx 5.12.

Power iteration (starting with v0=(1,0)\mathbf{v}_0 = (1,0)^\top):

IterAvA\mathbf{v}u\mathbf{u}AuA^\top\mathbf{u}v\mathbf{v}σ\sigma estimate
0---(1,0)(1,0)^\top-
1(3,2)(3,2)^\top(0.832,0.555)(0.832,0.555)^\top(3.607,4.052)(3.607,4.052)^\top(0.664,0.747)(0.664,0.747)^\top5.435.43
2(2.74,4.29)(2.74,4.29)^\top(0.538,0.843)(0.538,0.843)^\top(3.460,4.110)(3.460,4.110)^\top(0.644,0.765)(0.644,0.765)^\top5.375.37
3(2.70,4.35)(2.70,4.35)^\top(0.529,0.849)(0.529,0.849)^\top(3.437,4.124)(3.437,4.124)^\top(0.641,0.768)(0.641,0.768)^\top5.375.37

Converging to σ15.12\sigma_1 \approx 5.12 (the remaining gap is because we stopped early).

For AI: This is exactly how PyTorch implements torch.nn.utils.spectral_norm - one step of power iteration per training step, with the previous estimate v\mathbf{v} stored as a buffer.

D.3 Worked Example: Condition Number and Error Amplification

Consider the Hilbert matrix HnH_n with (Hn)ij=1/(i+j1)(H_n)_{ij} = 1/(i+j-1) - a canonical example of an ill-conditioned matrix.

For n=5n = 5:

H5=(11/21/31/41/51/21/31/41/51/61/31/41/51/61/71/41/51/61/71/81/51/61/71/81/9)H_5 = \begin{pmatrix} 1 & 1/2 & 1/3 & 1/4 & 1/5 \\ 1/2 & 1/3 & 1/4 & 1/5 & 1/6 \\ 1/3 & 1/4 & 1/5 & 1/6 & 1/7 \\ 1/4 & 1/5 & 1/6 & 1/7 & 1/8 \\ 1/5 & 1/6 & 1/7 & 1/8 & 1/9 \end{pmatrix}

The condition number grows as κ2(Hn)e3.5n\kappa_2(H_n) \approx e^{3.5n}:

  • κ2(H5)4.77×105\kappa_2(H_5) \approx 4.77 \times 10^5
  • κ2(H10)1.60×1013\kappa_2(H_{10}) \approx 1.60 \times 10^{13}
  • κ2(H12)1.83×1016\kappa_2(H_{12}) \approx 1.83 \times 10^{16} (at the limit of double precision!)

Error analysis. Solve H5x=bH_5 \mathbf{x} = \mathbf{b} where b=H51\mathbf{b} = H_5 \mathbf{1} (exact solution x0=(1,1,1,1,1)\mathbf{x}_0 = (1,1,1,1,1)^\top). With b\mathbf{b} perturbed by machine epsilon ϵ1016\epsilon \approx 10^{-16}:

Relative forward error κ(H5)10164.77×10510165×1011\leq \kappa(H_5) \cdot 10^{-16} \approx 4.77 \times 10^5 \cdot 10^{-16} \approx 5 \times 10^{-11}

So we lose about 5 decimal places of precision. For H10H_{10}, we'd lose 13 places - near total loss of information.

Tikhonov fix: With λ=105\lambda = 10^{-5}, κ(H5+λI)8×104\kappa(H_5 + \lambda I) \approx 8 \times 10^4 - a 6\times improvement at the cost of introducing systematic bias λx\approx \lambda\|\mathbf{x}\|.

D.4 The Spectral Norm of the Attention Matrix

In a transformer with sequence length T=512T = 512, dimension dk=64d_k = 64, and queries and keys drawn from a standard Gaussian:

Expected spectral norm. For Q,KRT×dkQ, K \in \mathbb{R}^{T \times d_k} with i.i.d. N(0,1/dk)\mathcal{N}(0, 1/d_k) entries:

E[QK2]T+dkdk/T+1σ2dk\mathbb{E}[\|QK^\top\|_2] \approx \frac{T + d_k}{d_k/T + 1} \cdot \frac{\sigma^2}{d_k}

More concretely, by random matrix theory (Marchenko-Pastur law), QK22Tdk/dkdk=2T\|QK^\top\|_2 \approx 2\sqrt{Td_k}/d_k \cdot \sqrt{d_k} = 2\sqrt{T}.

The factor 1/dk1/\sqrt{d_k} in attention (softmax(QK/dk)\text{softmax}(QK^\top/\sqrt{d_k})) is a spectral normalization: it scales the attention logits so that QK/dk22T/dk\|QK^\top/\sqrt{d_k}\|_2 \approx 2\sqrt{T/d_k} - preventing the softmax from collapsing to one-hot distributions when TdkT \gg d_k.

Nuclear norm and attention rank. In trained models, attention matrices exhibit low stable rank. Dong et al. (2021) measured stable rank ρ(A)=AF2/A22\rho(A) = \|A\|_F^2/\|A\|_2^2 averaging 4-8 in BERT's attention heads (out of possible 512), suggesting the effective attention rank is much lower than the sequence length.

D.5 LoRA Norm Analysis

LoRA fine-tuning adds ΔW=BA\Delta W = BA with BRd×rB \in \mathbb{R}^{d \times r}, ARr×dA \in \mathbb{R}^{r \times d}, typically r{4,8,16,32}r \in \{4, 8, 16, 32\} vs. d{768,1024,4096}d \in \{768, 1024, 4096\}.

Norm bounds on ΔW\Delta W:

  • ΔWF=BAFBFAF\|\Delta W\|_F = \|BA\|_F \leq \|B\|_F\|A\|_F (submultiplicativity)
  • ΔW2=BA2B2A2\|\Delta W\|_2 = \|BA\|_2 \leq \|B\|_2\|A\|_2
  • ΔW=BAmin(BA2,B2A)\|\Delta W\|_* = \|BA\|_* \leq \min(\|B\|_*\|A\|_2, \|B\|_2\|A\|_*)

Implicit nuclear norm regularization. The factored parameterization ΔW=BA\Delta W = BA has at most rr nonzero singular values (since rank(BA)r\text{rank}(BA) \leq r). The nuclear norm BA=i=1rσi(BA)\|BA\|_* = \sum_{i=1}^r \sigma_i(BA) is automatically bounded by:

BArBAFrBFAF\|BA\|_* \leq \sqrt{r}\|BA\|_F \leq \sqrt{r}\|B\|_F\|A\|_F

During optimization, gradient descent on minB,AL(W0+BA)\min_{B,A}\mathcal{L}(W_0+BA) implicitly minimizes BA\|BA\|_* - this is the Gunasekar et al. (2017) implicit regularization result.

DoRA (weight decomposition). DoRA (Liu et al., 2024) reparameterizes as W=m(V+BA)/V+BAcolW = m\cdot(V+BA)/\|V+BA\|_{col} where mm controls the magnitude and V+BA/...V+BA/\|...\| controls the direction. The column-wise normalization is related to the nuclear norm: W\|W\|_* is invariant to column-wise rescaling.

D.6 Gradient Flow and Norm Dynamics

During training, norms of weight matrices evolve. Understanding this evolution helps diagnose training pathologies.

Stable training. For a well-trained transformer layer with weight matrix WR4096×4096W \in \mathbb{R}^{4096 \times 4096}:

  • W215\|W\|_2 \approx 1-5 (spectral norm; bounded by weight decay + gradient clipping)
  • WF30100\|W\|_F \approx 30-100 (Frobenius norm; dW2\approx \sqrt{d}\|W\|_2 for flat spectrum)
  • κ(W)102104\kappa(W) \approx 10^2-10^4 (condition number; not too large for well-initialized models)
  • ρ(W)100500\rho(W) \approx 100-500 (stable rank; much less than 4096)

Warning signs:

  • W2\|W\|_2 growing rapidly -> potential gradient explosion; increase weight decay
  • W20\|W\|_2 \to 0 -> vanishing gradients or overly aggressive weight decay
  • κ(W)106\kappa(W) \to 10^6 -> poorly conditioned optimization; consider preconditioning
  • ρ(W)1\rho(W) \to 1 -> the layer is becoming rank-1 (mode collapse); increase model capacity

D.7 Norm-Based Pruning

Neural network pruning can be guided by matrix norms:

Magnitude pruning (Frobenius). Remove weight matrices (or rows/columns) with smallest Frobenius norm. The remaining error WprunedWF\|W_{\text{pruned}} - W\|_F equals the Frobenius norm of the pruned components.

Spectral pruning. Prune singular value components below a threshold τ\tau: W^=σi>τσiuivi\hat{W} = \sum_{\sigma_i > \tau} \sigma_i \mathbf{u}_i\mathbf{v}_i^\top. Error: WW^2=σk+1\|W - \hat{W}\|_2 = \sigma_{k+1} (spectral) and WW^F=i>kσi2\|W-\hat{W}\|_F = \sqrt{\sum_{i>k}\sigma_i^2} (Frobenius).

Nuclear norm pruning. Regularize the fine-tuned model with λΔW\lambda\|\Delta W\|_* during training, encouraging the weight update to use fewer singular value "directions." After training, prune near-zero singular values.

Comparison:

MethodError controlledNorm minimizedComputational cost
Magnitude pruningWprunedF\|W_{\text{pruned}}\|_FNone explicitlyO(1)O(1)
SVD truncationWW^2\|W-\hat{W}\|_2 and WW^F\|W-\hat{W}\|_FNone (deterministic)O(mnmin(m,n))O(mn\min(m,n))
Nuclear norm reg.W^\|\hat{W}\|_*Nuclear normO(mnmin(m,n))O(mn\min(m,n)) per step
Spectral norm SNW2\|W\|_2Spectral normO(k)O(k) power iter per step

<- Back to Advanced Linear Algebra | Next: Linear Transformations ->

Appendix E: Connections to Other Fields

E.1 Matrix Norms in Statistics

Matrix norms appear throughout multivariate statistics.

Covariance matrices. For a sample covariance matrix Σ^=1nXX\hat{\Sigma} = \frac{1}{n}X^\top X (where XRn×pX \in \mathbb{R}^{n \times p}):

  • Σ^2=λmax(Σ^)\|\hat{\Sigma}\|_2 = \lambda_{\max}(\hat{\Sigma}): the variance in the direction of maximum spread (principal component 1)
  • Σ^=tr(Σ^)=jσ^j2\|\hat{\Sigma}\|_*= \operatorname{tr}(\hat{\Sigma}) = \sum_j \hat{\sigma}_j^2: total variance
  • κ(Σ^)=λmax/λmin\kappa(\hat{\Sigma}) = \lambda_{\max}/\lambda_{\min}: measures how "spherical" the distribution is

Condition number and regression. For linear regression y=Xβ+ϵ\mathbf{y} = X\boldsymbol{\beta} + \boldsymbol{\epsilon}:

κ(XX)=λmax(XX)λmin(XX)=σ1(X)2σp(X)2=κ(X)2\kappa(X^\top X) = \frac{\lambda_{\max}(X^\top X)}{\lambda_{\min}(X^\top X)} = \frac{\sigma_1(X)^2}{\sigma_p(X)^2} = \kappa(X)^2

Multicollinearity in XX gives large κ(XX)\kappa(X^\top X), making OLS estimates numerically unstable. Ridge regression adds λI\lambda I to improve conditioning: κ((XX+λI))=(σ12+λ)/(σp2+λ)\kappa((X^\top X + \lambda I)) = (\sigma_1^2 + \lambda)/(\sigma_p^2 + \lambda).

PCA error bounds. Truncating PCA at kk components introduces Frobenius error i>kλi\sqrt{\sum_{i>k}\lambda_i} where λi\lambda_i are eigenvalues of Σ^\hat{\Sigma}. This is exactly the Eckart-Young theorem applied to the covariance matrix.

Sample covariance concentration. For nn samples from N(0,Σ)\mathcal{N}(0, \Sigma):

EΣ^Σ2Σ2pn(pn)\mathbb{E}\|\hat{\Sigma} - \Sigma\|_2 \lesssim \|\Sigma\|_2 \sqrt{\frac{p}{n}} \quad (p \leq n)

The spectral norm of the estimation error scales as Σ2p/n\|\Sigma\|_2\sqrt{p/n} - one needs npn \gg p samples to estimate Σ\Sigma well in spectral norm.

E.2 Matrix Norms in Control Theory

Control systems use matrix norms to quantify system gain and stability margins.

System norms. For a linear system x˙=Ax+Bu\dot{\mathbf{x}} = A\mathbf{x} + B\mathbf{u}, y=Cx\mathbf{y} = C\mathbf{x}:

  • HH_\infty norm: G=supωσmax(G(iω))\|G\|_\infty = \sup_\omega \sigma_{\max}(G(i\omega)) - worst-case gain over all frequencies; the spectral norm of the frequency response
  • H2H_2 norm: G2=tr(BPB)\|G\|_2 = \sqrt{\operatorname{tr}(B^\top P B)} where PP solves a Lyapunov equation; related to Frobenius norm in the frequency domain

Stability. A discrete-time system xt+1=Axt\mathbf{x}_{t+1} = A\mathbf{x}_t is stable iff ρ(A)<1\rho(A) < 1 (spectral radius < 1). But for finite-time analysis, At2A2t\|A^t\|_2 \leq \|A\|_2^t - the spectral norm controls the growth of powers.

For AI: Recurrent networks are discrete-time dynamical systems with ht+1=σ(Whhht+Wxhxt)\mathbf{h}_{t+1} = \sigma(W_{hh}\mathbf{h}_t + W_{xh}\mathbf{x}_t). The condition Whh2<1\|W_{hh}\|_2 < 1 (spectral normalization) guarantees contractivity: gradients decay as Whh2t\|W_{hh}\|_2^t through time - preventing explosion but also potentially causing vanishing gradients in long sequences.

E.3 Matrix Norms in Quantum Information

Quantum states are represented by density matrices ρ\rho (PSD, tr(ρ)=1\operatorname{tr}(\rho) = 1). Operations are described by quantum channels. Matrix norms quantify distances between quantum states and operations.

Trace norm distance. The trace distance between quantum states ρ,σ\rho, \sigma:

D(ρ,σ)=12ρσ=12iλi(ρσ)D(\rho, \sigma) = \frac{1}{2}\|\rho - \sigma\|_* = \frac{1}{2}\sum_i |\lambda_i(\rho - \sigma)|

(For Hermitian matrices, the nuclear norm equals the sum of absolute eigenvalues, not singular values.)

Diamond norm. For quantum channels E,F\mathcal{E}, \mathcal{F}:

EF=maxρ(EI)(ρ)(FI)(ρ)\|\mathcal{E} - \mathcal{F}\|_\diamond = \max_\rho \|(\mathcal{E} \otimes I)(\rho) - (\mathcal{F} \otimes I)(\rho)\|_*

This is the quantum analog of the 212 \to 1 norm - measuring the maximum distinguishability of the channels.

For AI: Large language models in principle implement quantum-inspired computations when trained on quantum data. More concretely, tensor network approximations of quantum states use matrix norms (Frobenius) to bound truncation error in tensor decompositions - the same mathematics as SVD-based model compression.

E.4 Matrix Norms in Graph Theory

For a graph GG on nn vertices with adjacency matrix A{0,1}n×nA \in \{0,1\}^{n \times n}:

Spectral radius. A2=λmax(A)\|A\|_2 = \lambda_{\max}(A) (for symmetric AA, since A2=ρ(A)\|A\|_2 = \rho(A) for symmetric PSD).

Graph conductance and mixing. The second eigenvalue λ2\lambda_2 of the normalized Laplacian controls the mixing time of random walks. Small λ2\lambda_2 means slow mixing (large κ\kappa).

Graph neural networks. A GNN layer applies H(l+1)=σ(A^H(l)W(l))H^{(l+1)} = \sigma(\hat{A}H^{(l)}W^{(l)}) where A^\hat{A} is the normalized adjacency. The spectral norm A^21\|\hat{A}\|_2 \leq 1 (by design of normalization) ensures the graph propagation is non-expansive - a Lipschitz constraint built into the architecture.

Over-smoothing and rank collapse. After many GNN layers, the representations H(L)H^{(L)} converge to a low-rank matrix. The nuclear norm of H(L)H^{(L)} decreases, reflecting that all nodes' features converge to the same value (weighted by PageRank). This is the GNN analog of the attention rank collapse phenomenon.


Appendix F: Historical Development

The theory of matrix norms developed in parallel with the needs of numerical analysis and functional analysis.

HISTORICAL TIMELINE: MATRIX NORMS
========================================================================

  1844  Cauchy introduces the "module" of a complex matrix - early norm idea

  1878  Frobenius studies bilinear forms; Frobenius norm implicit in his work

  1905  Hilbert introduces "Hilbert space" - inner product -> norm framework

  1929  Von Neumann: abstract operator theory in Hilbert space;
        nuclear operators (trace class) defined

  1937  Von Neumann trace inequality proved; singular values for operators

  1939  Ky Fan: Ky Fan k-norms, matrix inequalities

  1946  Eckart & Young: best low-rank approximation theorem (SVD)

  1950s Development of "matrix analysis" as a field (Bauer, Fike, etc.)
        Bauer-Fike theorem (1960): eigenvalue perturbation bound

  1960s Gershgorin circle theorem; norm-based stability conditions
        for numerical ODE solvers and control systems

  1970s  Numerical linear algebra matures (Golub, Van Loan)
        Condition number becomes central concept in floating-point analysis

  1988  Grothendieck's "resume" translated; connections to operator spaces

  1990s  Nuclear norm in matrix completion; compressed sensing foundations

  2004  Candes & Tao: compressed sensing; nuclear norm as convex
        proxy for rank in matrix recovery

  2010  Cai, Candes, Shen: singular value thresholding algorithm (SVT)
        for nuclear norm minimization

  2018  Miyato et al.: Spectral Normalization for GANs
        (ICLR 2018 paper)

  2021  Dong et al.: attention rank collapse analysis via matrix norms

  2021  Hu et al.: LoRA - implicit nuclear norm regularization via
        low-rank factored parameterization

  2024  DeepSeek MLA: explicit low-rank KV cache via nuclear norm
        motivated matrix compression

========================================================================

Key insight from the historical development. Matrix norms began as abstract tools in functional analysis (Von Neumann, Ky Fan) and numerical analysis (Frobenius, Bauer, Fike). Their entry into machine learning came through three channels:

  1. Optimization theory (nuclear norm = convex proxy for rank, 2004-2010)
  2. Generalization theory (Frobenius and spectral norms in PAC-Bayes bounds, 2017)
  3. Architecture design (spectral normalization, LoRA, MLA, 2018-2024)

The mathematical tools developed over 80 years now routinely appear in the training pipelines of the largest language models.


Appendix G: Summary Tables

G.1 Complete Norm Reference Table

NormSymbolFormulaSVD formulaComputationNotes
FrobeniusAF\|A\|_Faij2\sqrt{\sum a_{ij}^2}σ2\|\boldsymbol{\sigma}\|_2norm(A,'fro')Euclidean on entries; not induced
SpectralA2\|A\|_2maxx=1Ax\max_{\|x\|=1}\|Ax\|σ1\sigma_1norm(A,2)Largest singular value; induced
NuclearA\|A\|_*tr(AA)\operatorname{tr}(\sqrt{A^\top A})σi\sum\sigma_inorm(A,'nuc')Dual of spectral; convex rank proxy
Matrix-1A1\|A\|_1maxjiaij\max_j\sum_i\|a_{ij}\|-norm(A,1)Max col sum; induced
Matrix-\inftyA\|A\|_\inftymaxijaij\max_i\sum_j\|a_{ij}\|-norm(A,inf)Max row sum; induced
Schatten-ppASp\|A\|_{S_p}(σip)1/p(\sum\sigma_i^p)^{1/p}σp\|\boldsymbol{\sigma}\|_pCustom (use SVD)Unifies F, spec, nuclear
Ky Fan-kkA(k)\|A\|_{(k)}σ1++σk\sigma_1+\cdots+\sigma_kσ1:k1\|\boldsymbol{\sigma}_{1:k}\|_1sum(svdvals[:k])Sum of top-kk singular values
Max entryAmax\|A\|_{\max}maxijaij\max_{ij}\|a_{ij}\|-np.max(abs(A))NOT submultiplicative

G.2 Norm Inequality Summary

For ARm×nA \in \mathbb{R}^{m \times n} with rank rr and singular values σ1σr>0\sigma_1 \geq \cdots \geq \sigma_r > 0:

A2AFrA2\|A\|_2 \leq \|A\|_F \leq \sqrt{r}\|A\|_2 AFArAF\|A\|_F \leq \|A\|_* \leq \sqrt{r}\|A\|_F A2ArA2\|A\|_2 \leq \|A\|_* \leq r\|A\|_2 1nA1A2mA1\frac{1}{\sqrt{n}}\|A\|_1 \leq \|A\|_2 \leq \sqrt{m}\|A\|_1 1mAA2nA\frac{1}{\sqrt{m}}\|A\|_\infty \leq \|A\|_2 \leq \sqrt{n}\|A\|_\infty AmaxA2mnAmax\|A\|_{\max} \leq \|A\|_2 \leq \sqrt{mn}\|A\|_{\max}

All inequalities are tight (achieved by appropriate matrices).

G.3 Which Norm to Use When

GoalRecommended normReason
Measure approximation error AB\|A-B\|FrobeniusEuclidean geometry; easy to compute and differentiate
Bound amplification of a linear mapSpectralExactly measures worst-case gain
Promote low-rank solutionsNuclearConvex proxy for rank; SVT proximal operator
Measure GAN discriminator LipschitzSpectralProduct of spectral norms bounds network Lipschitz
Analyze numerical stabilityCondition number κ=A2A12\kappa = \|A\|_2\|A^{-1}\|_2Quantifies sensitivity to perturbations
Regularize neural network weightsFrobenius (WF2\|W\|_F^2)Gradient is 2W2W; easy to implement; weight decay
Compress weight matricesSpectral + Frobenius (Eckart-Young)Optimal low-rank approximation uses SVD
Certify network robustnessSpectral norm per layerBound on overall Lipschitz constant
Matrix completion / recommendationNuclearNuclear norm minimization recovers under incoherence
Quantum state discriminationTrace norm (nuclear for Hermitian)Operational meaning in quantum measurement

G.4 Condition Number Thresholds (Practical Guide)

κ2(A)\kappa_2(A)Precision lossStatusAction
11NonePerfectly conditioned-
<103< 10^3<3< 3 digitsWell conditionedStandard algorithms
10310^3-10610^63-6 digitsModerately ill-conditionedWatch for rounding
10610^6-101010^{10}6-10 digitsIll-conditionedUse Tikhonov; double-check
101010^{10}-101410^{14}10-14 digitsSeverely ill-conditionedRegularize aggressively
>1014> 10^{14}> 14 digitsNear-singularEssentially singular in double precision
\inftyAll digitsSingularProblem is underdetermined

In double precision arithmetic (ϵmach1016\epsilon_{\text{mach}} \approx 10^{-16}), effective precision = 16log10κ16 - \log_{10}\kappa digits.


Appendix H: Deep Dives

H.1 The Spectral Norm in Full Detail

The spectral norm A2=σ1(A)\|A\|_2 = \sigma_1(A) deserves extended treatment because it appears in so many different contexts.

Variational characterizations. All of the following equal σ1(A)\sigma_1(A):

σ1(A)=maxx2=1Ax2(definition)\sigma_1(A) = \max_{\|\mathbf{x}\|_2 = 1}\|A\mathbf{x}\|_2 \qquad \text{(definition)} =maxx2=y2=1yAx(bilinear form)= \max_{\|\mathbf{x}\|_2 = \|\mathbf{y}\|_2 = 1} \mathbf{y}^\top A\mathbf{x} \qquad \text{(bilinear form)} =λmax(AA)(eigenvalue of Gram matrix)= \sqrt{\lambda_{\max}(A^\top A)} \qquad \text{(eigenvalue of Gram matrix)} =λmax(AA)(left Gram matrix)= \sqrt{\lambda_{\max}(AA^\top)} \qquad \text{(left Gram matrix)} =maxB1A,BF(dual norm formula)= \max_{\|B\|_* \leq 1}\langle A, B\rangle_F \qquad \text{(dual norm formula)}

Each characterization reveals a different aspect:

  • The first shows it as maximum stretching
  • The second shows it as maximum inner product over the unit sphere (bilinear)
  • The third and fourth show it as square root of a largest eigenvalue
  • The fifth shows it as dual of nuclear norm

Computing σ1\sigma_1 for structured matrices:

For A=uvA = \mathbf{u}\mathbf{v}^\top (rank-1): σ1=uv\sigma_1 = \|\mathbf{u}\|\|\mathbf{v}\| (exact, no SVD needed).

For AA symmetric PSD: σ1=λmax(A)\sigma_1 = \lambda_{\max}(A) (Lanczos iteration converges fast).

For AA sparse: Power iteration on AAA^\top A with sparse matrix-vector products, O(nnz(A)k)O(\text{nnz}(A) \cdot k) for kk iterations.

For AA a convolution matrix (CNN weights): The spectral norm equals the maximum frequency response a^\|\hat{a}\|_\infty where a^\hat{a} is the Fourier transform of the filter - computable in O(nlogn)O(n\log n) via FFT.

For AI: The "singular value of a convolution" insight means spectral normalization of CNN layers can be done in O(nlogn)O(n\log n) using FFT instead of O(n2)O(n^2) SVD. This is exploited in efficient implementations of spectral normalization for CNNs.

Spectral norm of attention. For scaled dot-product attention with keys KRT×dkK \in \mathbb{R}^{T\times d_k}, queries QRT×dkQ \in \mathbb{R}^{T\times d_k}, the attention logit matrix S=QK/dkS = QK^\top/\sqrt{d_k} satisfies:

S2Q2K2/dk\|S\|_2 \leq \|Q\|_2\|K\|_2/\sqrt{d_k}

In practice, if Q,KQ, K are normalized (unit-norm rows), then Q2T\|Q\|_2 \leq \sqrt{T} and K2T\|K\|_2 \leq \sqrt{T}, giving S2T/dk\|S\|_2 \leq T/\sqrt{d_k}. The 1/dk1/\sqrt{d_k} factor prevents this from growing with dkd_k, maintaining bounded spectral norm for fixed TT.

Spectral norm through training. In typical training of GPT-like models:

  • At initialization (Xavier/Kaiming): W22/d\|W\|_2 \approx \sqrt{2/d} (by design)
  • After training without regularization: W2\|W\|_2 can grow by 10-100\times as features strengthen
  • With weight decay λ\lambda: equilibrium at W2WL2/λ\|W\|_2 \approx \|\nabla_W\mathcal{L}\|_2/\lambda (gradient norm divided by decay rate)
  • With spectral normalization: W2=1\|W\|_2 = 1 exactly (enforced each step)

H.2 The Nuclear Norm in Full Detail

The nuclear norm A=iσi\|A\|_* = \sum_i\sigma_i has a rich structure worth examining closely.

Characterizations. All of the following equal A\|A\|_*:

A=tr(AA)=tr(A)\|A\|_* = \operatorname{tr}(\sqrt{A^\top A}) = \operatorname{tr}(|A|) =minA=UV12(UF2+VF2)(factorization formula)= \min_{A = UV^\top} \frac{1}{2}(\|U\|_F^2 + \|V\|_F^2) \qquad \text{(factorization formula)} =maxB21tr(AB)(duality)= \max_{\|B\|_2 \leq 1}\operatorname{tr}(A^\top B) \qquad \text{(duality)} =minA=B+CB rank-1B+C(triangle inequality applied optimally)= \min_{\substack{A = B + C \\ B\text{ rank-1}}} \|B\|_* + \|C\|_* \qquad \text{(triangle inequality applied optimally)}

The factorization formula A=minA=UV12(UF2+VF2)\|A\|_* = \min_{A=UV^\top}\frac{1}{2}(\|U\|_F^2+\|V\|_F^2) is particularly useful:

It shows that the nuclear norm equals half the squared Frobenius norm at the optimal factorization - the one where the singular values split evenly: U=U0Σ1/2U = U_0\Sigma^{1/2} and V=V0Σ1/2V = V_0\Sigma^{1/2} in the SVD A=U0ΣV0A = U_0\Sigma V_0^\top.

For AI: This is exactly why LoRA works. The optimization minB,AL(W0+BA)\min_{B,A}\mathcal{L}(W_0 + BA) with BRd×rB \in \mathbb{R}^{d\times r} and ARr×dA \in \mathbb{R}^{r\times d} implicitly minimizes BA=minΔW=BABA\|BA\|_* = \min_{\Delta W = BA}\|BA\|_* over rank-rr weight increments. The factored form is the "unfolded" version of nuclear norm minimization.

Nuclear norm SDP representation. The nuclear norm can be computed via semidefinite programming:

A=minW1,W212(tr(W1)+tr(W2))s.t.(W1AAW2)0\|A\|_* = \min_{W_1, W_2} \frac{1}{2}(\operatorname{tr}(W_1) + \operatorname{tr}(W_2)) \quad\text{s.t.}\quad \begin{pmatrix}W_1 & A \\ A^\top & W_2\end{pmatrix} \succeq 0

This shows nuclear norm minimization is a semidefinite program (SDP) - solvable in polynomial time (in principle). For large-scale problems, proximal methods (using SVT) are much faster than interior-point SDP solvers.

Subdifferential. The subdifferential of \|\cdot\|_* at AA with compact SVD A=UrΣrVrA = U_r\Sigma_r V_r^\top (only positive singular values) is:

A={UrVr+PWP:W21}\partial\|A\|_* = \{U_r V_r^\top + P_\perp W P_\perp : \|W\|_2 \leq 1\}

where P=IUrUrP_\perp = I - U_rU_r^\top projects onto the orthogonal complement of the column space. The unique subgradient when all singular values are distinct is UrVrU_r V_r^\top - the "direction matrix."

H.3 Condition Number and Optimization Landscape

The condition number of the Hessian H=2LH = \nabla^2\mathcal{L} at a critical point determines the local convergence rate of gradient-based methods.

Gradient descent convergence. For L\mathcal{L} with LL-smooth and μ\mu-strongly convex Hessian (μIHLI\mu I \preceq H \preceq LI):

L(x(t))L(1μL)t(L(x(0))L)\mathcal{L}(\mathbf{x}^{(t)}) - \mathcal{L}^* \leq \left(1 - \frac{\mu}{L}\right)^t (\mathcal{L}(\mathbf{x}^{(0)}) - \mathcal{L}^*)

The convergence rate (1μ/L)=11/κ(H)(1-\mu/L) = 1 - 1/\kappa(H) depends directly on the condition number. For κ(H)=1000\kappa(H) = 1000, we need 1000\sim 1000 steps to reduce error by 1/e1/e.

Newton's method. Newton steps use the Hessian as a preconditioner: x(t+1)=x(t)H1L\mathbf{x}^{(t+1)} = \mathbf{x}^{(t)} - H^{-1}\nabla\mathcal{L}. This achieves quadratic convergence near the optimum, independent of κ(H)\kappa(H).

Adam as approximate preconditioning. Adam maintains estimates of E[gi2]\mathbb{E}[g_i^2] for each parameter. Dividing the gradient by E[gi2]\sqrt{\mathbb{E}[g_i^2]} approximates dividing by Hii\sqrt{H_{ii}} - a diagonal preconditioning. This reduces the effective condition number:

κeff=maxiHii/E[gi2]1/2miniHii/E[gi2]1/2κ(H)\kappa_{\text{eff}} = \frac{\max_i H_{ii}/\mathbb{E}[g_i^2]^{1/2}}{\min_i H_{ii}/\mathbb{E}[g_i^2]^{1/2}} \ll \kappa(H)

when HH is diagonally dominant. For non-diagonal HH, Adam's approximation is crude, which is why Shampoo (full matrix preconditioning) converges faster.

Shampoo optimizer. Shampoo (Gupta et al., 2018) computes full matrix preconditioners:

Gt+1=Gt+gradtgradt,G^t=Gt1/4G_{t+1} = G_t + \text{grad}_t \text{grad}_t^\top, \quad \hat{G}_t = G_t^{-1/4}

The preconditioned gradient G^tgradtG^t\hat{G}_t \text{grad}_t \hat{G}_t^\top (for a 2D weight matrix) approximates the natural gradient, achieving condition number κeff1\kappa_{\text{eff}} \approx 1 in the limit. The cost is computing Gt1/4G_t^{-1/4} (matrix pp-th root) periodically.

H.4 Norms in Transformer Architecture Design

Modern transformer architectures are designed with matrix norm considerations in mind.

Layer normalization. LayerNorm normalizes hidden representations h\mathbf{h} so that h2d\|\mathbf{h}\|_2 \approx \sqrt{d} (unit variance per coordinate). This bounds the spectral norm of the Jacobian of subsequent layers: if h2d\|\mathbf{h}\|_2 \leq \sqrt{d} and WFC\|W\|_F \leq C, then Wh2W2h2WFd\|W\mathbf{h}\|_2 \leq \|W\|_2\|\mathbf{h}\|_2 \leq \|W\|_F\sqrt{d}.

Residual connections. The residual architecture hl+1=hl+Fl(hl)\mathbf{h}_{l+1} = \mathbf{h}_l + F_l(\mathbf{h}_l) has Jacobian I+JFlI + J_{F_l}. The spectral norm:

I+JFl21+JFl2\|I + J_{F_l}\|_2 \leq 1 + \|J_{F_l}\|_2

This prevents extreme gradient flow: even if JFl2\|J_{F_l}\|_2 is large, the identity term stabilizes backward propagation. Empirically, JFl20.52\|J_{F_l}\|_2 \approx 0.5-2 in trained transformers.

Pre-norm vs. post-norm. In pre-norm transformers (LayerNorm before the sublayer), the effective Jacobian has better conditioning than post-norm. Specifically, pre-norm ensures h2\|\mathbf{h}\|_2 remains bounded before each attention/MLP, giving more stable Hessian conditioning.

RoPE (Rotary Position Embeddings). RoPE applies a position-dependent rotation to queries and keys:

q~=Rmq,k~=Rnk\tilde{\mathbf{q}} = R_m \mathbf{q}, \quad \tilde{\mathbf{k}} = R_n \mathbf{k}

where RmR_m is a rotation matrix depending on position mm. Since RmR_m is unitary (Rm2=1\|R_m\|_2 = 1), this preserves the spectral norm of the query/key vectors: q~2=q2\|\tilde{\mathbf{q}}\|_2 = \|\mathbf{q}\|_2. The inner product q~k~=qRmRnk=qRnmk\tilde{\mathbf{q}}^\top\tilde{\mathbf{k}} = \mathbf{q}^\top R_m^\top R_n \mathbf{k} = \mathbf{q}^\top R_{n-m}\mathbf{k} - only the relative position nmn-m matters.

MLA (Multi-Head Latent Attention). DeepSeek's MLA compresses the KV cache from 2Tdkv2Td_{kv} to TdcTd_c (with dc2dkvd_c \ll 2d_{kv}) by decomposing:

K=CKVWK,V=CKVWVK = C_{KV}W^K, \quad V = C_{KV}W^V

where CKVRT×dcC_{KV} \in \mathbb{R}^{T\times d_c} is the "latent" KV. The approximation error (measured in nuclear norm) is bounded by the nuclear norm of the difference KVK^V^\|KV^\top - \hat{K}\hat{V}^\top\|_* - exactly the type of bound from Eckart-Young applied to the KV product matrix.


Appendix I: Practice Problems and Solutions

I.1 Conceptual Checks

Check 1. Explain why InF=n\|I_n\|_F = \sqrt{n} while In2=1\|I_n\|_2 = 1. What does this say about whether the Frobenius norm is induced?

Solution. InF=i,jδij2=n\|I_n\|_F = \sqrt{\sum_{i,j}\delta_{ij}^2} = \sqrt{n}. Every induced norm must satisfy I=1\|I\| = 1 (since Ix=x\|I\mathbf{x}\| = \|\mathbf{x}\| for all x\mathbf{x}, so maxx=1Ix=1\max_{\|\mathbf{x}\|=1}\|I\mathbf{x}\| = 1). Since InF=n1\|I_n\|_F = \sqrt{n} \neq 1 for n>1n > 1, the Frobenius norm cannot be induced by any vector norm.

Check 2. A student claims: "Since AFrA2\|A\|_F \leq \sqrt{r}\|A\|_2, I can upper bound the Frobenius norm by computing only the spectral norm." When is this bound tight and when is it loose?

Solution. The bound AFrA2\|A\|_F \leq \sqrt{r}\|A\|_2 is tight when all rr singular values are equal (σ1==σr\sigma_1 = \cdots = \sigma_r), e.g., a scalar multiple of a unitary matrix. It is loose when singular values decay rapidly (e.g., σi=σ1/i\sigma_i = \sigma_1/i), in which case AFσ11/i2σ1π/6\|A\|_F \approx \sigma_1\sqrt{\sum 1/i^2} \approx \sigma_1\cdot\pi/\sqrt{6} while the bound gives σ1r\sigma_1\sqrt{r}. For matrices with low stable rank, the bound is tight.

Check 3. Is the condition number invariant under matrix addition? I.e., does κ(A+B)=κ(A)+κ(B)\kappa(A+B) = \kappa(A) + \kappa(B)?

Solution. No. Condition number is not additive. Consider A=diag(100,1)A = \text{diag}(100, 1) (so κ(A)=100\kappa(A) = 100) and B=diag(0,99)B = \text{diag}(0, 99) (so κ(B)=\kappa(B) = \infty since BB is singular). Then A+B=diag(100,100)A + B = \text{diag}(100, 100) with κ(A+B)=1\kappa(A+B) = 1. The sum of two ill-conditioned matrices can be perfectly conditioned.

Check 4. Prove or disprove: A+B2=A2+B2\|A+B\|_2 = \|A\|_2 + \|B\|_2 implies AA and BB have the same top right singular vector.

Solution. True. The spectral norm satisfies the triangle inequality A+B2A2+B2\|A+B\|_2 \leq \|A\|_2 + \|B\|_2 with equality iff AA and BB are "aligned" in the spectral sense. Specifically, equality holds iff there exist unit vectors u,v\mathbf{u}, \mathbf{v} such that uAv=A2\mathbf{u}^\top A\mathbf{v} = \|A\|_2 and uBv=B2\mathbf{u}^\top B\mathbf{v} = \|B\|_2 - meaning v\mathbf{v} is the top right singular vector of both AA and BB, and u\mathbf{u} is the corresponding top left singular vector. (Same structure as Cauchy-Schwarz equality condition.)

I.2 Computational Exercises with Answers

Problem 1. Let A=(2103)A = \begin{pmatrix}2 & 1 \\ 0 & 3\end{pmatrix}.

(a) Find all five norms: AF\|A\|_F, A2\|A\|_2, A\|A\|_*, A1\|A\|_1, A\|A\|_\infty.

(b) Find κ2(A)\kappa_2(A) and the condition number of the equation Ax=bA\mathbf{x} = \mathbf{b}.

Solution.

First compute AA=(42210)A^\top A = \begin{pmatrix}4&2\\2&10\end{pmatrix}. Eigenvalues: λ=(14±1963616)/2\lambda = (14 \pm \sqrt{196-36-16})/2... Let us directly:

det(AAλI)=(4λ)(10λ)4=λ214λ+36=0\det(A^\top A - \lambda I) = (4-\lambda)(10-\lambda) - 4 = \lambda^2 - 14\lambda + 36 = 0

λ=(14±196144)/2=(14±52)/2=7±13\lambda = (14 \pm \sqrt{196-144})/2 = (14 \pm \sqrt{52})/2 = 7 \pm \sqrt{13}

So σ1=7+1310.6063.257\sigma_1 = \sqrt{7+\sqrt{13}} \approx \sqrt{10.606} \approx 3.257 and σ2=7133.3941.842\sigma_2 = \sqrt{7-\sqrt{13}} \approx \sqrt{3.394} \approx 1.842.

(a) Results:

  • AF=4+1+0+9=143.742\|A\|_F = \sqrt{4+1+0+9} = \sqrt{14} \approx 3.742
  • A2=σ13.257\|A\|_2 = \sigma_1 \approx 3.257
  • A=σ1+σ23.257+1.842=5.099\|A\|_* = \sigma_1 + \sigma_2 \approx 3.257 + 1.842 = 5.099
  • A1=max(2+0,1+3)=max(2,4)=4\|A\|_1 = \max(|2|+|0|, |1|+|3|) = \max(2, 4) = 4
  • A=max(2+1,0+3)=max(3,3)=3\|A\|_\infty = \max(|2|+|1|, |0|+|3|) = \max(3, 3) = 3

(b) κ2(A)=σ1/σ23.257/1.8421.768\kappa_2(A) = \sigma_1/\sigma_2 \approx 3.257/1.842 \approx 1.768.

This is a well-conditioned matrix. For Ax=bA\mathbf{x}=\mathbf{b} with relative perturbation ϵ\epsilon in b\mathbf{b}, the relative error in x\mathbf{x} is at most κϵ1.77ϵ\kappa \epsilon \approx 1.77\epsilon.

Problem 2. Rank-1 approximation.

For A=(123456)A = \begin{pmatrix}1&2\\3&4\\5&6\end{pmatrix}, find the best rank-1 approximation in the Frobenius norm and compute the approximation error.

Solution. Compute SVD. The singular values are σ19.525\sigma_1 \approx 9.525 and σ20.514\sigma_2 \approx 0.514. The best rank-1 approximation A1=σ1u1v1A_1 = \sigma_1\mathbf{u}_1\mathbf{v}_1^\top has:

AA1F=σ20.514,AA12=σ20.514\|A - A_1\|_F = \sigma_2 \approx 0.514, \quad \|A - A_1\|_2 = \sigma_2 \approx 0.514

The approximation captures σ12/(σ12+σ22)=90.7/91.099.7%\sigma_1^2/(\sigma_1^2+\sigma_2^2) = 90.7/91.0 \approx 99.7\% of the Frobenius-squared energy.

Problem 3. Tikhonov regularization effect on condition number.

Let A=diag(10,1,0.01)A = \text{diag}(10, 1, 0.01) (diagonal, well-structured). Compute κ2(AA+λI)\kappa_2(A^\top A + \lambda I) for λ{0,0.001,0.01,0.1,1}\lambda \in \{0, 0.001, 0.01, 0.1, 1\} and observe the trade-off.

Solution. AA=diag(100,1,104)A^\top A = \text{diag}(100, 1, 10^{-4}), so κ(AA)=106\kappa(A^\top A) = 10^6.

κ(AA+λI)=(100+λ)/(104+λ)\kappa(A^\top A + \lambda I) = (100+\lambda)/(10^{-4}+\lambda):

λ\lambdaκ2\kappa_2Notes
0010610^6Original: very ill-conditioned
0.0010.001(100.001)/(1.001×103)99,901(100.001)/(1.001\times10^{-3}) \approx 99,901Modest improvement
0.010.01(100.01)/(0.0101)9,902(100.01)/(0.0101) \approx 9,902100\times improvement
0.10.1(100.1)/(0.1001)1,000(100.1)/(0.1001) \approx 1,0001000\times improvement
11(101)/(1.0001)101(101)/(1.0001) \approx 10110,000\times improvement

Each decade of λ\lambda improves κ\kappa dramatically but increases bias. The optimal λ\lambda balances condition improvement against solution bias.

I.3 Connection to Linear Programming

The nuclear norm can be computed via a semidefinite program (SDP) or, for special cases, via linear programming.

Ky Fan norm via LP. The Ky Fan kk-norm has the dual representation:

A(k)=min{kμ+tr(S):S0,S0,S+μIdiag(σ),μ0}\|A\|_{(k)} = \min\{k\mu + \operatorname{tr}(S) : S \succeq 0,\, S \geq 0,\, S + \mu I \geq \text{diag}(\boldsymbol{\sigma}),\, \mu \geq 0\}

(where the inequality is in the PSD sense on the diagonal). This is a semidefinite program in (μ,S)(\mu, S).

Nuclear norm via SDP.

A=minW1,W212(tr(W1)+tr(W2))s.t.(W1AAW2)0\|A\|_* = \min_{W_1,W_2}\frac{1}{2}(\operatorname{tr}(W_1)+\operatorname{tr}(W_2)) \quad \text{s.t.} \quad \begin{pmatrix}W_1&A\\A^\top&W_2\end{pmatrix} \succeq 0

This is a standard SDP with O(m+n)O(m+n) variables. Interior-point methods solve it in O((m+n)3)O((m+n)^3) time.

For AI: While these SDP representations are theoretically important (they prove polynomial solvability of nuclear norm problems), they are impractical for large matrices. Instead, proximal gradient descent with SVT (the practical algorithm) exploits the simple proximal operator structure.


Skill Check

Test this lesson

Answer 4 quick questions to lock in the lesson and feed your adaptive practice queue.

--
Score
0/4
Answered
Not attempted
Status
1

Which module does this lesson belong to?

2

Which section is covered in this lesson content?

3

Which term is most central to this lesson?

4

What is the best way to use this lesson for real learning?

Your answers save locally first, then sync when account storage is available.
Practice queue