NTH

Beyond the Library: An Agentic Framework for Autoformalizing Research Mathematics

AuthorsArshia Soltani Moakhar, Iman Gholami, Max Springer, Mahdi JafariRaviz, MohammadTaghi Hajiaghayi

August 11, 2026 2 min read
Watch on YouTube
The one-line take

An agentic system turns advanced mathematical research into verified Lean proofs, even when the required concepts are missing from existing libraries.

Key results

32
PutnamBench sample

Random problems solved end-to-end by Theo

91.3%
PutnamBench lower-bound accuracy

Wilson lower-bound accuracy at 95% confidence

5
Operational cost per problem

Approximate dollars per PutnamBench problem using a standard subscription

2
Kernel-only developments

Research-paper developments requiring no axioms beyond Lean’s kernel

What the paper found

Theo is an agentic autoformalization framework that turns research mathematics from PDF and LaTeX into machine-checked Lean 4. Built around Claude Code and Claude Opus 4.7 or 4.8, its orchestrator dynamically backtracks across two pipelines: statement formalization and recursive proof construction. The key novelty is a type-first strategy for concepts missing from Mathlib, combined with auxiliary lemmas that act like unit tests for newly defined mathematical types. A Faithfulness Judge uses direct comparison and back-translation to detect semantic mismatches, while Claim Check prevents agents from quietly changing theorem or lemma statements during proving. On a random 32-problem PutnamBench sample, Theo solved all 32, establishing a 91.3% lower-bound accuracy at 95% confidence, with an operational cost of about $5 per problem on a standard subscription. The system also formalized main results from seven research papers spanning combinatorics, communication complexity, mechanism design, learning theory, discrete geometry, and graph theory, including two recent OpenAI manuscripts. Two of these developments were fully machine-checked with no axioms beyond Lean’s kernel. The framework additionally exposed an expert-verified gap in one published proof, isolating the disputed result as a single explicit axiom rather than silently accepting it. The study positions general coding agents such as Claude as a practical alternative to specialized provers including DeepSeek-Prover-V2, especially when research mathematics exceeds existing formal libraries.

Original abstract

While Large Language Models (LLMs) have demonstrated exceptional capabilities in mathematical reasoning, they frequently produce subtle errors that evade human detection. Formal mathematical languages like Lean 4 offer mechanical proof checking, strongly motivating the need for autoformalization: the automatic translation of natural language mathematics into verifiable code. Recent trends indicate that general-purpose LLMs, heavily optimized for standard programming, now outperform smaller models explicitly fine-tuned for Lean. Leveraging this shift, we introduce an agentic autoformalization framework powered by general coding LLMs. At the core of our system is an orchestrator that manages a multi-agent pipeline tailored for research-level mathematics. Because cutting-edge research frequently relies on concepts outside the scope of existing libraries like Mathlib, our system dynamically extends necessary type definitions and validates them via a novel Auxiliary Lemma technique before formalizing the primary theorems. We applied our approach to PutnamBench, producing machine-checked Lean proofs for a random sample of 32 problems. Furthermore, we evaluate our system on five papers from the ACM Symposium on Theory of Computing (STOC) spanning combinatorics, communication complexity, mechanism design, and learning theory, successfully formalizing their main theorems and validating the generated formalizations with human experts; for all five we also formalize the proofs alongside the statements, and notably two of them are proved with no axioms beyond Lean's kernel. All of our formalizations are available at https://beyondthelibrary.github.io/formal_arxiv .

Read the original paper

More in Code Generation

Browse all 43 papers →
02Code Generation

Groupwise Agentic Grading and Advantage Redistribution for Code Agent RL

Jinhao Dong, Liang Zhao, Zihao Yue, Wenhan Ma, Linghao Zhang, Lei Li, Shicheng Li, Yifan Song, Bowen Ye, Fuli Luo

GAGAR helps code agents learn not only to pass tests, but to produce cleaner and more targeted implementations by redistributing RL credit according to agentic quality judgments.

Read analysis