l3lab/ntp-mathlib huggingface dataset:
theorem tendsto_abv_atTop {R k α : Type*} [Ring R] [LinearOrderedField k] (abv : R → k)
    [IsAbsoluteValue abv] (p : R[X]) (h : 0 < degree p) {l : Filter α} {z : α → R}
    (hz : Tendsto (abv ∘ z) l atTop) : Tendsto (fun x => abv (p.eval (z x))) l atTop := by
  apply tendsto_abv_eval₂_atTop _ _ _ h _ hz
  

Proof state:
R : Type u_1
k : Type u_2
α : Type u_3
inst✝² : Ring R
inst✝¹ : LinearOrderedField k
abv : R → k
inst✝ : IsAbsoluteValue abv
p : R[X]
h : 0 < degree p
l : Filter α
z : α → R
hz : Tendsto (abv ∘ z) l atTop
⊢ (RingHom.id R) (leadingCoeff p) ≠ 0

Next tactic:
exact (mt leadingCoeff_eq_zero.1 (ne_zero_of_degree_gt h))
theorem exists_forall_norm_le [ProperSpace R] (p : R[X]) : ∃ x, ∀ y, ‖p.eval x‖ ≤ ‖p.eval y‖ :=
  if hp0 : 0 < degree p then
    p.continuous.norm.exists_forall_le <| p.tendsto_norm_atTop hp0 tendsto_norm_cocompact_atTop
  else
    ⟨p.coeff 0, by 

Proof state:
α : Type u_1
R : Type u_2
inst✝² : NormedRing R
inst✝¹ : IsAbsoluteValue norm
inst✝ : ProperSpace R
p : R[X]
hp0 : ¬0 < degree p
⊢ ∀ (y : R), ‖eval (coeff p 0) p‖ ≤ ‖eval y p‖

Next tactic:
rw [eq_C_of_degree_le_zero (le_of_not_gt hp0)]
theorem exists_forall_norm_le [ProperSpace R] (p : R[X]) : ∃ x, ∀ y, ‖p.eval x‖ ≤ ‖p.eval y‖ :=
  if hp0 : 0 < degree p then
    p.continuous.norm.exists_forall_le <| p.tendsto_norm_atTop hp0 tendsto_norm_cocompact_atTop
  else
    ⟨p.coeff 0, by rw [eq_C_of_degree_le_zero (le_of_not_gt hp0)]; 

Proof state:
α : Type u_1
R : Type u_2
inst✝² : NormedRing R
inst✝¹ : IsAbsoluteValue norm
inst✝ : ProperSpace R
p : R[X]
hp0 : ¬0 < degree p
⊢ ∀ (y : R), ‖eval (coeff (C (coeff p 0)) 0) (C (coeff p 0))‖ ≤ ‖eval y (C (coeff p 0))‖

