# mathlib3documentation

linear_algebra.matrix.charpoly.basic

# Characteristic polynomials and the Cayley-Hamilton theorem #

THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.

We define characteristic polynomials of matrices and prove the Cayley–Hamilton theorem over arbitrary commutative rings.

See the file matrix/charpoly/coeff for corollaries of this theorem.

## Main definitions #

• matrix.charpoly is the characteristic polynomial of a matrix.

## Implementation details #

noncomputable def charmatrix {R : Type u} [comm_ring R] {n : Type w} [decidable_eq n] [fintype n] (M : n R) :
n (polynomial R)

The "characteristic matrix" of M : matrix n n R is the matrix of polynomials $t I - M$. The determinant of this matrix is the characteristic polynomial.

Equations
theorem charmatrix_apply {R : Type u} [comm_ring R] {n : Type w} [decidable_eq n] [fintype n] (M : n R) (i j : n) :
i j = polynomial.X * 1 i j - polynomial.C (M i j)
@[simp]
theorem charmatrix_apply_eq {R : Type u} [comm_ring R] {n : Type w} [decidable_eq n] [fintype n] (M : n R) (i : n) :
@[simp]
theorem charmatrix_apply_ne {R : Type u} [comm_ring R] {n : Type w} [decidable_eq n] [fintype n] (M : n R) (i j : n) (h : i j) :
i j = -polynomial.C (M i j)
theorem mat_poly_equiv_charmatrix {R : Type u} [comm_ring R] {n : Type w} [decidable_eq n] [fintype n] (M : n R) :
theorem charmatrix_reindex {R : Type u} [comm_ring R] {n : Type w} [decidable_eq n] [fintype n] {m : Type v} [decidable_eq m] [fintype m] (e : n m) (M : n R) :
charmatrix ( e) M) = e) (charmatrix M)
noncomputable def matrix.charpoly {R : Type u} [comm_ring R] {n : Type w} [decidable_eq n] [fintype n] (M : n R) :

The characteristic polynomial of a matrix M is given by $\det (t I - M)$.

Equations
theorem matrix.charpoly_reindex {R : Type u} [comm_ring R] {n : Type w} [decidable_eq n] [fintype n] {m : Type v} [decidable_eq m] [fintype m] (e : n m) (M : n R) :
theorem matrix.aeval_self_charpoly {R : Type u} [comm_ring R] {n : Type w} [decidable_eq n] [fintype n] (M : n R) :
= 0

The Cayley-Hamilton Theorem, that the characteristic polynomial of a matrix, applied to the matrix itself, is zero.

This holds over any commutative ring.

See linear_map.aeval_self_charpoly for the equivalent statement about endomorphisms.