English
If f = O_atTop g for functions on a ring R with natural cast, then f∘cast = O_atTop g∘cast.
Русский
Если f = O_atTop g на кольце R, то f черед cast относится к g через якорное отображение nat_cast.
LaTeX
$$$\\displaystyle f = O[atTop] g \\Rightarrow (n \\mapsto f(n)) = O[atTop] (n \\mapsto g(n))$ after casting via natural numbers.$$
Lean4
/-- If `f x = O(g x)` along `cofinite`, then there exists a positive constant `C` such that
`‖f x‖ ≤ C * ‖g x‖` whenever `g x ≠ 0`. -/
theorem bound_of_isBigO_cofinite (h : f =O[cofinite] g'') : ∃ C > 0, ∀ ⦃x⦄, g'' x ≠ 0 → ‖f x‖ ≤ C * ‖g'' x‖ :=
by
rcases h.exists_pos with ⟨C, C₀, hC⟩
rw [IsBigOWith_def, eventually_cofinite] at hC
rcases (hC.toFinset.image fun x => ‖f x‖ / ‖g'' x‖).exists_le with ⟨C', hC'⟩
have : ∀ x, C * ‖g'' x‖ < ‖f x‖ → ‖f x‖ / ‖g'' x‖ ≤ C' := by simpa using hC'
refine ⟨max C C', lt_max_iff.2 (Or.inl C₀), fun x h₀ => ?_⟩
rw [max_mul_of_nonneg _ _ (norm_nonneg _), le_max_iff, or_iff_not_imp_left, not_le]
exact fun hx => (div_le_iff₀ (norm_pos_iff.2 h₀)).1 (this _ hx)