|

Claude Fable 5.2 Coordinates 1,000 AI Agents to Formalize Fermat’s Last Theorem in 28.7 Hours

Claude Fable 5.2 Coordinates 1,000 AI Agents to Formalize Fermat’s Last Theorem in 28.7 Hours

On November 9, 2026, Anthropic announced a multi-agent experiment on its official engineering blog: 1,000 Claude Fable 5.2 agents worked together to formalize Fermat’s Last Theorem in 28.7 hours, and the final proof passed verification by Lean’s official kernel. An earlier formalization experiment, completed two months ago by dozens of agents, took 11 days.

This doesn’t mean “AI proved Fermat’s Last Theorem in 30 hours.” Andrew Wiles and Richard Taylor had already proved the theorem in the 1990s. This experiment translated an existing proof into a formal proof that a computer could check step by step. So the real question this article addresses is: How did 1,000 AI agents work together to complete such a complex project in less than 30 hours?

Key takeaways: By the end of this article, you’ll understand the key figures behind this Fermat’s Last Theorem formalization experiment, how the 1,000 agents were organized and how their work was verified, and what the experiment can—and can’t—teach us about enterprise agent systems.

claude-fable-5-2-1000-agents-fermat-last-theorem-formalization-en-image-0

Key Facts About the Fermat’s Last Theorem Formalization Experiment

Here’s a quick overview of the Claude Fable 5.2 experiment. A few details are easy to misinterpret: the model was an early version, the experiment used predefined inputs, and Anthropic explicitly described it as a toy experiment.

Item Details
Release date November 9, 2026, on Anthropic’s official engineering blog
Model used An early version of Claude Fable 5.2, before formal pre-release alignment evaluations were complete
Team size 1 Lead Agent + 999 Helper Agents
Time to completion 28.7 hours; the final theorem passed Lean’s official kernel check (rounded to 30 hours in the official announcement)
Predefined inputs 60 propositions, a one-sentence outline of the classical proof route, relevant definitions, and 47 lemmas proved in the previous formalization
Tooling environment Lean toolchain, Mathlib, Git, a shared PostgreSQL database, and isolated virtual machine sandboxes
Official characterization A toy experiment, not the first proof of Fermat’s Last Theorem

Fermat’s Last Theorem Formalization: The Experimental Setup Matters

The researchers didn’t just say, “Prove Fermat’s Last Theorem,” and leave the agents to it. They provided 60 propositions—including the final theorem and 59 intermediate milestones—along with a proof outline, definitions, and 47 lemmas proved in the previous experiment. The researchers also assigned the Lead and Helper roles in advance.

So this experiment tested a different capability: given a mathematical foundation and the necessary tools, could a large team of agents organize itself and turn a known proof route into a complete, machine-checkable proof? That’s more of an engineering question than “Can AI do math?”


Why Fermat’s Last Theorem Is So Difficult to Formalize

Fermat’s Last Theorem is simple to state: for any integer (n > 2), there are no positive integers (a), (b), and (c) such that (a^n + b^n = c^n). Pierre de Fermat proposed it in the 17th century, and it remained unsolved for more than 350 years. Wiles announced a proof in 1993, fixed a key gap with Taylor in 1994, and formally published the proof in 1995. The original proof runs about 129 pages and relies heavily on existing results in modern number theory and algebraic geometry.

When writing a proof, human mathematicians can say, “This follows obviously from the previous result,” and readers will fill in the missing steps. Computers don’t share that understanding. They need to know exactly which definition, theorem, or inference rule justifies each step. That’s the root of the challenge: what looks “obvious” to a human can take hundreds or even thousands of lines of code.

Lean, Mathlib, and Mathematical Formalization

To understand this experiment, it helps to distinguish three concepts:

  • Lean: An interactive theorem prover that checks whether a proof strictly follows the rules of formal logic.
  • Mathlib: Lean’s mathematical library, which contains a large collection of formalized definitions and theorems—like a “standard library” you can reference directly.
  • Mathematical formalization: Translating a human-readable mathematical proof into a logical structure that a computer can verify in full.

The most important point is this: AI constructs the proof, while Lean’s kernel checks it. A model saying “I’ve proved it” and Lean actually accepting the proof are two very different things. This experiment deserves serious attention precisely because the final result doesn’t rely on the model’s own judgment—it passed an independent machine check.

How 1,000 AI Agents Work Together: A Project Management System Run by AI

