Manuscript Offprint

arXiv:2610.32919

SemantEq: Faithful Bidirectional Equivalence of Formal Statements

Xinrui Li, Pawan Sasanka Ammanamanchi, Siddharth Bhat, Rianna Jamdar, Yongxi Lin, Stella Biderman

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

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↔QP \leftrightarrow Q holds trivially for any two statements PP and QQ that the library proves, because a prover can prove each separately and pass through P↔True↔QP \leftrightarrow 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

1 INTRODUCTION

Formal theorem proving has improved quickly on benchmarks such as miniF2F, ProofNet, and PutnamBench (Zheng et al., 2022; Azerbaijan et al., 2023; Tsoukalas et al., 2024), in part because the Lean kernel checks every proof and gives models a reliable signal (de Moura & Ullrich, 2021). Models now also formalize at scale, from large problem sets (Ying et al., 2024; Lin et al., 2025; Wu et al., 2026) to whole textbooks and research papers (Rammal et al., 2026; Zhang et al., 2026b), and the Formal Conjectures project collects Lean statements of open problems (The Formal Conjectures Authors, 2025). The kernel, however, checks a proof only against its formal statement, not whether the statement says what the source says. Audits of benchmarks find statements that drop hypotheses, change domains, or become vacuous (Ospanov et al., 2025; Ammanamanchi et al., 2026), and an expert review of an agent's formalization found it weakest at choosing definitions, not at filling in proofs (Ilin & Nugent, 2026). As provers get stronger, the burden of correctness shifts from the proof to the statement.

At this scale no one can read every statement, so an automatic evaluator decides which formalizations count as correct. It is also often the reward for training the next formalizer (Wu et al., 2026; Yu et al., 2026) or the filter that keeps its outputs (Peng et al., 2026). A formalizer trained against an evaluator that accepts unfaithful statements therefore learns to produce them, and one trained against an evaluator that rejects valid rewordings is held back.

The ideal evaluator would compare a formal statement with its informal source directly, and learned judges try to (Lu et al., 2025; Peng et al., 2026; Rammal et al., 2026), but their verdicts come with no proof that anyone can check. We work in the setting where a trusted formal reference exists, as it does when large projects formalize the statements of their main results before the proofs (van Doorn et al., 2023; Tao, 2023; Commelin & Topaz, 2024) and when benchmarks ship references checked by people. The task is still hard, because one informal statement has many correct formalizations, which differ in variable names, hypothesis order, library definitions, or the form of the conclusion. Text similarity to the reference, such as BLEU (Papineni et al., 2002), therefore cannot tell a rewording from a different claim (Azerbaiyev et al., 2023). The same problem arises across language model evaluation. Biderman et al. (2024) call it “the Key Problem”: many syntactically different outputs express the same content, and the best available tools for detecting semantic equivalence are language models, which are the systems being evaluated. Responses fall into three groups: restricting the answer space so a program can check it, grading with a model, and grading by people. Formal mathematics seems to belong to the first group, because the kernel checks proofs. The kernel does not check statements, however, so statement autoformalization brings the Key Problem back.

A natural test is to prove that the candidate and the reference imply each other, but the test proves too much. In Lean, Nat.Prime 5 and Irrational (Real.sqrt 2) are logically equivalent, because Mathlib proves both. Each implication can then ignore its antecedent, the statement it assumes, and prove its conclusion outright. A candidate that states something true but different from the reference passes the same way, and a stronger prover finds such proofs for more pairs. The existing evaluators BEq and BEq+ restrict how the proof is found and check the proof text for the antecedent's name (Liu et al., 2025b; Poiroux et al., 2025). A restricted search can still close a goal from library facts alone, however, and a name in the text does not show that the antecedent did any work (Section 2). The question is therefore which proofs to accept.

SemantEq answers that question before any prover runs. It relates two statements when each turns into the other by a chain of four kinds of step, namely logical rearrangement, rewriting with an equation or biconditional that the library states, a change of variables, and structural weakening (Figure 1). Our programs read the proof term that Lean checks, not the tactic script that produced it, to see which steps a proof takes and whether it depends on the other statement. Because the rule is fixed apart from the prover, it separates the generation of equivalence proofs from their acceptance. Any prover can search for chains, and a stronger prover can find more of them without changing what an acceptance means.

We study two ways to find chains. SemantEq-Eval is a deterministic Lean metaprogram that searches for a chain in each direction and audits the proof term it finds, with no model and no GPU, in a median of two seconds per pair (mean 30.5 s, on the 407 equivalent pairs of Section 3.3) on a laptop CPU. On the ProofNetVerif test split, under our adjudicated labels, it accepts no non-equivalent pair, for a precision of 100% against 95.8% for BEq+, and its recall is 65.6% against 61.8%. The published labels give the same ranking. On 100 non-equivalent pairs assembled to test each audit, it accepts none, while BEq+ accepts 54 (Section 3). More search barely helps. Across our grid an 8.9-fold increase in CPU time adds at most three pairs, because many of the missed pairs need a step that the search is not built to take, such as building a new object to plug into the other statement (Section 3.3).

The second way lets a language model write the proofs. A compiling proof establishes the implication but not, by itself, that the two statements say the same thing, since under prompts that ask only for a compiling proof the model proves both directions of about two in five of the non-equivalent pairs. SemantEq-ProofAudit reads each proof term and accepts a direction only when it is built from the four kinds of defined step, apart from exceptions it records, and it names the rule that a rejected proof breaks. It accepts none of the 104 non-equivalent pairs and certifies 330 of the 407 equivalent pairs under the best of four prompts, against 266 for the search (Sections 4.1 and 4.2).

Our contributions are as follows.

• We define SemantEq, a relation that fixes the allowed steps by their effect, and prove that it is an equivalence relation whose related pairs are logically equivalent (Section 2.1).

• We build SemantEq-Eval, a search without a model that improves on BEq+ in precision and recall, and find where more search stops helping (Sections 2.2 and 3).

• We introduce SemantEq-ProofAudit, which audits proofs from any prover and separates equivalent from non-equivalent pairs where compilation does not (Section 4).

SemantEq checks agreement with a formal reference, not with the informal source, so a candidate that copies a mistake in the reference still passes. A rejection means only that no proof passed the search and its audits, not that the two statements differ.

References (92)