Theorem: Matrix.matPolyEquiv_eval
File: Mathlib/LinearAlgebra/Matrix/Charpoly/Coeff.lean

tactic: unfold Polynomial.eval
state_before: R : Type u
inst✝³ : CommRing R
n G : Type v
inst✝² : DecidableEq n
inst✝¹ : Fintype n
α β : Type v
inst✝ : DecidableEq α
M✝ : Matrix n n R
M : Matrix n n R[X]
r : R
i j : n
⊢ eval (↑(scalar n) r) (↑matPolyEquiv M) i j = eval r (M i j)

tactic: rw [Polynomial.eval₂_def, Polynomial.eval₂_def]
state_before: R : Type u
inst✝³ : CommRing R
n G : Type v
inst✝² : DecidableEq n
inst✝¹ : Fintype n
α β : Type v
inst✝ : DecidableEq α
M✝ : Matrix n n R
M : Matrix n n R[X]
r : R
i j : n
⊢ eval₂ (RingHom.id ((fun x => Matrix n n R) r)) (↑(scalar n) r) (↑matPolyEquiv M) i j = eval₂ (RingHom.id R) r (M i j)

tactic: trans Polynomial.sum (matPolyEquiv M) fun (e : ℕ) (a : Matrix n n R) => (a * (scalar n) r ^ e) i j
state_before: R : Type u
inst✝³ : CommRing R
n G : Type v
inst✝² : DecidableEq n
inst✝¹ : Fintype n
α β : Type v
inst✝ : DecidableEq α
M✝ : Matrix n n R
M : Matrix n n R[X]
r : R
i j : n
⊢ sum (↑matPolyEquiv M) (fun e a => ↑(RingHom.id ((fun x => Matrix n n R) r)) a * ↑(scalar n) r ^ e) i j =
    sum (M i j) fun e a => ↑(RingHom.id R) a * r ^ e

tactic: unfold Polynomial.sum
state_before: R : Type u
inst✝³ : CommRing R
n G : Type v
inst✝² : DecidableEq n
inst✝¹ : Fintype n
α β : Type v
inst✝ : DecidableEq α
M✝ : Matrix n n R
M : Matrix n n R[X]
r : R
i j : n
⊢ sum (↑matPolyEquiv M) (fun e a => ↑(RingHom.id ((fun x => Matrix n n R) r)) a * ↑(scalar n) r ^ e) i j =
    sum (↑matPolyEquiv M) fun e a => (a * ↑(scalar n) r ^ e) i j

tactic: simp only [sum_apply]
state_before: R : Type u
inst✝³ : CommRing R
n G : Type v
inst✝² : DecidableEq n
inst✝¹ : Fintype n
α β : Type v
inst✝ : DecidableEq α
M✝ : Matrix n n R
M : Matrix n n R[X]
r : R
i j : n
⊢ Finset.sum (support (↑matPolyEquiv M))
      (fun n_1 =>
        (fun e a => ↑(RingHom.id ((fun x => Matrix n n R) r)) a * ↑(scalar n) r ^ e) n_1 (coeff (↑matPolyEquiv M) n_1))
      i j =
    ∑ n_1 in support (↑matPolyEquiv M), (fun e a => (a * ↑(scalar n) r ^ e) i j) n_1 (coeff (↑matPolyEquiv M) n_1)

tactic: dsimp
state_before: R : Type u
inst✝³ : CommRing R
n G : Type v
inst✝² : DecidableEq n
inst✝¹ : Fintype n
α β : Type v
inst✝ : DecidableEq α
M✝ : Matrix n n R
M : Matrix n n R[X]
r : R
i j : n
⊢ ∑ c in support (↑matPolyEquiv M), (↑(RingHom.id (Matrix n n R)) (coeff (↑matPolyEquiv M) c) * ↑(scalar n) r ^ c) i j =
    ∑ x in support (↑matPolyEquiv M), (coeff (↑matPolyEquiv M) x * ↑(scalar n) r ^ x) i j

tactic: simp_rw [← RingHom.map_pow, ← (scalar.commute _ _).eq]
state_before: R : Type u
inst✝³ : CommRing R
n G : Type v
inst✝² : DecidableEq n
inst✝¹ : Fintype n
α β : Type v
inst✝ : DecidableEq α
M✝ : Matrix n n R
M : Matrix n n R[X]
r : R
i j : n
⊢ (sum (↑matPolyEquiv M) fun e a => (a * ↑(scalar n) r ^ e) i j) = sum (M i j) fun e a => ↑(RingHom.id R) a * r ^ e