This is one of the most interesting parts of the Claude Fable 5.2 experiment. The 1,000 agents didn’t each work on problems in isolation. Instead, they formed a collaborative system with task management, resource scheduling, and dynamic adjustments.

How the Claude Fable 5.2 Team Is Organized

The team uses a simple hierarchy: one Lead Agent handles overall planning, task breakdown, and progress tracking, while 999 Helper Agents work on specific proofs. Each agent has its own lightweight virtual machine sandbox with access to the shell, a file editor, the Lean toolchain, and Mathlib. Each also has its own Git branch and can submit a Merge Request to the main branch.

None of the agents has direct internet access. All communication with the Claude API, Git, and the database goes through an external Gateway. Separate sandboxes and branches let all 1,000 agents edit code at the same time without overwriting one another’s files.

Shared PostgreSQL: The Collaboration Hub for AI Agents

If 1,000 agents tried to collaborate by messaging each other one-on-one, communication would quickly spiral out of control. The Lead Agent’s approach was to set up five shared database tables within the first 10 minutes of the experiment, turning communication into “reading and writing to the same bulletin board.”

Table Purpose Role in collaboration
Announce Publish team instructions Broadcasts to everyone, like a project noticeboard
Assign Assign tasks and owners Clarifies “who’s doing what” to avoid duplicated work
Notes Record progress, issues, and work plans Shares context and reduces information silos
Subtasks Manage smaller tasks for agents to claim Acts as a task pool, enabling agents to pick up work autonomously
Landed Record completed work that has passed checks Lists trusted results, including only verified work

The value of this setup is that agents don’t need to contact the other 999 agents individually. They can check the database to see what tasks are available, what’s been completed, and what has dependencies. Results are then merged into the main branch through Git. According to the figures released by the team, the process involved about 36,612 database writes and 311,734 reads. Of those writes, about 20,600 were to Notes and about 14,800 were to Subtasks. (The figures exclude most script calls.) Reads far outnumbered writes, which also shows that agents spent most of their time checking the overall status.

claude-fable-5-2-1000-agents-fermat-last-theorem-formalization-en-image-1

Dynamic Task Allocation: From Fixed Assignments to Self-Assigned Work

The scheduling process in this experiment wasn’t fixed from start to finish. The timeline below shows how the team’s workflow gradually evolved:

Time Key event
Minute 10 Lead creates five shared database tables
Around minute 27 Three propositions have been proved
Shortly after Lead sets aside 47 propositions judged too difficult to complete within the budget and focuses the team on 10 others
Around minute 70 All 10 propositions are complete, and Lead reassigns Agents to tackle harder ones
Around hour 3 Lead lets idle Agents claim tasks themselves instead of waiting for assignments
Hour 5.6 73 Helpers have created 756 tasks
Around hour 18 Work resumes from a saved state and continues for 12 hours
Hour 28.4 The Langlands–Tunnell-related proposition is complete
Hour 28.7 Fermat’s Last Theorem is complete and passes the official kernel check

Two details are worth noting. First, the shift from “Lead assigns work” to “Agents claim work themselves” effectively moves the team from centralized scheduling to a task-pool model, reducing the risk of Lead becoming a bottleneck. Second, the experiment resumes from a saved state around hour 18, so 28.7 hours doesn’t mean every Agent ran continuously from beginning to end.

Also, the 47 temporarily shelved propositions are different from the 47 lemmas in the predefined input. Don’t conflate the two when reading the official materials.

Langlands–Tunnell: 750 Agents Tackle the Hardest Challenge in Formalizing Fermat’s Last Theorem

Near the finish line, the team hit its toughest obstacle: a proposition related to Langlands–Tunnell, an important mathematical result in Wiles’s proof strategy. The Agents initially assigned to this part estimated that it could take 700,000 to 1 million lines of Lean code, and put the odds of finishing in the time remaining at less than 1%.

The Lead then focused around 750 Helpers on the task. The Agents built a multilayer task tree on their own:

  • Divided the work into 10 major areas;
  • Created 2,418 subtasks in total;
  • Built a task tree up to 10 levels deep;
  • Had hundreds of Agents working on different subtasks simultaneously.

Langlands–Tunnell was completed at hour 28.4, and Fermat’s Last Theorem was completed 0.3 hours later. This case shows that the value of large-scale parallelism isn’t just “more people means faster computation.” More importantly, it’s about breaking down a problem that’s too large to tackle directly into many smaller tasks that can be advanced independently, verified individually, and merged in the end. If the breakdown isn’t done well, 750 Agents will just end up waiting on one another or duplicating work.


