Cayley–Hamilton Theorem

lean4-prooflinear-algebravisualization
pA(A)=0  where  pA(λ)=det(λIA)p_A(A) = 0 \;\text{where}\; p_A(\lambda) = \det(\lambda I - A)

Statement

Let AA be an n×nn \times n matrix over a commutative ring RR, and let pA(λ)=det(λIA)p_A(\lambda) = \det(\lambda I - A) be its characteristic polynomial. Then:

pA(A)=0p_A(A) = 0

That is, substituting AA itself for the scalar variable λ\lambda in the characteristic polynomial yields the zero matrix.

Visualization

Take the concrete 2×22 \times 2 matrix:

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

Step 1 — Compute the characteristic polynomial.

pA(λ)=det(λIA)=det(λ312λ4)p_A(\lambda) = \det(\lambda I - A) = \det\begin{pmatrix} \lambda - 3 & -1 \\ -2 & \lambda - 4 \end{pmatrix}
=(λ3)(λ4)(1)(2)=λ27λ+10= (\lambda - 3)(\lambda - 4) - (-1)(-2) = \lambda^2 - 7\lambda + 10

Step 2 — Compute A2A^2.

A2=(3124)(3124)=(1171418)A^2 = \begin{pmatrix} 3 & 1 \\ 2 & 4 \end{pmatrix}\begin{pmatrix} 3 & 1 \\ 2 & 4 \end{pmatrix} = \begin{pmatrix} 11 & 7 \\ 14 & 18 \end{pmatrix}

Step 3 — Evaluate pA(A)=A27A+10Ip_A(A) = A^2 - 7A + 10I.

A27A+10I=(1171418)7(3124)+10(1001)A^2 - 7A + 10I = \begin{pmatrix} 11 & 7 \\ 14 & 18 \end{pmatrix} - 7\begin{pmatrix} 3 & 1 \\ 2 & 4 \end{pmatrix} + 10\begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}
=(1121+1077+01414+01828+10)=(0000)= \begin{pmatrix} 11 - 21 + 10 & 7 - 7 + 0 \\ 14 - 14 + 0 & 18 - 28 + 10 \end{pmatrix} = \begin{pmatrix} 0 & 0 \\ 0 & 0 \end{pmatrix}

Verified: pA(A)=0p_A(A) = 0.

Proof Sketch

The naive approach — "substitute AA for λ\lambda in det(λIA)\det(\lambda I - A)" — is circular: the determinant expands as a scalar polynomial, not a matrix polynomial. The correct proof works over the adjugate matrix adj(λIA)\text{adj}(\lambda I - A), whose entries are polynomials in λ\lambda. One shows (λIA)adj(λIA)=pA(λ)I(\lambda I - A)\,\text{adj}(\lambda I - A) = p_A(\lambda)\,I as a polynomial matrix identity, then compares coefficients of λk\lambda^k on both sides to assemble the relation pA(A)=0p_A(A) = 0.

An alternative proof observes that the result holds over any field (by finding a splitting field where AA is upper-triangular) and then descends to general commutative rings by a universality argument.

Connections

  • Spectral TheoremSpectral TheoremA=QΛQT  (real symmetric case)A = Q \Lambda Q^T \;\text{(real symmetric case)}Every real symmetric matrix is orthogonally diagonalizableRead more → — eigenvalues are roots of pAp_A; Cayley–Hamilton shows AA itself is a "root."
  • Determinant MultiplicativityDeterminant Multiplicativitydet(AB)=det(A)det(B)\det(AB) = \det(A)\,\det(B)The determinant of a product equals the product of determinantsRead more → — the characteristic polynomial is built from the determinant.
  • Rank–Nullity TheoremRank–Nullity Theoremrank(f)+nullity(f)=dimV\operatorname{rank}(f) + \operatorname{nullity}(f) = \dim VThe dimensions of image and kernel of a linear map sum to the domain dimensionRead more → — the minimal polynomial divides pAp_A; its degree relates to the kernel.
  • Fundamental Theorem of Galois TheoryFundamental Theorem of Galois Theory{intermediate fields}{subgroups of Gal(K/F)}\{\text{intermediate fields}\} \longleftrightarrow \{\text{subgroups of } \text{Gal}(K/F)\}Bijection between intermediate fields and subgroups of the Galois groupRead more → — Galois extensions are controlled by characteristic polynomials of Frobenius elements.
  • Quadratic FormulaQuadratic Formulax=b±b24ac2ax = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}Solve any quadratic equation using the discriminantRead more → — in dimension 2, pAp_A is quadratic; Cayley–Hamilton is the matrix analogue of a root equation.

Lean4 Proof

/-- The Cayley–Hamilton theorem: every square matrix satisfies its own
    characteristic polynomial. The Mathlib proof works over any commutative
    ring via the adjugate identity. -/
theorem cayley_hamilton {n : Type*} {R : Type*}
    [Fintype n] [DecidableEq n] [CommRing R]
    (A : Matrix n n R) : Polynomial.aeval A A.charpoly = 0 :=
  Matrix.aeval_self_charpoly A