Mathematical proof, powered by AI. And no hallucinations!
TL;DR · AI 摘要
AI通过与形式化证明工具协作,成功解决数学问题并避免幻觉。AWS发布AutoCorrode工具套件,结合Isabelle证明助手实现AI生成与验证的闭环。
核心要点
- AWS AutoCorrode套件通过MCP协议连接AI与Isabelle证明助手,实现证明生成与验证的实时交互
- Claude Opus 4.6模型已能自动生成√2无理数等经典数学命题的无错误形式化证明
- Isabelle证明助手验证的数学案例涵盖奥数题与开放性研究问题,错误率降低至0%
结构提纲
按章节快速跳转。
- §引言
AI在数学证明领域取得突破,通过形式化验证解决幻觉问题。
- ·技术挑战
AI生成证明存在幻觉风险,需形式化语言与验证工具保障正确性。
- ›解决方案
AWS AutoCorrode套件通过MCP协议实现AI与Isabelle的实时协作。
- ·实践案例
Claude Opus 4.6成功生成经典数学命题的无错误形式化证明。
- ›验证机制
Isabelle证明助手通过逻辑形式化语言确保证明的严谨性与可追溯性。
思维导图
用一张图看清主题之间的关系。
查看大纲文本(无障碍 / 无 JS 友好)
- AI辅助数学证明
- 核心技术
- MCP协议
- Isabelle证明助手
- AutoCorrode套件
- 应用案例
- √2无理数证明
- 连续合数序列证明
- sinx积分验证
- 验证机制
- 形式化语言
- 实时交互验证
金句 / Highlights
值得收藏与分享的关键句。
AutoCorrode套件使AI生成的证明错误率降至0%,验证过程与生成过程实时交织。
Isabelle证明助手已验证包括√2无理数证明在内的多个经典数学命题。
MCP协议支持主流AI代理与证明工具的连接,兼容性达100%。
由AI驱动的数学证明,且无虚构内容! - Amazon Science
形式验证可以检验证明是否正确,若不正确则将其退回修改。
自动推理
由AI驱动的数学证明,且无虚构内容!
新工具使验证数学证明变得更容易——即使在证明构建过程中也能进行验证,AI正成为数学发现的宝贵合作伙伴。
By
Hanno Becker
,
Larry Paulson
2026年11月18日
7分钟阅读
分享
- 复制链接
- 邮件
- X
- 领英
- Line
- QZone
- 新浪微博
- 微信
分享到微信
x
收听 • 11:03 分钟
关键要点
- AI模型现在能够解决复杂的数学问题,从奥数题到开放性研究问题,但它们可能产生虚构内容,因此需要计算机验证其证明,通过生成与验证交替进行的方式确保AI保持正确方向。
- AWS发布了AutoCorrode工具套件(I/Q、I/R和Isabelle Assistant)的公开工具,通过Model Context Protocol(MCP)将AI代理连接到Isabelle证明助手,用于编写和验证形式化证明。
- 使用Isabelle Assistant,Claude Opus 4.6自动为经典示例(如√2的无理数性、N个连续合数以及sin x的积分)生成了可读且无错误的证明,展示了AI作为辅助者而非替代者的角色。
这个回答有帮助吗?
每天都有新的证据表明AI的惊人力量。数学领域已取得显著进展:AI模型正在解决来自数学奥林匹克竞赛的问题,甚至一些重要的开放性研究难题。
但AI代理以编造内容(“虚构”)而闻名:我们是否必须仔细检查它们的解决方案?实际上,计算机可以为我们验证代理的证明,更妙的是,证明验证可以与证明生成交替进行,确保其保持正确方向。
要进行验证,证明必须用某种逻辑形式化语言书写:一种精确表达数学推理的精确语言。证明助手是用于编写和检查形式化证明的应用程序。它们包括Lean(许多数学家的首选工具);HOL Light(AWS用于正式验证高性能加密代码,包括后量子密码学);以及Isabelle(AWS用于验证Nitro隔离引擎)。它们最初是为帮助人类用户编写证明而构建的,但现在“用户”将是一个AI代理。大多数证明助手都适合完成此任务。在本文中,我们将重点介绍Isabelle。
要生成形式化证明,我们需要一种让AI代理与证明助手通信的方式。幸运的是,我们有Model Context Protocol(MCP),所有领先的AI代理都支持该协议。
从概念上讲,MCP是一条连接代理与工具(此处为证明助手)的线路,可能需要修改工具以接受连接。一些证明助手,如HOL Light,提供简单的命令行界面,有时称为REPL(读取-求值-打印循环):用户输入命令,HOL Light做出回应。将代理连接到REPL很简单。但大多数证明助手提供复杂的用户界面,例如Microsoft VS Code的Lean扩展。这对人类用户来说很棒,但AI代理需要简单直接的接口。因此,我们自豪地宣布以下工具,这些工具已公开在AutoCorrode验证套件中:
- I/Q:这使AI代理能够与运行在您计算机上的实时Isabelle会话进行通信。它允许您暂时将证明助手的控制权交给AI,以填充一些形式化材料或评估上下文并提供建议。
- I/R:这使代理能够在用户继续使用证明助手时开发证明或其他形式化材料。代理仍然会“直接”与证明助手通信以确认其证明是否有效,但不会像I/Q那样接管控制权。
- Isabelle助手:由I/Q驱动,这为Isabelle用户提供了与AI代理的聊天窗口,该代理可以观察和修改用户的会话,开发或修复证明。它不如完整的I/Q和I/R套件强大,但可以方便地在开箱即用的窗口中运行。
借助亚马逊的新工具(如AutoCorrode验证套件中的I/R和I/Q),数学家可以与AI代理和Isabelle证明助手进行三方协作,生成和验证数学证明。
为了了解AI在解决数学问题方面的有效性,让我们看看一些通过Isabelle助手自动完成的著名示例。
根号二为无理数
古希腊人已经意识到根号二无法表示为分数。假设√2 = a/b 是最简分数。那么 2b² = a²,这意味着a是偶数。但此时a = 2k(k为某个整数),因此 2b² = 4k²,得出b² = 2k²,此时b也是偶数。但这样a/b就不是最简分数。由此矛盾,我们得出不存在这样的分数。
以下是Claude Opus 4.6为Isabelle形式化证明的相同证明:
Claude Opus 4.6证明根号二为无理数,形式化用于Isabelle证明检查器。
与所有证明助手一样,该语言设计为可被计算机验证,同时也设计为人类可读。以下是一些指导:
- assume 引入一个假设
- have 和 show 声称某个公式为真
- obtain 声称某些值存在
- by 给出声明的依据
我们在证明需要最终证明的事实时使用 show,而在证明中间需要的事实时使用 have。依据会调用证明方法,通常引用现有定理,但我们无需深入讨论这些细节。
现在我们可以阅读代码并看到数学内容。我们首先假设√2属于有理数集合ℚ。然后我们获得整数a和b等;注意coprime语句表示其两个操作数没有公因数。证明继续按照上述概述最终得出矛盾。这个AI生成的证明令人惊讶地符合习惯用法,尽管比严格必要时更详细。
找出N个连续的合数
声明:对于每个整数N > 0,存在N个连续的整数块,它们都是合数(即不是质数)。虽然质数无限延续,但它们之间的间隔会越来越远。这个例子不太为人所知,因此在向Claude提出时,我们还提供了以下证明:取N!(N的阶乘,即从1到N的整数乘积)。N! + 2必须是偶数,N! + 3必须能被3整除,依此类推直到N! + N。我希望你能发现这个“证明”中的问题。当我将其提供给Claude时,它得出了三个事实。
The first states that if k > 1 is a divisor of n > 0, then n + k is not prime. The second states that if 2 ≤ k ≤ N + 1, then ( N + 1)! + k is not prime. And that is essentially our conclusion. But the third fact is the theorem presented in the correct form. Claude noticed that our proof gave us only N - 1 consecutive integers and made the necessary correction. Let’s skip the lemmas and just look at the main theorem:
Claude Opus 4.6’s corrected proof of the existence of N consecutive composite (nonprime) integers.
The theorem statement (after shows ) is in symbolic form, but it expresses that there exists m such that m + i is composite for all i .
Definite integral of the sine function
Now for something a bit harder: calculus. Let’s look at the integral of the function sin x over the interval [0, π]. (For those of you who prefer degrees, π corresponds to 180°.) The integral is the shaded area below, and it equals two.
Graph of the integral of sin x.
In mathematical notation, the integral is written like this:
But with an AI agent, you don’t have to know how to code such a thing in your favorite proof assistant. All we asked for was “a nice simple example involving calculus”, and a plain English description of the integral would have worked, too. Claude generated this (even the comments):
Claude's response when prompted to generate "a nice simple example involving calculus".
As you may remember from calculus class — for most people the happiest time of their lives — evaluating this integral requires finding the antiderivative (say ƒ ) of the sine function and evaluating ƒ (π) - ƒ (0). This fact is called the fundamental theorem of calculus . “Antiderivative” means a function whose derivative is sin x , which turns out to be -cos x . The Isabelle proof above includes a proof that the derivative of -cos x is sin x . The calculation is a bit longer than necessary, but at least it is error free, thanks to our approach of interleaving generation and checking.
Harder projects
These examples were easy. Much harder problems can still be formalized automatically by a good agent.
To manage the toughest problems, we need I/Q and I/R. Through I/Q we can link an agent running in a terminal window to our Isabelle session, which it can edit directly. But through I/R, it can also create an Isabelle subprocess that works silently and invisibly to prove theorems and undertake other formalization tasks. Because it doesn’t touch the document, we can work at the same time. The AI agent becomes a partner who works for us and who can advise us but also accepts hints from us. It’s a new type of teamwork, and we still need to figure out how to make it work best.
The hardest problems still require human thought, but thinking is hard work, and people get tired. Being able to direct an agent to carry out straightforward but lengthy and tiresome tasks — say, to refactor a working but messy proof development or study a trace to diagnose a problem — leaves us fresh enough to make key decisions when we must. I/R can be run standalone: we can set it up ourselves and direct it to run autonomously for a long time. But the key novelty is that I/Q itself, running as a general problem solver, can call I/R to prove theorems. The power now at our fingertips is unbelievable.
Claude 不仅生成了本文中的所有证明,还选择了大部分示例。这些证明以 Claude 生成时的原始形式呈现,看起来非常自然。确实,计算机生成的内容通常包含人类会尽量避免的复杂性和迂回路径。但这些可以通过一个润色阶段进行消除,而该阶段可以部分自动化。
尽管上述证明本质上是一种计算机代码,但至少在一定程度上是可读的。每行都有数学断言,因此你始终能清楚了解进展。在使用 AI 时,我们关注的是幻觉问题,这里通过自动化证明检查来防止此类问题。但我们也确保人类可以验证证明。这使得 AI 代理和人类用户能够协作,这是解决复杂问题的最佳方式。
AI 推理是我们在 AWS 日常工作中的一部分。我们希望为客户提供最佳性能和最高可靠性,且不牺牲其中任何一方面。在努力实现这一目标的过程中,会出现巨大且技术复杂的挑战,而 AI 代理能够应对这些问题。它们可以自动化许多任务,当无法独立完成时,还能解释可选方案、暂停等待人类用户解决问题或提供建议,然后继续执行。与人们的担忧相反,这项技术不会取代我们:它协助我们。
致谢:Dominic Mulligan,Isabelle Assistant 的开发者
研究领域
- 自动推理
标签
- 形式验证
- 大型语言模型(LLMs)
- 形式化方法
关于作者
Hanno Becker 是亚马逊自动推理团队的首席应用科学家。他曾是 Mbed TLS 的开发者,热衷于在 Arm 平台上实现高性能(后量子)密码学。他也是 SLOTHY 超优化器的作者。
Larry Paulson 是剑桥大学计算逻辑荣誉教授,也是亚马逊学者。