Why Formalizing Fermat’s Last Theorem Worked: Lean Verification and Safety Measures

From an engineering reliability perspective, the experiment relied on three layers of safeguards.

The first layer was result verification. Every subclaim had to pass Lean’s checks before it could be submitted to the main branch. The Landed table recorded only work that had passed those checks. The final proof was verified by the official kernel checker. The Lead Agent recorded the following: “Fermat’s Last Theorem is on main, kernel-checked by the official checker.”

The second layer was collaboration isolation. Separate sandboxes and Git branches kept file conflicts and interference between Agents to a minimum.

The third layer was security boundaries. The experiment used an early model that hadn’t yet completed pre-release alignment evaluations, so Anthropic put multiple safeguards in place:

  • Internet access and direct access to other Agents’ sandboxes were prohibited;
  • Commands were run under non-privileged accounts;
  • An external Gateway managed API, Git, and database communications;
  • A real-time classifier checked shell commands and file modifications, while an offline monitor reviewed operation logs.

The experiment generated more than 1 million tool calls, and not one required intervention. Anthropic also said it had added parallel chain-of-thought monitoring after the experiment. The takeaway is that a reliable Agent system can’t be judged solely by whether the model can complete a task. It also needs independent verification, clear permission boundaries, and an execution environment that can be audited.

From 11 Days to 28.7 Hours: A Comparison of Two Claude Fable 5.2 Experiments

The two formalization experiments on Fermat’s Last Theorem used different setups, so it’s best to look at them separately:

Metric First experiment (announced in September 2026) Second experiment (announced on November 9, 2026)
Model Internal research model (roughly on par with Fable 5.1) Early Fable 5.2
Number of agents Dozens 1,000
Runtime 11 days 28.7 hours
Output tokens About 6 billion Officially reported as roughly one-third of the first experiment
Proof length Baseline (about 13 million lines of Lean code) About one-seventh of the first experiment
Collaboration platform Prove2Me + Claude Code multi-agent harness General-purpose tools + PostgreSQL
Human guidance Researcher Tianyi Peng provided limited high-level guidance No ongoing guidance on the mathematical process

It’s important to note that the figures of 6 billion tokens, 13 million lines of code, and approximately 30,300 theorems all refer to the first experiment. The official report didn’t disclose the second experiment’s absolute token count, total cost, or exact number of lines of code.

The first experiment also hit some bumps early on: agents struggled to keep track of the overall state and couldn’t tell what others had already completed, leading to duplicated work. The team later introduced Prove2Me, a platform that uses a DAG to track theorem dependencies and provides task status, theorem search, and faster compilation. The second experiment took a different approach: instead of using this specialized platform, agents built their own collaboration workflow with general-purpose database tools and Git. Five tables served similar functions.

Anthropic also ran a comparison using the same 1,000-agent setup: Opus 5.5 completed about 26% in 18 hours, then made almost no further progress by the 30-hour mark. Fable 5.2 completed the final theorem in 28.7 hours. Both groups resumed from a saved state at around the 18-hour mark. However, each model was run only once, so these results don’t establish a general performance gap between the two models across all complex tasks.

claude-fable-5-2-1000-agents-fermat-last-theorem-formalization-en-image-2


How the 1,000 AI Agent Experiment Could Affect Enterprises

For Developers: Four Key Capabilities of Multi-Agent Systems

Set aside the mathematical background, and the capabilities demonstrated by this experiment map neatly to common enterprise scenarios:

Capability How it appeared in the experiment Enterprise application
Complex task decomposition 2,418 subtasks and a task tree up to 10 levels deep Large-scale code refactoring, complex research reports
Dynamic resource allocation Parking difficult problems and assigning 750 Helpers to tackle them Reallocating Agents and computing resources based on priority
Shared state management Five PostgreSQL tables plus Git merges A unified task board that reduces duplicated work
Independent result verification The Lean kernel checked every submission Unit tests, data validation, human review

The most practical takeaway for developers is that you don’t need to build a complex, custom platform right away. A well-designed shared database combined with version control can support collaboration at a considerable scale. Here’s a minimal example of calling a model:

import openai

client = openai.OpenAI(
    api_key="YOUR_API_KEY",
    base_url="https://api.apiyi.com/v1"  # APIYI unified interface
)

response = client.chat.completions.create(
    model="claude-fable-5-2",  # Use a model name from the platform's model list
    messages=[{"role": "user", "content": "把这个任务拆成可独立验证的子任务"}]
)
print(response.choices[0].message.content)
View sample Lead / Helper task-pool code
import sqlite3
import openai

