Theorem: Polynomial.multiset_prod_X_sub_C_coeff_card_pred
File: Mathlib/Algebra/Polynomial/BigOperators.lean

tactic: nontriviality R
state_before: R : Type u
ι : Type w
s : Finset ι
inst✝ : CommRing R
t : Multiset R
ht : 0 < ↑Multiset.card t
⊢ coeff (prod (Multiset.map (fun x => X - ↑C x) t)) (↑Multiset.card t - 1) = -Multiset.sum t

tactic: convert multiset_prod_X_sub_C_nextCoeff (by assumption)
state_before: R : Type u
ι : Type w
s : Finset ι
inst✝ : CommRing R
t : Multiset R
ht : 0 < ↑Multiset.card t
✝ : Nontrivial R
⊢ coeff (prod (Multiset.map (fun x => X - ↑C x) t)) (↑Multiset.card t - 1) = -Multiset.sum t

tactic: rw [nextCoeff]
state_before: case h.e'_2
R : Type u
ι : Type w
s : Finset ι
inst✝ : CommRing R
t : Multiset R
ht : 0 < ↑Multiset.card t
✝ : Nontrivial R
⊢ coeff (prod (Multiset.map (fun x => X - ↑C x) t)) (↑Multiset.card t - 1) =
    nextCoeff (prod (Multiset.map (fun x => X - ↑C x) t))

tactic: split_ifs with h
state_before: case h.e'_2
R : Type u
ι : Type w
s : Finset ι
inst✝ : CommRing R
t : Multiset R
ht : 0 < ↑Multiset.card t
✝ : Nontrivial R
⊢ coeff (prod (Multiset.map (fun x => X - ↑C x) t)) (↑Multiset.card t - 1) =
    if natDegree (prod (Multiset.map (fun x => X - ↑C x) t)) = 0 then 0
    else coeff (prod (Multiset.map (fun x => X - ↑C x) t)) (natDegree (prod (Multiset.map (fun x => X - ↑C x) t)) - 1)

tactic: congr
state_before: case h.e'_2.inr
R : Type u
ι : Type w
s : Finset ι
inst✝ : CommRing R
t : Multiset R
ht : 0 < ↑Multiset.card t
✝ : Nontrivial R
h : ¬natDegree (prod (Multiset.map (fun x => X - ↑C x) t)) = 0
⊢ coeff (prod (Multiset.map (fun x => X - ↑C x) t)) (↑Multiset.card t - 1) =
    coeff (prod (Multiset.map (fun x => X - ↑C x) t)) (natDegree (prod (Multiset.map (fun x => X - ↑C x) t)) - 1)

tactic: assumption
state_before: R : Type u
ι : Type w
s : Finset ι
inst✝ : CommRing R
t : Multiset R
ht : 0 < ↑Multiset.card t
✝ : Nontrivial R
⊢ Multiset ?m.820577

tactic: rw [natDegree_multiset_prod_of_monic] at h <;> simp only [Multiset.mem_map] at *
state_before: case h.e'_2.inl
R : Type u
ι : Type w
s : Finset ι
inst✝ : CommRing R
t : Multiset R
ht : 0 < ↑Multiset.card t
✝ : Nontrivial R
h : natDegree (prod (Multiset.map (fun x => X - ↑C x) t)) = 0
⊢ coeff (prod (Multiset.map (fun x => X - ↑C x) t)) (↑Multiset.card t - 1) = 0

tactic: swap
state_before: case h.e'_2.inl
R : Type u
ι : Type w
s : Finset ι
inst✝ : CommRing R
t : Multiset R
ht : 0 < ↑Multiset.card t
✝ : Nontrivial R
h : Multiset.sum (Multiset.map (fun x => natDegree x) (Multiset.map (fun x => X - ↑C x) t)) = 0
⊢ coeff (prod (Multiset.map (fun x => X - ↑C x) t)) (↑Multiset.card t - 1) = 0

case h.e'_2.inl.h
R : Type u
ι : Type w
s : Finset ι
inst✝ : CommRing R
t : Multiset R
ht : 0 < ↑Multiset.card t
✝ : Nontrivial R
h : natDegree (prod (Multiset.map (fun x => X - ↑C x) t)) = 0
⊢ ∀ (f : R[X]), (∃ a, a ∈ t ∧ X - ↑C a = f) → Monic f

