Linear Algebra II: Spectra, Cayley–Hamilton & Finite Fields

Study Sheet

Linear Algebra II: Spectra, Cayley–Hamilton & Finite Fields

Eigenvalues do the arithmetic; counting matrices over F_p

Spectral Reasoning

Tip
Eigenvalues carry every polynomial fact
Av₁ = 3v₁v₁Av₂ = v₂
A = [[2, 1], [1, 2]] maps the unit circle (dashed) to the ellipse: along v₁ = (1, 1)/√2 it stretches by 3, along v₂ = (1, −1)/√2 by 1.

If AA has eigenvalues λi\lambda_i then p(A)p(A) has eigenvalues p(λi)p(\lambda_i): det⁡(A2+I)=∏(λi2+1)\det(A^2 + I) = \prod(\lambda_i^2 + 1), tr(Ak)=∑λik\mathrm{tr}(A^k) = \sum\lambda_i^k, det⁡eA=etrA\det e^A = e^{\mathrm{tr}A}.

A 3×33\times3 matrix with eigenvalues 1,2,31, 2, 3 has det⁡(A2+I)=2⋅5⋅10=100\det(A^2 + I) = 2\cdot5\cdot10 = 100 — no entries needed. Trace and determinant are the first two symmetric functions of the spectrum; Newton's identities convert power sums tr(Ak)\mathrm{tr}(A^k) into the characteristic polynomial and back. If tr(Ak)=0\mathrm{tr}(A^k) = 0 for k=1..nk = 1..n, then all eigenvalues vanish and AA is nilpotent — a classic Putnam lemma. A 2×22\times2 picture: A=(2112)A = \begin{pmatrix}2&1\\1&2\end{pmatrix} has eigenvectors (1,1)(1, 1) and (1,−1)(1, -1) with eigenvalues 33 and 11, so det⁡(A2+I)=(32+1)(12+1)=20\det(A^2 + I) = (3^2 + 1)(1^2 + 1) = 20 — and directly, A2+I=(6446)A^2 + I = \begin{pmatrix}6&4\\4&6\end{pmatrix} has determinant 36−16=2036 - 16 = 20.

Tip
Cayley–Hamilton and minimal polynomials

Every matrix satisfies its own characteristic polynomial: pA(A)=0p_A(A) = 0. For 2×22\times2: A2−(trA)A+(det⁡A)I=0A^2 - (\mathrm{tr}A)A + (\det A)I = 0.

Consequences: AnA^n is a combination of I,A,…,An−1I, A, \ldots, A^{n-1}, so powers reduce; A−1A^{-1} is a polynomial in AA when det⁡A≠0\det A \ne 0; and a matrix with A2=AA^2 = A (idempotent) or A2=IA^2 = I (involution) or Ak=0A^k = 0 (nilpotent) has eigenvalues confined to the roots of the corresponding polynomial — {0,1}\{0,1\}, {±1}\{\pm1\}, {0}\{0\}. Rank of an idempotent equals its trace. These one-liners decide many "show that" problems.

Tip
Matrices over finite fields: count

∣GLn(Fq)∣=(qn−1)(qn−q)⋯(qn−qn−1)|GL_n(\mathbb F_q)| = (q^n - 1)(q^n - q)\cdots(q^n - q^{n-1}) — pick columns one at a time, each outside the span of the previous.

∣GL2(F2)∣=3⋅2=6|GL_2(\mathbb F_2)| = 3\cdot2 = 6 (≅S3\cong S_3); ∣GL2(F3)∣=8⋅6=48|GL_2(\mathbb F_3)| = 8\cdot6 = 48; ∣SLn∣=∣GLn∣/(q−1)|SL_n| = |GL_n|/(q - 1). The number of kk-dimensional subspaces of Fqn\mathbb F_q^n is the Gaussian binomial (nk)q\binom nk_q. Over F2\mathbb F_2, "how many symmetric / nilpotent / invertible matrices" problems all reduce to this counting-by-columns template.

