PaperFormalizer: Author-in-the-Loop Autoformalization of Research Papers in Lean
PaperFormalizer is an author‑in‑the‑loop system that converts LaTeX papers into Lean‑verified code, letting researchers close proof gaps while retaining full control over interpretation.

Introduction
Research papers that rely on mathematical proofs often contain subtle gaps—missing assumptions, ambiguous statements, or informal reasoning that can undermine confidence in the results. PaperFormalizer tackles this problem by providing an interactive pipeline that translates a LaTeX manuscript into a Lean formalization, audits each claim for clarity, and lets the author resolve ambiguities before the proof is committed to a machine‑checked library. The result is a revised paper annotated with verified Lean code, a change report, and a reusable toolkit that grows as more papers are formalized.
How the Pipeline Works
- Dependency Graph Extraction – Starting from the LaTeX source, the system parses sections, theorems, lemmas, and definitions, building a directed graph that captures which statements depend on which others. This graph guides the order in which formalizations are attempted.
- Natural‑Language Auditing – For each node, an AI‑driven auditor checks the statement for faithfulness to the author’s intent, flagging ambiguous phrasing or missing hypotheses. The auditor presents a concise natural‑language summary and a list of potential interpretations.
- Author‑In‑the‑Loop Decision – When multiple readings are possible, the pipeline pauses and shows the author a set of concrete proposals (both in TeX and Lean syntax). The author can accept a proposal, reject it, or provide a custom clarification. This step ensures that the formalization never diverges from the intended claim.
- Lean Formalization & Proof – Once the statement is disambiguated, a coding agent (e.g., Claude Code or Codex) generates Lean code that encodes the claim and attempts a proof using Mathlib and any optional domain libraries the author supplies. Successful proofs are linked back to the original statement in the manuscript.
- Output Generation – The final deliverable includes:
An annotated PDF where each formalized statement is hyperlinked to its Lean definition. A change‑log summarizing all author decisions and repaired gaps. * A Lean repository containing the verified code, ready for reuse by downstream researchers.
Benefits for Researchers and the Community
- Robustness – By catching hidden assumptions early, authors can publish papers that withstand rigorous scrutiny, reducing the need for post‑publication errata.
- Reusability – Verified Lean snippets become building blocks for future work. When a paper is shared, other researchers can import its Lean library, ensuring that subsequent results inherit the same level of formal assurance.
- Incremental Toolkit Growth – Each formalization adds to the author’s personal collection of lemmas and tactics. Over time, this personal toolkit can be contributed back to the broader Mathlib ecosystem, enriching the community’s resources.
- Transparency – The audit log records every point where the author intervened, providing a clear provenance trail that reviewers and readers can inspect.
Practical Considerations
- Learning Curve – Authors need a basic familiarity with Lean syntax, but the system’s natural‑language prompts and step‑by‑step guidance lower the barrier to entry.
- Computation Resources – Formalizing large sections can be compute‑intensive; the pipeline is designed to run on cloud instances with scalable resources, and intermediate results are cached to avoid redundant work.
- Domain Libraries – While Mathlib covers a broad swath of mathematics, specialized fields may require custom libraries. PaperFormalizer allows authors to plug in their own Lean files, ensuring coverage for niche topics.
Conclusion
PaperFormalizer bridges the gap between informal mathematical exposition and fully verified proof assistants. By embedding the author at every decision point, it preserves the creative intent of research while delivering the rigor of Lean verification. As more papers adopt this workflow, the scholarly ecosystem will benefit from higher confidence in results, reusable formal artifacts, and a collaborative culture that treats verification as a natural extension of the writing process.
Source
Read original sourceWhy we picked this
Core AI research paper introducing a new formalization pipeline for research papers.