Show full file and definitions
/-
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 FormalConjecturesUtil
/-!
# Erdős Problem 1063
*References:*
* [erdosproblems.com/1063](https://www.erdosproblems.com/1063)
* [ErSe83] Erdos, P. and Selfridge, J. L., Problem 6447. Amer. Math. Monthly (1983), 710.
* [Gu04] Guy, Richard K., _Unsolved problems in number theory_. (2004), Problem B31.
* [Mo85] Monier, Jean-Marie, _Problems and Solutions: Solutions of Advanced Problems: 6447_.
Amer. Math. Monthly **92** (1985), 435-436.
* [Ku+26] Kung, P.-N., Song, L., Hwang, D., Yoon, J., Li, C.-L., Severini, S., Olšák, M.,
Lockhart, E., Le, Q. V., Gokturk, B., Luong, T., Pfister, T., & Peng, N. (2026). _LEAP:
Supercharging LLMs for Formal Mathematics with Agentic Frameworks_.
[arXiv:2606.03303](https://arxiv.org/abs/2606.03303).
-/
@[expose] public section
open Filter Real
open scoped Nat Topology
namespace Erdos1063
/--
Let $n_k$ be the least $n \ge 2k$ such that all but one of the integers $n - i$ with
$0 \le i < k$ divide $\binom{n}{k}$.
-/
noncomputable def n (k : ℕ) : ℕ :=
sInf {m | 2 * k ≤ m ∧ ∃ i0 < k, ¬ (m - i0) ∣ m.choose k ∧
∀ i < k, i ≠ i0 → (m - i) ∣ m.choose k}
def erdos_1063.better_upper.answer : ℕ → ℝ := sorry
/--
Estimate $n_k$ by finding a better upper bound than Cambie's
$n_k \leq k \cdot \operatorname{lcm}(1, \dotsc, k-1)$.
The comparator takes its least common multiple in `ℕ` and casts the result. Writing the
ascription as `((… ).lcm (fun n : ℕ => n) : ℝ)` instead puts it on the `Finset.lcm`
application, so the coercion lands on `n` and the `lcm` is taken in `ℝ`, where `lcm` of
non-zero elements is `1` and the whole comparator collapses to `k`. -/
@[category research open, question value, AMS 11]
theorem erdos_1063.better_upper :
(fun k => (n k : ℝ)) =O[atTop] erdos_1063.better_upper.answer ∧
erdos_1063.better_upper.answer =o[atTop] fun k =>
(k : ℝ) * (((Finset.Icc 1 (k - 1)).lcm id : ℕ) : ℝ) := by
sorry
set_option linter.style.formal_proof_palomar false in
/--
An improved upper bound
$n_k \ll \exp\left(\frac{k}{\log k}(\log \log k + \log \log \log k + \log 2)\right)$,
which is $o\bigl(k \cdot \operatorname{lcm}(1, \dotsc, k - 1)\bigr)$, was formally proved in
Lean 4 by the LEAP prover agent [Ku+26] (see the linked `formal_proof`).
This is an improvement over another upper bound propsed [here](https://github.com/pw/erdos1063-upper-bound/blob/a28481f5b4bda374086533397269c5b550c759b8/README.md).
-/
@[category research solved, AMS 11,
formal_proof using formal_conjectures at
"https://github.com/lfsong-google/formal-conjectures/blob/ff33e501bb78a90ae4703e22e052f8bb38e10146/FormalConjectures/ErdosProblems/1063.lean#L5524"]
theorem erdos_1063.variants.subexponential_upper_bound :
let upper_bound : ℕ → ℝ := fun k =>
Real.exp ((k : ℝ) / Real.log k *
(Real.log (Real.log k) + Real.log (Real.log (Real.log k)) + Real.log 2))
(fun k => (n k : ℝ)) =O[atTop] upper_bound ∧
upper_bound =o[atTop] fun k =>
(k : ℝ) * (((Finset.Icc 1 (k - 1)).lcm id : ℕ) : ℝ) := by
sorry
set_option linter.style.formal_proof_palomar false in
/--
Erdős and Selfridge noted that, for $n \ge 2k$ with $k \ge 2$, at least one of the numbers
$n - i$ for $0 \le i < k$ fails to divide $\binom{n}{k}$ ([ErSe83]).
-/
@[category research solved, AMS 11,
formal_proof using formal_conjectures at
"https://github.com/lfsong-google/formal-conjectures/blob/ff33e501bb78a90ae4703e22e052f8bb38e10146/FormalConjectures/ErdosProblems/1063.lean#L5533"]
theorem erdos_1063.variants.exists_exception {n k : ℕ} (hk : 2 ≤ k) (h : 2 * k ≤ n) :
∃ i < k, ¬ (n - i) ∣ n.choose k := by
sorry
/-- The initial values satisfy $n_2 = 4$, $n_3 = 6$, $n_4 = 9$, and $n_5 = 12$ ([Gu04], Problem B31). -/
@[category research solved, AMS 11]
theorem erdos_1063.variants.small_values :
n 2 = 4 ∧ n 3 = 6 ∧ n 4 = 9 ∧ n 5 = 12 := by
refine ⟨?_, ?_, ?_, ?_⟩
· -- n 2 = 4 : every element of the set is ≥ 2 * 2 = 4, and 4 itself lies in the set
apply le_antisymm
· exact Nat.sInf_le (by decide)
· apply le_csInf ⟨4, by decide⟩
rintro b hb
have : 2 * 2 ≤ b := hb.1
omega
· -- n 3 = 6
apply le_antisymm
· exact Nat.sInf_le (by decide)
· apply le_csInf ⟨6, by decide⟩
rintro b hb
have : 2 * 3 ≤ b := hb.1
omega
· -- n 4 = 9 : the only candidate below 9 is m = 8, where both 8 and 6 fail to divide C(8,4) = 70
apply le_antisymm
· exact Nat.sInf_le (by decide)
· apply le_csInf ⟨9, by decide⟩
rintro b hb
have hb8 : 8 ≤ b := by have := hb.1; omega
by_contra! h
interval_cases b
· exact absurd hb (by decide)
· -- n 5 = 12 : the candidates below 12 are m = 10, 11, both of which fail
apply le_antisymm
· exact Nat.sInf_le (by decide)
· apply le_csInf ⟨12, by decide⟩
rintro b hb
have hb10 : 10 ≤ b := by have := hb.1; omega
by_contra! h
interval_cases b
· exact absurd hb (by decide)
· exact absurd hb (by decide)
set_option linter.style.formal_proof_palomar false in
/-- Monier observed that $n_k \le k!$ for $k \ge 3$ ([Mo85]), since $\binom{k!}{k}$ is divisible
by $k! - i$ for $1 \le i < k$.
The hypothesis `3 ≤ k` is necessary. At $k = 2$ the bound is false: $n_2 = 4$ and $2! = 2$. -/
@[category research solved, AMS 11,
formal_proof using formal_conjectures at
"https://github.com/lfsong-google/formal-conjectures/blob/ff33e501bb78a90ae4703e22e052f8bb38e10146/FormalConjectures/ErdosProblems/1063.lean#L5537"]
theorem erdos_1063.variants.monier_upper_bound {k : ℕ} (hk : 3 ≤ k) :
n k ≤ k ! := by
sorry
set_option linter.style.formal_proof_palomar false in
/-- [Cambie observed](https://www.erdosproblems.com/1063) the improved bound
$n_k \le k \cdot \operatorname{lcm}(1, \dotsc, k - 1)$.
The hypothesis `3 ≤ k` is necessary here too. At $k = 2$ the right hand side is
$2 \cdot \operatorname{lcm}(1) = 2$, while $n_2 = 4$.
The source writes the bound as $k[2, 3, \dotsc, k-1]$. That agrees with the range used here,
because including $1$ does not change a least common multiple. -/
@[category research solved, AMS 11,
formal_proof using formal_conjectures at
"https://github.com/lfsong-google/formal-conjectures/blob/ff33e501bb78a90ae4703e22e052f8bb38e10146/FormalConjectures/ErdosProblems/1063.lean#L5541"]
theorem erdos_1063.variants.cambie_upper_bound {k : ℕ} (hk : 3 ≤ k) :
n k ≤ k * (Finset.Icc 1 (k - 1)).lcm id := by
sorry
set_option linter.style.formal_proof_palomar false in
/-- The least common multiple bound implies $n_k \le \exp((1 + o(1))k)$. -/
@[category research solved, AMS 11,
formal_proof using formal_conjectures at
"https://github.com/lfsong-google/formal-conjectures/blob/ff33e501bb78a90ae4703e22e052f8bb38e10146/FormalConjectures/ErdosProblems/1063.lean#L5545"]
theorem erdos_1063.variants.exp_upper_bound :
∃ f : ℕ → ℝ, Tendsto f atTop (𝓝 0) ∧
∀ k, (n k : ℝ) ≤ exp ((1 + f k) * k) := by
sorry
end Erdos1063