# Documentation

Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff

# Characteristic polynomials #

We give methods for computing coefficients of the characteristic polynomial.

## Main definitions #

• Matrix.charpoly_degree_eq_dim proves that the degree of the characteristic polynomial over a nonzero ring is the dimension of the matrix
• Matrix.det_eq_sign_charpoly_coeff proves that the determinant is the constant term of the characteristic polynomial, up to sign.
• Matrix.trace_eq_neg_charpoly_coeff proves that the trace is the negative of the (d-1)th coefficient of the characteristic polynomial, where d is the dimension of the matrix. For a nonzero ring, this is the second-highest coefficient.
• Matrix.charpolyRev the reverse of the characteristic polynomial.
• Matrix.reverse_charpoly characterises the reverse of the characteristic polynomial.
theorem charmatrix_apply_natDegree {R : Type u} [] {n : Type v} [] [] {M : Matrix n n R} [] (i : n) (j : n) :
Polynomial.natDegree (charmatrix M i j) = if i = j then 1 else 0
theorem charmatrix_apply_natDegree_le {R : Type u} [] {n : Type v} [] [] {M : Matrix n n R} (i : n) (j : n) :
Polynomial.natDegree (charmatrix M i j) if i = j then 1 else 0
theorem Matrix.charpoly_sub_diagonal_degree_lt {R : Type u} [] {n : Type v} [] [] (M : Matrix n n R) :
Polynomial.degree ( - Finset.prod Finset.univ fun i => Polynomial.X - Polynomial.C (M i i)) < ↑()
theorem Matrix.charpoly_coeff_eq_prod_coeff_of_le {R : Type u} [] {n : Type v} [] [] (M : Matrix n n R) {k : } (h : k) :
= Polynomial.coeff (Finset.prod Finset.univ fun i => Polynomial.X - Polynomial.C (M i i)) k
theorem Matrix.det_of_card_zero {R : Type u} [] {n : Type v} [] [] (h : ) (M : Matrix n n R) :
= 1
theorem Matrix.charpoly_degree_eq_dim {R : Type u} [] {n : Type v} [] [] [] (M : Matrix n n R) :
@[simp]
theorem Matrix.charpoly_natDegree_eq_dim {R : Type u} [] {n : Type v} [] [] [] (M : Matrix n n R) :
theorem Matrix.charpoly_monic {R : Type u} [] {n : Type v} [] [] (M : Matrix n n R) :
theorem Matrix.trace_eq_neg_charpoly_coeff {R : Type u} [] {n : Type v} [] [] [] (M : Matrix n n R) :

See also Matrix.coeff_charpolyRev_eq_neg_trace.

theorem Matrix.matPolyEquiv_eval {R : Type u} [] {n : Type v} [] [] (M : Matrix n n ()) (r : R) (i : n) (j : n) :
Polynomial.eval ((fun x => Matrix n n R) r) Matrix.semiring (↑() r) (matPolyEquiv M) i j = Polynomial.eval r (M i j)
theorem Matrix.eval_det {R : Type u} [] {n : Type v} [] [] (M : Matrix n n ()) (r : R) :
= Matrix.det (Polynomial.eval (↑() r) (matPolyEquiv M))
theorem Matrix.det_eq_sign_charpoly_coeff {R : Type u} [] {n : Type v} [] [] (M : Matrix n n R) :
= (-1) ^ *
theorem matPolyEquiv_eq_x_pow_sub_c {n : Type v} [] [] {K : Type u_1} (k : ) [] (M : Matrix n n K) :
matPolyEquiv (↑() (charmatrix (M ^ k))) = Polynomial.X ^ k - Polynomial.C (M ^ k)
theorem Matrix.aeval_eq_aeval_mod_charpoly {R : Type u} [] {n : Type v} [] [] (M : Matrix n n R) (p : ) :
↑() p = ↑() ()

Any matrix polynomial p is equivalent under evaluation to p %ₘ M.charpoly; that is, p is equivalent to a polynomial with degree less than the dimension of the matrix.

theorem Matrix.pow_eq_aeval_mod_charpoly {R : Type u} [] {n : Type v} [] [] (M : Matrix n n R) (k : ) :
M ^ k = ↑() (Polynomial.X ^ k %ₘ )

Any matrix power can be computed as the sum of matrix powers less than Fintype.card n.

TODO: add the statement for negative powers phrased with zpow.

theorem coeff_charpoly_mem_ideal_pow {R : Type u} [] {n : Type v} [] [] {M : Matrix n n R} {I : } (h : ∀ (i j : n), M i j I) (k : ) :
I ^ ()
def Matrix.charpolyRev {R : Type u} [] {n : Type v} [] [] (M : Matrix n n R) :

The reverse of the characteristic polynomial of a matrix.

It has some advantages over the characteristic polynomial, including the fact that it can be extended to infinite dimensions (for appropriate operators). In such settings it is known as the "characteristic power series".

Instances For
theorem Matrix.reverse_charpoly {R : Type u} [] {n : Type v} [] [] (M : Matrix n n R) :
@[simp]
theorem Matrix.eval_charpolyRev {R : Type u} [] {n : Type v} [] [] {M : Matrix n n R} :
@[simp]
theorem Matrix.coeff_charpolyRev_eq_neg_trace {R : Type u} [] {n : Type v} [] [] (M : Matrix n n R) :
theorem Matrix.isUnit_charpolyRev_of_isNilpotent {R : Type u} [] {n : Type v} [] [] {M : Matrix n n R} (hM : ) :
theorem Matrix.isNilpotent_trace_of_isNilpotent {R : Type u} [] {n : Type v} [] [] {M : Matrix n n R} (hM : ) :
theorem Matrix.isNilpotent_charpoly_sub_pow_of_isNilpotent {R : Type u} [] {n : Type v} [] [] {M : Matrix n n R} (hM : ) :
IsNilpotent ( - Polynomial.X ^ )