tactic: simp only [coe_scalar, Matrix.one_mul, RingHom.id_apply, Pi.smul_apply, smul_eq_mul, mul_eq_mul,
  Algebra.smul_mul_assoc]
state_before: R : Type u
inst✝³ : CommRing R
n G : Type v
inst✝² : DecidableEq n
inst✝¹ : Fintype n
α β : Type v
inst✝ : DecidableEq α
M✝ : Matrix n n R
M : Matrix n n R[X]
r : R
i j : n
⊢ (sum (↑matPolyEquiv M) fun e a => (↑(scalar n) (r ^ e) * a) i j) = sum (M i j) fun e a => ↑(RingHom.id R) a * r ^ e

tactic: simp only [Polynomial.sum, matPolyEquiv_coeff_apply, mul_comm]
state_before: R : Type u
inst✝³ : CommRing R
n G : Type v
inst✝² : DecidableEq n
inst✝¹ : Fintype n
α β : Type v
inst✝ : DecidableEq α
M✝ : Matrix n n R
M : Matrix n n R[X]
r : R
i j : n
⊢ (sum (↑matPolyEquiv M) fun e a => (r ^ e • a) i j) = sum (M i j) fun e a => a * r ^ e

tactic: simp only [smul_apply, matPolyEquiv_coeff_apply, smul_eq_mul]
state_before: R : Type u
inst✝³ : CommRing R
n G : Type v
inst✝² : DecidableEq n
inst✝¹ : Fintype n
α β : Type v
inst✝ : DecidableEq α
M✝ : Matrix n n R
M : Matrix n n R[X]
r : R
i j : n
⊢ ∑ x in support (↑matPolyEquiv M), (r ^ x • coeff (↑matPolyEquiv M) x) i j =
    ∑ x in support (M i j), r ^ x * coeff (M i j) x

tactic: apply (Finset.sum_subset (support_subset_support_matPolyEquiv _ _ _) _).symm
state_before: R : Type u
inst✝³ : CommRing R
n G : Type v
inst✝² : DecidableEq n
inst✝¹ : Fintype n
α β : Type v
inst✝ : DecidableEq α
M✝ : Matrix n n R
M : Matrix n n R[X]
r : R
i j : n
⊢ ∑ x in support (↑matPolyEquiv M), r ^ x * coeff (M i j) x = ∑ x in support (M i j), r ^ x * coeff (M i j) x

tactic: intro n _hn h'n
state_before: R : Type u
inst✝³ : CommRing R
n G : Type v
inst✝² : DecidableEq n
inst✝¹ : Fintype n
α β : Type v
inst✝ : DecidableEq α
M✝ : Matrix n n R
M : Matrix n n R[X]
r : R
i j : n
⊢ ∀ (x : ℕ), x ∈ support (↑matPolyEquiv M) → ¬x ∈ support (M i j) → r ^ x * coeff (M i j) x = 0

tactic: rw [not_mem_support_iff] at h'n
state_before: R : Type u
inst✝³ : CommRing R
n✝ G : Type v
inst✝² : DecidableEq n✝
inst✝¹ : Fintype n✝
α β : Type v
inst✝ : DecidableEq α
M✝ : Matrix n✝ n✝ R
M : Matrix n✝ n✝ R[X]
r : R
i j : n✝
n : ℕ
_hn : n ∈ support (↑matPolyEquiv M)
h'n : ¬n ∈ support (M i j)
⊢ r ^ n * coeff (M i j) n = 0

tactic: simp only [h'n, MulZeroClass.zero_mul]
state_before: R : Type u
inst✝³ : CommRing R
n✝ G : Type v
inst✝² : DecidableEq n✝
inst✝¹ : Fintype n✝
α β : Type v
inst✝ : DecidableEq α
M✝ : Matrix n✝ n✝ R
M : Matrix n✝ n✝ R[X]
r : R
i j : n✝
n : ℕ
_hn : n ∈ support (↑matPolyEquiv M)
h'n : coeff (M i j) n = 0
⊢ r ^ n * coeff (M i j) n = 0

tactic: simp only [mul_zero]
state_before: R : Type u
inst✝³ : CommRing R
n✝ G : Type v
inst✝² : DecidableEq n✝
inst✝¹ : Fintype n✝
α β : Type v
inst✝ : DecidableEq α
M✝ : Matrix n✝ n✝ R
M : Matrix n✝ n✝ R[X]
r : R
i j : n✝
n : ℕ
_hn : n ∈ support (↑matPolyEquiv M)
h'n : coeff (M i j) n = 0
⊢ r ^ n * 0 = 0