Lean / Reader
Lean readerSquarefree.lean
Lean 4 Web has Mathlib, so it can check files that import only Mathlib. This one also imports Erdos824.Final, which it does not have: you can read it there, but it will not check. Build the project itself to check it.
import Erdos824.Final/-!# The squarefree variant of Erdős problem 824Li and Zhuang, Theorem 1.3, observe that their coprime pairs are also squarefree.This module derives the squarefree variant in Formal Conjectures from thatstrengthening of their finite counting argument and Yao Xu's smooth-successor supply.-/open Filteropen scoped ArithmeticFunction.sigmanamespace Erdos824/-- Formal Conjectures' count for the squarefree variant. -/noncomputable def hSquarefree (x : ℕ) : ℕ :=((Finset.Ico 1 x ×ˢ Finset.Ico 1 x).filter fun (a, b) ↦a < b ∧ Squarefree a ∧ Squarefree b ∧ σ 1 a = σ 1 b).cardprivate theorem coprimeSquarefree_le_squarefree (x : ℕ) :LiZhuang.hCoprimeSquarefree x ≤ hSquarefree x := byapply Finset.card_le_cardintro p hpobtain ⟨hm, hlt, _, ha, hb, hsig⟩ := Finset.mem_filter.mp hpexact Finset.mem_filter.mpr ⟨hm, hlt, ha, hb, hsig⟩/-- Coprime pairs that are squarefree in both coordinates satisfy the near-quadratic bound. -/theorem erdos_824_coprime_squarefree :∀ ε : ℝ, 0 < ε → ∀ᶠ x : ℕ in atTop,(x : ℝ) ^ (2 - ε) < (LiZhuang.hCoprimeSquarefree x : ℝ) := byintro ε hεobtain ⟨X, hX⟩ := LiZhuang.erdos824_of_smoothSuccessorWeak_squarefree(weak_of_supply Final.supply) ε hεrefine eventually_atTop.2 ⟨⌈X⌉₊, fun n hn ↦ hX n ?_⟩exact (Nat.le_ceil X).trans (by exact_mod_cast hn)/-- The statement of the squarefree variant in Formal Conjectures. -/theorem erdos_824.variants.squarefree :∀ ε : ℝ, 0 < ε → ∀ᶠ x : ℕ in atTop, (x : ℝ) ^ (2 - ε) < (hSquarefree x : ℝ) := byintro ε hεfilter_upwards [erdos_824_coprime_squarefree ε hε] with x hxexact hx.trans_le (by exact_mod_cast coprimeSquarefree_le_squarefree x)end Erdos824