William Booth-Clibborn

Improvements to the Diagonal Ramsey Upper Bound

Paper GitHub

We present a world record - a significant improvement to a famous unsolved problem in math proposed by Paul Erdős in 1935. This was achieved by a swarm of AI agents working on it together over a weekend hackathon, and our result is verified in Lean. Our result does not in any way depend on the recent manuscripts published by OpenAI.

We’ll release details on the 14 open problems we solved in the same hackathon next week.

Best known c in R(k,k) ≤ c^k over time: Erdős & Szekeres (1935) 4.0, Campos et al. (2023) 3.993, Gupta et al. (2024) 3.8, Lu & Wang (2026) 3.695, Ours (2026) 3.498.

The Diagonal Ramsey Problem

The problem in question is the diagonal Ramsey numbers. Take a set of points, connect every pair with a line, and colour each line red or blue. The Ramsey number is the smallest number of points at which every possible colouring is forced to contain a shape drawn in a single colour, with every corner of the shape joined to every other.

For a triangle, that number is six. After that, exact answers quickly become impossible to compute: the number of possible colourings explodes so fast that by the pentagon, checking them all would take more steps than there are atoms in the universe. The answer for the triangle and the square is known, but even the pentagon remains unsolved. So instead of exact answers, mathematicians ask how fast the number of points grows as the shapes get bigger.

In 1935, Erdős and Szekeres showed that each new shape needs at most about four times as many points as the one before, which stood for 88 years.

Result

Our proof builds on a method introduced in 2023 by Campos, Griffiths, Morris and Sahasrabudhe, the first to beat Erdős and Szekeres’s 1935 bound. Their approach narrows a large network down to smaller groups step by step. Gupta, Ndiaye, Norin and Wei tuned this method to reach 3.8ᵏ, and Lu and Wang 2026 refined it further to reach 3.695ᵏ. Our agents describe their new techniques as follows:

  1. Row-moment potential. Every proof in this line so far scored a group by its average number of connections. We gave extra weight to the most strongly connected members instead, which reveals progress that an average hides, and this one change accounts for most of our gain.
  2. Fractional row weight. The score multiplies together the sizes of two groups, and earlier proofs counted both at full weight. We count one of them only partly, so shrinking that group costs less and the search can take larger steps without losing ground.
  3. Self-improving feedback bank. The method also relies on a list of already-proven results about lopsided versions of the problem, which Lu and Wang supplied and kept fixed; they also showed that a fixed list can never get much below 3.69ᵏ. Our method improves some of those results, so we put the improved versions back into the list and reuse them, round after round, with a computer checking every step exactly.
Proven bound c in R(k,k) ≤ c^k over 33 hours, falling from Lu & Wang's 3.695 to a certified 3.4986, with steps for row-moment potential, fractional row weight, four refinements, and the self-improving feedback bank.

We verified our result is correct with Formal Verification, a technique that converts our math proof into a logical programming language called Lean. This offers us the guarantee that our mathematical reasoning is correct and not hallucinated. However, the problem may have been incorrectly translated by our Agents, as humans have not reviewed this, which is the main risk to this solutions correctness. However, this risk is mitigated as we build on prior work that formalised the same problem.

The proof is exceptionally large at 5M lines of Lean, second only to Anthropic’s Fermat’s Last Theorem project and larger than any of the proofs in OpenAI’s recent release. This is because we perform a grid search over 100k+ possible values and each of these values is a single Lean file. We heavily relied on Lu-Wang’s project that provided a scaffold to build on.

Engineering

We created an auto-researcher that combined several models, harnesses, tools, and indexes to accelerate mathematical discovery. The agents were instructed to contribute ideas, mathematically prove them, critique each other's work, and formally the most promising approaches in Lean.

The agents were predominantly orchestrated by Devin with GPT-6 Astra and Claude Opus 5.5. Although, as our agents were decentralised, several other agent harnesses were collaborating and communicating with each other including CodeX, ClaudeCode, and cursor.

Timeline from 3 to 7 October: accepted results by direction, lemmas accepted, and number of active agents, with grey bands for agent downtime and the unattended AWS Lean build.

Most ideas were rejected quickly, however there were significant resources spent on a long tail of several rejected long running ideas.

Number of ideas by time to investigate, split into accepted, rejected and unfinished: 126 took under 15 minutes (67% accepted, 25% rejected, 7% unfinished), then 30, 19, 8, 8, 5 and 3 for longer durations.

The Lean check took 4 hours on a r7a.24xlarge with 96 CPU cores and 768GB of memory. There’s certainly utilisation and Lean line length improvements that could reduce the resources required to formally verify this finding.

Memory and CPU use during the Lean build on 6 October 2026: memory peaks at 554 GB of 739 GB installed, all 96 cores stay busy from about 19:00 to 22:00, and all 82,143 modules pass.

References

  1. F. P. Ramsey, “On a problem of formal logic,” Proc. London Math. Soc. (2) 30 (1930), 264–286.
  2. P. Erdős and G. Szekeres, “A combinatorial problem in geometry,” Compositio Math. 2 (1935), 463–470.
  3. S. P. Radziszowski, “Small Ramsey numbers,” Electron. J. Combin., Dynamic Survey DS1.
  4. M. Campos, S. Griffiths, R. Morris and J. Sahasrabudhe, “An exponential improvement for diagonal Ramsey,” Ann. of Math. 203 (2026), 869–932. Preprint arXiv:2303.09521 (2023).
  5. P. Gupta, N. Ndiaye, S. Norin and L. Wei, “Optimizing the CGMS upper bound on Ramsey numbers,” arXiv:2407.19026 (2024).
  6. Z. Lu and S. Wang, “Retained-set descent for diagonal Ramsey numbers,” arXiv:2609.14525 (2026). Code and Lean proofs: github.com/sichen-wang/diagonal-ramsey-numbers.
  7. S. Norin, RamseyLean, Lean 4 formalisation of “Optimizing the CGMS upper bound on Ramsey numbers”, GitHub.
  8. Anthropic, “Formalizing Fermat’s Last Theorem,” September 4, 2026.
  9. OpenAI, “On the Navier–Stokes Millennium Prize Problem,” September 8, 2026.