no goals
R : Type u_1
inst✝ : CommSemiring R
s : Multiset R
⊢ prod (map (fun r => X + ↑C r) s) = ∑ j in Finset.range (↑card s + 1), ↑C (esymm s j) * X ^ (↑card s - j)
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_powersetLen] at ht
  dsimp
  rw [prod_hom' s (Polynomial.C : R →+* R[X])]
  simp [ht, map_const, prod_replicate, prod_hom', map_id', card_sub]
R : Type u_1
inst✝ : CommSemiring R
s : Multiset R
⊢ ∀ (x : ℕ),
    x ∈ range (↑card s + 1) →
      sum
          (map ((fun p => prod (map (fun r => X) p.fst) * prod (map (fun r => ↑C r) p.snd)) ∘ fun t => (s - t, t))
            (powersetLen x s)) =
        ↑C (esymm s x) * X ^ (↑card s - x)
R : Type u_1
inst✝ : CommSemiring R
s : Multiset R
⊢ prod (map (fun r => X + ↑C r) s) = ∑ j in Finset.range (↑card s + 1), ↑C (esymm s j) * X ^ (↑card s - j)
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 _)]
R : Type u_1
inst✝ : CommSemiring R
s : Multiset R
x✝ : ℕ
a✝ : x✝ ∈ range (↑card s + 1)
⊢ sum
      (map ((fun p => prod (map (fun r => X) p.fst) * prod (map (fun r => ↑C r) p.snd)) ∘ fun t => (s - t, t))
        (powersetLen x✝ s)) =
    ↑C (esymm s x✝) * X ^ (↑card s - x✝)
R : Type u_1
inst✝ : CommSemiring R
s : Multiset R
⊢ ∀ (x : ℕ),
    x ∈ range (↑card s + 1) →
      sum
          (map ((fun p => prod (map (fun r => X) p.fst) * prod (map (fun r => ↑C r) p.snd)) ∘ fun t => (s - t, t))
            (powersetLen x s)) =
        ↑C (esymm s x) * X ^ (↑card s - x)
intro _ _
R : Type u_1
inst✝ : CommSemiring R
s : Multiset R
x✝ : ℕ
a✝ : x✝ ∈ range (↑card s + 1)
⊢ ∀ (x : Multiset R),
    x ∈ powersetLen x✝ s →
      ((fun p => prod (map (fun r => X) p.fst) * prod (map (fun r => ↑C r) p.snd)) ∘ fun t => (s - t, t)) x =
        ↑C (prod x) * X ^ (↑card s - x✝)
R : Type u_1
inst✝ : CommSemiring R
s : Multiset R
x✝ : ℕ
a✝ : x✝ ∈ range (↑card s + 1)
⊢ sum
      (map ((fun p => prod (map (fun r => X) p.fst) * prod (map (fun r => ↑C r) p.snd)) ∘ fun t => (s - t, t))
        (powersetLen x✝ s)) =
    ↑C (esymm s x✝) * X ^ (↑card s - x✝)
rw [esymm, ← sum_hom', ← sum_map_mul_right, map_congr (Eq.refl _)]
R : Type u_1
inst✝ : CommSemiring R
s✝ : Multiset R
x✝ : ℕ
a✝ : x✝ ∈ range (↑card s✝ + 1)
s : Multiset R
ht : s ∈ powersetLen x✝ s✝
⊢ ((fun p => prod (map (fun r => X) p.fst) * prod (map (fun r => ↑C r) p.snd)) ∘ fun t => (s✝ - t, t)) s =
    ↑C (prod s) * X ^ (↑card s✝ - x✝)
R : Type u_1
inst✝ : CommSemiring R
s : Multiset R
x✝ : ℕ
a✝ : x✝ ∈ range (↑card s + 1)
⊢ ∀ (x : Multiset R),
    x ∈ powersetLen x✝ s →
      ((fun p => prod (map (fun r => X) p.fst) * prod (map (fun r => ↑C r) p.snd)) ∘ fun t => (s - t, t)) x =
        ↑C (prod x) * X ^ (↑card s - x✝)
intro s ht
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 => prod (map (fun r => X) p.fst) * prod (map (fun r => ↑C r) p.snd)) ∘ fun t => (s✝ - t, t)) s =
    ↑C (prod s) * X ^ (↑card s✝ - x✝)
R : Type u_1
inst✝ : CommSemiring R
s✝ : Multiset R
x✝ : ℕ
a✝ : x✝ ∈ range (↑card s✝ + 1)
s : Multiset R
ht : s ∈ powersetLen x✝ s✝
⊢ ((fun p => prod (map (fun r => X) p.fst) * prod (map (fun r => ↑C r) p.snd)) ∘ fun t => (s✝ - t, t)) s =
    ↑C (prod s) * X ^ (↑card s✝ - x✝)
rw [mem_powersetLen] at ht
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✝
⊢ prod (map (fun r => X) (s✝ - s)) * prod (map (fun r => ↑C r) s) = ↑C (prod s) * X ^ (↑card s✝ - x✝)
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 => prod (map (fun r => X) p.fst) * prod (map (fun r => ↑C r) p.snd)) ∘ fun t => (s✝ - t, t)) s =
    ↑C (prod s) * X ^ (↑card s✝ - x✝)
dsimp
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✝
⊢ prod (map (fun r => X) (s✝ - s)) * ↑C (prod (map (fun r => r) s)) = ↑C (prod s) * X ^ (↑card s✝ - x✝)
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✝
⊢ prod (map (fun r => X) (s✝ - s)) * prod (map (fun r => ↑C r) s) = ↑C (prod s) * X ^ (↑card s✝ - x✝)
rw [prod_hom' s (Polynomial.C : R →+* R[X])]
no goals
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✝
⊢ prod (map (fun r => X) (s✝ - s)) * ↑C (prod (map (fun r => r) s)) = ↑C (prod s) * X ^ (↑card s✝ - x✝)
simp [ht, map_const, prod_replicate, prod_hom', map_id', card_sub]