/-
Copyright 2026 The Formal Conjectures Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-/
module
public import FormalConjecturesUtilDirichlet divisor problem
Let $d(n)$ be the number of divisors of $n$ and $D(x) = \sum_{n \le x} d(n)$ the divisor summatory function. Dirichlet's hyperbola method gives $$D(x) = x \log x + (2\gamma - 1) x + \Delta(x), \qquad \Delta(x) = O(x^{1/2}),$$ where $\gamma$ is the Euler–Mascheroni constant. The Dirichlet divisor problem asks for the infimum $\theta$ of exponents with $\Delta(x) = O(x^{\theta})$. It is conjectured that $\theta = 1/4$, i.e. $\Delta(x) = O(x^{1/4 + \varepsilon})$ for every $\varepsilon > 0$. Hardy showed $\theta \ge 1/4$, so the conjecture would be sharp. Huxley's bound $\theta \le 131/416 \approx 0.3149$ [Hu03] is now historical: the best known upper bound is $\theta \le 0.314483\ldots$, due to Li and Yang [LY23]. The problem remains open.
References:
Wikipedia: Divisor summatory function
Wikipedia: Dirichlet divisor problem
[Di49] P. G. L. Dirichlet, Über die Bestimmung der mittleren Werthe in der Zahlentheorie, Abhandl. Königl. Preuss. Akad. Wiss. (1849), 69-83.
[Ha16] G. H. Hardy, On Dirichlet's divisor problem, Proc. London Math. Soc. (1916), 1-25.
[Hu03] M. N. Huxley, Exponential sums and lattice points III, Proc. London Math. Soc. (2003), 591-609.
[LY23] X. Li, X. Yang, An improvement on Gauss's circle problem and Dirichlet's divisor problem, arXiv:2308.14859 (2023), Theorem 1.2.
@[expose] public sectionopen Filter Asymptotics Realnamespace DirichletDivisorProblemThe divisor summatory function $D(x) = \sum_{n \le x} d(n)$, where $d(n)$ is the number of divisors of $n$.
noncomputable def divisorSummatory (x : ℝ) : ℝ :=
∑ n ∈ Finset.Icc 1 ⌊x⌋₊, (n.divisors.card : ℝ)The error term $\Delta(x) = D(x) - x \log x - (2\gamma - 1) x$ in the divisor summatory asymptotic, where $\gamma$ is the Euler–Mascheroni constant.
noncomputable def divisorError (x : ℝ) : ℝ :=
divisorSummatory x - x * Real.log x - (2 * eulerMascheroniConstant - 1) * x$D(1) = d(1) = 1$.
@[category test, AMS 11]
theorem divisorSummatory_one : divisorSummatory 1 = 1 := ⊢ divisorSummatory 1 = 1
All goals completed! 🐙Dirichlet's bound [Di49]: $\Delta(x) = O(x^{1/2})$.
@[category textbook, AMS 11]
theorem divisor_error_dirichlet :
divisorError =O[atTop] fun x => Real.sqrt x := ⊢ divisorError =O[atTop] fun x ↦ √x
All goals completed! 🐙The Dirichlet divisor problem: is it true that $\Delta(x) = O(x^{1/4 + \varepsilon})$ for every $\varepsilon > 0$? (Equivalently, is the infimum of admissible exponents equal to $1/4$?)
@[category research open, AMS 11]
theorem dirichlet_divisor_problem :
∀ ε > (0 : ℝ), divisorError =O[atTop] fun x => x ^ ((1 : ℝ) / 4 + ε) := ⊢ ∀ ε > 0, divisorError =O[atTop] fun x ↦ x ^ (1 / 4 + ε)
All goals completed! 🐙Hardy's lower bound [Ha16]: $\Delta(x)$ is not $o(x^{1/4})$, so the exponent $1/4$ in the Dirichlet divisor problem cannot be improved.
@[category research solved, AMS 11]
theorem divisor_error_hardy :
¬ (divisorError =o[atTop] fun x => x ^ ((1 : ℝ) / 4)) := ⊢ ¬divisorError =o[atTop] fun x ↦ x ^ (1 / 4)
All goals completed! 🐙end DirichletDivisorProblem