Zulip Chat Archive
Stream: mathlib4
Topic: f = o(g) -> f > g only on bounded set
Jeremy Tan (Feb 05 2026 at 01:28):
@Kevin Buzzard said in that I should prove #34845 through this lemma. But this lemma does not seem to be in mathlib
I think that
finite_abs_eval_lt_of_degree_ltshould be deduced from the claim that if one function is little-o of another one then the smaller one only beats the bigger one on a bounded set rather than grinding it out in the specific case of polynomials as Aristotle has seemed to have done
Jeremy Tan (Feb 05 2026 at 01:42):
In particular you also need to prove the behaviour atBot; mathlib currently only has atTop lemmas
Bolton Bailey (Feb 05 2026 at 02:24):
You may already be working on this, but I asked Claude to refactor out some of the haves and do a generalization along these lines, and I got this output, perhaps it's useful to you.
open Filter Topology in
/-- If `deg P < deg Q`, then `P(x) / Q(x) β 0` as `x β Β±β`. -/
lemma div_tendsto_zero_of_degree_lt_atTopBot (P Q : β[X]) (h : P.degree < Q.degree) :
Tendsto (fun x β¦ P.eval x / Q.eval x) (atTop β atBot) (π 0) := by
have lβ : ((P.comp (-X)).degree < (Q.comp (-X)).degree) := by simp [h]
apply Tendsto.sup
Β· exact div_tendsto_zero_of_degree_lt _ _ h
Β· convert (div_tendsto_zero_of_degree_lt _ _ lβ).comp tendsto_neg_atBot_atTop using 2
simp
open Filter Topology in
/-- If `f` tends to `0` as `x β Β±β`, then `|f x| < 1` outside a bounded interval. -/
lemma exists_bounds_abs_lt_one_of_tendsto_zero {f : β β β}
(hf : Tendsto f (atTop β atBot) (π 0)) :
β Mβ Mβ, β x, x β€ Mβ β¨ Mβ β€ x β |f x| < 1 := by
have hf' := hf.abs
simp only [abs_zero] at hf'
replace hf' := hf'.eventually (gt_mem_nhds zero_lt_one)
rw [eventually_sup, eventually_atTop, eventually_atBot] at hf'
obtain β¨β¨Mβ, hMββ©, β¨Mβ, hMββ©β© := hf'
exact β¨Mβ, Mβ, fun x hx β¦ hx.elim (hMβ _) (hMβ _)β©
open Filter Topology in
/-- For integers outside a finite interval, if `P(x) β 0` and the ratio `|Q(x)/P(x)| < 1` for
rationals outside that interval, then `|Q(x)| < |P(x)|`. -/
lemma abs_eval_lt_of_not_mem_Ioo {P Q : β€[X]}
{Mβ Mβ : β€} (hM : β (x : β), x β€ Mβ β¨ Mβ β€ x β
|(Q.map (Int.castRingHom β)).eval x| / |(P.map (Int.castRingHom β)).eval x| < 1)
{x : β€} (hx : x β Finset.Ioo Mβ Mβ) (hPx : P.eval x β 0) :
|Q.eval x| < |P.eval x| := by
have hx' : (x : β) β€ Mβ β¨ (Mβ : β) β€ x := by
simp only [Finset.mem_Ioo, not_and_or, not_lt, Int.cast_le] at hx β’
exact hx
specialize hM _ hx'
simp only [eval_intCast_map, Int.cast_eq, eq_intCast] at hM
rw [div_lt_oneβ (by positivity)] at hM
exact_mod_cast hM
open Filter Topology in
/-- If `deg Q < deg P`, there are only finitely many integers `x` where `|P(x)| β€ |Q(x)|`. -/
lemma finite_abs_eval_lt_of_degree_lt {P Q : β€[X]} (h : Q.degree < P.degree) :
{x | |P.eval x| β€ |Q.eval x|}.Finite := by
let c := Int.castRingHom β
have hdeg : (Q.map c).degree < (P.map c).degree := by
simpa [degree_map_eq_of_injective c.injective_int]
obtain β¨Mβ, Mβ, hMβ© := exists_bounds_abs_lt_one_of_tendsto_zero
((div_tendsto_zero_of_degree_lt_atTopBot _ _ hdeg).abs.congr fun _ β¦ abs_div _ _)
simp only [abs_div, abs_abs] at hM
have hM' : β (x : β), x β€ βMββ β¨ βMββ β€ x β
|(Q.map c).eval x| / |(P.map c).eval x| < 1 := fun x hx' β¦
hM x (hx'.elim (fun l β¦ .inl (l.trans (Int.floor_le Mβ)))
fun l β¦ .inr ((Int.le_ceil Mβ).trans l))
refine (Finset.Ioo βMββ βMββ βͺ P.roots.toFinset).finite_toSet.subset fun x hx β¦ ?_
contrapose! hx
rw [Set.mem_setOf_eq, not_le]
rw [SetLike.mem_coe, Finset.mem_union, not_or, Multiset.mem_toFinset, mem_roots', not_and] at hx
exact abs_eval_lt_of_not_mem_Ioo hM' hx.1 (hx.2 (ne_zero_of_degree_gt h))
Bolton Bailey (Feb 05 2026 at 02:25):
I think it meets the general description of "deduced from the claim that if one function is little-o of another one then the smaller one only beats the bigger one on a bounded set", but perhaps there are other "slop" things that someone else would find :shrug:
Jeremy Tan (Feb 05 2026 at 02:26):
Come to think of it, the more general claim is only guaranteed to be true along the filter used in the little-o. Think Airy's Ai and Bi β the two functions oscillate around each other on the negative axis, but Bi dominates Ai on the positive axis
Jeremy Tan (Feb 05 2026 at 02:29):
Is Kevin asking me to ditch AI entirely for this one?
Jeremy Tan (Feb 05 2026 at 06:53):
OK, I tried a different approach. #34868 adds missing atBot and asymptotics lemmas for Analysis.Polynomial.Basic
Last updated: Feb 28 2026 at 14:05 UTC