Manuscript Offprint

arXiv:2610.05367

AIProver: Agentic Auto-Formalization of Mathematical Research via Certificate-Driven Evolving Harness

Prithwish Jana, Viet Bach Hoang, Logan Luna, Viresh Pati, Akash Singirikonda, Cy Xie, Lisa Carbone, Wuyang Chen, Walter Moreira, Joe Stubbs, Sriram Vishwanath, Vijay Ganesh

ABSTRACT

Proof auto-formalization translates natural-language (NL) theorems and proofs into a formal language (FL) such as Lean, enabling mechanical verification. Despite rapid progress, research-level proofs often depend on concepts missing from leading proof assistant libraries (e.g., Lean's Mathlib), and successful compilation does not guarantee that a translation preserves the theorem's meaning or the proof's reasoning. Furthermore, aligned NL-FL training data are scarce, and leading agents often rely on costly frontier models and manually engineered harnesses.

To address the above issues, we present AIPROVER, an agentic framework for autonomous proof auto-formalization and proof synthesis (AFPS) that jointly post-trains a 119B open-weight language model and evolves its agentic, tool-calling harness with HarnessEvolve. Verifiers assess type correctness, proof completeness, and semantic correctness, returning rewards and diagnostic certificates that drive model fine-tuning and alternating reinforcement learning via symbolic feedback and HarnessEvolve, a certificate-driven evolutionary search over the whole harness control flow that re-tailors the harness to the updated model. HarnessEvolve retains and generalizes rejected designs as negative evidence to steer later mutations away from unproductive parts of the search. For research-level training and evaluation, we introduce LoCoBench, 58.9k instances from Mathlib, CSLib, Mizar Math Library, and a bounded-arithmetic textbook, combining 18.8k labelled NL–Lean pairs and 40.1k unlabelled NL–Mizar pairs with a 771-instance validation split whose theorem–proof pairs have no public Lean formalization. Against 39 frameworks spanning AFPS agents, frontier LLMs, and coding agents, AIPROVER lifts pass@4 semantic correctness over its Leanstral-1.5 base from 15.7% to 36.7% and outperforms every other open-weight system and Aristotle. As a Claude Code and Codex skill, it lifts their semantic correctness from 41.9% and 34.1% to 79.8% and 62.4%, respectively, outperforming Numina-Lean-Agent (72.5% and 44.5%) and OpenGauss (54.3% and 41.9%) in that role. Further, it is also 24% cheaper than Numina-Lean-Agent, pushing the accuracy–cost frontier of research-level AFPS.

1 INTRODUCTION

AI agents for mathematics are making rapid progress, with headline results such as the resolution of the Navier–Stokes conjecture (OpenAI, 2026c) and the complete formalization of Fermat’s last theorem (FLT) (Anthropic, 2026c). Key to this success is auto-formalization, the translation of natural language (NL) theorems and proofs into formal language (FL) counterparts. Most prior work on proof auto-formalization builds on large language models (LLMs) but targets competition and undergraduate mathematics, whose theorems and proofs are short and self-contained (Cabral et al., 2026; Liu et al., 2026b). Research mathematics instead involves long chains of interdependent definitions, lemmas, and proofs often absent from libraries such as Mathlib (2020) and CSLib (Barrett et al., 2026). A single LLM call is ill-equipped for such intricacies. Hence, recent work, such as the FLT formalization, has turned to agentic systems that wrap the LLM in a harness: in a stateful multi-turn loop with Lean and search tools, the agent iterates until the proof checks or hits an unresolvable error. Open-source harnesses LeanMarathon (Zhang et al., 2026), Numina-Lean-Agent (Liu et al., 2026a), and OpenGauss (Math, Inc., 2026) and the closed-source Aristotle (Achim et al., 2025) implement this loop, and general-purpose coding harnesses such as Claude Code (Anthropic, 2025) and Codex (OpenAI, 2025) are also used by mathematicians (Tao, 2026; Ilin & Nugent, 2026).

Despite this progress, these agentic systems share five limitations. Cost: Claude’s FLT formalization took eleven days and six billion output tokens (Anthropic, 2026c;b), resources at frontier rates beyond

*Corresponding author: pjana7@gatech.edu. Project page: jprithwish.github.io/AIProver

†^{\dagger}Equal contribution, sorted by last name. §^{\S}Equal senior authorship, sorted by last name.

typical academic budgets. Human-in-the-loop dependence: mathematicians supplied Fermat's FL target statements and stayed involved (Anthropic, 2026c; Chen et al., 2026), Gauss ran on an expert-built, iteratively-refined harness (Math, Inc., 2025), and Meta's AutoformBot, with 26 textbooks formalized, calls human involvement essential (Rammal et al., 2026). Jagged intelligence: frontier models excel at many tasks yet falter on unfamiliar ones; expert review of Claude's formalization (Ilin & Nugent, 2026) found strong local proof repair but poor definitions and interfaces, and no model proves over 20% of ArXivLean's recent research theorems (Gehrunger et al., 2026). Semantic drift: output cannot be trusted as-is. Lean checks the FL proof against the FL theorem, not the NL one, so compiled code may prove the wrong theorem (Han et al., 2026) or silently patch a flawed NL proof step (Cornish et al., 2026). Lack of accessibility: headline results often rest on non-public models: FLT and Navier–Stokes reportedly used internal ones (Anthropic, 2026c; OpenAI, 2026c; Reeve, 2026), so the auto-formalization and proof synthesis (AFPS) process cannot be cross-checked.

These limitations set our goal: an affordable, autonomous AI agent for semantically correct and faithful proof auto-formalization of research-level mathematics. Given NL research text interleaving theorems and proofs, it should (a) produce a full Lean counterpart preserving each theorem's meaning and proof's reasoning, (b) run unattended, (c) use an open-weight model via a model-agnostic training and harness recipe, and (d) be a sub-agent or skill of frontier agents. It should serve standalone as an open-source platform making research-level formalization accessible to all, and in conjunction with frontier agents as a Lean specialist pushing their accuracy-cost frontier, since frontier models will likely stay the most expensive for the foreseeable future (Tao, 2025).

Achieving this goal requires addressing four issues. First, NL–FL semantic alignment: decoder-only LLMs are fine-tuned to maximize the next-token likelihood of a reference output (Ouyang et al., 2022; Zhou et al., 2023), so it never learns that an NL theorem or proof and its FL counterpart are the same mathematical object in two syntactic forms. Prior work adds alignment outside the generator, in a retrieval encoder (ProofBridge, Jana et al., 2026b), a critic (CriticLean, Peng et al., 2026), or a scorer (FormalAlign, Lu et al., 2025); we hypothesize that an LLM internalizing this equivalence instead formalizes more accurately. Second, fine-grained training signal: most AFPS models are trained with reinforcement learning (RL) on Lean's binary verdict (Ren et al., 2025; Wang et al., 2025a), which never compares the output with the NL input or reference FL, so a formalization that compiles but proves the wrong theorem counts as success. Such drift is common: on ShadowBench (Han et al., 2026) the best agent compiles 61.8% of research-level statements yet only 11.2% align semantically, and FaithformBench (Cornish et al., 2026) finds pervasive silent correction of invalid NL steps. Third, research-level training data: learning either signal at research level needs gold-standard NL–Lean theorem–proof pairs, which barely exist: ShadowBench (178) and ArXivLean (41) are evaluation sets. Mizar (Bancerek et al., 2018) and Rocq MathComp (Mahboubi & Tassi, 2021) hold decades of verified research mathematics, but in neither NL nor Lean. Fourth, AFPS-tailored harness design: an agent's performance depends as much on its harness as on the model (Tian et al., 2026; Milikic et al., 2026), yet harnesses such as LeanMarathon and Numina-Lean-Agent retain the control flow of Claude Code and Codex that are built for software engineering. This control flow is suboptimal for Lean proving as well as for open-weight models, whose error modes and prompt sensitivity differ (Sclar et al., 2024), and hand-tailoring harnesses takes months (Cognition, 2026).

Contributions. The main contributions of this paper are summarized as follows:

• The AIPROVER proof auto-formalization agent with an evolving harness. We present AIPROVER, a framework to post-train an open-weight LLM and to simultaneously evolve its harness. Verifiers for completeness, type- and semantic correctness return a fine-grained reward and certificate, so RL and HarnessEvolve learn from partial success. Per round, HarnessEvolve adapts harness control flow to the model, then RL post-trains the model within it. To our knowledge, it is the first attempt to discover auto-formalization harnesses aligned to the LLM (Sec. 4.2).

• LoCoBench, a research-level benchmark for proof auto-formalization. We introduce LoCoBench, 58.9k instances (18.8k NL–Lean, 40.1k NL–Mizar) in algebraic structures, foundations, logic, & complexity, and number theory. We curate 771 validation instances from Mizar theorems with the longest proofs and a bounded-arithmetic textbook: NL theorem-proof pairs with no Lean formalizations online to retrieve or imitate and, to our knowledge, the first Mizar-to-Lean test at scale. We build it because no existing research-level dataset offers NL theorem-proof pairs at this scale: for instance, ShadowBench has only 178 examples and ArXivLean no proofs (Sec. 5.1).

• State-of-the-art proof auto-formalization results. We test AIPROVER against 39 systems comprising AFPS models and agents, frontier LLMs, and coding agents (Sec. 5). As a standalone agent built from Leanstral-1.5 in the Vibe harness, AIPROVER lifts pass@4 semantic correctness from 15.7% to 36.7%, beating the best open-weight system OpenGauss (21.5%) and Aristotle (18.4%). In conjunction with coding agents, AIPROVER+Claude Code (CC) reaches 79.8% vs. 41.9% (CC alone), 72.5% for Numina-Lean-Agent (NLA)+CC and 54.3% for OpenGauss (OG)+CC; with Codex it reaches 62.4% vs. 34.1% (Codex alone), 44.5% (NLA+Codex) and 41.9% (OG+Codex). It pushes the accuracy-cost frontier: 0.32/attemptstandalone,0.32/attempt standalone,1.55 with CC vs. 2.03(NLA+CC),2.03 (NLA+CC),0.85 with Codex vs. $1.08 (NLA+Codex), thus higher accuracy at lower cost.

References (61)