Next tactic:
simp
theorem eq_one_of_roots_le {p : F[X]} {f : F →+* K} {B : ℝ} (hB : B < 0) (h1 : p.Monic)
    (h2 : Splits f p) (h3 : ∀ z ∈ (map f p).roots, ‖z‖ ≤ B) : p = 1 :=
  h1.natDegree_eq_zero_iff_eq_one.mp (by
    

Proof state:
α : Type u_1
R : Type u_2
inst✝³ : NormedRing R
inst✝² : IsAbsoluteValue norm
F : Type u_3
K : Type u_4
inst✝¹ : CommRing F
inst✝ : NormedField K
p : F[X]
f : F →+* K
B : ℝ
hB : B < 0
h1 : Monic p
h2 : Splits f p
h3 : ∀ z ∈ roots (map f p), ‖z‖ ≤ B
⊢ natDegree p = 0

Next tactic:
contrapose! hB
theorem eq_one_of_roots_le {p : F[X]} {f : F →+* K} {B : ℝ} (hB : B < 0) (h1 : p.Monic)
    (h2 : Splits f p) (h3 : ∀ z ∈ (map f p).roots, ‖z‖ ≤ B) : p = 1 :=
  h1.natDegree_eq_zero_iff_eq_one.mp (by
    contrapose! hB
    

Proof state:
α : Type u_1
R : Type u_2
inst✝³ : NormedRing R
inst✝² : IsAbsoluteValue norm
F : Type u_3
K : Type u_4
inst✝¹ : CommRing F
inst✝ : NormedField K
p : F[X]
f : F →+* K
B : ℝ
h1 : Monic p
h2 : Splits f p
h3 : ∀ z ∈ roots (map f p), ‖z‖ ≤ B
hB : natDegree p ≠ 0
⊢ 0 ≤ B

Next tactic:
rw [← h1.natDegree_map f, natDegree_eq_card_roots' h2] at hB
theorem eq_one_of_roots_le {p : F[X]} {f : F →+* K} {B : ℝ} (hB : B < 0) (h1 : p.Monic)
    (h2 : Splits f p) (h3 : ∀ z ∈ (map f p).roots, ‖z‖ ≤ B) : p = 1 :=
  h1.natDegree_eq_zero_iff_eq_one.mp (by
    contrapose! hB
    rw [← h1.natDegree_map f, natDegree_eq_card_roots' h2] at hB
    

Proof state:
α : Type u_1
R : Type u_2
inst✝³ : NormedRing R
inst✝² : IsAbsoluteValue norm
F : Type u_3
K : Type u_4
inst✝¹ : CommRing F
inst✝ : NormedField K
p : F[X]
f : F →+* K
B : ℝ
h1 : Monic p
h2 : Splits f p
h3 : ∀ z ∈ roots (map f p), ‖z‖ ≤ B
hB : card (roots (map f p)) ≠ 0
⊢ 0 ≤ B

Next tactic:
obtain ⟨z, hz⟩ := card_pos_iff_exists_mem.mp (zero_lt_iff.mpr hB)
theorem eq_one_of_roots_le {p : F[X]} {f : F →+* K} {B : ℝ} (hB : B < 0) (h1 : p.Monic)
    (h2 : Splits f p) (h3 : ∀ z ∈ (map f p).roots, ‖z‖ ≤ B) : p = 1 :=
  h1.natDegree_eq_zero_iff_eq_one.mp (by
    contrapose! hB
    rw [← h1.natDegree_map f, natDegree_eq_card_roots' h2] at hB
    obtain ⟨z, hz⟩ := card_pos_iff_exists_mem.mp (zero_lt_iff.mpr hB)
    

Proof state:
case intro
α : Type u_1
R : Type u_2
inst✝³ : NormedRing R
inst✝² : IsAbsoluteValue norm
F : Type u_3
K : Type u_4
inst✝¹ : CommRing F
inst✝ : NormedField K
p : F[X]
f : F →+* K
B : ℝ
h1 : Monic p
h2 : Splits f p
h3 : ∀ z ∈ roots (map f p), ‖z‖ ≤ B
hB : card (roots (map f p)) ≠ 0
z : K
hz : z ∈ roots (map f p)
⊢ 0 ≤ B

Next tactic:
exact le_trans (norm_nonneg _) (h3 z hz)
theorem coeff_le_of_roots_le {p : F[X]} {f : F →+* K} {B : ℝ} (i : ℕ) (h1 : p.Monic)
    (h2 : Splits f p) (h3 : ∀ z ∈ (map f p).roots, ‖z‖ ≤ B) :
    ‖(map f p).coeff i‖ ≤ B ^ (p.natDegree - i) * p.natDegree.choose i := by
  

Proof state:
α : Type u_1
R : Type u_2
inst✝³ : NormedRing R
inst✝² : IsAbsoluteValue norm
F : Type u_3
K : Type u_4
inst✝¹ : CommRing F
inst✝ : NormedField K
p : F[X]
f : F →+* K
B : ℝ
i : ℕ
h1 : Monic p
h2 : Splits f p
h3 : ∀ z ∈ roots (map f p), ‖z‖ ≤ B
⊢ ‖coeff (map f p) i‖ ≤ B ^ (natDegree p - i) * ↑(Nat.choose (natDegree p) i)

Next tactic:
obtain hB | hB := lt_or_le B 0
theorem coeff_le_of_roots_le {p : F[X]} {f : F →+* K} {B : ℝ} (i : ℕ) (h1 : p.Monic)
    (h2 : Splits f p) (h3 : ∀ z ∈ (map f p).roots, ‖z‖ ≤ B) :
    ‖(map f p).coeff i‖ ≤ B ^ (p.natDegree - i) * p.natDegree.choose i := by
  obtain hB | hB := lt_or_le B 0
  · 

Proof state:
case inl
α : Type u_1
R : Type u_2
inst✝³ : NormedRing R
inst✝² : IsAbsoluteValue norm
F : Type u_3
K : Type u_4
inst✝¹ : CommRing F
inst✝ : NormedField K
p : F[X]
f : F →+* K
B : ℝ
i : ℕ
h1 : Monic p
h2 : Splits f p
h3 : ∀ z ∈ roots (map f p), ‖z‖ ≤ B
hB : B < 0
⊢ ‖coeff (map f p) i‖ ≤ B ^ (natDegree p - i) * ↑(Nat.choose (natDegree p) i)

Next tactic:
rw [eq_one_of_roots_le hB h1 h2 h3, Polynomial.map_one, natDegree_one, zero_tsub, pow_zero,
      one_mul, coeff_one]
theorem coeff_le_of_roots_le {p : F[X]} {f : F →+* K} {B : ℝ} (i : ℕ) (h1 : p.Monic)
    (h2 : Splits f p) (h3 : ∀ z ∈ (map f p).roots, ‖z‖ ≤ B) :
    ‖(map f p).coeff i‖ ≤ B ^ (p.natDegree - i) * p.natDegree.choose i := by
  obtain hB | hB := lt_or_le B 0
  · rw [eq_one_of_roots_le hB h1 h2 h3, Polynomial.map_one, natDegree_one, zero_tsub, pow_zero,
      one_mul, coeff_one]
    

Proof state:
case inl
α : Type u_1
R : Type u_2
inst✝³ : NormedRing R
inst✝² : IsAbsoluteValue norm
F : Type u_3
K : Type u_4
inst✝¹ : CommRing F
inst✝ : NormedField K
p : F[X]
f : F →+* K
B : ℝ
i : ℕ
h1 : Monic p
h2 : Splits f p
h3 : ∀ z ∈ roots (map f p), ‖z‖ ≤ B
hB : B < 0
⊢ ‖if i = 0 then 1 else 0‖ ≤ ↑(Nat.choose 0 i)

Next tactic:
split_ifs with h
theorem coeff_le_of_roots_le {p : F[X]} {f : F →+* K} {B : ℝ} (i : ℕ) (h1 : p.Monic)
    (h2 : Splits f p) (h3 : ∀ z ∈ (map f p).roots, ‖z‖ ≤ B) :
    ‖(map f p).coeff i‖ ≤ B ^ (p.natDegree - i) * p.natDegree.choose i := by
  obtain hB | hB := lt_or_le B 0
  · rw [eq_one_of_roots_le hB h1 h2 h3, Polynomial.map_one, natDegree_one, zero_tsub, pow_zero,
      one_mul, coeff_one]
    split_ifs with h <;> 

Proof state:
case pos
α : Type u_1
R : Type u_2
inst✝³ : NormedRing R
inst✝² : IsAbsoluteValue norm
F : Type u_3
K : Type u_4
inst✝¹ : CommRing F
inst✝ : NormedField K
p : F[X]
f : F →+* K
B : ℝ
i : ℕ
h1 : Monic p
h2 : Splits f p
h3 : ∀ z ∈ roots (map f p), ‖z‖ ≤ B
hB : B < 0
h : i = 0
⊢ ‖1‖ ≤ ↑(Nat.choose 0 i)

Next tactic:
simp [h]
theorem coeff_le_of_roots_le {p : F[X]} {f : F →+* K} {B : ℝ} (i : ℕ) (h1 : p.Monic)
    (h2 : Splits f p) (h3 : ∀ z ∈ (map f p).roots, ‖z‖ ≤ B) :
    ‖(map f p).coeff i‖ ≤ B ^ (p.natDegree - i) * p.natDegree.choose i := by
  obtain hB | hB := lt_or_le B 0
  · rw [eq_one_of_roots_le hB h1 h2 h3, Polynomial.map_one, natDegree_one, zero_tsub, pow_zero,
      one_mul, coeff_one]
    split_ifs with h <;> 

Proof state:
case neg
α : Type u_1
R : Type u_2
inst✝³ : NormedRing R
inst✝² : IsAbsoluteValue norm
F : Type u_3
K : Type u_4
inst✝¹ : CommRing F
inst✝ : NormedField K
p : F[X]
f : F →+* K
B : ℝ
i : ℕ
h1 : Monic p
h2 : Splits f p
h3 : ∀ z ∈ roots (map f p), ‖z‖ ≤ B
hB : B < 0
h : ¬i = 0
⊢ ‖0‖ ≤ ↑(Nat.choose 0 i)

Next tactic:
simp [h]
theorem coeff_le_of_roots_le {p : F[X]} {f : F →+* K} {B : ℝ} (i : ℕ) (h1 : p.Monic)
    (h2 : Splits f p) (h3 : ∀ z ∈ (map f p).roots, ‖z‖ ≤ B) :
    ‖(map f p).coeff i‖ ≤ B ^ (p.natDegree - i) * p.natDegree.choose i := by
  obtain hB | hB := lt_or_le B 0
  · rw [eq_one_of_roots_le hB h1 h2 h3, Polynomial.map_one, natDegree_one, zero_tsub, pow_zero,
      one_mul, coeff_one]
    split_ifs with h <;> simp [h]
  

Proof state:
case inr
α : Type u_1
R : Type u_2
inst✝³ : NormedRing R
inst✝² : IsAbsoluteValue norm
F : Type u_3
K : Type u_4
inst✝¹ : CommRing F
inst✝ : NormedField K
p : F[X]
f : F →+* K
B : ℝ
i : ℕ
h1 : Monic p
h2 : Splits f p
h3 : ∀ z ∈ roots (map f p), ‖z‖ ≤ B
hB : 0 ≤ B
⊢ ‖coeff (map f p) i‖ ≤ B ^ (natDegree p - i) * ↑(Nat.choose (natDegree p) i)

Next tactic:
rw [← h1.natDegree_map f]
theorem coeff_le_of_roots_le {p : F[X]} {f : F →+* K} {B : ℝ} (i : ℕ) (h1 : p.Monic)
    (h2 : Splits f p) (h3 : ∀ z ∈ (map f p).roots, ‖z‖ ≤ B) :
    ‖(map f p).coeff i‖ ≤ B ^ (p.natDegree - i) * p.natDegree.choose i := by
  obtain hB | hB := lt_or_le B 0
  · rw [eq_one_of_roots_le hB h1 h2 h3, Polynomial.map_one, natDegree_one, zero_tsub, pow_zero,
      one_mul, coeff_one]
    split_ifs with h <;> simp [h]
  rw [← h1.natDegree_map f]
  

Proof state:
case inr
α : Type u_1
R : Type u_2
inst✝³ : NormedRing R
inst✝² : IsAbsoluteValue norm
F : Type u_3
K : Type u_4
inst✝¹ : CommRing F
inst✝ : NormedField K
p : F[X]
f : F →+* K
B : ℝ
i : ℕ
h1 : Monic p
h2 : Splits f p
h3 : ∀ z ∈ roots (map f p), ‖z‖ ≤ B
hB : 0 ≤ B
⊢ ‖coeff (map f p) i‖ ≤ B ^ (natDegree (map f p) - i) * ↑(Nat.choose (natDegree (map f p)) i)

Next tactic:
obtain hi | hi := lt_or_le (map f p).natDegree i
theorem coeff_le_of_roots_le {p : F[X]} {f : F →+* K} {B : ℝ} (i : ℕ) (h1 : p.Monic)
    (h2 : Splits f p) (h3 : ∀ z ∈ (map f p).roots, ‖z‖ ≤ B) :
    ‖(map f p).coeff i‖ ≤ B ^ (p.natDegree - i) * p.natDegree.choose i := by
  obtain hB | hB := lt_or_le B 0
  · rw [eq_one_of_roots_le hB h1 h2 h3, Polynomial.map_one, natDegree_one, zero_tsub, pow_zero,
      one_mul, coeff_one]
    split_ifs with h <;> simp [h]
  rw [← h1.natDegree_map f]
  obtain hi | hi := lt_or_le (map f p).natDegree i
  · 

Proof state:
case inr.inl
α : Type u_1
R : Type u_2
inst✝³ : NormedRing R
inst✝² : IsAbsoluteValue norm
F : Type u_3
K : Type u_4
inst✝¹ : CommRing F
inst✝ : NormedField K
p : F[X]
f : F →+* K
B : ℝ
i : ℕ
h1 : Monic p
h2 : Splits f p
h3 : ∀ z ∈ roots (map f p), ‖z‖ ≤ B
hB : 0 ≤ B
hi : natDegree (map f p) < i
⊢ ‖coeff (map f p) i‖ ≤ B ^ (natDegree (map f p) - i) * ↑(Nat.choose (natDegree (map f p)) i)

Next tactic:
rw [coeff_eq_zero_of_natDegree_lt hi, norm_zero]
theorem coeff_le_of_roots_le {p : F[X]} {f : F →+* K} {B : ℝ} (i : ℕ) (h1 : p.Monic)
    (h2 : Splits f p) (h3 : ∀ z ∈ (map f p).roots, ‖z‖ ≤ B) :
    ‖(map f p).coeff i‖ ≤ B ^ (p.natDegree - i) * p.natDegree.choose i := by
  obtain hB | hB := lt_or_le B 0
  · rw [eq_one_of_roots_le hB h1 h2 h3, Polynomial.map_one, natDegree_one, zero_tsub, pow_zero,
      one_mul, coeff_one]
    split_ifs with h <;> simp [h]
  rw [← h1.natDegree_map f]
  obtain hi | hi := lt_or_le (map f p).natDegree i
  · rw [coeff_eq_zero_of_natDegree_lt hi, norm_zero]
    

Proof state:
case inr.inl
α : Type u_1
R : Type u_2
inst✝³ : NormedRing R
inst✝² : IsAbsoluteValue norm
F : Type u_3
K : Type u_4
inst✝¹ : CommRing F
inst✝ : NormedField K
p : F[X]
f : F →+* K
B : ℝ
i : ℕ
h1 : Monic p
h2 : Splits f p
h3 : ∀ z ∈ roots (map f p), ‖z‖ ≤ B
hB : 0 ≤ B
hi : natDegree (map f p) < i
⊢ 0 ≤ B ^ (natDegree (map f p) - i) * ↑(Nat.choose (natDegree (map f p)) i)

Next tactic:
positivity
theorem coeff_le_of_roots_le {p : F[X]} {f : F →+* K} {B : ℝ} (i : ℕ) (h1 : p.Monic)
    (h2 : Splits f p) (h3 : ∀ z ∈ (map f p).roots, ‖z‖ ≤ B) :
    ‖(map f p).coeff i‖ ≤ B ^ (p.natDegree - i) * p.natDegree.choose i := by
  obtain hB | hB := lt_or_le B 0
  · rw [eq_one_of_roots_le hB h1 h2 h3, Polynomial.map_one, natDegree_one, zero_tsub, pow_zero,
      one_mul, coeff_one]
    split_ifs with h <;> simp [h]
  rw [← h1.natDegree_map f]
  obtain hi | hi := lt_or_le (map f p).natDegree i
  · rw [coeff_eq_zero_of_natDegree_lt hi, norm_zero]
    positivity
  

Proof state:
case inr.inr
α : Type u_1
R : Type u_2
inst✝³ : NormedRing R
inst✝² : IsAbsoluteValue norm
F : Type u_3
K : Type u_4
inst✝¹ : CommRing F
inst✝ : NormedField K
p : F[X]
f : F →+* K
B : ℝ
i : ℕ
h1 : Monic p
h2 : Splits f p
h3 : ∀ z ∈ roots (map f p), ‖z‖ ≤ B
hB : 0 ≤ B
hi : i ≤ natDegree (map f p)
⊢ ‖coeff (map f p) i‖ ≤ B ^ (natDegree (map f p) - i) * ↑(Nat.choose (natDegree (map f p)) i)

Next tactic:
rw [coeff_eq_esymm_roots_of_splits ((splits_id_iff_splits f).2 h2) hi, (h1.map _).leadingCoeff,
    one_mul, norm_mul, norm_pow, norm_neg, norm_one, one_pow, one_mul]
theorem coeff_le_of_roots_le {p : F[X]} {f : F →+* K} {B : ℝ} (i : ℕ) (h1 : p.Monic)
    (h2 : Splits f p) (h3 : ∀ z ∈ (map f p).roots, ‖z‖ ≤ B) :
    ‖(map f p).coeff i‖ ≤ B ^ (p.natDegree - i) * p.natDegree.choose i := by
  obtain hB | hB := lt_or_le B 0
  · rw [eq_one_of_roots_le hB h1 h2 h3, Polynomial.map_one, natDegree_one, zero_tsub, pow_zero,
      one_mul, coeff_one]
    split_ifs with h <;> simp [h]
  rw [← h1.natDegree_map f]
  obtain hi | hi := lt_or_le (map f p).natDegree i
  · rw [coeff_eq_zero_of_natDegree_lt hi, norm_zero]
    positivity
  rw [coeff_eq_esymm_roots_of_splits ((splits_id_iff_splits f).2 h2) hi, (h1.map _).leadingCoeff,
    one_mul, norm_mul, norm_pow, norm_neg, norm_one, one_pow, one_mul]
  

Proof state:
case inr.inr
α : Type u_1
R : Type u_2
inst✝³ : NormedRing R
inst✝² : IsAbsoluteValue norm
F : Type u_3
K : Type u_4
inst✝¹ : CommRing F
inst✝ : NormedField K
p : F[X]
f : F →+* K
B : ℝ
i : ℕ
h1 : Monic p
h2 : Splits f p
h3 : ∀ z ∈ roots (map f p), ‖z‖ ≤ B
hB : 0 ≤ B
hi : i ≤ natDegree (map f p)
⊢ ‖esymm (roots (map f p)) (natDegree (map f p) - i)‖ ≤
    B ^ (natDegree (map f p) - i) * ↑(Nat.choose (natDegree (map f p)) i)

Next tactic:
apply ((norm_multiset_sum_le _).trans <| sum_le_card_nsmul _ _ fun r hr => _).trans
theorem coeff_le_of_roots_le {p : F[X]} {f : F →+* K} {B : ℝ} (i : ℕ) (h1 : p.Monic)
    (h2 : Splits f p) (h3 : ∀ z ∈ (map f p).roots, ‖z‖ ≤ B) :
    ‖(map f p).coeff i‖ ≤ B ^ (p.natDegree - i) * p.natDegree.choose i := by
  obtain hB | hB := lt_or_le B 0
  · rw [eq_one_of_roots_le hB h1 h2 h3, Polynomial.map_one, natDegree_one, zero_tsub, pow_zero,
      one_mul, coeff_one]
    split_ifs with h <;> simp [h]
  rw [← h1.natDegree_map f]
  obtain hi | hi := lt_or_le (map f p).natDegree i
  · rw [coeff_eq_zero_of_natDegree_lt hi, norm_zero]
    positivity
  rw [coeff_eq_esymm_roots_of_splits ((splits_id_iff_splits f).2 h2) hi, (h1.map _).leadingCoeff,
    one_mul, norm_mul, norm_pow, norm_neg, norm_one, one_pow, one_mul]
  apply ((norm_multiset_sum_le _).trans <| sum_le_card_nsmul _ _ fun r hr => _).trans
  · 

Proof state:
case inr.inr
α : Type u_1
R : Type u_2
inst✝³ : NormedRing R
inst✝² : IsAbsoluteValue norm
F : Type u_3
K : Type u_4
inst✝¹ : CommRing F
inst✝ : NormedField K
p : F[X]
f : F →+* K
B : ℝ
i : ℕ
h1 : Monic p
h2 : Splits f p
h3 : ∀ z ∈ roots (map f p), ‖z‖ ≤ B
hB : 0 ≤ B
hi : i ≤ natDegree (map f p)
⊢ card (Multiset.map (fun x => ‖x‖) (Multiset.map prod (powersetCard (natDegree (map f p) - i) (roots (map f p))))) •
      ?m.211892 ≤
    B ^ (natDegree (map f p) - i) * ↑(Nat.choose (natDegree (map f p)) i)

Next tactic:
rw [Multiset.map_map, card_map, card_powersetCard, ← natDegree_eq_card_roots' h2,
      Nat.choose_symm hi, mul_comm, nsmul_eq_mul]
theorem coeff_le_of_roots_le {p : F[X]} {f : F →+* K} {B : ℝ} (i : ℕ) (h1 : p.Monic)
    (h2 : Splits f p) (h3 : ∀ z ∈ (map f p).roots, ‖z‖ ≤ B) :
    ‖(map f p).coeff i‖ ≤ B ^ (p.natDegree - i) * p.natDegree.choose i := by
  obtain hB | hB := lt_or_le B 0
  · rw [eq_one_of_roots_le hB h1 h2 h3, Polynomial.map_one, natDegree_one, zero_tsub, pow_zero,
      one_mul, coeff_one]
    split_ifs with h <;> simp [h]
  rw [← h1.natDegree_map f]
  obtain hi | hi := lt_or_le (map f p).natDegree i
  · rw [coeff_eq_zero_of_natDegree_lt hi, norm_zero]
    positivity
  rw [coeff_eq_esymm_roots_of_splits ((splits_id_iff_splits f).2 h2) hi, (h1.map _).leadingCoeff,
    one_mul, norm_mul, norm_pow, norm_neg, norm_one, one_pow, one_mul]
  apply ((norm_multiset_sum_le _).trans <| sum_le_card_nsmul _ _ fun r hr => _).trans
  · rw [Multiset.map_map, card_map, card_powersetCard, ← natDegree_eq_card_roots' h2,
      Nat.choose_symm hi, mul_comm, nsmul_eq_mul]
  

Proof state:
α : Type u_1
R : Type u_2
inst✝³ : NormedRing R
inst✝² : IsAbsoluteValue norm
F : Type u_3
K : Type u_4
inst✝¹ : CommRing F
inst✝ : NormedField K
p : F[X]
f : F →+* K
B : ℝ
i : ℕ
h1 : Monic p
h2 : Splits f p
h3 : ∀ z ∈ roots (map f p), ‖z‖ ≤ B
hB : 0 ≤ B
hi : i ≤ natDegree (map f p)
⊢ ∀ r ∈ Multiset.map (fun x => ‖x‖) (Multiset.map prod (powersetCard (natDegree (map f p) - i) (roots (map f p)))),
    r ≤ B ^ (natDegree (map f p) - i)

Next tactic:
intro r hr
theorem coeff_le_of_roots_le {p : F[X]} {f : F →+* K} {B : ℝ} (i : ℕ) (h1 : p.Monic)
    (h2 : Splits f p) (h3 : ∀ z ∈ (map f p).roots, ‖z‖ ≤ B) :
    ‖(map f p).coeff i‖ ≤ B ^ (p.natDegree - i) * p.natDegree.choose i := by
  obtain hB | hB := lt_or_le B 0
  · rw [eq_one_of_roots_le hB h1 h2 h3, Polynomial.map_one, natDegree_one, zero_tsub, pow_zero,
      one_mul, coeff_one]
    split_ifs with h <;> simp [h]
  rw [← h1.natDegree_map f]
  obtain hi | hi := lt_or_le (map f p).natDegree i
  · rw [coeff_eq_zero_of_natDegree_lt hi, norm_zero]
    positivity
  rw [coeff_eq_esymm_roots_of_splits ((splits_id_iff_splits f).2 h2) hi, (h1.map _).leadingCoeff,
    one_mul, norm_mul, norm_pow, norm_neg, norm_one, one_pow, one_mul]
  apply ((norm_multiset_sum_le _).trans <| sum_le_card_nsmul _ _ fun r hr => _).trans
  · rw [Multiset.map_map, card_map, card_powersetCard, ← natDegree_eq_card_roots' h2,
      Nat.choose_symm hi, mul_comm, nsmul_eq_mul]
  intro r hr
  

Proof state:
α : Type u_1
R : Type u_2
inst✝³ : NormedRing R
inst✝² : IsAbsoluteValue norm
F : Type u_3
K : Type u_4
inst✝¹ : CommRing F
inst✝ : NormedField K
p : F[X]
f : F →+* K
B : ℝ
i : ℕ
h1 : Monic p
h2 : Splits f p
h3 : ∀ z ∈ roots (map f p), ‖z‖ ≤ B
hB : 0 ≤ B
hi : i ≤ natDegree (map f p)
r : ℝ
hr : r ∈ Multiset.map (fun x => ‖x‖) (Multiset.map prod (powersetCard (natDegree (map f p) - i) (roots (map f p))))
⊢ r ≤ B ^ (natDegree (map f p) - i)

Next tactic:
simp_rw [Multiset.mem_map] at hr
theorem coeff_le_of_roots_le {p : F[X]} {f : F →+* K} {B : ℝ} (i : ℕ) (h1 : p.Monic)
    (h2 : Splits f p) (h3 : ∀ z ∈ (map f p).roots, ‖z‖ ≤ B) :
    ‖(map f p).coeff i‖ ≤ B ^ (p.natDegree - i) * p.natDegree.choose i := by
  obtain hB | hB := lt_or_le B 0
  · rw [eq_one_of_roots_le hB h1 h2 h3, Polynomial.map_one, natDegree_one, zero_tsub, pow_zero,
      one_mul, coeff_one]
    split_ifs with h <;> simp [h]
  rw [← h1.natDegree_map f]
  obtain hi | hi := lt_or_le (map f p).natDegree i
  · rw [coeff_eq_zero_of_natDegree_lt hi, norm_zero]
    positivity
  rw [coeff_eq_esymm_roots_of_splits ((splits_id_iff_splits f).2 h2) hi, (h1.map _).leadingCoeff,
    one_mul, norm_mul, norm_pow, norm_neg, norm_one, one_pow, one_mul]
  apply ((norm_multiset_sum_le _).trans <| sum_le_card_nsmul _ _ fun r hr => _).trans
  · rw [Multiset.map_map, card_map, card_powersetCard, ← natDegree_eq_card_roots' h2,
      Nat.choose_symm hi, mul_comm, nsmul_eq_mul]
  intro r hr
  simp_rw [Multiset.mem_map] at hr
  

Proof state:
α : Type u_1
R : Type u_2
inst✝³ : NormedRing R
inst✝² : IsAbsoluteValue norm
F : Type u_3
K : Type u_4
inst✝¹ : CommRing F
inst✝ : NormedField K
p : F[X]
f : F →+* K
B : ℝ
i : ℕ
h1 : Monic p
h2 : Splits f p
h3 : ∀ z ∈ roots (map f p), ‖z‖ ≤ B
hB : 0 ≤ B
hi : i ≤ natDegree (map f p)
r : ℝ
hr : ∃ a, (∃ a_1 ∈ powersetCard (natDegree (map f p) - i) (roots (map f p)), prod a_1 = a) ∧ ‖a‖ = r
⊢ r ≤ B ^ (natDegree (map f p) - i)

Next tactic:
obtain ⟨_, ⟨s, hs, rfl⟩, rfl⟩ := hr
theorem coeff_le_of_roots_le {p : F[X]} {f : F →+* K} {B : ℝ} (i : ℕ) (h1 : p.Monic)
    (h2 : Splits f p) (h3 : ∀ z ∈ (map f p).roots, ‖z‖ ≤ B) :
    ‖(map f p).coeff i‖ ≤ B ^ (p.natDegree - i) * p.natDegree.choose i := by
  obtain hB | hB := lt_or_le B 0
  · rw [eq_one_of_roots_le hB h1 h2 h3, Polynomial.map_one, natDegree_one, zero_tsub, pow_zero,
      one_mul, coeff_one]
    split_ifs with h <;> simp [h]
  rw [← h1.natDegree_map f]
  obtain hi | hi := lt_or_le (map f p).natDegree i
  · rw [coeff_eq_zero_of_natDegree_lt hi, norm_zero]
    positivity
  rw [coeff_eq_esymm_roots_of_splits ((splits_id_iff_splits f).2 h2) hi, (h1.map _).leadingCoeff,
    one_mul, norm_mul, norm_pow, norm_neg, norm_one, one_pow, one_mul]
  apply ((norm_multiset_sum_le _).trans <| sum_le_card_nsmul _ _ fun r hr => _).trans
  · rw [Multiset.map_map, card_map, card_powersetCard, ← natDegree_eq_card_roots' h2,
      Nat.choose_symm hi, mul_comm, nsmul_eq_mul]
  intro r hr
  simp_rw [Multiset.mem_map] at hr
  obtain ⟨_, ⟨s, hs, rfl⟩, rfl⟩ := hr
  

Proof state:
case intro.intro.intro.intro
α : Type u_1
R : Type u_2
inst✝³ : NormedRing R
inst✝² : IsAbsoluteValue norm
F : Type u_3
K : Type u_4
inst✝¹ : CommRing F
inst✝ : NormedField K
p : F[X]
f : F →+* K
B : ℝ
i : ℕ
h1 : Monic p
h2 : Splits f p
h3 : ∀ z ∈ roots (map f p), ‖z‖ ≤ B
hB : 0 ≤ B
hi : i ≤ natDegree (map f p)
s : Multiset K
hs : s ∈ powersetCard (natDegree (map f p) - i) (roots (map f p))
⊢ ‖prod s‖ ≤ B ^ (natDegree (map f p) - i)

Next tactic:
rw [mem_powersetCard] at hs
theorem coeff_le_of_roots_le {p : F[X]} {f : F →+* K} {B : ℝ} (i : ℕ) (h1 : p.Monic)
    (h2 : Splits f p) (h3 : ∀ z ∈ (map f p).roots, ‖z‖ ≤ B) :
    ‖(map f p).coeff i‖ ≤ B ^ (p.natDegree - i) * p.natDegree.choose i := by
  obtain hB | hB := lt_or_le B 0
  · rw [eq_one_of_roots_le hB h1 h2 h3, Polynomial.map_one, natDegree_one, zero_tsub, pow_zero,
      one_mul, coeff_one]
    split_ifs with h <;> simp [h]
  rw [← h1.natDegree_map f]
  obtain hi | hi := lt_or_le (map f p).natDegree i
  · rw [coeff_eq_zero_of_natDegree_lt hi, norm_zero]
    positivity
  rw [coeff_eq_esymm_roots_of_splits ((splits_id_iff_splits f).2 h2) hi, (h1.map _).leadingCoeff,
    one_mul, norm_mul, norm_pow, norm_neg, norm_one, one_pow, one_mul]
  apply ((norm_multiset_sum_le _).trans <| sum_le_card_nsmul _ _ fun r hr => _).trans
  · rw [Multiset.map_map, card_map, card_powersetCard, ← natDegree_eq_card_roots' h2,
      Nat.choose_symm hi, mul_comm, nsmul_eq_mul]
  intro r hr
  simp_rw [Multiset.mem_map] at hr
  obtain ⟨_, ⟨s, hs, rfl⟩, rfl⟩ := hr
  rw [mem_powersetCard] at hs
  

Proof state:
case intro.intro.intro.intro
α : Type u_1
R : Type u_2
inst✝³ : NormedRing R
inst✝² : IsAbsoluteValue norm
F : Type u_3
K : Type u_4
inst✝¹ : CommRing F
inst✝ : NormedField K
p : F[X]
f : F →+* K
B : ℝ
i : ℕ
h1 : Monic p
h2 : Splits f p
h3 : ∀ z ∈ roots (map f p), ‖z‖ ≤ B
hB : 0 ≤ B
hi : i ≤ natDegree (map f p)
s : Multiset K
hs : s ≤ roots (map f p) ∧ card s = natDegree (map f p) - i
⊢ ‖prod s‖ ≤ B ^ (natDegree (map f p) - i)

Next tactic:
lift B to ℝ≥0 using hB
theorem coeff_le_of_roots_le {p : F[X]} {f : F →+* K} {B : ℝ} (i : ℕ) (h1 : p.Monic)
    (h2 : Splits f p) (h3 : ∀ z ∈ (map f p).roots, ‖z‖ ≤ B) :
    ‖(map f p).coeff i‖ ≤ B ^ (p.natDegree - i) * p.natDegree.choose i := by
  obtain hB | hB := lt_or_le B 0
  · rw [eq_one_of_roots_le hB h1 h2 h3, Polynomial.map_one, natDegree_one, zero_tsub, pow_zero,
      one_mul, coeff_one]
    split_ifs with h <;> simp [h]
  rw [← h1.natDegree_map f]
  obtain hi | hi := lt_or_le (map f p).natDegree i
  · rw [coeff_eq_zero_of_natDegree_lt hi, norm_zero]
    positivity
  rw [coeff_eq_esymm_roots_of_splits ((splits_id_iff_splits f).2 h2) hi, (h1.map _).leadingCoeff,
    one_mul, norm_mul, norm_pow, norm_neg, norm_one, one_pow, one_mul]
  apply ((norm_multiset_sum_le _).trans <| sum_le_card_nsmul _ _ fun r hr => _).trans
  · rw [Multiset.map_map, card_map, card_powersetCard, ← natDegree_eq_card_roots' h2,
      Nat.choose_symm hi, mul_comm, nsmul_eq_mul]
  intro r hr
  simp_rw [Multiset.mem_map] at hr
  obtain ⟨_, ⟨s, hs, rfl⟩, rfl⟩ := hr
  rw [mem_powersetCard] at hs
  lift B to ℝ≥0 using hB
  

Proof state:
case intro.intro.intro.intro.intro
α : Type u_1
R : Type u_2
inst✝³ : NormedRing R
inst✝² : IsAbsoluteValue norm
F : Type u_3
K : Type u_4
inst✝¹ : CommRing F
inst✝ : NormedField K
p : F[X]
f : F →+* K
i : ℕ
h1 : Monic p
h2 : Splits f p
hi : i ≤ natDegree (map f p)
s : Multiset K
hs : s ≤ roots (map f p) ∧ card s = natDegree (map f p) - i
B : ℝ≥0
h3 : ∀ z ∈ roots (map f p), ‖z‖ ≤ ↑B
⊢ ‖prod s‖ ≤ ↑B ^ (natDegree (map f p) - i)

Next tactic:
rw [← coe_nnnorm, ← NNReal.coe_pow, NNReal.coe_le_coe, ← nnnormHom_apply, ← MonoidHom.coe_coe,
    MonoidHom.map_multiset_prod]