# SQLite is used locally to simulate the experiment's Subtasks / Landed tables (the experiment used PostgreSQL)
db = sqlite3.connect("board.db")
db.execute("CREATE TABLE IF NOT EXISTS subtasks (id INTEGER PRIMARY KEY, goal TEXT, status TEXT, owner TEXT)")
db.execute("CREATE TABLE IF NOT EXISTS landed (task_id INTEGER, result TEXT)")

client = openai.OpenAI(
    api_key="YOUR_API_KEY",
    base_url="https://api.apiyi.com/v1"
)

def lead_plan(goal: str):
    """Lead: break down the task and add it to the task pool."""
    resp = client.chat.completions.create(
        model="claude-fable-5-2",
        messages=[{"role": "user", "content": f"将目标拆为3-5个子任务,每行一个:{goal}"}]
    )
    for line in resp.choices[0].message.content.splitlines():
        if line.strip():
            db.execute("INSERT INTO subtasks (goal, status) VALUES (?, 'open')", (line.strip(),))
    db.commit()

def verify(result: str) -> bool:
    """Independent verifier: in a real-world setting, replace this with tests, validation scripts, or Lean checks."""
    return len(result) > 0

def helper_claim(name: str):
    """Helper: claim a task and add it to Landed only if it passes verification."""
    row = db.execute("SELECT id, goal FROM subtasks WHERE status='open' LIMIT 1").fetchone()
    if not row:
        return
    task_id, goal = row
    db.execute("UPDATE subtasks SET status='doing', owner=? WHERE id=?", (name, task_id))
    db.commit()
    resp = client.chat.completions.create(
        model="claude-fable-5-2",
        messages=[{"role": "user", "content": goal}]
    )
    result = resp.choices[0].message.content
    if verify(result):
        db.execute("INSERT INTO landed VALUES (?, ?)", (task_id, result))
        db.execute("UPDATE subtasks SET status='done' WHERE id=?", (task_id,))
    else:
        db.execute("UPDATE subtasks SET status='open', owner=NULL WHERE id=?", (task_id,))
    db.commit()

lead_plan("为一个开源库补全单元测试")
for i in range(3):
    helper_claim(f"helper-{i}")

🚀 Quick-start tip: To reproduce a small-scale prototype of “Lead decomposition + Helper task claiming + independent verification,” you can start by getting free test credits through APIYI at apiyi.com. The platform offers an OpenAI-compatible interface, so you can switch between Claude, GPT, Gemini, and other models with a single key—making it easy to compare how well different models break down tasks as the Lead.

For the Industry: Boundaries Matter More Than the Numbers

One thing to keep in mind is that formalized mathematics has strict, objective verifiers like Lean, while most enterprise tasks don’t have equally clear standards for correctness. Code can be backed up by tests, but it’s often hard to determine correctness automatically for market analysis or cross-functional workflows. So the 28.7 hours and the success rate in this experiment can’t be directly applied to enterprise Agent systems.

Anthropic also highlighted several limitations: Agents can decide too early that a task can’t be completed—for example, most of the 47 theorems shelved early on were eventually completed. Human guidance still helps at difficult points, and domain-specific tools like Prove2Me could further improve compilation, retrieval, and collaboration efficiency. The experiment doesn’t show that more Agents are always better, or that human experts and specialized harnesses are no longer needed.

💡 Engineering Tip: When piloting a multi-Agent approach in an enterprise, start with tasks that have clear verification criteria, such as test-driven code changes, and then gradually expand the scope. With APIYI apiyi.com’s pay-as-you-go pricing, you can first evaluate task decomposition and verification with a small number of Agents, then decide whether to invest more.

claude-fable-5-2-1000-agents-fermat-last-theorem-formalization-en-image-3


Frequently Asked Questions

Q1: Did AI prove Fermat’s Last Theorem in this experiment?

No. Wiles published a formal proof of Fermat’s Last Theorem in 1995, correcting a key issue in collaboration with Taylor. This experiment took an existing proof strategy and translated it into a formal proof that Lean could check, given 60 propositions, an outline of the approach, definitions, and 47 previously proven lemmas.

Q2: Why were only 54 of the 60 propositions marked as proven?

In the tally at hour 30, five alternative propositions were no longer needed, and one proposition had been abandoned. The final theorem had already passed verification at hour 28.7, so there was no need to complete all 60 propositions originally listed.

Q3: How much does the Claude Fable 5.2 API cost?

