SemantEq:形式化陈述的忠实双向等价性
SemantEq: Faithful Bidirectional Equivalence of Formal Statements
AI总结:
本文针对形式化陈述等价性测试的缺陷,提出SemantEq等价关系及相关评估、审核方法,在ProofNetVerif测试集上提升了等价判断的精度与召回率,分离证明生成与审核实现了性能优化。
摘要:
陈述自动形式化是指将数学内容从自然语言转换为Lean 4等证明助手的过程,目前模型已能大规模完成该任务。随着证明器能力增强,正确性的负担从证明本身转移到陈述上,即形式化陈述是否忠实于其源内容。给定可信的参考形式化,逻辑等价性是自然的测试方式,但该方法存在缺陷:对于证明库中已有的任意两个陈述P和Q,P↔Q会平凡成立,因为证明器可分别证明P和Q,再通过P↔True↔Q完成推导。证明器越强,越会有更多不相关的陈述对通过该测试。早期方法会限制证明器,并检查每个证明是否引用了另一个陈述。本文提出SemantEq,一种更具原则性的等价关系,它要求每个陈述仅能通过一系列允许的步骤(如逻辑重排、利用证明库自身等式进行重写)转换为另一个陈述。我们的程序通过Lean检查的证明项而非策略脚本来判断证明。SemantEq-Eval是一种不依赖模型的搜索方法,在经我们裁定标签的ProofNetVerif测试拆分上,其精度达100%、召回率达65.6%,而BEq+的精度和召回率分别为95.8%和61.8%;其CPU时间增加8.9倍,但仅多检测出3对陈述。语言模型能找到更多证明,但在4种提示中的2种下,约2/5的非等价陈述对会被证明器双向证明。SemantEq-ProofAudit基于该关系衍生的策略审核每个模型生成的证明,对104对非等价陈述对均不接受,且在最优提示下,其对407对等价陈述对的召回率从65.4%提升至81.1%。将等价证明的生成与审核分离,可让更强的证明器在不改变审核含义的前提下提升召回率。我们在该httpsURL处发布代码和数据。
英文摘要:
Statement autoformalization translates mathematics from natural language into a proof assistant such as Lean 4, and models now do it at scale. As provers get stronger, the burden of correctness shifts from the proof to the statement, that is, to whether the formal statement faithfully translates its source. Given a trusted reference formalization, the natural test is logical equivalence, and it proves too much. $P \leftrightarrow Q$ holds trivially for any two statements $P$ and $Q$ that the library proves, because a prover can prove each separately and pass through $P \leftrightarrow \mathrm{True} \leftrightarrow Q$. The stronger the prover, the more unrelated pairs pass. Earlier methods restrict the prover and check that each proof names the other statement. We introduce SemantEq, a more principled relation that instead requires each statement to turn into the other only through a chain of allowed steps, such as logical rearrangement and rewriting with the library's own equations. Our programs judge a proof by the proof term Lean checks, not by its tactic script. SemantEq-Eval, a search without a model, reaches 100% precision and 65.6% recall on the ProofNetVerif test split under our adjudicated labels, against 95.8% and 61.8% for BEq+, and an 8.9-fold increase in its CPU time adds at most three pairs. A language model finds more proofs, but under two of four prompts it proves both directions of about two in five of the non-equivalent pairs. SemantEq-ProofAudit audits each model-written proof under a policy derived from the relation and accepts none of the 104 non-equivalent pairs, and it raises recall on 407 equivalent pairs from 65.4% to 81.1% under the best prompt. Separating the generation of equivalence proofs from their acceptance lets a stronger prover raise recall without changing what an acceptance means. We release code and data at: https://github.com/hlxr89/SemantEq
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。