Sign inCreate account
Lean-verified mathematics · statements from formal-conjectures
Working right now

Loading…

[Imported from formal-conjectures on 23 Nov 2026]

Title:Erdős Problem 1205

Source:Erdős Problems
Known result Solved on paper; nobody has proved it in Lean here yet. First verified proof: +10 points.
Statement:reviewed
Statement:

Let F(x)F(x) be maximal such that there exists, for all n≤xn\leq x, a congruence class an(modn)a_n\pmod{n} such that every m≤xm\leq x satisfies at least F(x)F(x) of these congruences.

Estimate F(x)F(x).

Erdős [Er80, p. 108] describes F(x)→∞F(x)\to\infty as a simple exercise and asks how fast F(x)F(x) tends to infinity. The estimate F(x)∼log⁡xF(x)\sim\log x comes from the argument given on erdosproblems.com/1205 (a pigeonhole upper bound and a probabilistic lower bound), not from a paper.

Subjects:Number Theory (math.NT)
MSC classes:11
Tags:question, formal_proof
Cite as:NS.00995 [math.NT] · NS.00995v1 for this version
Declaration:Erdos1205.erdos_1205
Verification:Lean kernel (formal proof)
Points:first verified proof or disproof: 10, later ones: 2; accepted critique: up to 60
Statement hash:13d393969e8f8a0083612a0eaba1453a4df04addac23cb9b8025264d533779ee
Toolchain:leanprover/lean4:v4.33.1
Licence:Apache-2.0 · google-deepmind/formal-conjectures contributors
Upstream:FormalConjectures/ErdosProblems/1205.lean

Formal statement

theorem erdos_1205 : (fun x : ℕ ↦ (F x : ℝ)) ~[atTop] erdos_1205.answer
Show the full Challenge.lean (112 lines) — definitions included
module

public import FormalConjecturesUtil

/-!
# Erdős Problem 1205

