File: Mathlib/LinearAlgebra/Matrix/Charpoly/Basic.lean

full_name: Matrix.charmatrix
code: /-- 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.
-/
def charmatrix (M : Matrix n n R) : Matrix n n R[X] 
goal: Matrix n n (Polynomial R)

full_name: Matrix.charmatrix_apply
code: theorem charmatrix_apply :
    charmatrix M i j = (Matrix.diagonal fun _ : n => X) i j - C (M i j) 
goal: M.charmatrix i j = Matrix.diagonal (fun x => Polynomial.X) i j - Polynomial.C (M i j)

full_name: Matrix.charmatrix_apply_eq
code: @[simp]
theorem charmatrix_apply_eq : charmatrix M i i = (X : R[X]) - C (M i i) 
goal: M.charmatrix i i = Polynomial.X - Polynomial.C (M i i)

full_name: Matrix.charmatrix_apply_ne
code: @[simp]
theorem charmatrix_apply_ne (h : i ≠ j) : charmatrix M i j = -C (M i j) 
goal: M.charmatrix i j = -Polynomial.C (M i j)

full_name: Matrix.matPolyEquiv_charmatrix
code: theorem matPolyEquiv_charmatrix : matPolyEquiv (charmatrix M) = X - C M 
goal: matPolyEquiv M.charmatrix = Polynomial.X - Polynomial.C M

full_name: Matrix.charmatrix_reindex
code: theorem charmatrix_reindex (e : n ≃ m) :
    charmatrix (reindex e e M) = reindex e e (charmatrix M) 
goal: ((Matrix.reindex e e) M).charmatrix = (Matrix.reindex e e) M.charmatrix

full_name: Matrix.charmatrix_map
code: lemma charmatrix_map (M : Matrix n n R) (f : R →+* S) :
    charmatrix (M.map f) = (charmatrix M).map (Polynomial.map f) 
goal: (M.map ⇑f).charmatrix = M.charmatrix.map (Polynomial.map f)

full_name: Matrix.charmatrix_fromBlocks
code: lemma charmatrix_fromBlocks :
    charmatrix (fromBlocks M₁₁ M₁₂ M₂₁ M₂₂) =
      fromBlocks (charmatrix M₁₁) (- M₁₂.map C) (- M₂₁.map C) (charmatrix M₂₂) 
goal: (Matrix.fromBlocks M₁₁ M₁₂ M₂₁ M₂₂).charmatrix =
  Matrix.fromBlocks M₁₁.charmatrix (-M₁₂.map ⇑Polynomial.C) (-M₂₁.map ⇑Polynomial.C) M₂₂.charmatrix

full_name: Matrix.charpoly
code: /-- The characteristic polynomial of a matrix `M` is given by $\det (t I - M)$.
-/
def charpoly (M : Matrix n n R) : R[X] 
goal: Polynomial R

full_name: Matrix.charpoly_reindex
code: theorem charpoly_reindex (e : n ≃ m)
    (M : Matrix n n R) : (reindex e e M).charpoly = M.charpoly 
goal: ((Matrix.reindex e e) M).charpoly = M.charpoly

full_name: Matrix.charpoly_map
code: lemma charpoly_map (M : Matrix n n R) (f : R →+* S) :
    (M.map f).charpoly = M.charpoly.map f 
goal: (M.map ⇑f).charpoly = Polynomial.map f M.charpoly

full_name: Matrix.charpoly_fromBlocks_zero₁₂
code: @[simp]
lemma charpoly_fromBlocks_zero₁₂ :
    (fromBlocks M₁₁ 0 M₂₁ M₂₂).charpoly = (M₁₁.charpoly * M₂₂.charpoly) 
goal: (Matrix.fromBlocks M₁₁ 0 M₂₁ M₂₂).charpoly = M₁₁.charpoly * M₂₂.charpoly

full_name: Matrix.charpoly_fromBlocks_zero₂₁
code: @[simp]
lemma charpoly_fromBlocks_zero₂₁ :
    (fromBlocks M₁₁ M₁₂ 0 M₂₂).charpoly = (M₁₁.charpoly * M₂₂.charpoly) 
goal: (Matrix.fromBlocks M₁₁ M₁₂ 0 M₂₂).charpoly = M₁₁.charpoly * M₂₂.charpoly

full_name: Matrix.aeval_self_charpoly
code: /-- 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 `LinearMap.aeval_self_charpoly` for the equivalent statement about endomorphisms.
-/
theorem aeval_self_charpoly (M : Matrix n n R) : aeval M M.charpoly = 0 
goal: (Polynomial.aeval M) M.charpoly = 0