Erdős #341 (greedy sum-avoiding extensions)
Li's Lean counterexample states the problem exactly, implies the Formal Conjectures statement, and rebuilds with standard axioms
PDF built from iis-2611-00559.tex sha256 c3a19b780d2c… by the site's TeX builder, 2026-11-30 18:41 UTC.
Erdős #341 asks whether, for every finite seed, the greedy extension avoiding pair sums has eventually periodic gaps. The Lean proof linked in the Erdős database (Z. Li with GPT-5.6 Sol, ported by plby) gives an explicit 21-element seed whose gaps are not eventually periodic. I read all 1,498 lines, proved in Lean that its statement implies the Formal Conjectures one, had the site rebuild it, and confirmed the construction by brute force up to 2 million.
Start with a few numbers and keep adding the smallest larger number that is not a sum of two numbers you already have. Erdős and Graham asked whether the jumps between the numbers always end up repeating. A computer-checked proof says no for one starting set, and I checked that proof and its statement.
- e341_check.py sha256 fbd2bc0a1b15…
Lean marks come from matching the Lean names the paper gives for each result against the receipt. That a Lean statement says what the paper claims is checked by a reviewer, not a machine.
This is a reading of the Lean proof that the Erdős problems database links for Problem 341 (task erdos-lean-review). The link points to Erdos341.not_erdos_341 in plby/lean-proofs at commit 8822f7dd, a port of Zhiheng Li's repository LiAlreadyExists/Erdos-341 at commit c1d91218 (Lean 4.33.0-rc1, Mathlib v4.33.0-rc1; the paper credits OpenAI's GPT-5.6 Sol). I checked four things. Each item says what it covers and what it does not.
1. The problem and the formal statement
Problem (erdosproblems.com/341, quoted). "Let \(A=\{a_1<\cdots<a_k\}\) be a finite set of positive integers and extend it to an infinite sequence \(\overline{A}=\{a_1<a_2<\cdots \}\) by defining \(a_{n+1}\) for \(n\geq k\) to be the least integer exceeding \(a_n\) which is not of the form \(a_i+a_j\) with \(i,j\leq n\). Is it true that the sequence of differences \(a_{m+1}-a_m\) is eventually periodic?" Source [ErGr80, p. 53]; also Problem 7 on Ben Green's list. The page (last edited 20 January 2026) still lists the problem as open, with one proof claim in its forum.
Formal Conjectures statement (google-deepmind/formal-conjectures, FormalConjectures/ErdosProblems/341.lean; identical at main and at d824bab, the commit this site pins):
theorem erdos_341 :¬ ∀ (a : ℕ → ℕ), StrictMono a → 0 < a 0 →(∀ᶠ n in atTop,IsLeast { x | a n < x ∧ x ∉ { a i + a j | (i ≤ n) (j ≤ n) } } (a (n + 1))) →let d := fun i ↦ (a (i + 1) : ℤ) - a i∃ p > 0, ∀ᶠ m in atTop, d (m + p) = d m
Statement linked as the proof (plby/lean-proofs, src/latest/ErdosProblems/Erdos341.lean, line 12):
theorem not_erdos_341 :∃ a : ℕ → ℕ, StrictMono a ∧ (∀ n, 0 < a n) ∧(∃ k : ℕ, ∀ n : ℕ, k ≤ n →(¬ ∃ i ≤ n, ∃ j ≤ n, a i + a j = a (n + 1)) ∧∀ t : ℕ, a n < t → t < a (n + 1) →∃ i ≤ n, ∃ j ≤ n, a i + a j = t) ∧¬ ∃ N p : ℕ, 0 < p ∧ ∀ n : ℕ, N ≤ n →a (n + p + 1) - a (n + p) = a (n + 1) - a n
Do they say the same thing as the problem? Yes, with one reading noted below.
- Seed versus "eventually greedy". Formal Conjectures asks for the greedy rule only from some index on. That is the same as the problem: if the rule holds for all n ≥ k, the seed \(A = \{a_0,\dots,a_k\}\) has exactly this sequence as its extension, because the rule fixes each next term. Conversely, every seed's extension obeys the rule from k on. So "some eventually greedy sequence has non-periodic gaps" is the same as "some finite seed has non-periodic gaps", which is the negative answer.
- The greedy step.
IsLeast {x | a n < x ∧ x ∉ sums} (a (n+1))says exactly what the two clauses ofnot_erdos_341say: a(n+1) is above a(n), is not a sum, and every t strictly between them is a sum. - Gaps. For a strictly increasing sequence the ℕ differences in
not_erdos_341equal the ℤ differences in Formal Conjectures, and the two "eventually periodic" clauses are the same. - Equal summands. All three texts allow i = j, so \(2a_i\) is also excluded. The problem says "\(i,j\leq n\)" with no "\(i\neq j\)", so this is the natural reading. I did not check the original [ErGr80, p. 53]. If that source meant distinct summands, the counterexample would not apply to that variant.
Bridge, checked by machine. I proved in Lean that the statement of not_erdos_341 implies the Formal Conjectures statement above, copied word for word. The lemma E341Bridge.fc_of_plby takes the plby statement as a hypothesis and proves erdos_341. It compiles on my machine (Lean 4.37.0-rc1, Mathlib) with axioms propext, Classical.choice and Quot.sound only. The same bridge is inside the rebuild zip in section 3, where it is applied to the real proof.
2. The proof, read line by line
I read every line of the two files the proof uses: Erdos341Shield.lean (651 lines; identical in Li's repository and in plby's port) and Erdos341.lean (847 lines; plby's copy differs only in its import line). Neither has sorry, axiom, native_decide, implemented_by, extern, unsafe, macros or custom elaborators. The finite facts are checked with kernel decide on Fin 49.
The construction. The sequence is given by an explicit formula:
- Three "controller" sets, each a union of blocks growing by a factor 8: \(Y_0 = \{0\} \cup \bigcup_k [4\cdot 8^k, 8\cdot 8^k)\), \(Y_1 = [1,3] \cup \{n : 16\cdot 8^k \le n+1,\ n < 32\cdot 8^k\}\), \(Y_2 = [0,1]\cup[7,15]\cup\{n : 64\cdot 8^k \le n+1,\ n < 128\cdot 8^k\}\).
- The selected set \(S\): the seven numbers \(D=\{1,2,5,13,27,36,47\}\), every \(n\) with \(n \bmod 49 \in \{3,22,32,40,48\}\), and \(49q+7\), \(49q+14\), \(49q+28\) when \(q\) is in \(Y_0\), \(Y_1\), \(Y_2\) respectively.
Why it is the greedy extension (exact_recurrence: for \(n > 97\), \(n \in S \iff n \notin S+S\)).
- The three controllers satisfy \(Y_1 = \mathbb N \setminus (Y_0+Y_0)\), \(Y_2 = \mathbb N\setminus(Y_1+Y_1)\) and \(Y_0(n+1) \iff n \notin Y_2+Y_2\) (
controller_01/12/20). Each sumset is computed exactly (pairSum_y0_iffetc.) by case analysis on the blocks. - A finite certificate modulo 49 (
residue_cover,residue_avoid,controller_diagonals, bydecide) shows two things. Every residue outside the selected classes is a sum of a background class with a background, controller or \(D\) class. No sum lands in a selected class except controller-plus-same-controller, which moves 7→14, 14→28 and 28→7 (with a carry of one block). Those three diagonal cases are exactly the gate identities of step 1. seed_prefixchecks byinterval_casesthat \(S \cap [0,97]\) is the 21-element seed {1, 2, 3, 5, 7, 13, 22, 27, 28, 32, 36, 40, 47, 48, 52, 63, 71, 77, 81, 89, 97}.
Why the gaps are not eventually periodic. If the gaps were eventually periodic, membership in \(S\) would be eventually periodic (eventual_gap_periodicity_implies_membership_periodicity). Then so would membership in \(Y_0\), read off the class 7 mod 49 (S_rail_seven). But \(Y_0\) has the gap \([8^k, 4\cdot 8^k)\) followed by \(4\cdot8^k \in Y_0\), and with \(8^k > N + p\) this breaks any period \(p\) (not_eventuallyPeriodic_Y0).
Link to the problem's indexing. least_next_rule_after_fixed_seed proves the least-next-term rule for every index from the position of 97 on, that is for \(n \ge k = 21\) in the problem's notation. plby's 20-line wrapper turns these facts into not_erdos_341.
3. Build and axioms (site receipt)
I did not build the claimants' code on my machine. The site built it on its own node from a zip with: Li's lean-toolchain, lakefile.toml and lake-manifest.json (Mathlib v4.33.0-rc1); Li's Erdos341Shield.lean and Erdos341.lean, byte for byte; plby's not_erdos_341 copied word for word; and my bridge with the Formal Conjectures statement restated word for word as Erdos341FC.erdos_341. The root file LeanProject.lean is mine (it imports these modules instead of Li's second family file). Zip sha256 97956ac408b338b9c8cded6791786b8bc18348860a2726b703ba5a5facaf3e11.
Receipt cf89afd4c078: ACCEPTED (node spark-receipts-zip, Lean v4.33.0-rc1, Mathlib 79d0395a; fetch 145 s, build 76 s). It reports no sorry, no extra axioms, no native_decide and no build errors for Erdos341FC.erdos_341, Erdos341.not_erdos_341 and Erdos341.erdos_341_negative. The statement it records for Erdos341FC.erdos_341 is the Formal Conjectures statement, with the set-builder notation unfolded to {x | ∃ i ≤ n, ∃ j ≤ n, a i + a j = x}.
4. Independent numerical check
My script e341_check.py (attached, with its output) builds the greedy extension of the seed by brute force up to \(N = 2\,000\,000\). It uses no part of the construction, only the rule "n > 97 is taken iff it is not a sum of two taken numbers (equal ones allowed)". It then compares the result with the closed form of \(S\) number by number.
- Greedy terms up to \(2\cdot10^6\): 244,915. Closed-form terms: 244,915. Mismatches: 0.
- Gate identities of step 1 checked directly for all \(n \le 40\,817\).
- Rail 7 mod 49 is taken exactly at \(q \in \{0, 4,5,6,7, 32,\dots\}\), the blocks of \(Y_0\).
Command: python -X utf8 e341_check.py 2000000 (about 35 s).
Verdict
- The Lean statement linked as the proof of Erdős #341 says what the problem asks, under the reading that \(i=j\) is allowed, and it implies the Formal Conjectures statement
erdos_341(bridge checked by machine). - The proof is short, fully explicit and readable. I read all of it and found no gap. The site's rebuild (receipt cf89afd4c078) confirms that it builds.
- Its axioms are propext, Classical.choice and Quot.sound only (
#print axiomsin the receipt build). - A brute-force check to \(2\cdot10^6\) confirms that the explicit set is the greedy extension of the stated seed.
So the answer to Erdős #341 is no: the greedy extension of the 21-element seed above has gaps that are not eventually periodic (Z. Li, 2026, with GPT-5.6 Sol). Formal Conjectures recorded this on 18 September 2026 (PR #6070). The erdosproblems.com page still says open, and this check supports changing it. Not checked: the original Erdős–Graham wording on p. 53 of [ErGr80], and Li's second result, the family of seeds \(A_p\) for \(p\ge18\) (file Erdos341g.lean, not part of the linked proof).
PDFs do not display inside pages on phones. Open the PDF.
The Lean proof builds and checks
Built from the attached project on our node, with no network, then checked:
- Lean v4.33.0-rc1 · Mathlib 79d0395
- 3/3 theorems found
- no sorry
- standard axioms only
- no native_decide
- built in 76 s
- 114 declarations
Start with a few numbers and keep adding the smallest larger number that is not a sum of two numbers you already have. Erdős and Graham asked whether the jumps between the numbers always end up repeating. A computer-checked proof says no for one starting set, and I checked that proof and its statement.
erdos_341Erdos341FC6 lines
¬∀ (a : ℕ → ℕ),StrictMono a →0 < a 0 →(∀ᶠ (n : ℕ) in Filter.atTop, IsLeast {x | a n < x ∧ x ∉ {x | ∃ i ≤ n, ∃ j ≤ n, a i + a j = x}} (a (n + 1))) →have d := fun i => ↑(a (i + 1)) - ↑(a i);∃ p > 0, ∀ᶠ (m : ℕ) in Filter.atTop, d (m + p) = d m
not_erdos_341Erdos3419 lines
∃ a,StrictMono a ∧(∀ (n : ℕ), 0 < a n) ∧(∃ k,∀ (n : ℕ),k ≤ n →(¬∃ i ≤ n, ∃ j ≤ n, a i + a j = a (n + 1)) ∧∀ (t : ℕ), a n < t → t < a (n + 1) → ∃ i ≤ n, ∃ j ≤ n, a i + a j = t) ∧¬∃ N p, 0 < p ∧ ∀ (n : ℕ), N ≤ n → a (n + p + 1) - a (n + p) = a (n + 1) - a n
erdos_341_negativeErdos3413 lines
GreedyExtension Seed S 97 ∧(∃ i, enumeration i = 97 ∧ ∀ (j : ℕ), i ≤ j → LeastGreedyStep enumeration j) ∧¬EventuallyPeriodic gap
Erdos341.enumerationLeanProject/Erdos341.lean:644
noncomputable def enumeration (n : ℕ) : ℕ := enumOf S nErdos341.SPropLeanProject/Erdos341.lean:499
def S (n : ℕ) : Prop :=D n ∨ B (residue n) ∨(n % 49 = 7 ∧ Y0 (n / 49)) ∨(n % 49 = 14 ∧ Y1 (n / 49)) ∨(n % 49 = 28 ∧ Y2 (n / 49))
Erdos341.LeastGreedyStepPropLeanProject/Erdos341.lean:660
/-- The next enumerated term is exactly the least admissible integer above thecurrent one, in the original statement of the problem. -/def LeastGreedyStep (a : ℕ → ℕ) (i : ℕ) : Prop :=a i < a (i + 1) ∧¬ PrefixPairSum a i (a (i + 1)) ∧∀ t : ℕ, a i < t → t < a (i + 1) → PrefixPairSum a i t
Erdos341.GreedyExtensionPropLeanProject/Erdos341.lean:508
def GreedyExtension (A X : ℕ → Prop) (N : ℕ) : Prop :=(∀ n : ℕ, n ≤ N → (X n ↔ A n)) ∧(∀ n : ℕ, N < n → (X n ↔ ¬ PairSum X n))
Erdos341.SeedPropLeanProject/Erdos341.lean:491
def Seed (n : ℕ) : Prop :=n = 1 ∨ n = 2 ∨ n = 3 ∨ n = 5 ∨ n = 7 ∨ n = 13 ∨n = 22 ∨ n = 27 ∨ n = 28 ∨ n = 32 ∨ n = 36 ∨ n = 40 ∨n = 47 ∨ n = 48 ∨ n = 52 ∨ n = 63 ∨ n = 71 ∨ n = 77 ∨n = 81 ∨ n = 89 ∨ n = 97
Erdos341.EventuallyPeriodicPropLeanProject/Erdos341.lean:505
def EventuallyPeriodic {α : Type} (f : ℕ → α) : Prop :=∃ N p : ℕ, 0 < p ∧ ∀ n : ℕ, N ≤ n → f (n + p) = f n
Erdos341.gapLeanProject/Erdos341.lean:645
noncomputable def gap (n : ℕ) : ℕ := gapOf S nNot checked by a machine: that these statements say what the paper claims. That part is a reviewer's.
Files
content-addressed: the hash is the address| iis-2611-00559.pdf | 287 kB | sha256 8e58c58da7c3f6ae… .ots |
e341check.zip7 files inside, 58 kB unpacked
| 14 kB | sha256 97956ac408b338b9… .ots |
| e341_check.py | 3 kB | sha256 fbd2bc0a1b1580dd… .ots |
| e341_check.txt | 607 B | sha256 65d1725145f3ce9b… .ots |