Theorem: Multiset.prod_X_add_C_eq_sum_esymm
File: Mathlib/RingTheory/Polynomial/Vieta.lean

tactic: classical
  rw [prod_map_add, antidiagonal_eq_map_powerset, map_map, ← bind_powerset_len,
    map_bind, sum_bind, Finset.sum_eq_multiset_sum, Finset.range_val, map_congr (Eq.refl _)]
  intro _ _
  rw [esymm, ← sum_hom', ← sum_map_mul_right, map_congr (Eq.refl _)]
  intro s ht
  rw [mem_powersetCard] at ht
  dsimp
  rw [prod_hom' s (Polynomial.C : R →+* R[X])]
  simp [ht, map_const, prod_replicate, prod_hom', map_id', card_sub]
state_before: R : Type u_1
inst✝ : CommSemiring R
s : Multiset R
⊢ (map (fun r => X + C r) s).prod = ∑ j ∈ Finset.range (card s + 1), C (s.esymm j) * X ^ (card s - j)
state_after: no goals

tactic: rw [prod_map_add, antidiagonal_eq_map_powerset, map_map, ← bind_powerset_len,
  map_bind, sum_bind, Finset.sum_eq_multiset_sum, Finset.range_val, map_congr (Eq.refl _)]
state_before: R : Type u_1
inst✝ : CommSemiring R
s : Multiset R
⊢ (map (fun r => X + C r) s).prod = ∑ j ∈ Finset.range (card s + 1), C (s.esymm j) * X ^ (card s - j)
state_after: R : Type u_1
inst✝ : CommSemiring R
s : Multiset R
⊢ ∀ x ∈ range (card s + 1),
    (map ((fun p => (map (fun r => X) p.1).prod * (map (⇑C) p.2).prod) ∘ fun t => (s - t, t)) (powersetCard x s)).sum =
      C (s.esymm x) * X ^ (card s - x)

tactic: intro _ _
state_before: R : Type u_1
inst✝ : CommSemiring R
s : Multiset R
⊢ ∀ x ∈ range (card s + 1),
    (map ((fun p => (map (fun r => X) p.1).prod * (map (⇑C) p.2).prod) ∘ fun t => (s - t, t)) (powersetCard x s)).sum =
      C (s.esymm x) * X ^ (card s - x)
state_after: R : Type u_1
inst✝ : CommSemiring R
s : Multiset R
x✝ : ℕ
a✝ : x✝ ∈ range (card s + 1)
⊢ (map ((fun p => (map (fun r => X) p.1).prod * (map (⇑C) p.2).prod) ∘ fun t => (s - t, t)) (powersetCard x✝ s)).sum =
    C (s.esymm x✝) * X ^ (card s - x✝)

tactic: rw [esymm, ← sum_hom', ← sum_map_mul_right, map_congr (Eq.refl _)]
state_before: R : Type u_1
inst✝ : CommSemiring R
s : Multiset R
x✝ : ℕ
a✝ : x✝ ∈ range (card s + 1)
⊢ (map ((fun p => (map (fun r => X) p.1).prod * (map (⇑C) p.2).prod) ∘ fun t => (s - t, t)) (powersetCard x✝ s)).sum =
    C (s.esymm x✝) * X ^ (card s - x✝)
state_after: R : Type u_1
inst✝ : CommSemiring R
s : Multiset R
x✝ : ℕ
a✝ : x✝ ∈ range (card s + 1)
⊢ ∀ x ∈ powersetCard x✝ s,
    ((fun p => (map (fun r => X) p.1).prod * (map (⇑C) p.2).prod) ∘ fun t => (s - t, t)) x =
      C x.prod * X ^ (card s - x✝)

tactic: intro s ht
state_before: R : Type u_1
inst✝ : CommSemiring R
s : Multiset R
x✝ : ℕ
a✝ : x✝ ∈ range (card s + 1)
⊢ ∀ x ∈ powersetCard x✝ s,
    ((fun p => (map (fun r => X) p.1).prod * (map (⇑C) p.2).prod) ∘ fun t => (s - t, t)) x =
      C x.prod * X ^ (card s - x✝)
state_after: R : Type u_1
inst✝ : CommSemiring R
s✝ : Multiset R
x✝ : ℕ
a✝ : x✝ ∈ range (card s✝ + 1)
s : Multiset R
ht : s ∈ powersetCard x✝ s✝
⊢ ((fun p => (map (fun r => X) p.1).prod * (map (⇑C) p.2).prod) ∘ fun t => (s✝ - t, t)) s =
    C s.prod * X ^ (card s✝ - x✝)

tactic: rw [mem_powersetCard] at ht
state_before: R : Type u_1
inst✝ : CommSemiring R
s✝ : Multiset R
x✝ : ℕ
a✝ : x✝ ∈ range (card s✝ + 1)
s : Multiset R
ht : s ∈ powersetCard x✝ s✝
⊢ ((fun p => (map (fun r => X) p.1).prod * (map (⇑C) p.2).prod) ∘ fun t => (s✝ - t, t)) s =
    C s.prod * X ^ (card s✝ - x✝)
state_after: R : Type u_1
inst✝ : CommSemiring R
s✝ : Multiset R
x✝ : ℕ
a✝ : x✝ ∈ range (card s✝ + 1)
s : Multiset R
ht : s ≤ s✝ ∧ card s = x✝
⊢ ((fun p => (map (fun r => X) p.1).prod * (map (⇑C) p.2).prod) ∘ fun t => (s✝ - t, t)) s =
    C s.prod * X ^ (card s✝ - x✝)

tactic: dsimp
state_before: R : Type u_1
inst✝ : CommSemiring R
s✝ : Multiset R
x✝ : ℕ
a✝ : x✝ ∈ range (card s✝ + 1)
s : Multiset R
ht : s ≤ s✝ ∧ card s = x✝
⊢ ((fun p => (map (fun r => X) p.1).prod * (map (⇑C) p.2).prod) ∘ fun t => (s✝ - t, t)) s =
    C s.prod * X ^ (card s✝ - x✝)
state_after: R : Type u_1
inst✝ : CommSemiring R
s✝ : Multiset R
x✝ : ℕ
a✝ : x✝ ∈ range (card s✝ + 1)
s : Multiset R
ht : s ≤ s✝ ∧ card s = x✝
⊢ (map (fun r => X) (s✝ - s)).prod * (map (⇑C) s).prod = C s.prod * X ^ (card s✝ - x✝)

tactic: rw [prod_hom' s (Polynomial.C : R →+* R[X])]
state_before: R : Type u_1
inst✝ : CommSemiring R
s✝ : Multiset R
x✝ : ℕ
a✝ : x✝ ∈ range (card s✝ + 1)
s : Multiset R
ht : s ≤ s✝ ∧ card s = x✝
⊢ (map (fun r => X) (s✝ - s)).prod * (map (⇑C) s).prod = C s.prod * X ^ (card s✝ - x✝)
state_after: R : Type u_1
inst✝ : CommSemiring R
s✝ : Multiset R
x✝ : ℕ
a✝ : x✝ ∈ range (card s✝ + 1)
s : Multiset R
ht : s ≤ s✝ ∧ card s = x✝
⊢ (map (fun r => X) (s✝ - s)).prod * C (map (fun i => i) s).prod = C s.prod * X ^ (card s✝ - x✝)

tactic: simp [ht, map_const, prod_replicate, prod_hom', map_id', card_sub]
state_before: R : Type u_1
inst✝ : CommSemiring R
s✝ : Multiset R
x✝ : ℕ
a✝ : x✝ ∈ range (card s✝ + 1)
s : Multiset R
ht : s ≤ s✝ ∧ card s = x✝
⊢ (map (fun r => X) (s✝ - s)).prod * C (map (fun i => i) s).prod = C s.prod * X ^ (card s✝ - x✝)
state_after: no goals