tactic: simp_rw [Multiset.sum_eq_zero_iff, Multiset.mem_map] at h
state_before: case h.e'_2.inl
R : Type u
ι : Type w
s : Finset ι
inst✝ : CommRing R
t : Multiset R
ht : 0 < ↑Multiset.card t
✝ : Nontrivial R
h : Multiset.sum (Multiset.map (fun x => natDegree x) (Multiset.map (fun x => X - ↑C x) t)) = 0
⊢ coeff (prod (Multiset.map (fun x => X - ↑C x) t)) (↑Multiset.card t - 1) = 0

tactic: contrapose! h
state_before: case h.e'_2.inl
R : Type u
ι : Type w
s : Finset ι
inst✝ : CommRing R
t : Multiset R
ht : 0 < ↑Multiset.card t
✝ : Nontrivial R
h : ∀ (x : ℕ), (∃ a, (∃ a_1, a_1 ∈ t ∧ X - ↑C a_1 = a) ∧ natDegree a = x) → x = 0
⊢ coeff (prod (Multiset.map (fun x => X - ↑C x) t)) (↑Multiset.card t - 1) = 0

tactic: obtain ⟨x, hx⟩ := card_pos_iff_exists_mem.mp ht
state_before: case h.e'_2.inl
R : Type u
ι : Type w
s : Finset ι
inst✝ : CommRing R
t : Multiset R
ht : 0 < ↑Multiset.card t
✝ : Nontrivial R
h : coeff (prod (Multiset.map (fun x => X - ↑C x) t)) (↑Multiset.card t - 1) ≠ 0
⊢ ∃ x, (∃ a, (∃ a_1, a_1 ∈ t ∧ X - ↑C a_1 = a) ∧ natDegree a = x) ∧ x ≠ 0

tactic: exact ⟨_, ⟨_, ⟨x, hx, rfl⟩, natDegree_X_sub_C _⟩, one_ne_zero⟩
state_before: case h.e'_2.inl.intro
R : Type u
ι : Type w
s : Finset ι
inst✝ : CommRing R
t : Multiset R
ht : 0 < ↑Multiset.card t
✝ : Nontrivial R
h : coeff (prod (Multiset.map (fun x => X - ↑C x) t)) (↑Multiset.card t - 1) ≠ 0
x : R
hx : x ∈ t
⊢ ∃ x, (∃ a, (∃ a_1, a_1 ∈ t ∧ X - ↑C a_1 = a) ∧ natDegree a = x) ∧ x ≠ 0

tactic: rintro _ ⟨_, _, rfl⟩
state_before: case h.e'_2.inl.h
R : Type u
ι : Type w
s : Finset ι
inst✝ : CommRing R
t : Multiset R
ht : 0 < ↑Multiset.card t
✝ : Nontrivial R
h : natDegree (prod (Multiset.map (fun x => X - ↑C x) t)) = 0
⊢ ∀ (f : R[X]), (∃ a, a ∈ t ∧ X - ↑C a = f) → Monic f

tactic: apply monic_X_sub_C
state_before: case h.e'_2.inl.h.intro.intro
R : Type u
ι : Type w
s : Finset ι
inst✝ : CommRing R
t : Multiset R
ht : 0 < ↑Multiset.card t
✝ : Nontrivial R
h : natDegree (prod (Multiset.map (fun x => X - ↑C x) t)) = 0
w✝ : R
left✝ : w✝ ∈ t
⊢ Monic (X - ↑C w✝)

tactic: simp [natDegree_X_sub_C, monic_X_sub_C]
state_before: case h.e'_2.inr.e_a.e_a.h
R : Type u
ι : Type w
s : Finset ι
inst✝ : CommRing R
t : Multiset R
ht : 0 < ↑Multiset.card t
✝ : Nontrivial R
h : ¬natDegree (prod (Multiset.map (fun x => X - ↑C x) t)) = 0
⊢ ∀ (f : R[X]), f ∈ Multiset.map (fun x => X - ↑C x) t → Monic f