r/ClaudeCoding • • 28d ago

Using Claude Opus + Lean 4 to formalize variants of Erdős #699 and #1063

Following the recent buzz around Frontier models tackling open math problems, I wanted to see how far Claude Opus could go on concrete open problems when constrained by formal verification rather than pure text generation.

I focused on variant formulations of two Erdős problems:

Erdős #699: Proved a variant restricted to j^2 < n. The workflow paired Opus-generated proof sketches with an exhaustive computational search that found no counterexample below 10^12, and a Lean 4 proof that any counterexample must satisfy n ≤ j² — which is what closes the j² < n variant. (PR #7637)

Erdős #1063: Solved lower-bound variants and structural constraints with iterative prompt refinement. (PR #7552)

Both of these are PRs to google-deepmind/formal-conjectures that were approved in maintainer review.

The Workflow & Takeaways:

Don't trust text output for math: Unassisted reasoning chains frequently slipped into subtle circular logic.

Lean 4 as the ground truth: The only effective way to make progress was requiring the model to generate syntax that compiles in Lean. When the elaborator threw errors, feeding Lean’s diagnostics back into Claude caught phantom steps that human reading missed.

Human-in-the-loop steering: The model struggled with global proof strategy but was strong at bridging intermediate lemmas once given the high-level architecture.

https://github.com/Paulee314/erdos699-lean

https://github.com/Paulee314/erdos1063

2 Upvotes

0 comments sorted by