Lean创始人访谈:Handwritten Math Will Change Dramatically
https://www.youtube.com/watch?v=KzdYKeAqWhY 题目:《Lean 创始人访谈全记录:当形式化验证遇上 AI,手写数学与软件验证将如何被重塑》 第(一)部分 开场与核心命题:从“测试只能证明有 bug”到“证明可确保无 bug” (0% - 8%) Dijkstra 名言引出形式化验证的根本价值:主持人以 Dijkstra 的名言“程序测试可用于揭示 bug 的存在,但永远无法证明 bug 的不存在”开场,指出 Lean 与形式化证明的意义恰恰在于“证明 bug 不可能发生”。 Lean 的基础定位:Lean 既是一门编程语言(可以写代码),也是一个证明系统(可以对代码写性质并用机器可检查的证明来验证)。它提供绝对正确的保证,并拥有多个独立的检查器。 Lean 应被视为平台:用户可以在 Lean…
Dijkstra's quote emphasized the fundamental value of formal verification: tests can reveal bugs but cannot prove their nonexistence. Lean serves a dual purpose, functioning both as a programming language for writing code and as a proof system for verifying code properties with machine-checkable proofs. It provides absolute correctness guarantees and includes multiple independent checkers.
Lean's programming language and proof assistant nature stem from Dependent Type Theory-based proof assistants like Rocq/Coq and Lean. Software verification can follow two main paths: shallow embedding, where other languages are mapped into Lean for verification using tools like Rust-to-Lean translators, or deep embedding/semantic modeling, where languages like C are represented as data structures in Lean and their properties are stated and reasoned about.
The distinction between testing and proof is crucial: comprehensive test suites only cover limited scenarios and may miss edge cases, while formal proofs cover all possible situations, ensuring "bug nonexistence." An example is Zlib's compression library, where AI translated C code into Lean, proving the critical property that compressed data decompresses to the original data. This was completed in just one week, with further performance optimization possible without compromising existing proofs.
Specifying properties is discussed, with varying costs depending on the program. Writing a correct but inefficient specification can serve as a baseline, while AI can generate optimized versions that are proven equivalent. Companies like Jane Street have begun investing in formal verification for critical systems like the seL4 microkernel. However, the high cost of manual proof development has decreased significantly with AI, which excels at writing and maintaining formal proofs.
Lean is more than just a proof assistant; it's a production-level programming language. AWS runs an AI-optimized compiler with millions of lines of Lean code, providing additional proof benefits. Lean offers a near-native developer experience, with a build system similar to Rust's Cargo and an editor integrated with VS Code. Its unique Info View displays proof states in real-time, akin to a game's progress bar.
The core trust issue in Lean concerns trusting its core kernel. While the core is extensive and frequently changes, only a small kernel is essential to verify. Mario Carneiro implemented a "Lean for Lean" kernel in Lean, proving its consistency with Lean semantics. Other third-party kernels exist, also verified for consistency.
Formalizing mathematics has seen remarkable breakthroughs, including an IMO gold medalist AI-generated proof and a Unit Distance Conjecture formalized by AI in just two weeks. The Lean Mathematics Library (mathlib) has made significant strides, with Terence Tao using Lean to rediscover passion for mathematics. The key to Lean's appeal is its interactive, game-like proof experience, reminiscent of puzzle-solving, keeping enthusiasts deeply engaged.
AI can find new proofs but hasn't yet created new mathematical theories. While AI has discovered counterexamples refuting conjectures in Lean, proposing entirely new mathematical concepts remains beyond its current capabilities. Formalization is crucial for safety-critical systems or when human understanding is incomplete, providing confidence that "bug nonexistence" is assured.
In the next 3-5 years, formal verification and "handwritten math" will undergo significant transformation. Large language models are starting to integrate formal verification into their training pipelines, with promising results. Functional languages like Lean and Rocq are expected to become more mainstream, driven by AI-assisted coding and specification.
Handwritten math is likely to diminish as a dominant practice, replaced by AI-assisted, hybrid workflows where AI handles repetitive, non-creative tasks, and humans focus on defining specifications and intentions. Humans will remain essential in connecting mathematical formalisms to the real world, ensuring practical applications and usability.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.