Lean / Ghuffy1/erdos319-sharp-deficit / Solution.lean
Lean readerSolution.lean
Lean 4 Web has Mathlib, so it can check files that import only Mathlib. This one also imports Erdos319Sharp, Submission, which it does not have: you can read it there, but it will not check. Build the project itself to check it.
import Erdos319Sharpimport Submission/-!The original fixed-sign maximum and the sharp asymptotic for Erdős 319.The literal sign condition is defined in Submission.lean. The same signfunction is restricted to every proper nonempty subset.-/open Filteropen scoped Topologynamespace Erdos319Jspdef IsOriginalMaximum (N k : ℕ) : Prop :=IsGreatest{j : ℕ | ∃ A : Finset ℕ, A ⊆ Finset.Icc 1 N ∧Erdos319Submission.LiteralPrimitive A ∧ A.card = j} ktheorem maximum_correspondence (N : ℕ) :IsOriginalMaximum N (Erdos319Formal.maxSize N) :=Erdos319Submission.literal_maximum Ntheorem sharp_asymptotic :Tendsto (fun N : ℕ =>((N : ℝ) - Erdos319Formal.maxSize N) * Real.log (Real.log N) /((N : ℝ) * Real.log (Real.log (Real.log N))))atTop (𝓝 (Real.exp (-Real.eulerMascheroniConstant))) :=Erdos319Sharp.erdos319_sharp_deficittheorem sharp_asymptotic_ratio :Tendsto (fun N : ℕ =>((N : ℝ) - Erdos319Formal.maxSize N) /(Real.exp (-Real.eulerMascheroniConstant) * (N : ℝ) *Real.log (Real.log (Real.log N)) / Real.log (Real.log N)))atTop (𝓝 1) :=Erdos319Sharp.erdos319_sharp_deficit_ratiotheorem sharp_for_every_literal_maximum (c : ℕ → ℕ)(hc : ∀ N, IsOriginalMaximum N (c N)) :Tendsto (fun N : ℕ =>((N : ℝ) - c N) * Real.log (Real.log N) /((N : ℝ) * Real.log (Real.log (Real.log N))))atTop (𝓝 (Real.exp (-Real.eulerMascheroniConstant))) := byhave heq : c = Erdos319Formal.maxSize := byfunext Nexact (hc N).unique (maximum_correspondence N)rw [heq]exact sharp_asymptotictheorem full_solution :(∀ N, IsOriginalMaximum N (Erdos319Formal.maxSize N)) ∧Tendsto (fun N : ℕ =>((N : ℝ) - Erdos319Formal.maxSize N) * Real.log (Real.log N) /((N : ℝ) * Real.log (Real.log (Real.log N))))atTop (𝓝 (Real.exp (-Real.eulerMascheroniConstant))) :=⟨maximum_correspondence, sharp_asymptotic⟩end Erdos319Jsp