The official list price is $8 per million input tokens and $40 per million output tokens. Fast Mode costs $16 and $80, respectively. Cached reads cost $0.20 per million tokens, and the Batch API offers a 50% discount. The context window is 1M tokens, with a maximum output of 128K tokens. The official cost of the second experiment hasn’t been disclosed, so it can’t be estimated by multiplying the first experiment’s 6 billion tokens by the per-token price.

Q4: How can I quickly try Claude Fable 5.2 through an API?

Sign up at APIYI apiyi.com and get an API key, then set `base_url` to `https://api.apiyi.com/v1` to use the sample code in this article. New users get free test credits, which are suitable for trying out a small-scale multi-agent prototype.

Q5: Does a multi-agent system always need PostgreSQL?

Not necessarily. What matters is having a shared state store that all agents can read from and write to, along with version control and independent verification. SQLite or Redis is enough for a small prototype. When you call models through APIYI apiyi.com, your own system is responsible for state storage, so you can combine the two however you like.

Q6: What are the known limitations of this experiment?

The team explicitly called it a toy experiment. The Fable and Opus comparison was run only once, and it used an early model that required multiple layers of safety protection. Agents also incorrectly gave up on the task too early, and human guidance and domain-specific tools still have value.


1,000 AI Agents Formalize Fermat’s Last Theorem: Key Takeaways

  • What the experiment actually did: Formalized an existing proof as Lean-checkable code; it did not prove Fermat’s Last Theorem for the first time.
  • Key numbers: 1,000 early Fable 5.2 Agents completed the task in 28.7 hours, and the result passed verification by Lean’s official kernel.
  • How the team was organized: One Lead and 999 Helpers worked together using five shared database tables and Git.
  • How they tackled the hard parts: About 750 Agents broke the Langlands–Tunnell theorem into 2,418 subtasks, with a maximum depth of 10 levels.
  • Why the system was reliable: Lean provided independent verification, while sandbox isolation helped manage more than one million tool calls without requiring intervention.
  • Where the approach may not apply: Enterprise tasks often lack a verifier like Lean, so these efficiency figures shouldn’t be extrapolated directly.
  • How to get started: You can use APIYI at apiyi.com’s unified interface to build a small-scale prototype of Lead/Helper collaboration.

Summary

Here are the main takeaways from Claude Fable 5.2’s experiment with 1,000 Agents:

  1. The system matters more than any one component: Model capability, task decomposition, shared state, parallel execution, and machine verification all contributed to the 28.7-hour result.
  2. Verification is the foundation of trust: Lean’s kernel checks make a clear distinction between “the model says it’s done” and “it’s actually done.”
  3. Be clear about the limits: The predefined inputs, early-stage models, single comparison, and toy experiment framing all mean the result shouldn’t be overinterpreted.

The experiment leaves the industry with an important question: Is the competition between AI systems shifting from the capabilities of a single model to the ability to organize and coordinate large numbers of agents on complex tasks? Developers can start experimenting today with a small multi-Agent prototype that includes independent verification. APIYI at apiyi.com is a good way to quickly test the approach, with free testing credits and a unified interface for multiple models.


📚 References

  1. Anthropic Engineering Blog: Safely scaling multi-agent teams with Claude Fable 5.2
  2. Link: claude.dev/blog/safely-scaling-multi-agent-teams-with-fable-5-2
  3. Note: Covers the organizational structure, database collaboration, and safety mechanisms in the second experiment, along with a comparison to Opus.

  4. Anthropic Research Article: Formalizing Fermat’s Last Theorem

  5. Link: anthropic.com/research/formalizing-fermats-last-theorem
  6. Note: Data from the first formalization experiment and the Prove2Me collaboration process.

  7. Anthropic Official Lean Proof Repository: First formal proof

  8. Link: github.com/anthropics/fermats-last-theorem
  9. Note: The publicly available proof code from September. The README data isn’t the same as the statistics from the November experiment.

  10. Official Lean Case Study: Formalizing Fermat’s Last Theorem

  11. Link: lean-lang.org/use-cases/flt
  12. Note: Background on Lean and formalized mathematics.

  13. Fable 5.2 Model Documentation: Model specifications and API migration

  14. Link: platform.claude.com/docs/en/models/fable-5-2/overview
  15. Note: Information on the context window, output limits, and pricing.

Author: APIYI Technical Team
Technical inquiries: Contact us through the APIYI homepage. For more resources, visit the documentation center at docs.apiyi.com.

Related Articles

Similar Posts