/-
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 FormalConjecturesUtilErdős Problem 964
References:
[Er86b] Erdős, P., Some problems on number theory. Proceedings of the seventeenth Southeastern international conference on combinatorics, graph theory, and computing (Boca Raton, Fla., 1986), Congr. Numer. 54 (1986), 225-244.
[Eb25] Eberhard, S., Ratios of consecutive values of the divisor function. arXiv:2505.00727 (2025).
@[expose] public sectionopen scoped ArithmeticFunction.sigmanamespace Erdos964$\tau(n+1)/\tau(n)$ as a real number, where $\tau = \sigma_0$ counts divisors. For $n = 0$ this is the junk value $0$, so the statements below use $n \geq 1$.
noncomputable def tauRatio (n : ℕ) : ℝ := (σ 0 (n + 1) : ℝ) / (σ 0 n : ℝ)For $n \geq 1$ the ratio $\tau(n+1)/\tau(n)$ is positive.
@[category API, AMS 11]
theorem tauRatio_pos {n : ℕ} (hn : 0 < n) : 0 < tauRatio n := n:ℕhn:0 < n⊢ 0 < tauRatio n
n:ℕhn:0 < n⊢ 0 < ↑((σ 0) (n + 1)) / ↑((σ 0) n)
n:ℕhn:0 < nh1:0 < (σ 0) (n + 1)⊢ 0 < ↑((σ 0) (n + 1)) / ↑((σ 0) n)
n:ℕhn:0 < nh1:0 < (σ 0) (n + 1)h2:0 < (σ 0) n⊢ 0 < ↑((σ 0) (n + 1)) / ↑((σ 0) n)
All goals completed! 🐙Let $\tau(n)$ count the number of divisors of $n$. Is the sequence $$\frac{\tau(n+1)}{\tau(n)}$$ everywhere dense in $(0,\infty)$?
The answer is yes, proved by Eberhard [Eb25].
@[category research solved, question, AMS 11, formal_proof using lean4 at
"https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos964.lean#L1559"]
theorem erdos_964 : Set.Ioi (0 : ℝ) ⊆ closure (tauRatio '' Set.Ici 1) := ⊢ Set.Ioi 0 ⊆ closure (tauRatio '' Set.Ici 1)
All goals completed! 🐙
Eberhard [Eb25] proved that the ratios $\tau(n+1)/\tau(n)$ attain every positive rational value
infinitely many times. Since the positive rationals are dense in $(0,\infty)$, this implies
erdos_964.
@[category research solved, AMS 11]
theorem erdos_964.variants.eberhard (q : ℚ) (hq : 0 < q) :
{n : ℕ | 0 < n ∧ tauRatio n = q}.Infinite := q:ℚhq:0 < q⊢ {n | 0 < n ∧ tauRatio n = ↑q}.Infinite
All goals completed! 🐙end Erdos964