Side note
Real symmetric matrices are the nice case

Real eigenvalues, orthogonal eigenvectors, diagonalizable — so xTAx\mathbf x^{\mathsf T}A\mathbf x on the unit sphere ranges over [λmin⁡,λmax⁡][\lambda_{\min}, \lambda_{\max}] (the Rayleigh quotient). Positive definiteness is "all eigenvalues positive," tested by leading principal minors. Half of Putnam linear algebra is recognizing that the matrix in front of you is symmetric and applying the spectral theorem.

Side note
Where it goes wrong

"The eigenvalues of A+BA + B are the sums of the eigenvalues of AA and BB." Take A=(0100)A = \begin{pmatrix}0&1\\0&0\end{pmatrix} and B=(0010)B = \begin{pmatrix}0&0\\1&0\end{pmatrix}: both have only the eigenvalue 00, yet A+B=(0110)A + B = \begin{pmatrix}0&1\\1&0\end{pmatrix} has eigenvalues 11 and −1-1. Eigenvalues add (and multiply) only when the matrices share eigenvectors — for instance when BB is a polynomial in AA, which is why "p(A)p(A) has eigenvalues p(λi)p(\lambda_i)" is safe. What does survive for sums is the trace: tr(A+B)=trA+trB\mathrm{tr}(A + B) = \mathrm{tr}A + \mathrm{tr}B always (0=1+(−1)0 = 1 + (-1) here).

Try it
Try it: Cayley–Hamilton reduces a power

For A=(1110)A = \begin{pmatrix}1&1\\1&0\end{pmatrix}, express A5A^5 as aA+bIaA + bI.

Show the answer

tr=1\mathrm{tr} = 1, det⁡=−1\det = -1: A2=A+IA^2 = A + I. Then A3=A2+A=2A+IA^3 = A^2 + A = 2A + I, A4=2A2+A=3A+2IA^4 = 2A^2 + A = 3A + 2I, A5=3A2+2A=5A+3IA^5 = 3A^2 + 2A = 5A + 3I. The coefficients are Fibonacci numbers — because AA is the Fibonacci matrix.

Proofs & Why It Matters

Tip
Proof: tr⁡Ak=0\operatorname{tr}A^k = 0 for k=1,…,nk = 1, \ldots, n forces AA nilpotent

If an n×nn\times n complex matrix has tr⁡Ak=0\operatorname{tr}A^k = 0 for all 1≤k≤n1 \le k \le n, then every eigenvalue is 00.