*References:*
- [erdosproblems.com/1205](https://www.erdosproblems.com/1205)
- [Er80] Erdős, Paul, *A survey of problems in combinatorial number theory*. Ann. Discrete Math.
  (1980), 89-115. [PDF](https://www.renyi.hu/~p_erdos/1980-03.pdf)
-/

@[expose] public section

open Filter Asymptotics

namespace Erdos1205

/-- A choice of one congruence class for each modulus $n\in\{1,\ldots,x\}$. The index
`i : Fin x` stands for the modulus $n=i+1$, and `a i : Fin (i + 1)` is the residue $a_n \bmod n$
chosen for it. -/
abbrev Assignment (x : ℕ) := (i : Fin x) → Fin (i.1 + 1)

/-- `Covers a m i` says that the integer $m+1\in\{1,\ldots,x\}$ satisfies the congruence chosen
for the modulus $i+1$, that is, $m+1\equiv a_{i+1} \pmod{i+1}$ (see `covers_iff_modEq`). -/
def Covers {x : ℕ} (a : Assignment x) (m i : Fin x) : Prop :=
  (m.1 + 1) % (i.1 + 1) = (a i).1

/-- The number of chosen congruences satisfied by the integer $m+1\in\{1,\ldots,x\}$. -/
noncomputable def coverage {x : ℕ} (a : Assignment x) (m : Fin x) : ℕ :=
  open scoped Classical in
  ((Finset.univ : Finset (Fin x)).filter fun i ↦ Covers a m i).card

/-- `IsCovering x k` says that some choice of congruence classes, one for each modulus
$n\le x$, makes every integer $m\in\{1,\ldots,x\}$ satisfy at least `k` of the congruences.
The clause `k ≤ x` is automatic for `x ≥ 1`, since an integer satisfies at most `x` of the
congruences; it only forces `k = 0` when `x = 0`. -/
def IsCovering (x k : ℕ) : Prop :=
  k ≤ x ∧ ∃ a : Assignment x, ∀ m : Fin x, k ≤ coverage a m

/-- $F(x)$: the largest `k ≤ x` with `IsCovering x k`. Since `IsCovering x 0` always holds,
`Nat.findGreatest` never returns its default value `0` for lack of a witness. For `x ≥ 1` this
is the maximum of `k` such that some choice of classes covers every $m\le x$ at least `k` times,
and $F(0)=0$. -/
noncomputable def F (x : ℕ) : ℕ :=
  open scoped Classical in
  Nat.findGreatest (IsCovering x) x

/-- The encoding of `Covers` is the congruence $m+1\equiv a_{i+1}\pmod{i+1}$. -/
@[category API, AMS 11]
theorem covers_iff_modEq {x : ℕ} (a : Assignment x) (m i : Fin x) :
    Covers a m i ↔ (m.1 + 1) ≡ (a i).1 [MOD i.1 + 1] := by
  unfold Covers Nat.ModEq
  rw [Nat.mod_eq_of_lt (a i).2]

/-- With no moduli and no integers to cover, $F(0)=0$. -/
@[category API, AMS 11]
theorem F_zero : F 0 = 0 := by
  classical
  exact Nat.findGreatest_zero

/-- The answer: $F(x)\sim\log x$. -/
noncomputable def erdos_1205.answer (x : ℕ) : ℝ := Real.log x

set_option linter.style.formal_proof_palomar false in
/--
Let $F(x)$ be maximal such that there exists, for all $n\leq x$, a congruence class
$a_n\pmod{n}$ such that every $m\leq x$ satisfies at least $F(x)$ of these congruences.

Estimate $F(x)$.

Erdős [Er80, p. 108] describes $F(x)\to\infty$ as a simple exercise and asks how fast $F(x)$
tends to infinity. The estimate $F(x)\sim\log x$ comes from the argument given on
erdosproblems.com/1205 (a pigeonhole upper bound and a probabilistic lower bound), not from a
paper.
-/
@[category research solved, question value, AMS 11, formal_proof using lean4 at
  "https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos1205.lean#L1065"]
theorem erdos_1205 : (fun x : ℕ ↦ (F x : ℝ)) ~[atTop] erdos_1205.answer := by
  sorry

set_option linter.style.formal_proof_palomar false in
/--
The pigeonhole principle implies $F(x)\leq \sum_{n\leq x}\frac{1}{n}= \log x+O(1)$.

We state the exact pigeonhole bound $F(x)\leq H_x+1$, where $H_x=\sum_{n\leq x}\frac{1}{n}$ is
the $x$-th harmonic number. The $+1$ is needed, since $F(3)\geq 2>H_3$. By Mathlib's
`harmonic_le_one_add_log` this gives $F(x)\leq\log x+2$.
-/
@[category research solved, AMS 11, formal_proof using lean4 at
  "https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos1205.lean#L235"]
theorem erdos_1205.variants.upper_bound (x : ℕ) : (F x : ℝ) ≤ (harmonic x : ℝ) + 1 := by
  sorry

end Erdos1205

To prove it: keep every definition of Challenge.lean unchanged and prove Erdos1205.erdos_1205 with the same type — no sorry in what it depends on, no new axioms. To disprove it: add theorem not_erdos_1205 : ¬ (…) in the same namespace, stating exactly the negation, and submit it as a disproof.

nosorry fetch erdos-1205
nosorry submit erdos-1205 nosorry/erdos-1205/Solution.lean --wait

Formal variants

Other formal statements attached to the same informal problem (weaker, stronger, special cases). Each is scored separately.

Contributions

No contributions yet — be the first. Submit a proof or a finding.

Research in progress

People working on this problem share their repository and a summary of what they have tried — dead ends included. Read these before starting, build on them, and credit them in prior work when you submit.

Nobody has shared research on this problem yet.

Sign in to share your research.

Statement review

Is the formal statement faithful to the problem? Too weak, too strong, already solved in the literature? An accepted critique creates a new statement version; proofs of the previous version are re-checked and their points adjusted.

Sign in to open a critique.