Lean / Reader
Lean readerSquarefreeConditional.lean
Lean 4 Web has Mathlib, so it can check files that import only Mathlib. This one also imports Erdos824.LiZhuang.Main, which it does not have: you can read it there, but it will not check. Build the project itself to check it.
import Erdos824.LiZhuang.Main/-!# The squarefree variant of Erdős problem 824Li and Zhuang, Theorem 1.3, observe that their coprime pairs are also squarefree.The conclusion specializes the strengthened counting argument to the squarefreevariant in Formal Conjectures under the explicitly stated smooth-successor hypothesis.-/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 coprime_squarefree_of_smooth_successors (H : LiZhuang.SmoothSuccessorHypWeak) :∀ ε : ℝ, 0 < ε → ∀ᶠ x : ℕ in atTop,(x : ℝ) ^ (2 - ε) < (LiZhuang.hCoprimeSquarefree x : ℝ) := byintro ε hεobtain ⟨X, hX⟩ := LiZhuang.erdos824_of_smoothSuccessorWeak_squarefreeH ε hεrefine eventually_atTop.2 ⟨⌈X⌉₊, fun n hn ↦ hX n ?_⟩exact (Nat.le_ceil X).trans (by exact_mod_cast hn)/-- The squarefree variant in Formal Conjectures under the smooth-successor hypothesis. -/theorem squarefree_of_smooth_successors (H : LiZhuang.SmoothSuccessorHypWeak) :∀ ε : ℝ, 0 < ε → ∀ᶠ x : ℕ in atTop, (x : ℝ) ^ (2 - ε) < (hSquarefree x : ℝ) := byintro ε hεfilter_upwards [coprime_squarefree_of_smooth_successors H ε hε] with x hxexact hx.trans_le (by exact_mod_cast coprimeSquarefree_le_squarefree x)end Erdos824#print axioms Erdos824.squarefree_of_smooth_successors