Type at least 2 letters. Enter opens the first result, Esc closes.

    Linear Algebra · Lesson 17 · Linear algebra for modern ML

    Perturbation theory: Weyl and Davis–Kahan

    Advanced 70 min 4 interactive figures 3 videos Colab notebook

    Before this lesson: lesson 06 (spectral theorem, Rayleigh quotient, Courant–Fischer; Weyl is proved there), lesson 08 (the SVD) and lesson 09 (PCA); conditioning is in lesson 13. Time: about 70 minutes, plus the notebook.


    Why this matters #

    In practice every matrix is a noisy copy of the matrix we care about: a sample covariance instead of the population covariance, a graph Laplacian built from noisy similarities, a quantized weight matrix, the floating-point output of an eigensolver. Perturbation theory says which spectral quantities survive the noise. Eigenvalues of symmetric matrices are robust: they move at most as much as the noise (Weyl). Eigenvectors are only as robust as the eigengap, the distance from their eigenvalue to the rest of the spectrum (Davis–Kahan). This one idea tells you when principal components can be trusted, how spectral clustering picks the number of clusters, why climate scientists group nearly equal EOFs, and when a low-rank compression keeps its subspace.

    1. Predict first #

    2. The picture #

    Simplest case. A=diag⁡(a,b)A = \operatorname{diag}(a, b) with a>ba > b and gap δ=a−b\delta = a - b. Add the off-diagonal noise E=ε(0110)E = \varepsilon\begin{pmatrix}0&1\\1&0\end{pmatrix}, with ∥E∥2=ε\|E\|_2 = \varepsilon. The matrix (aεεb)\begin{pmatrix}a&\varepsilon\\\varepsilon&b\end{pmatrix} has eigenvalues

    a+b2±δ2/4+ε2,\tfrac{a+b}2 \pm \sqrt{\delta^2/4 + \varepsilon^2},

    and its top eigenvector makes an angle θ\theta with e1e_1, where tan⁡2θ=2ε/δ\tan 2\theta = 2\varepsilon/\delta (section 3 derives this). There are two regimes:

    • Large gap (ε≪δ\varepsilon \ll \delta): θ≈ε/δ\theta \approx \varepsilon/\delta, and each eigenvalue moves by about ε2/δ\varepsilon^2/\delta, much less than ε\varepsilon.
    • Small gap (δ≪ε\delta \ll \varepsilon): 2θ≈90°2\theta \approx 90°, so θ≈45°\theta \approx 45°, however small ε\varepsilon is. The eigenvalues still move by at most ε\varepsilon.

    So the eigenvalue error is controlled by ε\varepsilon alone, and the eigenvector error by ε/δ\varepsilon/\delta.

    Why, as a picture. AA maps the unit circle to an ellipse with half-axes aa and bb, and the eigenvectors are its axes. With a small gap the ellipse is almost a circle. Its axes are poorly defined, and a small bump can turn them anywhere. At δ=0\delta = 0 (a circle) every direction is an eigenvector.

    Interactive figure: loading…

    Shrink the gap. Here A=diag⁡(1+δ,1)A = \operatorname{diag}(1 + \delta, 1) and E=ε(0110)E = \varepsilon\begin{pmatrix}0&1\\1&0\end{pmatrix}. On the left, the blue dashed ellipse is the unit circle mapped by AA, the orange one is mapped by A+EA + E; the arrows are their long axes λ1q1\lambda_1 q_1 and λ^1q^1\hat\lambda_1 \hat q_1. Move δ\delta below ε\varepsilon: the ellipse becomes a circle and q^1\hat q_1 turns by almost 45°45°, while the eigenvalues move by less than ε\varepsilon. On the right, the true sin⁡θ\sin\theta (orange) is about ε/δ\varepsilon/\delta for large gaps, where it almost touches the classical bound ∥Eq1∥/δ^\|Eq_1\|/\hat\delta (aqua), and it levels off at sin⁡45°≈0.71\sin 45° \approx 0.71 for small gaps. Both Davis–Kahan bounds of section 3 stay above it; the bound 2ε/δ2\varepsilon/\delta (violet) is twice as large for large gaps.

    Quick check

    Keep the noise at ε=0.01\varepsilon = 0.01 and shrink the gap δ\delta from 1 to 0.001. What happens?

    3. Definitions and main results #

    Throughout, AA and A^=A+E\hat A = A + E are real symmetric n×nn\times n matrices, with eigenvalues λ1≥⋯≥λn\lambda_1 \ge \dots \ge \lambda_n and λ^1≥⋯≥λ^n\hat\lambda_1 \ge \dots \ge \hat\lambda_n and orthonormal eigenvectors qjq_j and q^j\hat q_j.

    Eigenvalues: Weyl #

    Theorem (Weyl). ∣λ^k−λk∣≤∥E∥2|\hat\lambda_k - \lambda_k| \le \|E\|_2 for every kk.

    Lesson 06 proves it from Courant–Fischer: the Rayleigh quotients add, RA+E(x)=RA(x)+RE(x)R_{A+E}(x) = R_A(x) + R_E(x), and RE(x)R_E(x) always lies in [−∥E∥2,∥E∥2][-\|E\|_2, \|E\|_2]. So the eigenvalues of a symmetric matrix have condition number 1: an error of size ∥E∥2\|E\|_2 in the matrix gives an error of at most ∥E∥2\|E\|_2 in every eigenvalue.

    Interactive figure: loading…

    Each eigenvalue stays in its own interval. Row kk shows λk\lambda_k of an 8×88\times8 symmetric AA (blue), the interval [λk−∥E∥2, λk+∥E∥2][\lambda_k - \|E\|_2,\ \lambda_k + \|E\|_2] (aqua) and λ^k\hat\lambda_k of A+EA + E (orange). Increase ∥E∥2\|E\|_2 and press New noise: the orange dot never leaves its interval, even when neighbouring intervals overlap. Choose εI\varepsilon I to see that the bound is reached, and a rank-one EE to see every eigenvalue move up.

    Frobenius version (Hoffman–Wielandt): ∑k(λ^k−λk)2≤∥E∥F2\sum_k (\hat\lambda_k - \lambda_k)^2 \le \|E\|_F^2. It bounds all the moves together.

    Singular values: Weyl for any matrix #

    Theorem (Weyl for singular values). For any A,E∈Rm×nA, E \in \mathbb{R}^{m\times n} and every kk,

    ∣σk(A+E)−σk(A)∣≤∥E∥2.|\sigma_k(A + E) - \sigma_k(A)| \le \|E\|_2 .

    The matrices need not be square or symmetric. The trick is to build a symmetric matrix whose eigenvalues are the singular values.

    The symmetric embedding. For A∈Rm×nA \in \mathbb{R}^{m\times n}, let

    H(A)=(0AA⊤0)∈R(m+n)×(m+n).H(A) = \begin{pmatrix} 0 & A \\ A^\top & 0 \end{pmatrix} \in \mathbb{R}^{(m+n)\times(m+n)} .

    It is symmetric. Its eigenvalues are ±σ1(A),…,±σp(A)\pm\sigma_1(A), \dots, \pm\sigma_p(A) with p=min⁡(m,n)p = \min(m, n), plus ∣m−n∣|m - n| zeros.

    Small example first. A=(300100)A = \begin{pmatrix} 3 & 0 \\ 0 & 1 \\ 0 & 0 \end{pmatrix} (3×23\times2, singular values 3 and 1). H(A)H(A) is 5×55\times5, and its eigenvalues are 3,1,0,−1,−33, 1, 0, -1, -3. The single 0 comes from ∣m−n∣=1|m - n| = 1.

    Proof of the theorem.

    1. Let Avi=σiuiAv_i = \sigma_i u_i and A⊤ui=σiviA^\top u_i = \sigma_i v_i (the SVD, lesson 08). Then H(uivi)=(AviA⊤ui)=σi(uivi)H\begin{pmatrix}u_i\\v_i\end{pmatrix} = \begin{pmatrix}Av_i\\A^\top u_i\end{pmatrix} = \sigma_i\begin{pmatrix}u_i\\v_i\end{pmatrix} and H(ui−vi)=−σi(ui−vi)H\begin{pmatrix}u_i\\-v_i\end{pmatrix} = -\sigma_i\begin{pmatrix}u_i\\-v_i\end{pmatrix}.
    2. These 2p2p vectors are orthogonal. The remaining ∣m−n∣|m - n| eigenvectors come from the null space: if m>nm > n, every unit u⊥u1,…,unu \perp u_1, \dots, u_n has A⊤u=0A^\top u = 0, so H(u0)=0H\begin{pmatrix}u\\0\end{pmatrix} = 0 (the case m<nm < n is the same with vv).
    3. Sorted in decreasing order, the eigenvalues of H(A)H(A) are
    σ1≥⋯≥σp ≥ 0,…,0 ≥ −σp≥⋯≥−σ1.\sigma_1 \ge \dots \ge \sigma_p \ \ge\ 0, \dots, 0\ \ge\ -\sigma_p \ge \dots \ge -\sigma_1 .

    So λk(H(A))=σk(A)\lambda_k(H(A)) = \sigma_k(A) for k=1,…,pk = 1, \dots, p. 4. HH is linear: H(A+E)=H(A)+H(E)H(A + E) = H(A) + H(E). By steps 1–2 for EE, the largest ∣λi(H(E))∣|\lambda_i(H(E))| is σ1(E)\sigma_1(E). So ∥H(E)∥2=σ1(E)=∥E∥2\|H(E)\|_2 = \sigma_1(E) = \|E\|_2. 5. Weyl for the symmetric matrices H(A)H(A) and H(E)H(E) gives

    ∣λk(H(A+E))−λk(H(A))∣≤∥H(E)∥2=∥E∥2.|\lambda_k(H(A + E)) - \lambda_k(H(A))| \le \|H(E)\|_2 = \|E\|_2 .

    By step 3, for k≤pk \le p the left side is ∣σk(A+E)−σk(A)∣|\sigma_k(A + E) - \sigma_k(A)|. ■\blacksquare

    The same embedding turns other symmetric results into results about singular values. Wedin's theorem below is the singular-vector version of Davis–Kahan.

    Non-symmetric matrices have no such bound #

    For a non-symmetric matrix, a tiny EE can move the eigenvalues a lot. The extreme case is a Jordan block: the n×nn\times n matrix JJ with zeros on the diagonal and ones just above it. Its only eigenvalue is 0. Put ε\varepsilon in its bottom-left corner. The characteristic polynomial becomes λn−ε\lambda^n - \varepsilon, so the eigenvalues are the nn points ε1/ne2πij/n\varepsilon^{1/n} e^{2\pi i j/n} on a circle of radius ε1/n\varepsilon^{1/n}. For n=6n = 6 and ε=10−4\varepsilon = 10^{-4} that radius is 10−4/6≈0.2210^{-4/6} \approx 0.22; for n=10n = 10 and ε=10−10\varepsilon = 10^{-10} the eigenvalues move by 0.10.1, a billion times ∥E∥2\|E\|_2.

    Interactive figure: loading…

    A non-normal matrix amplifies noise. The orange dots are the eigenvalues of J+EJ + E in the complex plane. They sit on the violet circle of radius ε1/n\varepsilon^{1/n}, far outside the aqua disc ∣μ∣≤ε|\mu| \le \varepsilon that Weyl and Bauer–Fike give for a symmetric or normal matrix (for small ε\varepsilon this disc is so small that it hides under the blue dot at 0). Make nn larger or ε\varepsilon smaller and read the amplification. Switch to a random EE with the same norm: the eigenvalues still spread around a circle of about the same size (usually a little smaller, because only part of the norm of EE sits in the corner entry).

    Quick check

    JJ is the 6×66\times6 Jordan block with eigenvalue 0. You put 10−410^{-4} in its bottom-left corner. About how large are the new eigenvalues?

    Bauer–Fike and near-defective matrices

    Theorem (Bauer–Fike). Let A=XΛX−1A = X\Lambda X^{-1} be diagonalizable. Every eigenvalue μ\mu of A+EA + E satisfies min⁡i∣μ−λi∣≤κ2(X) ∥E∥2\min_i |\mu - \lambda_i| \le \kappa_2(X)\,\|E\|_2, where κ2(X)=∥X∥2∥X−1∥2\kappa_2(X) = \|X\|_2\|X^{-1}\|_2.

    Proof.

    1. If μ\mu is an eigenvalue of AA, there is nothing to prove. Otherwise A−μI=X(Λ−μI)X−1A - \mu I = X(\Lambda - \mu I)X^{-1} is invertible.
    2. A+E−μI=(A−μI)(I+(A−μI)−1E)A + E - \mu I = (A - \mu I)\big(I + (A - \mu I)^{-1}E\big) is singular, so I+(A−μI)−1EI + (A - \mu I)^{-1}E is singular. Then some unit zz has (A−μI)−1Ez=−z(A - \mu I)^{-1}Ez = -z, so ∥(A−μI)−1E∥2≥1\|(A - \mu I)^{-1}E\|_2 \ge 1.
    3. ∥(A−μI)−1∥2=∥X(Λ−μI)−1X−1∥2≤κ2(X)/min⁡i∣λi−μ∣\|(A - \mu I)^{-1}\|_2 = \|X(\Lambda - \mu I)^{-1}X^{-1}\|_2 \le \kappa_2(X)/\min_i|\lambda_i - \mu|.
    4. So 1≤κ2(X) ∥E∥2/min⁡i∣λi−μ∣1 \le \kappa_2(X)\,\|E\|_2/\min_i|\lambda_i - \mu|. ■\blacksquare

    The condition number of the eigenvector matrix XX is the amplifier. For symmetric AA, X=QX = Q is orthogonal and κ2(Q)=1\kappa_2(Q) = 1: the same constant 1 as in Weyl. The same holds for every normal matrix (AA⊤=A⊤AAA^\top = A^\top A), which also has orthonormal eigenvectors (complex ones in general).

    Ill-conditioned eigenvectors, not an ill-conditioned matrix. "Near-defective" means that the eigenvector matrix XX is ill-conditioned; AA itself can be well-conditioned. A=(1101.001)A = \begin{pmatrix}1&1\\0&1.001\end{pmatrix} has κ(A)≈2.6\kappa(A) \approx 2.6 but κ(X)≈2000\kappa(X) \approx 2000, and an entry 10−610^{-6} at position (2,1)(2,1) moves both eigenvalues by about 6×10−46\times10^{-4}. A defective matrix (like the Jordan block) is the limit κ(X)=∞\kappa(X) = \infty; there the move is like ∥E∥21/n\|E\|_2^{1/n}, not proportional to ∥E∥2\|E\|_2.

    Angles between subspaces #

    To say how far an eigenvector or an eigenspace has moved, we need a distance between subspaces. Comparing vectors entry by entry does not work: qq and −q-q are the same eigenvector, and inside an eigenspace any orthonormal basis is allowed. We use angles. Three cases in R3\mathbb{R}^3 show the idea.

    Two lines. For unit vectors u,vu, v, the angle θ∈[0°,90°]\theta \in [0°, 90°] is given by cos⁡θ=∣u⊤v∣\cos\theta = |u^\top v|. The absolute value ignores the sign. Example: u=(1,0)u = (1, 0) and v=(1,1)/2v = (1, 1)/\sqrt2 give cos⁡θ=1/2\cos\theta = 1/\sqrt2, so θ=45°\theta = 45° and sin⁡θ=0.707\sin\theta = 0.707. Two useful forms: sin⁡θ=∥(I−uu⊤)v∥\sin\theta = \|(I - uu^\top)v\| (the part of vv that is not along uu) and sin⁡θ=∥uu⊤−vv⊤∥2\sin\theta = \|uu^\top - vv^\top\|_2 (the distance between the two projectors).

    A line and a plane. Project the line onto the plane. The angle is the angle between the line and its shadow. Example: the line through (1,1,1)(1, 1, 1) and the xyxy-plane. The shadow is along (1,1,0)(1, 1, 0), and cos⁡θ=∥(1,1,0)∥/∥(1,1,1)∥=2/3\cos\theta = \|(1, 1, 0)\|/\|(1, 1, 1)\| = \sqrt{2/3}, so θ≈35.3°\theta \approx 35.3°.

    Two planes in R3\mathbb{R}^3. They always share a line (2+2>32 + 2 > 3, as in lesson 06). So the first angle is θ1=0\theta_1 = 0. The second angle θ2\theta_2 is the opening angle between the planes, measured perpendicular to the shared line. Example: the xyxy-plane and the plane spanned by e1e_1 and (0,1,1)/2(0, 1, 1)/\sqrt2 share the xx-axis, and they open by θ2=45°\theta_2 = 45°.

    Interactive figure: loading…

    Turn and tilt V^\hat V. Blue is VV (the xx-axis, or the xyxy-plane), orange is V^\hat V. The readout computes the singular values of V^⊤V\hat V^\top V and the principal angles. With two planes, the magenta line is the shared line, and θ1=0\theta_1 = 0 always; the arc shows θ2\theta_2. With line and plane, the dashed segment drops the line onto its shadow. For equal dimensions the readout also checks ∥VV⊤−V^V^⊤∥2=sin⁡θmax⁡\|VV^\top - \hat V\hat V^\top\|_2 = \sin\theta_{\max}.

    The general definition. Let V,V^∈Rn×dV, \hat V \in \mathbb{R}^{n\times d} have orthonormal columns. The principal angles 0≤θ1≤⋯≤θd≤90°0 \le \theta_1 \le \dots \le \theta_d \le 90° between their column spaces are given by

    cos⁡θi=σi(V^⊤V),\cos\theta_i = \sigma_i(\hat V^\top V),

    and we collect their sines in the diagonal matrix sin⁡Θ=diag⁡(sin⁡θ1,…,sin⁡θd)\sin\Theta = \operatorname{diag}(\sin\theta_1, \dots, \sin\theta_d).

    In words: θ1\theta_1 is the smallest angle between a vector of one subspace and a vector of the other. Remove these two directions; θ2\theta_2 is the smallest angle between what is left, and so on. The result does not depend on the choice of bases: V^⊤V\hat V^\top V changes to R1⊤V^⊤VR2R_1^\top \hat V^\top V R_2 with orthogonal R1,R2R_1, R_2, which has the same singular values. Two facts make sin⁡Θ\sin\Theta a distance between subspaces:

    ∥sin⁡Θ∥2=∥VV⊤−V^V^⊤∥2,\|\sin\Theta\|_2 = \|VV^\top - \hat V\hat V^\top\|_2,
    ∥sin⁡Θ∥F=∥VV⊤−V^V^⊤∥F/2.\|\sin\Theta\|_F = \|VV^\top - \hat V\hat V^\top\|_F/\sqrt2 .

    For the two planes above: σ(V^⊤V)=(1,0.707)\sigma(\hat V^\top V) = (1, 0.707), the angles are 0°0° and 45°45°, and ∥VV⊤−V^V^⊤∥2=0.707\|VV^\top - \hat V\hat V^\top\|_2 = 0.707.

    Quick check

    VV is the xyxy-plane and V^\hat V is the xzxz-plane in R3\mathbb{R}^3. What are the principal angles?

    First-order perturbation: where the gap comes from #

    Step 1: the exact 2×22\times2 answer. A symmetric 2×22\times2 matrix M=(prrq)M = \begin{pmatrix}p&r\\r&q\end{pmatrix} has a unit eigenvector (cos⁡θ,sin⁡θ)(\cos\theta, \sin\theta). Write Mv=λvMv = \lambda v in both rows:

    pcos⁡θ+rsin⁡θ=λcos⁡θ,p\cos\theta + r\sin\theta = \lambda\cos\theta,
    rcos⁡θ+qsin⁡θ=λsin⁡θ.r\cos\theta + q\sin\theta = \lambda\sin\theta .

    Multiply the first equation by sin⁡θ\sin\theta, the second by cos⁡θ\cos\theta, and subtract. λ\lambda cancels:

    (p−q)sin⁡θcos⁡θ=r(cos⁡2θ−sin⁡2θ).(p - q)\sin\theta\cos\theta = r(\cos^2\theta - \sin^2\theta).

    With 2sin⁡θcos⁡θ=sin⁡2θ2\sin\theta\cos\theta = \sin 2\theta and cos⁡2θ−sin⁡2θ=cos⁡2θ\cos^2\theta - \sin^2\theta = \cos 2\theta this is p−q2sin⁡2θ=rcos⁡2θ\tfrac{p - q}2\sin 2\theta = r\cos 2\theta.

    So tan⁡2θ=2r/(p−q)\tan 2\theta = 2r/(p - q). For A+E=(1+δεε1)A + E = \begin{pmatrix}1 + \delta&\varepsilon\\\varepsilon&1\end{pmatrix} this gives

    tan⁡2θ=2εδ.\tan 2\theta = \frac{2\varepsilon}{\delta} .

    Step 2: compare with a first-order guess. For small xx, tan⁡x≈x\tan x \approx x, so 2θ≈2ε/δ2\theta \approx 2\varepsilon/\delta and θ≈ε/δ\theta \approx \varepsilon/\delta: (coupling)/(gap). The table compares the exact angle with ε/δ\varepsilon/\delta for δ=1\delta = 1.

    ε\varepsilon exact θ\theta first order ε/δ\varepsilon/\delta
    0.01 0.573° 0.573°
    0.1 5.65° 5.73°
    0.5 22.5° 28.6°
    1 31.7° 57.3°

    The first-order answer is excellent while ε≪δ\varepsilon \ll \delta. When ε\varepsilon is comparable to δ\delta, it is too large: the exact angle can never pass 45°45°, but ε/δ\varepsilon/\delta grows without limit.

    Step 3: the general formulas. Let λk\lambda_k be a simple (not repeated) eigenvalue, and let λ(t),q(t)\lambda(t), q(t) be the eigenpair of A+tEA + tE that starts at (λk,qk)(\lambda_k, q_k), with ∥q(t)∥=1\|q(t)\| = 1. Then

    λ′(0)=qk⊤Eqk,q′(0)=∑j≠kqj⊤Eqkλk−λj qj.\lambda'(0) = q_k^\top E q_k, \qquad q'(0) = \sum_{j \ne k} \frac{q_j^\top E q_k}{\lambda_k - \lambda_j}\, q_j .

    Derivation.

    1. Differentiate (A+tE) q(t)=λ(t) q(t)(A + tE)\,q(t) = \lambda(t)\,q(t) at t=0t = 0: Eqk+Aq′=λ′qk+λkq′Eq_k + Aq' = \lambda' q_k + \lambda_k q'.
    2. Multiply on the left by qk⊤q_k^\top. As qk⊤A=λkqk⊤q_k^\top A = \lambda_k q_k^\top, the terms with q′q' cancel: λ′=qk⊤Eqk\lambda' = q_k^\top E q_k.
    3. Multiply by qj⊤q_j^\top with j≠kj \ne k: qj⊤Eqk+λj qj⊤q′=λk qj⊤q′q_j^\top E q_k + \lambda_j\, q_j^\top q' = \lambda_k\, q_j^\top q', so qj⊤q′=qj⊤Eqk/(λk−λj)q_j^\top q' = q_j^\top E q_k/(\lambda_k - \lambda_j).
    4. From ∥q(t)∥2=1\|q(t)\|^2 = 1: qk⊤q′=0q_k^\top q' = 0. Expand q′q' in the eigenbasis. ■\blacksquare

    For the 2×22\times2 example, q2⊤Eq1=e2⊤Ee1=εq_2^\top E q_1 = e_2^\top E e_1 = \varepsilon and λ1−λ2=δ\lambda_1 - \lambda_2 = \delta, so q′(0)=(ε/δ) e2q'(0) = (\varepsilon/\delta)\,e_2 and q(1)≈e1+(ε/δ) e2q(1) \approx e_1 + (\varepsilon/\delta)\,e_2: the same θ≈ε/δ\theta \approx \varepsilon/\delta as in step 2.

    How to read the formulas:

    • The eigenvalue changes by qk⊤Eqkq_k^\top E q_k, which is at most ∥E∥2\|E\|_2: the same constant 1 as Weyl.
    • The eigenvector mixes in each qjq_j with weight (coupling)/(gap). The nearest eigenvalue dominates, and ∥q′∥≤∥E∥2/min⁡j≠k∣λk−λj∣\|q'\| \le \|E\|_2/\min_{j\ne k}|\lambda_k - \lambda_j|. So the condition number of an eigenvector is 1/gap.
    • At a repeated eigenvalue the formula divides by zero. Inside the eigenspace the eigenvectors are not unique, and an arbitrarily small EE picks the basis. The eigenspace itself stays stable if it is separated from the rest of the spectrum.

    The Davis–Kahan sin⁡θ\sin\theta theorem #

    The first-order formula holds only for small EE. Davis–Kahan gives a bound for every EE.

    Theorem (one eigenvector, classical form). Let Aq=λqAq = \lambda q with ∥q∥=1\|q\| = 1, let q^k\hat q_k be the eigenvector of A^\hat A that we compare with qq, and let δ^=min⁡j≠k∣λ^j−λ∣\hat\delta = \min_{j \ne k}|\hat\lambda_j - \lambda|, the distance from λ\lambda to the other eigenvalues of A^\hat A. If δ^>0\hat\delta > 0, then

    sin⁡θ(q^k,q)≤∥Eq∥δ^≤∥E∥2δ^.\sin\theta(\hat q_k, q) \le \frac{\|Eq\|}{\hat\delta} \le \frac{\|E\|_2}{\hat\delta}.

    Proof.

    1. Residual: as Aq=λqAq = \lambda q, we get (A^−λI) q=Eq(\hat A - \lambda I)\,q = Eq.
    2. Write q=∑jcjq^jq = \sum_j c_j \hat q_j in the orthonormal eigenbasis of A^\hat A (here symmetry is used). Then (A^−λI)q=∑j(λ^j−λ) cj q^j(\hat A - \lambda I)q = \sum_j (\hat\lambda_j - \lambda)\,c_j\,\hat q_j.
    3. Take norms (the q^j\hat q_j are orthonormal), drop the term j=kj = k, and use ∣λ^j−λ∣≥δ^|\hat\lambda_j - \lambda| \ge \hat\delta for j≠kj \ne k:
    ∥Eq∥2=∑j(λ^j−λ)2cj2≥∑j≠k(λ^j−λ)2cj2 ≥ δ^2∑j≠kcj2.\begin{aligned} \|Eq\|^2 &= \sum_j (\hat\lambda_j - \lambda)^2 c_j^2 \\ &\ge \sum_{j\ne k}(\hat\lambda_j - \lambda)^2 c_j^2 \ \ge\ \hat\delta^2 \sum_{j\ne k} c_j^2 . \end{aligned}
    1. ∑j≠kcj2=1−ck2=1−cos⁡2θ=sin⁡2θ\sum_{j\ne k} c_j^2 = 1 - c_k^2 = 1 - \cos^2\theta = \sin^2\theta. Hence sin⁡θ≤∥Eq∥/δ^\sin\theta \le \|Eq\|/\hat\delta. ■\blacksquare

    The gap δ^\hat\delta uses the eigenvalues of the noisy matrix A^\hat A. In statistics we know AA's gap better, or we want a bound in terms of it. The next corollary uses only the gap of AA, at the price of a factor 2.

    Corollary (gap of AA only; Yu, Wang and Samworth). Let δk=min⁡(λk−1−λk, λk−λk+1)>0\delta_k = \min(\lambda_{k-1} - \lambda_k,\ \lambda_k - \lambda_{k+1}) > 0, with λ0=+∞\lambda_0 = +\infty and λn+1=−∞\lambda_{n+1} = -\infty. Then

    sin⁡θ(q^k,qk)≤2 ∥E∥2δk.\sin\theta(\hat q_k, q_k) \le \frac{2\,\|E\|_2}{\delta_k}.
    Proof of the corollary
    1. If ∥E∥2>δk/2\|E\|_2 > \delta_k/2, the right side is above 1, and sin⁡θ≤1\sin\theta \le 1 always. Nothing to prove.
    2. If ∥E∥2≤δk/2\|E\|_2 \le \delta_k/2, Weyl gives, for j<kj < k, λ^j≥λ^k−1≥λk−1−∥E∥2≥λk+δk−∥E∥2\hat\lambda_j \ge \hat\lambda_{k-1} \ge \lambda_{k-1} - \|E\|_2 \ge \lambda_k + \delta_k - \|E\|_2, and for j>kj > k, λ^j≤λk−δk+∥E∥2\hat\lambda_j \le \lambda_k - \delta_k + \|E\|_2.
    3. So every other eigenvalue of A^\hat A is at distance at least δk−∥E∥2≥δk/2\delta_k - \|E\|_2 \ge \delta_k/2 from λk\lambda_k: δ^≥δk/2\hat\delta \ge \delta_k/2.
    4. The theorem gives sin⁡θ≤∥E∥2/δ^≤∥E∥2/(δk/2)\sin\theta \le \|E\|_2/\hat\delta \le \|E\|_2/(\delta_k/2). ■\blacksquare

    Read the corollary in words: the eigenvector turns by at most about (noise)/(gap). When the bound is above 1, it says nothing; the vector may or may not turn.

    Subspace version. Let V=(qr,…,qs)V = (q_r, \dots, q_s) hold d=s−r+1d = s - r + 1 eigenvectors of AA, V^\hat V the matching eigenvectors of A^\hat A, and δ=min⁡(λr−1−λr, λs−λs+1)>0\delta = \min(\lambda_{r-1} - \lambda_r,\ \lambda_s - \lambda_{s+1}) > 0 the gap between this block of eigenvalues and the rest of the spectrum of AA. Then (Yu, Wang, Samworth 2015)

    ∥sin⁡Θ(V^,V)∥F≤2min⁡(d ∥E∥2, ∥E∥F)δ.\|\sin\Theta(\hat V, V)\|_F \le \frac{2\min\big(\sqrt d\,\|E\|_2,\ \|E\|_F\big)}{\delta}.

    Gaps inside the block do not matter: only the separation of the block from the rest. This is why a cluster of close eigenvalues has a stable subspace even when its single eigenvectors are unstable.

    Sharpness, the classical subspace form, and singular vectors (Wedin)

    The constant 2 cannot be improved in general: Yu, Wang and Samworth give an example where the bound is reached (there V^\hat V is orthogonal to VV). For small EE the first-order formula gives at most about min⁡(d ∥E∥2, ∥E∥F)/δ\min(\sqrt d\,\|E\|_2,\ \|E\|_F)/\delta, half the bound. The classical Davis–Kahan form is ∥sin⁡Θ∥≤∥EV∥/δ^\|\sin\Theta\| \le \|EV\|/\hat\delta in the spectral or Frobenius norm, when the block eigenvalues of AA lie in an interval [α,β][\alpha, \beta] and the other eigenvalues of A^\hat A lie outside (α−δ^,β+δ^)(\alpha - \hat\delta, \beta + \hat\delta).

    Singular vectors (Wedin). For any AA and A+EA + E of the same shape, let Uk,VkU_k, V_k hold the top kk left and right singular vectors of AA, and U^k,V^k\hat U_k, \hat V_k those of A+EA + E. If ∥E∥2<σk−σk+1\|E\|_2 < \sigma_k - \sigma_{k+1} (singular values of AA), then the sines of the principal angles between UkU_k and U^k\hat U_k, and between VkV_k and V^k\hat V_k, are at most ∥E∥2/(σk−σk+1−∥E∥2)\|E\|_2/(\sigma_k - \sigma_{k+1} - \|E\|_2). The singular-value gap plays the role of the eigengap.

    Quick check

    AA has eigenvalues 3,2.95,0.53, 2.95, 0.5 and ∥E∥2=0.02\|E\|_2 = 0.02. What do the Davis–Kahan bounds support?

    Answers to section 1. (1) By Weyl, at most 0.010.01; in fact both move by about 0.00950.0095 (to 1.01051.0105 and 0.99050.9905). For the eigenvector, tan⁡2θ=2⋅0.01/0.001=20\tan 2\theta = 2\cdot0.01/0.001 = 20, so θ≈43.6°\theta \approx 43.6°: almost the largest possible turn, 45°45°. (2) The plane. The gap λ1−λ2=0.1\lambda_1 - \lambda_2 = 0.1 is small, so q1q_1 alone can turn a lot. The gap between the pair and the rest is λ2−λ3=0.9\lambda_2 - \lambda_3 = 0.9, so span⁡(q1,q2)\operatorname{span}(q_1, q_2) moves little. Section 4 has the numbers.

    4. Worked example #

    (a) Same noise, three gaps. E=ε(0110)E = \varepsilon\begin{pmatrix}0&1\\1&0\end{pmatrix} with ε=∥E∥2=0.01\varepsilon = \|E\|_2 = 0.01, and A=diag⁡(1+δ,1)A = \operatorname{diag}(1 + \delta, 1):

    gap δ\delta eigenvalues of A+EA + E eigenvalue move angle of q^1\hat q_1 (sin⁡\sin) bound 2ε/δ2\varepsilon/\delta
    1 2.0001, 0.9999 0.0001 0.57° (0.0100) 0.02
    0.01 1.01618, 0.99382 0.0062 31.7° (0.526) 2 (no information)
    0.001 1.01051, 0.99049 0.0095 43.6° (0.689) 20 (no information)
    1. Weyl holds in every row: every move is below 0.01.
    2. Row 1: the first-order formula predicts q^1≈e1+q2⊤Eq1λ1−λ2e2=e1+0.01 e2\hat q_1 \approx e_1 + \frac{q_2^\top E q_1}{\lambda_1 - \lambda_2}e_2 = e_1 + 0.01\,e_2, an angle of 0.010.01 rad =0.57°= 0.57°. Exact.
    3. Rows 2 and 3: the bound is above 1, so it says nothing, and the angles really are large (tan⁡2θ=2\tan 2\theta = 2 and 2020).

    (b) A cluster. A=diag⁡(2,1.9,1)A = \operatorname{diag}(2, 1.9, 1) and E=0.05 (11⊤−I)E = 0.05\,(\mathbf 1\mathbf 1^\top - I), that is, 0.050.05 in every off-diagonal entry (1\mathbf 1 is the all-ones vector). Then ∥E∥2=0.1\|E\|_2 = 0.1 and ∥E∥F≈0.122\|E\|_F \approx 0.122.

    1. A+EA + E has eigenvalues 2.0249,1.8801,0.99502.0249, 1.8801, 0.9950. Each moved by less than 0.10.1 (Weyl).
    2. q^1\hat q_1 is 23.5°23.5° away from q1=e1q_1 = e_1. The gap is δ1=0.1\delta_1 = 0.1, so the bound 2⋅0.1/0.1=22\cdot0.1/0.1 = 2 says nothing, and the vector really turned.
    3. The top-2 plane has gap δ=λ2−λ3=0.9\delta = \lambda_2 - \lambda_3 = 0.9. Its principal angles are 4.04°4.04° and 0°0° (two planes in R3\mathbb{R}^3 always share a line), so ∥sin⁡Θ∥F=0.0705\|\sin\Theta\|_F = 0.0705. The bound is 2min⁡(2⋅0.1, 0.122)/0.9=0.2722\min(\sqrt2\cdot0.1,\ 0.122)/0.9 = 0.272. The plane is stable, although the vectors inside it are not.
    4. Why: the noise mostly rotates q1q_1 and q2q_2 inside their plane (the coupling 0.050.05 is half the gap 0.10.1). It tilts the plane only a little (the coupling 0.050.05 is small compared with the gap 0.90.9).
    5. q3=e3q_3 = e_3 also has gap 0.90.9: it turns by 4.04°4.04° (sin⁡=0.070\sin = 0.070), below its bound 2⋅0.1/0.9=0.2222\cdot0.1/0.9 = 0.222.
    Quick check

    In example (b), what does the corollary sin⁡θ≤2∥E∥2/δk\sin\theta \le 2\|E\|_2/\delta_k guarantee for q3=e3q_3 = e_3?

    5. In code #

    NumPy checks the numbers of sections 3 and 4, tests the corollary in random trials and shows the non-symmetric amplifier. The notebook for this lesson has these cells and the exercises.

    import numpy as np
    from scipy.linalg import subspace_angles
    
    def eigh_desc(M):
        """Eigenvalues in DEcreasing order and matching eigenvectors (eigh sorts ascending)."""
        w, V = np.linalg.eigh(M)
        return w[::-1], V[:, ::-1]
    
    # Weyl for singular values through the symmetric embedding H(A) = [[0, A], [A^T, 0]]
    A = np.array([[3., 0.], [0., 1.], [0., 0.]])
    H = np.block([[np.zeros((3, 3)), A], [A.T, np.zeros((2, 2))]])
    print(np.round(np.sort(np.linalg.eigvalsh(H))[::-1], 6))              # [ 3.  1.  0. -1. -3.]
    
    # principal angles: two planes in R^3 share a line
    V = np.eye(3)[:, :2]                                                   # the xy-plane
    Vh = np.column_stack([[1, 0, 0], np.array([0, 1, 1]) / np.sqrt(2)])    # span(e1, (e2+e3)/sqrt2)
    print(np.round(np.linalg.svd(Vh.T @ V, compute_uv=False), 4))          # [1.     0.7071]
    print(np.round(np.degrees(subspace_angles(Vh, V)), 2))                 # [45.  0.]
    
    # 2x2: the same noise and three gaps
    F = np.array([[0., 1.], [1., 0.]]); eps = 0.01
    for gap in (1.0, 0.01, 0.001):
        w, Vg = eigh_desc(np.diag([1 + gap, 1.0]) + eps * F)
        theta = np.degrees(np.arccos(abs(Vg[0, 0])))          # angle between q1_hat and e1
        print(gap, np.round(w, 5), round(theta, 2), round(2 * eps / gap, 3))
    # 1.0 [2.0001 0.9999] 0.57 0.02
    # 0.01 [1.01618 0.99382] 31.72 2.0
    # 0.001 [1.01051 0.99049] 43.57 20.0
    
    # a cluster: the top eigenvector turns a lot, the top-2 plane does not
    A = np.diag([2.0, 1.9, 1.0]); E = 0.05 * (np.ones((3, 3)) - np.eye(3))
    w0, V0 = eigh_desc(A); w, V = eigh_desc(A + E)
    print(round(np.linalg.norm(E, 2), 6), np.round(w, 4))                  # 0.1 [2.0249 1.8801 0.995 ]
    print(round(np.degrees(np.arccos(abs(V[:, 0] @ V0[:, 0]))), 2))         # 23.45
    ang = subspace_angles(V[:, :2], V0[:, :2])                              # principal angles, largest first
    print(np.round(np.degrees(ang), 2), round(np.linalg.norm(np.sin(ang)), 4))  # [4.04 0.  ] 0.0705
    print(round(2 * min(np.sqrt(2) * 0.1, np.linalg.norm(E)) / 0.9, 3))     # 0.272 (the bound)
    P, P0 = V[:, :2] @ V[:, :2].T, V0[:, :2] @ V0[:, :2].T
    print(round(np.linalg.norm(P - P0, 2), 4))                              # 0.0705 = ||sin Theta||_2
    
    # the corollary sin(theta) <= 2 ||E||_2 / delta_k in random trials
    rng = np.random.default_rng(0); worst = 0.0
    for _ in range(2000):
        lam = np.sort(rng.uniform(0, 5, 6))[::-1]
        Q, _ = np.linalg.qr(rng.standard_normal((6, 6)))
        G = rng.standard_normal((6, 6)); En = rng.uniform(1e-3, 0.3) * (G + G.T)
        _, Vh = eigh_desc(Q @ np.diag(lam) @ Q.T + En)
        k = rng.integers(6)
        delta = min(lam[k - 1] - lam[k] if k > 0 else np.inf, lam[k] - lam[k + 1] if k < 5 else np.inf)
        s = np.sqrt(max(0.0, 1 - (Vh[:, k] @ Q[:, k]) ** 2))
        worst = max(worst, s / (2 * np.linalg.norm(En, 2) / delta))
    print(worst < 1)                                                        # True
    
    # non-symmetric: the eigenvector matrix X amplifies (Bauer-Fike)
    B = np.array([[1., 1.], [0., 1.001]])
    _, X = np.linalg.eig(B)
    print(round(np.linalg.cond(B), 2), round(np.linalg.cond(X)))            # 2.62 2000
    print(np.round(np.linalg.eigvals(B + np.array([[0., 0.], [1e-6, 0.]])).real, 6))  # moved ~6e-4, not 1e-6
    

    subspace_angles returns the principal angles in radians, largest first. Always compare eigenvectors through ∣q^⊤q∣|\hat q^\top q|, angles or projectors, never entry by entry.

    6. Where it shows up #

    • PCA from samples. For NN samples of dd-dimensional Gaussian data with N≥dN \ge d, the sample covariance has ∥Σ^−Σ∥2\|\hat\Sigma - \Sigma\|_2 of order ∥Σ∥2d/N\|\Sigma\|_2\sqrt{d/N} (up to a constant). Weyl: the variances are that accurate. Davis–Kahan: principal component kk is reliable only when this is small compared with δk\delta_k, so roughly N≫d ∥Σ∥22/δk2N \gg d\,\|\Sigma\|_2^2/\delta_k^2. When eigenvalues are nearly equal, report the subspace they span, not single components.
    • Climate EOFs and ensemble PCA (ML for science). EOFs are the principal components of a climate field. North et al. (1982) give the rule of thumb: the sampling error of an eigenvalue is about λ2/N\lambda\sqrt{2/N} for NN independent samples. If it is comparable to the distance to a neighbouring eigenvalue, the two EOFs are mixed by sampling noise and must be read as a pair. For example, λ=2\lambda = 2 with N=100N = 100 gives an error of about 0.280.28.
    • Spectral clustering. For kk disconnected clusters, the eigenvectors of the kk smallest Laplacian eigenvalues span the cluster indicators. Edges between clusters perturb the Laplacian; Davis–Kahan keeps this kk-dimensional eigenspace close if the gap μk+1−μk\mu_{k+1} - \mu_k is large (μ\mu sorted ascending). This is the eigengap heuristic for choosing kk (lesson 19).
    • Compression and quantization. Quantization or pruning adds EE to a weight matrix. The singular values move by at most ∥E∥2\|E\|_2 (Weyl), and the top-kk singular subspace stays put only if σk−σk+1\sigma_k - \sigma_{k+1} is large compared with ∥E∥2\|E\|_2 (Wedin). With a small gap at the cut, an SVD-based compression can pick a different subspace after a tiny change.
    • Numerics. LAPACK's error bound for a computed symmetric eigenvector is about εmach∥A∥2/gapk\varepsilon_{\text{mach}}\|A\|_2/\text{gap}_k. Eigenvalues are accurate to εmach∥A∥2\varepsilon_{\text{mach}}\|A\|_2; eigenvectors of close eigenvalues are individually unreliable, but their span is reliable.
    • Physics. The first-order formulas are Rayleigh–Schrödinger perturbation theory: the energy shift is qk⊤Eqkq_k^\top E q_k, and states mix with weights 1/(λk−λj)1/(\lambda_k - \lambda_j). Degenerate levels need degenerate perturbation theory, for the same reason as above.

    7. Common mistakes #

    • Comparing eigenvectors entry by entry. qq and −q-q are the same eigenvector, and inside a repeated eigenspace any rotation is allowed. Compare ∣q^⊤q∣|\hat q^\top q|, principal angles or projectors.
    • "Small noise, so small eigenvector change." Only relative to the gap: sin⁡θ≤2∥E∥2/δk\sin\theta \le 2\|E\|_2/\delta_k.
    • The wrong gap. For qkq_k the gap is to both neighbours. For a block, it is the gap between the block and the rest; gaps inside the block do not matter.
    • Reading a bound above 1 as "large rotation". Such a bound says nothing. Davis–Kahan is an upper bound; the true angle can be small, for example when EE has the same eigenvectors as AA.
    • Using the first-order formula for large noise. θ≈ε/δ\theta \approx \varepsilon/\delta needs ε≪δ\varepsilon \ll \delta; in the 2×22\times2 example the true angle never passes 45°45°.
    • Mismatched indices. q^k\hat q_k must be the kk-th eigenvector of A^\hat A in the same order as qkq_k (np.linalg.eigh sorts ascending).
    • Using Weyl or Davis–Kahan for non-symmetric matrices. Eigenvalues can move by much more than ∥E∥2\|E\|_2 (Bauer–Fike allows κ(X)∥E∥2\kappa(X)\|E\|_2). For general matrices use singular values and Wedin.

    8. Check yourself #

    1. AA has eigenvalues 5,4.9,15, 4.9, 1 and ∥E∥2=0.02\|E\|_2 = 0.02. Bound sin⁡θ\sin\theta for the top eigenvector, and ∥sin⁡Θ∥F\|\sin\Theta\|_F for the top-2 eigenspace.
      AnswerTop eigenvector: δ1=0.1\delta_1 = 0.1, so sin⁡θ≤2⋅0.02/0.1=0.4\sin\theta \le 2\cdot0.02/0.1 = 0.4. Top-2 eigenspace: δ=4.9−1=3.9\delta = 4.9 - 1 = 3.9, so ∥sin⁡Θ∥F≤22⋅0.02/3.9≈0.0145\|\sin\Theta\|_F \le 2\sqrt2\cdot0.02/3.9 \approx 0.0145.
    2. From (A+tE) q(t)=λ(t) q(t)(A + tE)\,q(t) = \lambda(t)\,q(t), derive λ′(0)\lambda'(0) for a simple eigenvalue.
      AnswerDifferentiate at t=0t = 0: Eqk+Aq′=λ′qk+λkq′Eq_k + Aq' = \lambda'q_k + \lambda_kq'. Multiply by qk⊤q_k^\top and use qk⊤A=λkqk⊤q_k^\top A = \lambda_kq_k^\top: the q′q' terms cancel and λ′(0)=qk⊤Eqk\lambda'(0) = q_k^\top Eq_k.
    3. A=diag⁡(3,1)A = \operatorname{diag}(3, 1) and E=ε(0110)E = \varepsilon\begin{pmatrix}0&1\\1&0\end{pmatrix}. What is the top eigenvector to first order?
      Answerq^1≈e1+e2⊤Ee13−1e2=e1+ε2e2\hat q_1 \approx e_1 + \frac{e_2^\top Ee_1}{3 - 1}e_2 = e_1 + \frac{\varepsilon}2 e_2. (For ε=0.1\varepsilon = 0.1 the exact ratio of the entries is 0.04990.0499.)
    4. Where does the Davis–Kahan proof use that A^\hat A is symmetric?
      AnswerIn steps 2–3: A^\hat A has an orthonormal eigenbasis, so ∥(A^−λI)q∥2=∑j(λ^j−λ)2cj2\|(\hat A - \lambda I)q\|^2 = \sum_j(\hat\lambda_j - \lambda)^2c_j^2 and ∑jcj2=1\sum_j c_j^2 = 1. For a non-normal A^\hat A the eigenvectors are not orthogonal and this identity fails.
    5. A noisy matrix A+EA + E has singular values 5,3,0.08,0.055, 3, 0.08, 0.05, and you know ∥E∥2≤0.1\|E\|_2 \le 0.1. What can you say about rank⁡(A)\operatorname{rank}(A) and its top-2 singular subspaces?
      AnswerWeyl for singular values: σ1(A)≥4.9\sigma_1(A) \ge 4.9 and σ2(A)≥2.9\sigma_2(A) \ge 2.9, so rank⁡A≥2\operatorname{rank}A \ge 2; but σ3(A)≤0.18\sigma_3(A) \le 0.18 and σ4(A)≤0.15\sigma_4(A) \le 0.15 can be zero or not, so the rank (2, 3 or 4) is not determined. The gap σ2(A)−σ3(A)≥2.72\sigma_2(A) - \sigma_3(A) \ge 2.72 is large, so by Wedin the top-2 singular subspaces are well determined: sines at most 0.1/(2.72−0.1)≈0.040.1/(2.72 - 0.1) \approx 0.04.
    6. A sample covariance has eigenvalues 2.00,1.98,0.502.00, 1.98, 0.50, and ∥Σ^−Σ∥2≈0.05\|\hat\Sigma - \Sigma\|_2 \approx 0.05. Can you report PC1? What can you report?
      AnswerNot PC1. By Weyl, the population gap λ1−λ2\lambda_1 - \lambda_2 is at most 0.02+2⋅0.05=0.120.02 + 2\cdot0.05 = 0.12, so the bound 2⋅0.05/δ12\cdot0.05/\delta_1 is at least 0.830.83: PC1 and PC2 may mix. Report the plane of PC1 and PC2: by Weyl the population gap λ2−λ3\lambda_2 - \lambda_3 is at least 1.98−0.50−2⋅0.05=1.381.98 - 0.50 - 2\cdot0.05 = 1.38, so ∥sin⁡Θ∥F≤22⋅0.05/1.38≈0.10\|\sin\Theta\|_F \le 2\sqrt2\cdot0.05/1.38 \approx 0.10.
    7. What are the eigenvalues of H(A)=(0AA⊤0)H(A) = \begin{pmatrix} 0 & A \\ A^\top & 0 \end{pmatrix} for A=(200010)A = \begin{pmatrix} 2 & 0 & 0 \\ 0 & 1 & 0 \end{pmatrix}?
      AnswerAA is 2×32\times3 with singular values 2 and 1, so H(A)H(A) is 5×55\times5 with eigenvalues 2,1,0,−1,−22, 1, 0, -1, -2 (one zero, because ∣m−n∣=1|m - n| = 1).
    Recall cardsAnswer in your head first, then reveal. Add the cards to your review deck to see them again just before you would forget.
    1. State Weyl's inequality for eigenvalues of symmetric matrices.

    2. State Weyl's inequality for singular values. How is it proved?

    3. State the Bauer–Fike theorem.

    4. How are the principal angles between two subspaces computed?

    5. What is ∥sin⁡Θ∥2\|\sin\Theta\|_2 in terms of projectors?

    6. What is λ′(0)\lambda'(0) for a simple eigenvalue of A+tEA + tE?

    7. What is q′(0)q'(0) for the eigenvector of a simple eigenvalue λk\lambda_k of A+tEA + tE?

    8. Compute the angle of the top eigenvector of (1.0010.010.011)\begin{pmatrix} 1.001 & 0.01 \\ 0.01 & 1 \end{pmatrix}.

    9. Davis–Kahan in words.

    10. Why is the span of a cluster of close eigenvectors stable when its single eigenvectors are not?

    Open the review →

    9. Interview angle #

    • "Eigenvalues are stable but eigenvectors are not. Explain." — Weyl has constant 1; eigenvectors have condition number 1/gap (first-order formula, Davis–Kahan); give the 2×22\times2 example.
    • "How many samples do you need to estimate the top principal component?" — Enough that ∥Σ^−Σ∥2≈∥Σ∥2d/N\|\hat\Sigma - \Sigma\|_2 \approx \|\Sigma\|_2\sqrt{d/N} is small compared with λ1−λ2\lambda_1 - \lambda_2.
    • "Two eigenvalues of your covariance are almost equal. What do you report?" — The 2-D subspace they span; it is stable if it is separated from the rest of the spectrum.
    • "Why does spectral clustering look at the eigengap?" — The kk-dimensional eigenspace is stable when μk+1−μk\mu_{k+1} - \mu_k is large.
    • "The eigenvectors from your solver change between machines. Bug?" — Not necessarily: sign flips and rotations inside a near-degenerate eigenspace are allowed. Compare subspaces.

    10. Practice #

    The notebook for this lesson runs in Colab. It has four exercises, each with a check cell and a folded solution:

    1. Weyl in practice: compute the largest eigenvalue move for random symmetric noise, check it against ∥E∥2\|E\|_2, and find the noise that reaches the bound.
    2. Write sin_theta for two vectors and sin_theta_subspaces for two subspaces (through projectors), and compare with scipy.linalg.subspace_angles.
    3. Implement the first-order eigenvector formula and show that its error shrinks like ∥E∥22\|E\|_2^2.
    4. Davis–Kahan for PCA: for a covariance with a small and a large eigengap, compare the true angles of the sample eigenvectors with the bound 2∥E∥2/δk2\|E\|_2/\delta_k.

    11. Watch and read #

    Derivatives of eigenvalues, as in the first-order formulas of section 3, and interlacing.
    Open on YouTube · the player loads from youtube-nocookie.com when you press play
    From 6:36, the proof of Weyl's inequality, then covariance concentration.
    Open on YouTube · the player loads from youtube-nocookie.com when you press play
    The proof of Davis–Kahan and the subspace version.
    Open on YouTube · the player loads from youtube-nocookie.com when you press play