Let the distinct nonzero eigenvalues be λ1,…,λm\lambda_1, \ldots, \lambda_m with multiplicities c1,…,cm≥1c_1, \ldots, c_m \ge 1. The hypotheses say ∑iciλik=0\sum_i c_i\lambda_i^k = 0 for k=1,…,mk = 1, \ldots, m (we only need m≤nm \le n of them): a homogeneous linear system in the unknowns cic_i whose coefficient matrix [λik][\lambda_i^k] is a Vandermonde matrix in distinct nonzero nodes times diag⁡(λi)\operatorname{diag}(\lambda_i) — invertible. So all ci=0c_i = 0, contradicting ci≥1c_i \ge 1 unless m=0m = 0. ■\blacksquare Significance: traces of powers determine the spectrum (Newton's identities in matrix clothing); the converse — a nilpotent matrix has all power-traces zero — is immediate from triangularization.

Tip
Proof: Cayley–Hamilton via the adjugate

Every square matrix satisfies its own characteristic polynomial: pA(A)=0p_A(A) = 0.

Let pA(t)=det⁡(tI−A)=tn+cn−1tn−1+⋯+c0p_A(t) = \det(tI - A) = t^n + c_{n-1}t^{n-1} + \cdots + c_0 and let B(t)=adj⁡(tI−A)B(t) = \operatorname{adj}(tI - A), a matrix whose entries are polynomials in tt of degree ≤n−1\le n - 1; write B(t)=∑k=0n−1BktkB(t) = \sum_{k=0}^{n-1}B_kt^k with constant matrices BkB_k. The adjugate identity (tI−A)B(t)=pA(t)I(tI - A)B(t) = p_A(t)I holds for every scalar tt, so comparing coefficients of tkt^k on both sides gives Bk−1−ABk=ckIB_{k-1} - AB_k = c_kI (with B−1=Bn=0B_{-1} = B_n = 0). Multiply the kkth equation by AkA^k on the left and add over kk: the left side telescopes to 00, the right side is ∑ckAk=pA(A)\sum c_kA^k = p_A(A). ■\blacksquare (The one-line "substitute t=At = A into det⁡(tI−A)\det(tI - A)" is NOT a proof — tt is a scalar there.) Significance: AnA^n is a combination of I,A,…,An−1I, A, \ldots, A^{n-1}, so powers, inverses, and eAe^{A} all live in an nn-dimensional space; that is what makes "compute A100A^{100}" tractable. A second route, worth knowing as a technique: for diagonalizable A=PDP−1A = PDP^{-1}, pA(A)=P pA(D)P−1p_A(A) = P\,p_A(D)P^{-1} and pA(D)p_A(D) is diagonal with entries pA(λi)=0p_A(\lambda_i) = 0; diagonalizable matrices are dense (perturb the eigenvalues apart) and A↦pA(A)A \mapsto p_A(A) is continuous in the entries, so the identity extends to every complex matrix. Prove an algebraic identity on a dense set, then pass to the limit.

Tip
Proof: the spectral theorem for real symmetric matrices

A real symmetric matrix has real eigenvalues and an orthonormal basis of eigenvectors.

Real eigenvalues: if Ax=λxA\mathbf x = \lambda\mathbf x with x≠0\mathbf x \ne 0 complex, then xˉTAx=λ∣x∣2\bar{\mathbf x}^{\mathsf T}A\mathbf x = \lambda|\mathbf x|^2, and taking the conjugate transpose of the same scalar (using AT=AA^{\mathsf T} = A real) gives λˉ∣x∣2\bar\lambda|\mathbf x|^2; hence λ=λˉ\lambda = \bar\lambda. Orthogonality: for eigenvectors with λ≠μ\lambda \ne \mu, λ yTx=yTAx=(Ay)Tx=μ yTx\lambda\,\mathbf y^{\mathsf T}\mathbf x = \mathbf y^{\mathsf T}A\mathbf x = (A\mathbf y)^{\mathsf T}\mathbf x = \mu\,\mathbf y^{\mathsf T}\mathbf x, so yTx=0\mathbf y^{\mathsf T}\mathbf x = 0. Full basis: take a unit eigenvector q1\mathbf q_1 (it exists since the characteristic polynomial has a real root); AA maps the orthogonal complement q1⊥\mathbf q_1^\perp to itself (if x⊥q1\mathbf x \perp \mathbf q_1 then q1TAx=(Aq1)Tx=λ1q1Tx=0\mathbf q_1^{\mathsf T}A\mathbf x = (A\mathbf q_1)^{\mathsf T}\mathbf x = \lambda_1\mathbf q_1^{\mathsf T}\mathbf x = 0), and restricted there it is again symmetric; induct on the dimension. ■\blacksquare Significance: xTAx=∑λici2\mathbf x^{\mathsf T}A\mathbf x = \sum\lambda_ic_i^2 in the eigenbasis, which is the Rayleigh-quotient principle and the reason every quadratic-form extremum on the Putnam is "largest or smallest eigenvalue".

Going Deeper: Worked Problems

Example
Worked: an eigenvalue argument for a "show that"

Let AA be a real n×nn\times n matrix with A3=AA^3 = A. Show rank(A)=tr(A2)\mathrm{rank}(A) = \mathrm{tr}(A^2).

Step 1 — AA satisfies x3−x=x(x−1)(x+1)x^3 - x = x(x-1)(x+1), which has distinct roots, so AA is diagonalizable with eigenvalues in {−1,0,1}\{-1, 0, 1\}.

Step 2 — in the eigenbasis, A2A^2 is diagonal with entries λi2∈{0,1}\lambda_i^2 \in \{0, 1\}: it is 11 exactly for the nonzero eigenvalues.

Step 3 — so tr(A2)\mathrm{tr}(A^2) counts nonzero eigenvalues, which (diagonalizable!) equals the rank. ■\blacksquare The whole proof is: a polynomial with distinct roots forces diagonalizability, and then everything is a count.

Example
Worked: counting matrices over F2\mathbb F_2

How many 3×33\times3 matrices over F2\mathbb F_2 are invertible, and what fraction is that?

Step 1 — columns one at a time: the first is any nonzero vector (23−1=72^3 - 1 = 7), the second avoids the 22 vectors in the span of the first (8−2=68 - 2 = 6), the third avoids the 44 in the span of the first two (8−4=48 - 4 = 4).

Step 2 — 7⋅6⋅4=1687\cdot6\cdot4 = 168 (this group is GL3(F2)GL_3(\mathbb F_2), the second-smallest nonabelian simple group).

Step 3 — fraction: 168512≈0.33\tfrac{168}{512} \approx 0.33; as n→∞n \to \infty the fraction of invertible matrices over F2\mathbb F_2 tends to ∏k≥1(1−2−k)≈0.289\prod_{k\ge1}(1 - 2^{-k}) \approx 0.289. A random binary matrix is singular with probability about 0.710.71.

Example
Worked: a quadratic form on the circle (folklore)
Q = 6
The unit circle (dashed) between the level curves Q = 1 (shaded ellipse inside) and Q = 6 (outer ellipse): they touch it at ±(1, −2)/√5 and ±(2, 1)/√5, the eigenvectors.

Find the largest and smallest values of Q(x,y)=5x2+4xy+2y2Q(x, y) = 5x^2 + 4xy + 2y^2 on the unit circle x2+y2=1x^2 + y^2 = 1, and where they occur.

Step 1 — write Q=xTAxQ = \mathbf x^{\mathsf T}A\mathbf x with the symmetric A=(5222)A = \begin{pmatrix}5&2\\2&2\end{pmatrix} (the cross term is split evenly).

Step 2 — eigenvalues: trA=7\mathrm{tr}A = 7, det⁡A=6\det A = 6, so λ2−7λ+6=0\lambda^2 - 7\lambda + 6 = 0 and λ=6,1\lambda = 6, 1, with unit eigenvectors v1=15(2,1)\mathbf v_1 = \tfrac{1}{\sqrt5}(2, 1) and v2=15(1,−2)\mathbf v_2 = \tfrac{1}{\sqrt5}(1, -2), orthogonal as the spectral theorem promises.

Step 3 — write a unit vector as x=c1v1+c2v2\mathbf x = c_1\mathbf v_1 + c_2\mathbf v_2 with c12+c22=1c_1^2 + c_2^2 = 1. Then Q=6c12+c22=1+5c12Q = 6c_1^2 + c_2^2 = 1 + 5c_1^2, which ranges over [1,6][1, 6].

Step 4 — maximum 66 at ±15(2,1)\pm\tfrac{1}{\sqrt5}(2, 1), minimum 11 at ±15(1,−2)\pm\tfrac{1}{\sqrt5}(1, -2). Check: Q(2,1)=20+8+2=30=6⋅5Q(2, 1) = 20 + 8 + 2 = 30 = 6\cdot5 ✓.

How to find it. Any extremum of a quadratic form on a sphere is an eigenvalue problem (the Rayleigh quotient); Lagrange's condition ∇Q=λ∇(x2+y2)\nabla Q = \lambda\nabla(x^2 + y^2) is literally Ax=λxA\mathbf x = \lambda\mathbf x.