← Latest papers
🤖 AI

LeanMarathon: Toward Reliable AI Co-Mathematicians through Long-Horizon Lean Autoformalization

LeanMarathon introduces a multi-agent system centered on an evolving blueprint and a two-stage orchestrator to overcome long-horizon autoformalization failures, successfully formalizing seven theorems from four recent research papers on Erdős problems without errors.

Original authors: Yuanhe Zhang, Yuekai Sun, Taiji Suzuki, Jason D. Lee, Fanghui Liu

Published 2026-06-05
📖 5 min read🧠 Deep dive

Original authors: Yuanhe Zhang, Yuekai Sun, Taiji Suzuki, Jason D. Lee, Fanghui Liu

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are trying to build a massive, intricate castle out of Lego bricks, but you are doing it with a team of AI robots. The goal isn't just to build a castle; it's to build a castle based on a very complex, handwritten blueprint from a human mathematician, and every single brick must fit perfectly according to the strict laws of physics (in this case, the strict rules of a computer language called Lean).

The problem with previous attempts was that if one robot made a small mistake early on—like using the wrong color brick or misreading a line of the blueprint—the whole team would keep building on top of that error. Eventually, they would build a huge, beautiful-looking castle that looked fine to the eye but would collapse the moment you tried to put a roof on it because the foundation was wrong. The robots would get confused, argue with each other, or just keep making the same mistake over and over for days.

LeanMarathon is a new way of organizing these robot teams so they don't crash. Here is how it works, using simple analogies:

1. The "Living Blueprint" (The System of Record)

Instead of giving the robots a static PDF to read, LeanMarathon uses a single, living document that acts as three things at once:

  • A skeleton of the math (the formal code).
  • A story written in plain English (the natural language explanation).
  • A map showing how every piece connects to the next.

Think of this like a shared Google Doc where every sentence has a tiny "checkmark" next to it. If a sentence is wrong, the checkmark turns red. The robots can't just ignore the red marks; they have to fix them before moving on.

2. The Four Specialized Robots (Agents)

Instead of one super-robot trying to do everything (which makes it prone to getting overwhelmed and confused), LeanMarathon uses four specialized robots, each with a very specific job and a strict rule: You can only touch your own section.

  • The Architect (Blueprinter): This robot reads the original human paper and breaks it down into small, manageable Lego pieces. It draws the initial map but doesn't build the walls yet. It just sets up the structure.
  • The Inspector (Target-Reviewer): Before any building starts, this robot checks the map against the original human paper. It asks, "Did the Architect misunderstand the goal?" If the map says "Build a tower" but the paper says "Build a bridge," the Inspector stops everything and sends a ticket to fix it. It never builds; it only checks.
  • The Builder (Worker): These are the robots that actually do the heavy lifting. But here's the trick: Each Builder is assigned only one tiny Lego piece. They work in parallel (many at once). They are only allowed to touch their specific piece and the immediate bricks around it. They cannot reach over and change their neighbor's work. If they get stuck, they raise a hand and ask for help rather than guessing.
  • The Fixer (Refiner): If a Builder gets stuck or the Inspector finds a problem, the Fixer steps in. This robot looks at the specific broken area, reads the original human paper again to understand what went wrong, and rewrites that specific section. It's like a surgeon who only operates on one specific organ, ensuring the rest of the body stays healthy.

3. The "Traffic Light" (The CI Gate)

This is the most important safety feature. Imagine a traffic light at the entrance of a construction site.

  • Every time a Builder finishes a piece or a Fixer makes a repair, they have to stop at the light.
  • A computer program (the Traffic Light) automatically checks: "Does this piece fit? Does it match the story? Is it connected correctly?"
  • If it passes, the piece is merged into the main castle.
  • If it fails, the piece is rejected immediately. The robot has to go back and try again.
  • Crucially: This happens automatically and instantly. No human has to look at every single brick. This prevents "bad bricks" from ever getting into the main structure.

4. The "Marathon" Strategy

The name "Marathon" comes from how they handle long, difficult tasks.

  • Old Way: One robot tries to run the whole marathon alone. It gets tired, hallucinates, and falls over.
  • LeanMarathon Way: They break the marathon into tiny sprints. If a robot falls, only that one sprint is affected. The rest of the team keeps running. Because the work is broken into small, independent pieces, the team can recover from mistakes instantly without losing days of progress.

What Did They Actually Achieve?

The researchers tested this system on two very difficult, real-world math papers that had been written with the help of AI. These papers contained four famous unsolved math problems (called Erdős problems).

  • The Result: LeanMarathon successfully turned all the math in these papers into perfect, computer-checked code. It proved 258 different mathematical steps (lemmas and theorems) with zero errors.
  • The Comparison: They tried a commercial, "all-in-one" AI robot (named Aristotle) on the same papers. That robot tried to do everything at once, got confused, and failed to finish the job even after running for days. It left behind unfinished, broken pieces.
  • The Lesson: The paper shows that to do hard math with AI, you don't just need a "smarter" robot. You need a better team structure that prevents mistakes from spreading and keeps the team focused on the original goal.

In short, LeanMarathon proves that by organizing AI robots into a disciplined, specialized team with strict rules and automatic checks, we can turn messy, long mathematical arguments into perfectly verified, error-free code.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →