import Mathlib.Analysis.SpecialFunctions.Pow.Real import Mathlib.Order.Filter.AtTopBot.Basic import Mathlib.Tactic namespace Erdos824Cutoff open Filter /-- The strict real upper bound on the second member of a pair. -/ theorem mem_cutoff {b : ℕ} {x : ℝ} : (b : ℝ) < x ↔ b < ⌈x⌉₊ := Nat.lt_ceil.symm /-- For any count using a strict upper cutoff, integer and real formulations of the near-quadratic lower bound are equivalent. -/ theorem nat_iff_real (h : ℕ → ℕ) : (∀ ε : ℝ, 0 < ε → ∀ᶠ n : ℕ in atTop, (n : ℝ) ^ (2 - ε) < (h n : ℝ)) ↔ (∀ ε : ℝ, 0 < ε → ∀ᶠ x : ℝ in atTop, x ^ (2 - ε) < (h ⌈x⌉₊ : ℝ)) := by constructor · intro hn ε hε let δ := min ε 1 have hδ : 0 < δ := lt_min hε zero_lt_one obtain ⟨N, hN⟩ := eventually_atTop.1 (hn δ hδ) refine eventually_atTop.2 ⟨max (N : ℝ) 1, ?_⟩ intro x hx have hx₁ : 1 ≤ x := (le_max_right _ _).trans hx have hNx : (N : ℝ) ≤ x := (le_max_left _ _).trans hx have hnceil : N ≤ ⌈x⌉₊ := by exact_mod_cast hNx.trans (Nat.le_ceil x) have hδ₁ : δ ≤ 1 := min_le_right _ _ calc x ^ (2 - ε) ≤ x ^ (2 - δ) := Real.rpow_le_rpow_of_exponent_le hx₁ (sub_le_sub_left (min_le_left _ _) _) _ ≤ (⌈x⌉₊ : ℝ) ^ (2 - δ) := Real.rpow_le_rpow (zero_le_one.trans hx₁) (Nat.le_ceil x) (by linarith) _ < (h ⌈x⌉₊ : ℝ) := hN _ hnceil · intro hr ε hε obtain ⟨X, hX⟩ := eventually_atTop.1 (hr ε hε) refine eventually_atTop.2 ⟨⌈X⌉₊, ?_⟩ intro n hn have hXn : X ≤ (n : ℝ) := (Nat.le_ceil X).trans (by exact_mod_cast hn) simpa using hX n hXn #print axioms Erdos824Cutoff.nat_iff_real end Erdos824Cutoff