Diagonalizability Criterion

lean4-prooflinear-algebravisualization
A diagonalizable    μA squarefreeA \text{ diagonalizable} \iff \mu_A \text{ squarefree}

Statement

Let KK be a field and AA a square matrix over KK (or equivalently, a linear endomorphism of a finite-dimensional KK-vector space). Then:

A is diagonalizable over K    μA splits into distinct linear factors over K.A \text{ is diagonalizable over } K \iff \mu_A \text{ splits into distinct linear factors over } K.

In particular:

  • If AA has nn distinct eigenvalues (over KK), then AA is diagonalizable.
  • AA is diagonalizable iff μA\mu_A is squarefree (no repeated irreducible factor), i.e.\ gcd(μA,μA)=1\gcd(\mu_A, \mu_A') = 1.
  • Over an algebraically closed field, diagonalizable \Leftrightarrow μA=(xλ1)(xλk)\mu_A = (x - \lambda_1)\cdots(x - \lambda_k) for distinct λi\lambda_i.

Visualization

Three canonical 2×22 \times 2 examples:

Diagonalizable (distinct eigenvalues):
A = ( 1  1 )    eigenvalues 1, 2 (distinct)
    ( 0  2 )    mu_A = (x-1)(x-2)  -- squarefree
                P = ( 1  1 )  P^{-1} A P = diag(1, 2)
                    ( 0  1 )

Not diagonalizable (repeated, non-trivial Jordan block):
B = ( 1  1 )    eigenvalue 1 (double)
    ( 0  1 )    mu_B = (x-1)^2  -- NOT squarefree
                (B - I)^1 ≠ 0, so min poly has degree 2

Diagonalizable (repeated but semisimple):
C = ( 1  0 )    eigenvalue 1 (double)
    ( 0  1 )    mu_C = x - 1  -- squarefree!
                C = I, already diagonal
MatrixEigenvaluesMin polySquarefree?Diagonalizable?
A=(1102)A = \begin{pmatrix}1&1\\0&2\end{pmatrix}1,21, 2(x1)(x2)(x-1)(x-2)YesYes
B=(1101)B = \begin{pmatrix}1&1\\0&1\end{pmatrix}1,11, 1(x1)2(x-1)^2NoNo
C=I2C = I_21,11, 1x1x - 1YesYes

Proof Sketch

  1. Squarefree implies diagonalizable. If μA=p1pk\mu_A = p_1 \cdots p_k with distinct monic irreducibles, the Chinese Remainder Theorem for K[x]K[x]-modules gives V=kerp1(A)kerpk(A)V = \ker p_1(A) \oplus \cdots \oplus \ker p_k(A). Over an algebraically closed field, each pi=xλip_i = x - \lambda_i and each kernel is an eigenspace.
  2. Diagonalizable implies squarefree. If A=Pdiag(λ1,,λn)P1A = P \, \text{diag}(\lambda_1, \ldots, \lambda_n) P^{-1}, then (AλiI)eigenspace of λi=0(A - \lambda_i I)|_{\text{eigenspace of }\lambda_i} = 0, so μA\mu_A vanishes at each λi\lambda_i with multiplicity 11 — hence μA=distinct(xλi)\mu_A = \prod_{\text{distinct}} (x - \lambda_i), which is squarefree.
  3. Distinct eigenvalues are sufficient. nn distinct eigenvalues \Rightarrow nn linearly independent eigenvectors (by the linear independence of eigenvectors for distinct eigenvalues) \Rightarrow AA is diagonalizable.
  4. Semisimple endomorphism perspective. An endomorphism ff is semisimple iff μf\mu_f is squarefree; this is Module.End.IsSemisimple in Mathlib.

Connections

  • Minimal PolynomialMinimal PolynomialμAp    p(A)=0\mu_A \mid p \iff p(A) = 0The minimal polynomial of a matrix is the monic polynomial of least degree that annihilates it.Read more → — the squarefree condition on μA\mu_A is precisely the distinction between the diagonal and non-diagonal Jordan forms
  • Jordan Canonical FormJordan Canonical FormA=PJP1,J=iJni(λi)A = P J P^{-1},\quad J = \bigoplus_i J_{n_i}(\lambda_i)Every square matrix over an algebraically closed field is similar to a direct sum of Jordan blocks.Read more → — the Jordan form is fully diagonal iff every Jordan block has size 11, which happens iff μA\mu_A is squarefree
  • 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 → — for Hermitian matrices over C\mathbb{C}, all eigenvalues are real and the spectral theorem provides an orthonormal eigenbasis, giving diagonalizability unconditionally

Lean4 Proof

import Mathlib.LinearAlgebra.Semisimple
import Mathlib.LinearAlgebra.Eigenspace.Basic

/-- Eigenvectors corresponding to distinct eigenvalues are linearly independent.
    This is the key sufficiency lemma: n distinct eigenvalues give n independent
    eigenvectors and hence diagonalizability.
    Mathlib's direct alias is `Module.End.eigenvectors_linearIndependent`. -/
theorem distinct_eigenvalues_independent
    {K : Type*} [Field K]
    {V : Type*} [AddCommGroup V] [Module K V]
    (f : Module.End K V)
    (μs : Set K) (xs : μs  V)
    (h_eigenvec :  μ : μs, f.HasEigenvector μ (xs μ)) :
    LinearIndependent K xs :=
  Module.End.eigenvectors_linearIndependent f μs xs h_eigenvec