Asymptotics for affine floor sampling
DefinitionOAI_NumberTheory_PiExponent_Polynomials_SimplexFloorasymptotic-analysisnumber-theoryopenai-pi-exponent-017
For real a > 0 and any real b, the natural floor ⌊a x + b⌋₊ tends to infinity as x tends to infinity, and its real cast divided by x tends to a. If f n / n^d tends to L, then f ⌊a x + b⌋₊ / x^d tends to L a^d.
Definition code
import Mathlib.Algebra.MvPolynomial.Eval
import Mathlib.Algebra.Order.Antidiag.FinsuppEquiv
import Mathlib.Analysis.Asymptotics.SpecificAsymptotics
import Mathlib.Analysis.SpecialFunctions.Log.Basic
import Mathlib.Analysis.SpecialFunctions.Pow.Real
import Mathlib.Analysis.SpecialFunctions.Trigonometric.Bounds
import Mathlib.Analysis.SpecificLimits.Basic
import Mathlib.Analysis.SpecificLimits.Normed
import Mathlib.RingTheory.PowerSeries.Order
import Mathlib.RingTheory.PowerSeries.Trunc
import Mathlib.Tactic
namespace OAI
open Filter Topology
namespace PiExponent
theorem tendsto_natFloor_affine_atTop {a : ℝ} (ha : 0 < a) (b : ℝ) :
Tendsto (fun x : ℝ => ⌊a * x + b⌋₊) atTop atTop :=
tendsto_nat_floor_atTop.comp
(tendsto_atTop_add_const_right atTop b (Tendsto.const_mul_atTop ha tendsto_id))
theorem tendsto_natFloor_affine_div {a : ℝ} (ha : 0 < a) (b : ℝ) :
Tendsto (fun x : ℝ => (⌊a * x + b⌋₊ : ℝ) / x) atTop (𝓝 a) := by
have hy : Tendsto (fun x : ℝ => a * x + b) atTop atTop :=
tendsto_atTop_add_const_right atTop b (Tendsto.const_mul_atTop ha tendsto_id)
have hratio : Tendsto (fun x : ℝ => (a * x + b) / x) atTop (𝓝 a) := by
have h : Tendsto (fun x : ℝ => a + b * x⁻¹) atTop (𝓝 (a + b * 0)) :=
tendsto_const_nhds.add (tendsto_const_nhds.mul
(tendsto_inv_atTop_zero : Tendsto (fun x : ℝ => x⁻¹) atTop (𝓝 0)))
simp only [mul_zero, add_zero] at h
apply h.congr'
filter_upwards [eventually_gt_atTop (0 : ℝ)] with x hx
field_simp
have h := (tendsto_nat_floor_div_atTop.comp hy).mul hratio
simp only [one_mul] at h
apply h.congr'
filter_upwards [hy.eventually (eventually_gt_atTop (0 : ℝ))] with x hx
change (⌊a * x + b⌋₊ : ℝ) / (a * x + b) * ((a * x + b) / x) = _
field_simp
theorem tendsto_normalized_natFloor_affine {f : ℕ → ℝ} {d : ℕ} {L a : ℝ}
(hf : Tendsto (fun n : ℕ => f n / (n : ℝ) ^ d) atTop (𝓝 L))
(ha : 0 < a) (b : ℝ) :
Tendsto (fun x : ℝ => f ⌊a * x + b⌋₊ / x ^ d) atTop (𝓝 (L * a ^ d)) := by
have hfloor := tendsto_natFloor_affine_atTop ha b
have h := (hf.comp hfloor).mul ((tendsto_natFloor_affine_div ha b).pow d)
apply h.congr'
filter_upwards [hfloor.eventually (eventually_ge_atTop 1)] with x hx
have hn : (⌊a * x + b⌋₊ : ℝ) ≠ 0 := by
exact_mod_cast (by omega : ⌊a * x + b⌋₊ ≠ 0)
simp only [Function.comp_apply]
rw [div_pow]
field_simp
end PiExponent
end OAI
Source
OpenAI math, commit adc7f1241b42e322a6451854ab7e4b4c146bf78a: https://github.com/openai/math/blob/adc7f1241b42e322a6451854ab7e4b4c146bf78a/lean/OAI/NumberTheory/PiExponent/Polynomials/SimplexFloor.lean#L9-L45