Lean / Reader
Lean reader

Erdos824Cutoff.lean

45 lines2 declarationsno sorryimports Mathlib.Analysis.SpecialFunctions.Pow.Real Mathlib.Order.Filter.AtTopBot.Basic Mathlib.Tactic
  1. import Mathlib.Analysis.SpecialFunctions.Pow.Real
  2. import Mathlib.Order.Filter.AtTopBot.Basic
  3. import Mathlib.Tactic
  4. namespace Erdos824Cutoff
  5. open Filter
  6. /-- The strict real upper bound on the second member of a pair. -/
  7. theorem mem_cutoff {b : ℕ} {x : ℝ} : (b : ℝ) < x ↔ b < ⌈x⌉₊ :=
  8. Nat.lt_ceil.symm
  9. /-- For any count using a strict upper cutoff, integer and real formulations
  10. of the near-quadratic lower bound are equivalent. -/
  11. theorem nat_iff_real (h : ℕ → ℕ) :
  12. (∀ ε : ℝ, 0 < ε → ∀ᶠ n : ℕ in atTop, (n : ℝ) ^ (2 - ε) < (h n : ℝ)) ↔
  13. (∀ ε : ℝ, 0 < ε → ∀ᶠ x : ℝ in atTop, x ^ (2 - ε) < (h ⌈x⌉₊ : ℝ)) := by
  14. constructor
  15. · intro hn ε hε
  16. let δ := min ε 1
  17. have hδ : 0 < δ := lt_min hε zero_lt_one
  18. obtain ⟨N, hN⟩ := eventually_atTop.1 (hn δ hδ)
  19. refine eventually_atTop.2 ⟨max (N : ℝ) 1, ?_⟩
  20. intro x hx
  21. have hx₁ : 1 ≤ x := (le_max_right _ _).trans hx
  22. have hNx : (N : ℝ) ≤ x := (le_max_left _ _).trans hx
  23. have hnceil : N ≤ ⌈x⌉₊ := by exact_mod_cast hNx.trans (Nat.le_ceil x)
  24. have hδ₁ : δ ≤ 1 := min_le_right _ _
  25. calc
  26. x ^ (2 - ε) ≤ x ^ (2 - δ) :=
  27. Real.rpow_le_rpow_of_exponent_le hx₁ (sub_le_sub_left (min_le_left _ _) _)
  28. _ ≤ (⌈x⌉₊ : ℝ) ^ (2 - δ) :=
  29. Real.rpow_le_rpow (zero_le_one.trans hx₁) (Nat.le_ceil x) (by linarith)
  30. _ < (h ⌈x⌉₊ : ℝ) := hN _ hnceil
  31. · intro hr ε hε
  32. obtain ⟨X, hX⟩ := eventually_atTop.1 (hr ε hε)
  33. refine eventually_atTop.2 ⟨⌈X⌉₊, ?_⟩
  34. intro n hn
  35. have hXn : X ≤ (n : ℝ) := (Nat.le_ceil X).trans (by exact_mod_cast hn)
  36. simpa using hX n hXn
  37. #print axioms Erdos824Cutoff.nat_iff_real
  38. end Erdos824Cutoff