Theorem: PolyEquivTensor.toFunLinear_mul_tmul_mul
File: Mathlib/RingTheory/PolynomialAlgebra.lean

tactic: classical
  simp only [toFunLinear_tmul_apply, toFunBilinear_apply_eq_sum]
  ext k
  simp_rw [coeff_sum, coeff_monomial, sum_def, Finset.sum_ite_eq', mem_support_iff, Ne.def]
  conv_rhs => rw [coeff_mul]
  simp_rw [finset_sum_coeff, coeff_monomial, Finset.sum_ite_eq', mem_support_iff, Ne.def, mul_ite,
    MulZeroClass.mul_zero, ite_mul, MulZeroClass.zero_mul]
  simp_rw [ite_mul_zero_left (¬coeff p₁ _ = 0) (a₁ * (algebraMap R A) (coeff p₁ _))]
  simp_rw [ite_mul_zero_right (¬coeff p₂ _ = 0) _ (_ * _)]
  simp_rw [toFunLinear_mul_tmul_mul_aux_1, toFunLinear_mul_tmul_mul_aux_2]
state_before: R : Type u_1
A : Type u_2
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
a₁ a₂ : A
p₁ p₂ : R[X]
⊢ ↑(toFunLinear R A) ((a₁ * a₂) ⊗ₜ[R] (p₁ * p₂)) = ↑(toFunLinear R A) (a₁ ⊗ₜ[R] p₁) * ↑(toFunLinear R A) (a₂ ⊗ₜ[R] p₂)

tactic: simp only [toFunLinear_tmul_apply, toFunBilinear_apply_eq_sum]
state_before: R : Type u_1
A : Type u_2
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
a₁ a₂ : A
p₁ p₂ : R[X]
⊢ ↑(toFunLinear R A) ((a₁ * a₂) ⊗ₜ[R] (p₁ * p₂)) = ↑(toFunLinear R A) (a₁ ⊗ₜ[R] p₁) * ↑(toFunLinear R A) (a₂ ⊗ₜ[R] p₂)

tactic: ext k
state_before: R : Type u_1
A : Type u_2
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
a₁ a₂ : A
p₁ p₂ : R[X]
⊢ (sum (p₁ * p₂) fun n r => ↑(monomial n) (a₁ * a₂ * ↑(algebraMap R A) r)) =
    (sum p₁ fun n r => ↑(monomial n) (a₁ * ↑(algebraMap R A) r)) *
      sum p₂ fun n r => ↑(monomial n) (a₂ * ↑(algebraMap R A) r)

tactic: simp_rw [coeff_sum, coeff_monomial, sum_def, Finset.sum_ite_eq', mem_support_iff, Ne.def]
state_before: case a
R : Type u_1
A : Type u_2
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
a₁ a₂ : A
p₁ p₂ : R[X]
k : ℕ
⊢ coeff (sum (p₁ * p₂) fun n r => ↑(monomial n) (a₁ * a₂ * ↑(algebraMap R A) r)) k =
    coeff
      ((sum p₁ fun n r => ↑(monomial n) (a₁ * ↑(algebraMap R A) r)) *
        sum p₂ fun n r => ↑(monomial n) (a₂ * ↑(algebraMap R A) r))
      k

tactic: conv_rhs => rw [coeff_mul]
state_before: case a
R : Type u_1
A : Type u_2
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
a₁ a₂ : A
p₁ p₂ : R[X]
k : ℕ
⊢ (if ¬coeff (p₁ * p₂) k = 0 then a₁ * a₂ * ↑(algebraMap R A) (coeff (p₁ * p₂) k) else 0) =
    coeff
      ((Finset.sum (support p₁) fun n => ↑(monomial n) (a₁ * ↑(algebraMap R A) (coeff p₁ n))) *
        Finset.sum (support p₂) fun n => ↑(monomial n) (a₂ * ↑(algebraMap R A) (coeff p₂ n)))
      k

tactic: simp_rw [finset_sum_coeff, coeff_monomial, Finset.sum_ite_eq', mem_support_iff, Ne.def, mul_ite,
  MulZeroClass.mul_zero, ite_mul, MulZeroClass.zero_mul]
state_before: case a
R : Type u_1
A : Type u_2
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
a₁ a₂ : A
p₁ p₂ : R[X]
k : ℕ
⊢ (if ¬coeff (p₁ * p₂) k = 0 then a₁ * a₂ * ↑(algebraMap R A) (coeff (p₁ * p₂) k) else 0) =
    Finset.sum (Finset.Nat.antidiagonal k) fun x =>
      coeff (Finset.sum (support p₁) fun n => ↑(monomial n) (a₁ * ↑(algebraMap R A) (coeff p₁ n))) x.fst *
        coeff (Finset.sum (support p₂) fun n => ↑(monomial n) (a₂ * ↑(algebraMap R A) (coeff p₂ n))) x.snd

tactic: simp_rw [ite_mul_zero_left (¬coeff p₁ _ = 0) (a₁ * (algebraMap R A) (coeff p₁ _))]
state_before: case a
R : Type u_1
A : Type u_2
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
a₁ a₂ : A
p₁ p₂ : R[X]
k : ℕ
⊢ (if ¬coeff (p₁ * p₂) k = 0 then a₁ * a₂ * ↑(algebraMap R A) (coeff (p₁ * p₂) k) else 0) =
    Finset.sum (Finset.Nat.antidiagonal k) fun x =>
      if ¬coeff p₂ x.snd = 0 then
        if ¬coeff p₁ x.fst = 0 then a₁ * ↑(algebraMap R A) (coeff p₁ x.fst) * (a₂ * ↑(algebraMap R A) (coeff p₂ x.snd))
        else 0
      else 0

tactic: simp_rw [ite_mul_zero_right (¬coeff p₂ _ = 0) _ (_ * _)]
state_before: case a
R : Type u_1
A : Type u_2
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
a₁ a₂ : A
p₁ p₂ : R[X]
k : ℕ
⊢ (if ¬coeff (p₁ * p₂) k = 0 then a₁ * a₂ * ↑(algebraMap R A) (coeff (p₁ * p₂) k) else 0) =
    Finset.sum (Finset.Nat.antidiagonal k) fun x =>
      if ¬coeff p₂ x.snd = 0 then
        (if ¬coeff p₁ x.fst = 0 then a₁ * ↑(algebraMap R A) (coeff p₁ x.fst) else 0) *
          (a₂ * ↑(algebraMap R A) (coeff p₂ x.snd))
      else 0

tactic: simp_rw [toFunLinear_mul_tmul_mul_aux_1, toFunLinear_mul_tmul_mul_aux_2]
state_before: case a
R : Type u_1
A : Type u_2
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
a₁ a₂ : A
p₁ p₂ : R[X]
k : ℕ
⊢ (if ¬coeff (p₁ * p₂) k = 0 then a₁ * a₂ * ↑(algebraMap R A) (coeff (p₁ * p₂) k) else 0) =
    Finset.sum (Finset.Nat.antidiagonal k) fun x =>
      (if ¬coeff p₁ x.fst = 0 then a₁ * ↑(algebraMap R A) (coeff p₁ x.fst) else 0) *
        if ¬coeff p₂ x.snd = 0 then a₂ * ↑(algebraMap R A) (coeff p₂ x.snd) else 0