AI Skills AI技能 4h ago Updated 1h ago 更新于 1小时前 54

Anthropic's Fermat Proof Is 13 Million Lines Anthropic的费马证明有1300万行

Anthropic's formalized proof of Fermat's Last Theorem contains 13,499,380 lines of Lean across 60,478 files, verified at commit aa2d8b3 on 7 September 2026 88.5% of the repository consists of proof bodies (11,943,389 lines in P2M/Sol), with 562,341 top-level declarations — roughly three times the total declarations in all of Mathlib Individual proof steps are only 2x more verbose than human-written Mathlib (median 8 lines vs. 4 lines), meaning the enormity is structural (decomposition into many Anthropic发布的费马大定理形式化证明共13,499,380行Lean代码(60,478个文件),其中88.5%为证明体,规模庞大但非冗余膨胀 证明包含562,341个声明,是Mathlib库(185,411个声明)的3倍,核心成本在于步骤数量而非单步长度(中位数8行 vs Mathlib的4行) 仅0.6%的定理名称与Mathlib有重叠,证明几乎全部为新形式化内容,沿Frey-Serre-Ribet-Wiles-Taylor路线构建 可信度来自完整验证链:Lean内核检查、Rust独立内核验证、#print axioms确认仅依赖3个标准公理、comparator工具比对 这是age

75
Hot 热度
80
Quality 质量
78
Impact 影响力

Analysis 深度分析

TL;DR

  • Anthropic's formalized proof of Fermat's Last Theorem contains 13,499,380 lines of Lean across 60,478 files, verified at commit aa2d8b3 on 7 September 2026
  • 88.5% of the repository consists of proof bodies (11,943,389 lines in P2M/Sol), with 562,341 top-level declarations — roughly three times the total declarations in all of Mathlib
  • Individual proof steps are only 2x more verbose than human-written Mathlib (median 8 lines vs. 4 lines), meaning the enormity is structural (decomposition into many small steps) rather than stylistic (padding)
  • Only 0.6% of the proof's theorem names overlap with Mathlib, reflecting that most of the underlying machinery (modular curves, Galois representations, Cerednik–Drinfeld theory) had never been formalized before
  • The proof's trustworthiness rests on a complete audit trail: Lean kernel verification, independent Rust kernel validation (nanoda), axiom audit (#print axioms confirming exactly three standard axioms), and a comparator tool — a level of verification nearly unique in agent-generated output

Why It Matters

This analysis reframes the conversation about machine-generated formal proofs: the cost is not verbosity per step but the sheer number of decomposition steps an AI requires compared to a human mathematician. It also establishes the first clean example of a verifiable evidence layer for large-scale agent output, offering a template for how to build trust in AI-generated content across domains that currently lack independent verification mechanisms.

Technical Details

  • Repository structure: Three directories — P2M/Sol (29,511 files, 11,943,389 lines of proof bodies), Theorems/ (29,511 files, 1,276,305 lines of theorem statements), and Definitions/ (1,450 files, 279,497 lines). Each theorem has a one-to-one mapping between statement and solution file.
  • Declaration metrics: 562,341 top-level declarations in the Fermat proof vs. 185,411 in Mathlib (same commit, db584cd, Lean 4.33.1). Median lines per declaration: 8 (Fermat) vs. 4 (Mathlib); mean: 17.2 vs. 6.2; p99: 166 vs. 33.
  • Verification pipeline: From-scratch lake build on Lean 4.33.1 with Mathlib compiled from source, validated by nanoda (independent Rust kernel), #print axioms confirming exactly three standard axioms, and a comparator tool confirming the proved statement matches Mathlib's formulation. One deliberate sorry exists only in the comparator's challenge file.
  • Novelty of formalization: The proof follows the Frey–Serre–Ribet–Wiles–Taylor route through modular curves, Galois representations, and Cerednik–Drinfeld theory — areas largely unformalized. Only 0.6% of theorem names share a final name component with Mathlib entries.
  • Methodology caveat: Line counts are a proxy, not a measure of effort or elegance. Redundancy was not measured. The 3x declaration ratio against Mathlib is a ceiling, not a floor, since some Mathlib lemmas are generated by attributes and invisible in source scans.

Industry Insight

  • The Fermat proof demonstrates that agent-generated output at scale can achieve mathematical-grade verifiability when paired with a formal kernel — a pattern that could extend to code generation, compliance documentation, and scientific modeling, domains that currently ship unverified agent output at scale.
  • The decomposition gap (562K declarations for one theorem vs. human mathematicians' compact arguments) suggests current AI reasoning lacks the high-level abstraction and lemma-reuse strategies of expert humans; progress will depend on improving strategic planning and library utilization, not just step-level quality.
  • The absence of verification infrastructure outside formal mathematics is a critical risk: tool-call traces in open-source agent frameworks capture only 5 of 12 needed audit fields, and none record termination mechanisms behind silent failures. Building equivalent evidence layers should be a priority for any domain deploying high-stakes agent output.

TL;DR

  • Anthropic发布的费马大定理形式化证明共13,499,380行Lean代码(60,478个文件),其中88.5%为证明体,规模庞大但非冗余膨胀
  • 证明包含562,341个声明,是Mathlib库(185,411个声明)的3倍,核心成本在于步骤数量而非单步长度(中位数8行 vs Mathlib的4行)
  • 仅0.6%的定理名称与Mathlib有重叠,证明几乎全部为新形式化内容,沿Frey-Serre-Ribet-Wiles-Taylor路线构建
  • 可信度来自完整验证链:Lean内核检查、Rust独立内核验证、#print axioms确认仅依赖3个标准公理、comparator工具比对
  • 这是agent输出"证据层"的最清晰案例:11天、数十个agent协作生成1350万行无人阅读的代码,但形式化验证提供了审计轨迹

为什么值得看

本文首次对Anthropic费马大定理证明进行了量化拆解,揭示了机器生成证明的规模瓶颈在于"步骤分解数量"而非"单步冗长度",为评估AI形式化验证能力提供了可复现的度量框架。对AI从业者而言,这展示了形式化方法如何为agent输出提供近乎唯一的可信验证层,对比其他领域agent审计记录的缺失,具有战略参考价值。

技术解析

  • 代码规模分布:13,499,380行Lean代码分属三个目录——P2M/Sol(证明体,11,943,389行,88.5%)、Theorems/(定理声明,1,276,305行)、Definitions/(定义,279,497行)。29,511个定理文件与29,511个解决方案文件一一对应,99.7%的解决方案文件顶层声明命名为theorem solution
  • 步骤密度对比:使用相同计数器测量,Mathlib中位数4行/声明(均值6.2,p99为33,最长256行),费马证明中位数8行/声明(均值17.2,p99为166,最长3,123行)。机器生成步骤仅比人类编写冗长2倍(中位数)至2.8倍(均值),差距集中在尾部。
  • 验证架构:证明通过Lean 4.33.1 + Mathlib v4.33.0从头编译验证,独立Rust内核(nanoda)接受同一环境导出进行二次验证,comparator工具确认证明的定理与Mathlib声明一致。#print axioms确认仅依赖3个标准公理。唯一sorry位于verification/comparator/Challenge.lean,为故意留空。
  • 复用率极低:仅0.6%的定理名称与Mathlib有末位名称组件重叠,证明沿模曲线、伽罗瓦表示、Cerednik-Drinfeld理论等新形式化路径推进,大部分机器为首次构建该数学分支的形式化基础。

行业启示

  • 形式化验证是agent可信输出的标杆:1350万行代码无人阅读却高度可信,依赖的是内核级验证链而非过程信任。当前其他领域agent输出的审计记录普遍缺失(如工具调用记录仅覆盖5/12个必要字段),形式化数学的验证基础设施值得其他领域借鉴。
  • 机器证明的瓶颈在于分解而非表达:单步冗长度仅2倍差距,真正成本是562,341个声明的分解数量。这提示评估AI数学能力时,应关注"步骤效率"而非"代码长度",并推动更智能的定理分解策略。
  • 可复现的量化分析框架:本文提供了从clone仓库到目录统计的完整度量方法,为后续AI形式化证明研究建立了可对比的基准。建议行业建立类似的公开度量标准,避免仅凭"行数"等单一指标判断质量。

Disclaimer: The above content is generated by AI and is for reference only. 免责声明:以上内容由 AI 生成,仅供参考。

Claude Claude Research 科学研究 Programming 编程 Open Source 开源