/-
Copyright 2025 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.
-/
import FormalConjecturesUtilErdős Problem 897
[Ar25] Archivara Math Research Agent, An Additive Counterexample: Erdős Problem 897 (2025)
[ArWu25] Aristotle, operated mostly by L. Wu, Lean formalisation of Erdős problem 897 (2025)
[Wi70] E. Wirsing, A characterization of $\log n$ as an additive arithmetic function. Symposia Math. (1970), 45-57.
[Wi81] E. Wirsing, Additive and completely additive functions with restricted growth. Recent progress in analytic number theory, Vol. 2 (Durham, 1979), 231--280 (1981).
-- TODO(lezeau): add `ArithmeticFunction.IsAdditive` to `ForMathlib`
namespace Erdos897
Let $f(n)$ be an additive function (so that $f(ab)=f(a)+f(b)$ if $(a,b)=1$ such that $\limsup_{p,k} f(p^k) / \log(p^k) = ∞$. Is it true that $\limsup_n (f(n+1)−f(n))/ \log n = ∞$?
The answer is no; this follows from a construction of Wirsing [Wi81], rediscovered by Archivara [Ar25] and formalised in Lean by Aristotle [ArWu25].
@[category research solved, AMS 11, formal_proof using lean4 at
"https://github.com/plby/lean-proofs/blob/main/src/v4.24.0/ErdosProblems/Erdos897.lean"]
theorem erdos_897.parts.i : answer(False) ↔ ∀ (f : ℕ → ℝ),
(∀ᵉ (a > 0) (b > 0), a.Coprime b → f (a * b) = f a + f b) →
((Filter.atTop ⊓ Filter.principal {(p, k) : ℕ × ℕ | p.Prime}).limsup
(fun (p, k) => (f (p^k) / (p^k : ℝ).log : EReal)) = ⊤) →
Filter.atTop.limsup (fun (n : ℕ) => ((f (n+1) - f n) / (n : ℝ).log : EReal)) = ⊤ := ⊢ False ↔
∀ (f : ℕ → ℝ),
(∀ a > 0, ∀ b > 0, a.Coprime b → f (a * b) = f a + f b) →
Filter.limsup
(fun x =>
match x with
| (p, k) => ↑(f (p ^ k)) / ↑(Real.log (↑p ^ k)))
(Filter.atTop ⊓ Filter.principal {(p, k) | Nat.Prime p}) =
⊤ →
Filter.limsup (fun n => (↑(f (n + 1)) - ↑(f n)) / ↑(Real.log ↑n)) Filter.atTop = ⊤
All goals completed! 🐙
Let $f(n)$ be an additive function (so that $f(ab)=f(a)+f(b)$ if $(a,b)=1$) such that $\limsup_{p,k} f(p^k) / \log(p^k) = ∞$. Is it true that $\limsup_n f(n+1)/ f(n) = ∞$?
The answer is no; the same counterexample is formalised in Lean by Aristotle [ArWu25].
@[category research solved, AMS 11, formal_proof using lean4 at
"https://github.com/plby/lean-proofs/blob/main/src/v4.24.0/ErdosProblems/Erdos897.lean"]
theorem erdos_897.parts.ii : answer(False) ↔ ∀ (f : ℕ → ℝ),
(∀ᵉ (a > 0) (b > 0), a.Coprime b → f (a * b) = f a + f b) →
((Filter.atTop ⊓ Filter.principal {(p, k) : ℕ × ℕ | p.Prime}).limsup
(fun (p, k) => (f (p^k) / (p^k : ℝ).log : EReal)) = ⊤) →
Filter.atTop.limsup (fun (n : ℕ) => (f (n+1) / f n : EReal)) = ⊤ := ⊢ False ↔
∀ (f : ℕ → ℝ),
(∀ a > 0, ∀ b > 0, a.Coprime b → f (a * b) = f a + f b) →
Filter.limsup
(fun x =>
match x with
| (p, k) => ↑(f (p ^ k)) / ↑(Real.log (↑p ^ k)))
(Filter.atTop ⊓ Filter.principal {(p, k) | Nat.Prime p}) =
⊤ →
Filter.limsup (fun n => ↑(f (n + 1)) / ↑(f n)) Filter.atTop = ⊤
All goals completed! 🐙
Wirsing [Wi70] proved that if $|f(n+1)−f(n)| ≤ C$ then $f(n) = c \log n + O(1)$ for some constant $c$.
@[category research solved, AMS 11]
theorem erdos_897.variants.log_growth
(f : ℕ → ℝ)
(hf : ∀ᵉ (a > 0) (b > 0), a.Coprime b → f (a * b) = f a + f b)
(C : ℝ) (hf' : ∀ n, |f (n+1) - f n| ≤ C) :
∃ c, ∃ (O : ℕ → ℝ), O =O[Filter.atTop] (1 : ℕ → ℝ) ∧
∀ n, f n ≤ c*Real.log n + O n := f:ℕ → ℝhf:∀ a > 0, ∀ b > 0, a.Coprime b → f (a * b) = f a + f bC:ℝhf':∀ (n : ℕ), |f (n + 1) - f n| ≤ C⊢ ∃ c O, O =O[Filter.atTop] 1 ∧ ∀ (n : ℕ), f n ≤ c * Real.log ↑n + O n
All goals completed! 🐙
Let $f(n)$ be an additive function (so that $f(ab)=f(a)+f(b)$ if $(a,b)=1$) such that $\limsup_{p,k} f(p^k) / \log(p^k) = ∞$ and $f(p^k) = f(p)$ or $f(p^k) = kf(p)$. Is it true that $\limsup_n (f(n+1)−f(n))/ \log n = ∞$?
The known counterexample does not satisfy either of these extra hypotheses, so this variant remains open.
@[category research open, AMS 11]
theorem erdos_897.variants.parts.i : answer(sorry) ↔ ∀ (f : ℕ → ℝ),
(∀ᵉ (a > 0) (b > 0), a.Coprime b → f (a * b) = f a + f b) →
((Filter.atTop ⊓ Filter.principal {(p, k) : ℕ × ℕ | p.Prime}).limsup
(fun (p, k) => (f (p^k) / (p^k : ℝ).log : EReal)) = ⊤) →
(∀ k p, p.Prime → f (p^k) = f p) ∨ (∀ (k p : ℕ), p.Prime → f (p^k) = k*f p) →
Filter.atTop.limsup (fun (n : ℕ) => ((f (n+1) - f n) / (n : ℝ).log : EReal)) = ⊤ := ⊢ True ↔
∀ (f : ℕ → ℝ),
(∀ a > 0, ∀ b > 0, a.Coprime b → f (a * b) = f a + f b) →
Filter.limsup
(fun x =>
match x with
| (p, k) => ↑(f (p ^ k)) / ↑(Real.log (↑p ^ k)))
(Filter.atTop ⊓ Filter.principal {(p, k) | Nat.Prime p}) =
⊤ →
((∀ (k p : ℕ), Nat.Prime p → f (p ^ k) = f p) ∨ ∀ (k p : ℕ), Nat.Prime p → f (p ^ k) = ↑k * f p) →
Filter.limsup (fun n => (↑(f (n + 1)) - ↑(f n)) / ↑(Real.log ↑n)) Filter.atTop = ⊤
All goals completed! 🐙
Let $f(n)$ be an additive function (so that $f(ab)=f(a)+f(b)$ if $(a,b)=1$) such that $\limsup_{p,k} f(p^k) / \log(p^k) = ∞$ and $f(p^k) = f(p)$ or $f(p^k) = kf(p)$. Is it true that $\limsup_n f(n+1)/f(n) = ∞$?
The known counterexample does not satisfy either of these extra hypotheses, so this variant remains open.
@[category research open, AMS 11]
theorem erdos_897.variants.parts.ii : answer(sorry) ↔ ∀ (f : ℕ → ℝ),
(∀ᵉ (a > 0) (b > 0), a.Coprime b → f (a * b) = f a + f b) →
((Filter.atTop ⊓ Filter.principal {(p, k) : ℕ × ℕ | p.Prime}).limsup
(fun (p, k) => (f (p^k) / (p^k : ℝ).log : EReal)) = ⊤) →
(∀ k p, p.Prime → f (p^k) = f p) ∨ (∀ (k p : ℕ), p.Prime → f (p^k) = k*f p) →
Filter.atTop.limsup (fun (n : ℕ) => (f (n+1) / f n : EReal)) = ⊤ := ⊢ True ↔
∀ (f : ℕ → ℝ),
(∀ a > 0, ∀ b > 0, a.Coprime b → f (a * b) = f a + f b) →
Filter.limsup
(fun x =>
match x with
| (p, k) => ↑(f (p ^ k)) / ↑(Real.log (↑p ^ k)))
(Filter.atTop ⊓ Filter.principal {(p, k) | Nat.Prime p}) =
⊤ →
((∀ (k p : ℕ), Nat.Prime p → f (p ^ k) = f p) ∨ ∀ (k p : ℕ), Nat.Prime p → f (p ^ k) = ↑k * f p) →
Filter.limsup (fun n => ↑(f (n + 1)) / ↑(f n)) Filter.atTop = ⊤
All goals completed! 🐙
end Erdos897