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 Matrix.charmatrix_apply_natDegree {R : Type u} [] {n : Type v} [] [] {M : Matrix n n R} [] (i : n) (j : n) :
(M.charmatrix i j).natDegree = if i = j then 1 else 0
theorem Matrix.charmatrix_apply_natDegree_le {R : Type u} [] {n : Type v} [] [] {M : Matrix n n R} (i : n) (j : n) :
(M.charmatrix i j).natDegree 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) :
(M.charpoly - i : n, (Polynomial.X - Polynomial.C (M i i))).degree < ()
theorem Matrix.charpoly_coeff_eq_prod_coeff_of_le {R : Type u} [] {n : Type v} [] [] (M : Matrix n n R) {k : } (h : k) :
M.charpoly.coeff k = (i : n, (Polynomial.X - Polynomial.C (M i i))).coeff k
theorem Matrix.det_of_card_zero {R : Type u} [] {n : Type v} [] [] (h : ) (M : Matrix n n R) :
M.det = 1
theorem Matrix.charpoly_degree_eq_dim {R : Type u} [] {n : Type v} [] [] [] (M : Matrix n n R) :
M.charpoly.degree = ()
@[simp]
theorem Matrix.charpoly_natDegree_eq_dim {R : Type u} [] {n : Type v} [] [] [] (M : Matrix n n R) :
M.charpoly.natDegree =
theorem Matrix.charpoly_monic {R : Type u} [] {n : Type v} [] [] (M : Matrix n n R) :
M.charpoly.Monic
theorem Matrix.trace_eq_neg_charpoly_coeff {R : Type u} [] {n : Type v} [] [] [] (M : Matrix n n R) :
M.trace = -M.charpoly.coeff ()

See also Matrix.coeff_charpolyRev_eq_neg_trace.

theorem Matrix.matPolyEquiv_symm_map_eval {R : Type u} [] {n : Type v} [] [] (M : Polynomial (Matrix n n R)) (r : R) :
(matPolyEquiv.symm M).map () = Polynomial.eval (() r) M
theorem Matrix.matPolyEquiv_eval_eq_map {R : Type u} [] {n : Type v} [] [] (M : Matrix n n ()) (r : R) :
Polynomial.eval (() r) (matPolyEquiv M) = M.map ()
theorem Matrix.matPolyEquiv_eval {R : Type u} [] {n : Type v} [] [] (M : Matrix n n ()) (r : R) (i : n) (j : n) :
Polynomial.eval (() 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) :
Polynomial.eval r M.det = (Polynomial.eval (() r) (matPolyEquiv M)).det
theorem Matrix.det_eq_sign_charpoly_coeff {R : Type u} [] {n : Type v} [] [] (M : Matrix n n R) :
M.det = (-1) ^ * M.charpoly.coeff 0
theorem Matrix.eval_det_add_X_smul {R : Type u} [] {n : Type v} [] [] (A : Matrix n n ()) (M : Matrix n n R) :
Polynomial.eval 0 (A + Polynomial.X M.map Polynomial.C).det = Polynomial.eval 0 A.det
theorem Matrix.derivative_det_one_add_X_smul_aux {R : Type u} [] {n : } (M : Matrix (Fin n) (Fin n) R) :
Polynomial.eval 0 (Polynomial.derivative (1 + Polynomial.X M.map Polynomial.C).det) = M.trace
theorem Matrix.derivative_det_one_add_X_smul {R : Type u} [] {n : Type v} [] [] (M : Matrix n n R) :
Polynomial.eval 0 (Polynomial.derivative (1 + Polynomial.X M.map Polynomial.C).det) = M.trace

The derivative of det (1 + M X) at 0 is the trace of M.

theorem Matrix.coeff_det_one_add_X_smul_one {R : Type u} [] {n : Type v} [] [] (M : Matrix n n R) :
(1 + Polynomial.X M.map Polynomial.C).det.coeff 1 = M.trace
theorem Matrix.det_one_add_X_smul {R : Type u} [] {n : Type v} [] [] (M : Matrix n n R) :
(1 + Polynomial.X M.map Polynomial.C).det = 1 + M.trace Polynomial.X + (1 + Polynomial.X M.map Polynomial.C).det.divX.divX * Polynomial.X ^ 2
theorem Matrix.det_one_add_smul {R : Type u} [] {n : Type v} [] [] (r : R) (M : Matrix n n R) :
(1 + r M).det = 1 + M.trace * r + Polynomial.eval r (1 + Polynomial.X M.map Polynomial.C).det.divX.divX * r ^ 2

The first two terms of the taylor expansion of det (1 + r • M) at r = 0.

theorem matPolyEquiv_eq_X_pow_sub_C {n : Type v} [] [] {K : Type u_1} (k : ) [] (M : Matrix n n K) :
matPolyEquiv ((()).mapMatrix (M ^ k).charmatrix) = 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 = () (p %ₘ M.charpoly)

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 %ₘ M.charpoly)

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 Matrix.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 : ) :
M.charpoly.coeff 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".

Equations
• M.charpolyRev = (1 - Polynomial.X M.map Polynomial.C).det
Instances For
theorem Matrix.reverse_charpoly {R : Type u} [] {n : Type v} [] [] (M : Matrix n n R) :
M.charpoly.reverse = M.charpolyRev
@[simp]
theorem Matrix.eval_charpolyRev {R : Type u} [] {n : Type v} [] [] {M : Matrix n n R} :
Polynomial.eval 0 M.charpolyRev = 1
@[simp]
theorem Matrix.coeff_charpolyRev_eq_neg_trace {R : Type u} [] {n : Type v} [] [] (M : Matrix n n R) :
M.charpolyRev.coeff 1 = -M.trace
theorem Matrix.isUnit_charpolyRev_of_isNilpotent {R : Type u} [] {n : Type v} [] [] {M : Matrix n n R} (hM : ) :
IsUnit M.charpolyRev
theorem Matrix.isNilpotent_trace_of_isNilpotent {R : Type u} [] {n : Type v} [] [] {M : Matrix n n R} (hM : ) :
IsNilpotent M.trace
theorem Matrix.isNilpotent_charpoly_sub_pow_of_isNilpotent {R : Type u} [] {n : Type v} [] [] {M : Matrix n n R} (hM : ) :
IsNilpotent (M.charpoly - Polynomial.X ^ )