是的,1700万行 Lean 代码很多
Yes, 17M lines of Lean is a lot

原始链接: https://micjm.com/blog/yes-17m-lines-of-lean-is-a-lot/

最近的 Lean 中黎曼猜想证明达 1700 万行。为衡量其规模,作者考察了在线 Lean 证明集合。Mathlib 著名的人工编写定理远不及 1700 万行。Reservoir 的 938 个包中包含一些更大的仓库,但它们是特殊情况:一个 8800 万行的 AI 进行中项目,一个手写部分仅约 50 万行的 3600 万行数据库链接项目,以及一个比人类对应版本长约 450 倍的 2700 万行 AI 费马大定理证明。因此,尽管有些仓库超过 1700 万行,它们严重依赖生成或 AI 辅助代码,确认 1700 万行确实巨大。

Hacker News 用户讨论一个 AI 生成的、约 1700 万行的黎曼猜想 Lean 证明。评论者争论这个证明的巨大规模是否使其无用或不可理解,指出 Lean 可以机械地验证它,即使人类无法轻易阅读。一些人指出,大量体积可能来自形式化现有结果或生成效率低下,重构可以缩小它。其他人讨论更广泛的担忧,AI 生成的证明缺乏优雅、上下文和洞察。一个大子帖问为什么 LLM 写作对人类来说很糟糕,理论包括缺乏受众意识或心智理论、训练偏差、冗长,以及难以区分平凡内容与新颖内容。一些人指出,为受众提示和使用 linter 可以提高可读性。总体而言,该帖子将对证明的惊叹与对其在缺乏人类可理解结构时的价值的怀疑混在一起。
相关文章

原文

The recent proof of the Riemann hypothesis came with a statistic attached: the proof is 17 million lines of Lean. Beyond the philosophical questions of what it means to have a proof longer than any human could comprehend, I’m left with a simpler question: is that as large as it sounds?

To investigate, I hunted for collections of Lean proofs online. I found two and charted the lengths of their proofs.

(All charts have a log x axis, which makes 17m lines look a lot closer to 1m and 100k than it really is.)

Famous theorems in Mathlib

Mathlib maintains a collection of famous proofs. There are over 1k but only 259 have Lean associated, which I chart here.

These are all human generated, and as we can see, they come nowhere close to 17m.

Histogram of 259 famous theorems in Mathlib by the Lean lines they depend on: nearly all fall between 100k and 1.2m lines, below the 2.4m lines of all of Mathlib and far below the claimed Riemann proof at 17m

Every Lean package on Reservoir

Reservoir indexes every published Lean package, 938 of which have Lean code on GitHub. This one has a lot more data, including AI assisted proofs. We even have a few that are over 16m!:

  1. 88m: Qiuzhen-CFSG/CFSG this appears to be an AI built proof that is still a work in progress.

  2. 36m: CBirkbeck/LeanBridge, a project linking the LMFDB database of number theory objects to Mathlib. This isn’t really a proof: about 98% of its Lean is files generated by scripts that check the database’s numbers one by one. The hand-written part is closer to 500k lines.

  3. 27m: anthropics/fermats-last-theorem is another Anthropic special: a complete proof of Fermat’s Last Theorem, published on GitHub in September. Its README says “the Lean sources were produced by AI agents building on human-written open-source Lean”, including the human FLT project led by Kevin Buzzard, which is about 60k lines and still in progress. The AI version is roughly 450 times longer.

Histogram of 938 Lean packages on Reservoir by estimated lines: the median package is about 4k lines, all of Mathlib is 2.4m, and only three packages (88m, 36m and 27m) are larger than the claimed Riemann proof at 17m

So yes, 17m lines is a lot.

联系我们 contact @ memedata.com