Chapter 4 Formula Sheet
Reference, not teaching. Each entry names the book’s number, states the result, gives the condition it needs, and names the call that computes it. Read the concept pages first; come back here when you are working.
The one-line summary
Section titled “The one-line summary”Every decomposition in this chapter trades a condition for a capability:
Read it right to left and the SVD is the one with no entry fee. Read it left to right and each step buys something cheaper: Cholesky costs where an SVD costs about .
§4.1 Determinant and trace
Section titled “§4.1 Determinant and trace”| # | result | condition | NumPy |
|---|---|---|---|
| Thm 4.1 | is invertible | square | np.linalg.det |
| Eq 4.5 | : | — | — |
| Eq 4.6 | Sarrus for : three down-right products minus three down-left | only | — |
| Thm 4.2 | Laplace expansion along row or column : | square | — |
| Eq 4.8 | triangular matrix: | triangular | — |
| Thm 4.3 | ; ; ; similar matrices share a determinant; row operations, sign rules | square | — |
| Thm 4.3 | square | np.linalg.matrix_rank | |
| Def 4.4 | square | np.trace | |
| Eq 4.19 | — so the trace is cyclic | shapes must compose both ways | — |
| Eq 4.21 | — | — | |
| — | trace is invariant under basis change: | invertible | — |
The cost warning. Laplace expansion is about multiplications; Gaussian elimination is about . Determinants are a theoretical tool.
§4.2 Eigenvalues and eigenvectors
Section titled “§4.2 Eigenvalues and eigenvectors”| # | result | condition | NumPy |
|---|---|---|---|
| Def 4.6 | , | square | np.linalg.eig |
| Thm 4.8 | is an eigenvalue it is a root of | square | np.roots on the char. poly (don’t) |
| Def 4.9 | algebraic multiplicity: multiplicity as a root of | — | — |
| Def 4.11 | eigenspace ; geometric multiplicity | — | n - matrix_rank(A - lam*I) |
| — | geometric algebraic, always | — | — |
| Def 4.13 | defective: geometric multiplicities sum to less than | square | — |
| Thm 4.12 | eigenvectors for distinct eigenvalues are linearly independent | — | — |
| Thm 4.14 | is symmetric positive semidefinite; positive definite iff | any shape | — |
| Thm 4.15 | spectral theorem: a symmetric matrix has an orthonormal basis of eigenvectors and real eigenvalues | symmetric | np.linalg.eigh |
| Thm 4.16 | , counting algebraic multiplicity | square | — |
| Thm 4.17 | , counting algebraic multiplicity | square | — |
| Eq 4.23–4.24 | for a : | — | |
| — | is the volume scaling; its sign is the orientation | square | — |
Use eigh for symmetric input — faster, real, sorted ascending, orthonormal eigenvectors. Never on
non-symmetric input: it reads only the lower triangle.
§4.3 Cholesky decomposition
Section titled “§4.3 Cholesky decomposition”| # | result | condition | NumPy |
|---|---|---|---|
| Thm 4.18 | with lower triangular and positive diagonal, uniquely | symmetric positive definite | np.linalg.cholesky |
| Eq 4.44 | SPD | — | |
| — | sampling: with gives | SPD | — |
| — | cost , about half an LU factorisation | SPD | — |
| — | a raised LinAlgError is the positive-definiteness test | — | try/except |
§4.4 Eigendecomposition and diagonalization
Section titled “§4.4 Eigendecomposition and diagonalization”| # | result | condition | NumPy |
|---|---|---|---|
| Def 4.19 | diagonalizable: similar to a diagonal matrix, | square | — |
| Eq 4.50 | the columns of are eigenvectors and holds the eigenvalues | — | — |
| Thm 4.20 | iff the eigenvectors form a basis of | square, non-defective | np.linalg.eig |
| Thm 4.21 | a symmetric matrix can always be diagonalized, and can be taken orthogonal so | symmetric | np.linalg.eigh |
| Eq 4.62 | diagonalizable | np.linalg.matrix_power | |
| Eq 4.63 | diagonalizable | — | |
| — | geometry: into the eigenbasis, scales, back. Rotations only if symmetric | — | — |
| — | defective matrices need the Jordan normal form — outside this book | — | — |
§4.5 Singular value decomposition
Section titled “§4.5 Singular value decomposition”| # | result | condition | NumPy |
|---|---|---|---|
| Thm 4.22 | with , both orthogonal, with descending | none | np.linalg.svd |
| Eq 4.65–4.66 | has the shape of : zero rows below if , zero columns to the right if | — | — |
| Eq 4.73 | — the eigenvectors of are | — | — |
| Eq 4.76 | — the eigenvectors of are | — | — |
| Eq 4.78 | — | ||
| Eq 4.79 | singular value equation , | — | — |
| Eq 4.80 | — | — | |
| — | the trailing columns of are an orthonormal basis of | — | Vt[r:].T |
| Eq 4.89 | reduced SVD: is , is square | full_matrices=False | |
| — | and | square for the first | — |
| — | only for symmetric matrices | symmetric | — |
| — | for symmetric the eigendecomposition and the SVD coincide | symmetric | — |
Never compute an SVD through a Gram matrix. ; measured, the smallest singular value is wrong at and lost entirely at .
§4.6 Matrix approximation
Section titled “§4.6 Matrix approximation”| # | result | condition | NumPy |
|---|---|---|---|
| Eq 4.90 | , a rank-1 outer product | — | np.outer |
| Eq 4.91 | — | — | |
| Eq 4.92 | , with exactly | (U[:,:k]*s[:k]) @ Vt[:k] | |
| Def 4.23 | spectral norm | — | np.linalg.norm(A, 2) |
| Thm 4.24 | — | — | |
| Thm 4.25 | Eckart-Young: and | — | — |
| Eq 4.96 | — | — | |
| — | Frobenius error: , also optimal | — | — |
| — | storage: numbers, so it saves only when | — | — |
§4.7 Matrix phylogeny
Section titled “§4.7 Matrix phylogeny”| class | condition | what it gives you |
|---|---|---|
| real, any shape | — | SVD, pseudo-inverse |
| square | determinant, trace, eigenvalues | |
| regular / invertible | ||
| non-defective | independent eigenvectors | |
| normal | singular and eigen directions align | |
| orthogonal (Def 3.8) | , free | |
| rotation | orthogonal with | preserves orientation |
| symmetric | real eigenvalues, orthonormal eigenbasis | |
| positive definite | unique Cholesky, , invertible | |
| diagonal | , | everything elementwise |
| identity | — |
Diagonal matrices are closed under multiplication and addition but form a group only when every diagonal entry is nonzero.
Numbers worth remembering
Section titled “Numbers worth remembering”| quantity | value | where |
|---|---|---|
| Laplace vs elimination at | ratio | §4.1 |
| Cholesky cost | , half an LU | §4.3 |
| eigendecomposition cost | about symmetric | §4.4 |
| SVD cost | about square | §4.5 |
| crossover, | eigen route wins from | §4.4 |
| defective random Gaussians | of | §4.4 |
| defective small-integer | §4.4 | |
of np.linalg.qr’s | , exactly | §4.7 |
| Eckart-Young agreement over 420 truncations | §4.6 | |
| random rank- competitors below the bound | of | §4.6 |
| Stonehenge rank-5 storage | of , | §4.6 |
| Gram route error at | — the singular value is lost | §4.5 |
The exercises, in one line each
Section titled “The exercises, in one line each”| # | answer |
|---|---|
| 4.1 | ; |
| 4.2 | |
| 4.3 | (a) defective, geometric ; (b) , diagonalizable |
| 4.4 | ( doubled, geometric ) — defective |
| 4.5 | all four invertible-by-diagonalizable combinations |
| 4.6 | (a) defective ; (b) diagonalizable |
| 4.7 | (a) , no over ; (b) yes; (c) defective ; (d) yes |
| 4.8 | |
| 4.9 | , with |
| 4.10 | , error |
| 4.11 | multiply by ; needs to keep |
| 4.12 | orthogonal factors preserve length; the max is at |
Where each section is used later
Section titled “Where each section is used later”| from | used in |
|---|---|
| §4.1 determinant, trace | Ch 5 Jacobians; Ch 6 Gaussian densities carry |
| §4.2 eigenvalues | Ch 7 the Hessian’s spectrum decides minimum vs saddle; Ch 10 variance along a component |
| §4.2 spectral theorem | Ch 10 orthogonal principal components; Ch 12 kernel matrices |
| §4.3 Cholesky | Ch 6 Gaussian sampling and the reparametrisation trick; Ch 11 GMM covariances |
| §4.4 eigendecomposition | Ch 10 PCA as an eigendecomposition of a covariance matrix |
| §4.5 SVD | Ch 9 the pseudo-inverse and least squares; Ch 10 PCA by another route |
| §4.6 Eckart-Young | Ch 10 the reconstruction-error derivation of PCA |
The six mistakes this chapter is designed to prevent
Section titled “The six mistakes this chapter is designed to prevent”- Computing a determinant by cofactor expansion. against . Use elimination, or Cholesky if the matrix is SPD.
- Assuming invertible means diagonalizable. Measured, the implication holds one way and the other. Neither is a theorem.
- Assuming a repeated eigenvalue means defective. Exercise 4.6b has an eigenvalue repeated three times and is perfectly diagonalizable. What matters is .
- Writing without checking symmetry. Example 4.5 is diagonalizable with .
- Constructing an SVD through . The condition number squares. The construction is a proof, not an algorithm.
- Reading individual eigenvector or singular-vector components across a repeated value. Any rotation inside the repeated eigenspace is equally valid, so different builds report different vectors.
-
Which decomposition needs no condition on the matrix at all?
Theorem 4.22 holds for every real matrix of every shape, with rank anywhere from 0 to min(m,n). Cholesky needs symmetric positive definite; the eigendecomposition needs square and non-defective.
pch.quizShowAnswer
C — The SVD — Theorem 4.22 holds for every real matrix of every shape, with rank anywhere from 0 to min(m,n). Cholesky needs symmetric positive definite; the eigendecomposition needs square and non-defective.
-
Theorem 4.24 says the spectral norm equals sigma_1. What makes Equation 4.95 follow almost immediately?
Equation 4.96 makes that explicit. The hard half of Theorem 4.25 is optimality, Equation 4.94, which needs the rank-nullity contradiction.
pch.quizShowAnswer
B — That A minus A-hat(k) is the tail of the SVD sum, so it is already in SVD form with largest singular value sigma-k-plus-one — Equation 4.96 makes that explicit. The hard half of Theorem 4.25 is optimality, Equation 4.94, which needs the rank-nullity contradiction.
-
Which single result does the rest of the chapter lean on most heavily?
It gives Theorem 4.21 for symmetric matrices, it is what makes the SVD construction of §4.5.2 work at all since A-transpose A is always symmetric, and it is why PCA in Chapter 10 gets orthogonal components without asking.
pch.quizShowAnswer
B — Theorem 4.15, the spectral theorem: a symmetric matrix has real eigenvalues and an orthonormal eigenbasis — It gives Theorem 4.21 for symmetric matrices, it is what makes the SVD construction of §4.5.2 work at all since A-transpose A is always symmetric, and it is why PCA in Chapter 10 gets orthogonal components without asking.
Recall card
Section titled “Recall card”- The chapter is a ladder of conditions: Cholesky needs SPD, the eigendecomposition needs square and non-defective, the SVD needs nothing — and the cheaper the decomposition, the stricter the condition.
- Determinant and trace are basis-independent, so they describe the mapping rather than the matrix; both equal a symmetric function of the eigenvalues (product and sum).
- The spectral theorem is the load-bearing result: symmetric implies real eigenvalues and an orthonormal eigenbasis, which is what makes Theorem 4.21, the SVD construction and PCA all work.
- Diagonalizability is about the count of independent eigenvectors, which is the sum of the geometric multiplicities — not about repeats and not about invertibility.
- The SVD’s two outer factors are orthogonal and live in different spaces, so unlike P and P-inverse they are not inverses of each other; Sigma has the shape of A and pads with zeros.
- Eckart-Young gives the error before you compute the approximation: exactly sigma-k-plus-one in the spectral norm, and the square root of the discarded tail in the Frobenius norm.
- Low rank is not few numbers: a rank-k factorisation costs k(m+n+1), so the saving depends on the ratio of k to mn/(m+n+1).
- Three library traps:
choleskyandeighread only the lower triangle;np.linalg.qrreturns a Q with determinant exactly (-1) to the (n-1); andeigreturns P for a defective matrix without complaint.
Back to: Matrix Decompositions Overview — or on to Chapter 5, Vector Calculus.
pch.coffeeTagline
pch.coffeeCtapch.feedbackHeading
pch.feedbackSubheading