/- 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 FormalConjecturesUtil

Erdős Problem 945

References:

    erdosproblems.com/945

    [ErMi52] Erdős, P. and Mirsky, L., The distribution of values of the divisor function {$d(n)$}. Proc. London Math. Soc. (3) (1952), 257--271.

open Filter Real namespace Erdos945 abbrev τ := fun (n : ) => n.divisors.card

Let $F(x)$ be the maximal $k$ such that there exist $n+1, \dots, n+k \le x$ with $τ(n+1), \dots, τ(n+k)$ all distinct, where $τ(m)$ counts the divisors of $m$.

noncomputable def F (x : ) : := sSup {k | (n : ), n + k x (Set.Ioc n (n + k)).InjOn τ} -- Implementation note: we define a Prop here and below to be able to easily formulate -- the equivalence between the two variants. Because the theorems require `answer(sorry)` we -- can't handle this with `type_of%`. def Erdos945Prop : Prop := O : , O =O[atTop] (1 : ) ∀ᶠ x in atTop, F x log x ^ O x

Is it true that $F(x) \leq (\log x)^{O(1)}$?

@[category research open, AMS 11] theorem declaration uses 'sorry'erdos_945 : answer(sorry) Erdos945Prop := True Erdos945Prop All goals completed! 🐙 def Erdos945Constant : Prop := C > (0 : ), ∀ᶠ x : in atTop, a b : , a b a Set.Icc x (x + log x ^ C) b Set.Icc x (x + log x ^ C) τ a = τ b

Is there a constant $C > 0$ such that, for all large $x$, every interval $[x, x+(\log x)C]$ contains two integers with the same number of divisors?

@[category research open, AMS 11] theorem declaration uses 'sorry'erdos_945.variants.constant : answer(sorry) Erdos945Constant := True Erdos945Constant All goals completed! 🐙

The two ways of phrasing the conjecture are equivalent.

@[category textbook, AMS 11] theorem declaration uses 'sorry'erdos_945.variants.equivalence : Erdos945Prop Erdos945Constant := Erdos945Prop Erdos945Constant All goals completed! 🐙

Erdős and Mirsky [ErMi52] proved that $\frac{(\log x)^{1/2}}{\log\log x}\ll F(x)$.

@[category research solved, AMS 11] theorem declaration uses 'sorry'erdos_945.variants.lower_bound : (fun (x : ) => (log x).sqrt /(log x).log) =O[atTop] fun (n : ) => (F n : ) := (fun x => (log x) / log (log x)) =O[atTop] fun n => (F n) All goals completed! 🐙

Erdős and Mirsky [ErMi52] proved that $\log F(x) \ll \frac{(\log x)^{1/2}}$.

@[category research solved, AMS 11] theorem declaration uses 'sorry'erdos_945.variants.upper_bound : (fun (n : ) => (F n : ).log) =O[atTop] fun (x : ) => (log x).sqrt /(log x).log := (fun n => log (F n)) =O[atTop] fun x => (log x) / log (log x) All goals completed! 🐙 -- TODO(firsching): add observations what follows from Cramér's conjecture and if every sufficient -- interval contains a squarefree number. end Erdos945