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

tactic: nontriviality R
state_before: R : Type u
ι : Type w
s : Finset ι
inst✝ : CommSemiring R
f : ι → R[X]
t : Multiset R[X]
h : ∀ (f : R[X]), f ∈ t → Monic f
⊢ natDegree (prod t) = Multiset.sum (Multiset.map natDegree t)

tactic: apply natDegree_multiset_prod'
state_before: R : Type u
ι : Type w
s : Finset ι
inst✝ : CommSemiring R
f : ι → R[X]
t : Multiset R[X]
h : ∀ (f : R[X]), f ∈ t → Monic f
✝ : Nontrivial R
⊢ natDegree (prod t) = Multiset.sum (Multiset.map natDegree t)

tactic: suffices (t.map fun f => leadingCoeff f).prod = 1 by
  rw [this]
  simp
state_before: case h
R : Type u
ι : Type w
s : Finset ι
inst✝ : CommSemiring R
f : ι → R[X]
t : Multiset R[X]
h : ∀ (f : R[X]), f ∈ t → Monic f
✝ : Nontrivial R
⊢ prod (Multiset.map (fun f => leadingCoeff f) t) ≠ 0

tactic: convert prod_replicate (Multiset.card t) (1 : R)
state_before: case h
R : Type u
ι : Type w
s : Finset ι
inst✝ : CommSemiring R
f : ι → R[X]
t : Multiset R[X]
h : ∀ (f : R[X]), f ∈ t → Monic f
✝ : Nontrivial R
⊢ prod (Multiset.map (fun f => leadingCoeff f) t) = 1

tactic: rw [this]
state_before: R : Type u
ι : Type w
s : Finset ι
inst✝ : CommSemiring R
f : ι → R[X]
t : Multiset R[X]
h : ∀ (f : R[X]), f ∈ t → Monic f
✝ : Nontrivial R
this : prod (Multiset.map (fun f => leadingCoeff f) t) = 1
⊢ prod (Multiset.map (fun f => leadingCoeff f) t) ≠ 0

tactic: simp
state_before: R : Type u
ι : Type w
s : Finset ι
inst✝ : CommSemiring R
f : ι → R[X]
t : Multiset R[X]
h : ∀ (f : R[X]), f ∈ t → Monic f
✝ : Nontrivial R
this : prod (Multiset.map (fun f => leadingCoeff f) t) = 1
⊢ 1 ≠ 0

tactic: simp only [eq_replicate, Multiset.card_map, eq_self_iff_true, true_and_iff]
state_before: case h.e'_2.h.e'_3
R : Type u
ι : Type w
s : Finset ι
inst✝ : CommSemiring R
f : ι → R[X]
t : Multiset R[X]
h : ∀ (f : R[X]), f ∈ t → Monic f
✝ : Nontrivial R
⊢ Multiset.map (fun f => leadingCoeff f) t = replicate (↑Multiset.card t) 1

tactic: rintro i hi
state_before: case h.e'_2.h.e'_3
R : Type u
ι : Type w
s : Finset ι
inst✝ : CommSemiring R
f : ι → R[X]
t : Multiset R[X]
h : ∀ (f : R[X]), f ∈ t → Monic f
✝ : Nontrivial R
⊢ ∀ (b : R), b ∈ Multiset.map (fun f => leadingCoeff f) t → b = 1

tactic: obtain ⟨i, hi, rfl⟩ := Multiset.mem_map.mp hi
state_before: case h.e'_2.h.e'_3
R : Type u
ι : Type w
s : Finset ι
inst✝ : CommSemiring R
f : ι → R[X]
t : Multiset R[X]
h : ∀ (f : R[X]), f ∈ t → Monic f
✝ : Nontrivial R
i : R
hi : i ∈ Multiset.map (fun f => leadingCoeff f) t
⊢ i = 1

tactic: apply h
state_before: case h.e'_2.h.e'_3.intro.intro
R : Type u
ι : Type w
s : Finset ι
inst✝ : CommSemiring R
f : ι → R[X]
t : Multiset R[X]
h : ∀ (f : R[X]), f ∈ t → Monic f
✝ : Nontrivial R
i : R[X]
hi✝ : i ∈ t
hi : leadingCoeff i ∈ Multiset.map (fun f => leadingCoeff f) t
⊢ leadingCoeff i = 1

tactic: assumption
state_before: case h.e'_2.h.e'_3.intro.intro.a
R : Type u
ι : Type w
s : Finset ι
inst✝ : CommSemiring R
f : ι → R[X]
t : Multiset R[X]
h : ∀ (f : R[X]), f ∈ t → Monic f
✝ : Nontrivial R
i : R[X]
hi✝ : i ∈ t
hi : leadingCoeff i ∈ Multiset.map (fun f => leadingCoeff f) t
⊢ i ∈ t

tactic: simp
state_before: case h.e'_3
R : Type u
ι : Type w
s : Finset ι
inst✝ : CommSemiring R
f : ι → R[X]
t : Multiset R[X]
h : ∀ (f : R[X]), f ∈ t → Monic f
✝ : Nontrivial R
⊢ 1 = 1 ^ ↑Multiset.card t