PaperFormalizer Turns LaTeX Papers into Verified Lean Code, with the Author in the Loop

Jiyuan Tan, Vasilis Syrgkanis and José Blanchet have released PaperFormalizer. It is an agentic Lean pipeline that takes a paper's LaTeX source, finds gaps in its proofs and assumptions, and turns the work into a compiler-verified version. The tool runs inside the coding agents Claude Code or Codex. The key feature is that the author stays in the loop. The system stops and asks a question if a statement can be read in two ways, and it presents every fix as a suggestion the author can accept, reject or redirect. The output is three artifacts: an annotated paper, a report of changes, and Lean code in which every declaration is linked to the statement it formalizes. • It draws on Mathlib, domain libraries and the author's personal set of lemmas, which grows from paper to paper • Verified papers can be published on paperformalizer.org • The code is open source on GitHub: Jiyuan-Tan/PaperFormalizer

AI-processed from Hugging Face Daily Papers; edited by Hamidun News
PaperFormalizer Turns LaTeX Papers into Verified Lean Code, with the Author in the Loop
Source: Hugging Face Daily Papers. Collage: Hamidun News.
Listen to article
Article Fact Sheet & Key Figures
ParameterDetails
Primary sourceHugging Face Daily Papers ↗
Editor-in-Chief
Key metric #1It draws on Mathlib, domain libraries and the author's personal set of lemmas, which grows from paper to paper
Key metric #2Verified papers can be published on paperformalizer.org
The code is open source on GitHubJiyuan-Tan/PaperFormalizer

A team from Stanford has proposed a way to make formal verification of mathematical papers a routine part of preparing a publication. PaperFormalizer, released by Jiyuan Tan, Vasilis Syrgkanis and José Blanchet, turns a LaTeX source into a Lean-verified version of the work. It runs as an agentic pipeline inside Claude Code or Codex. The key idea: even a carefully proofread paper can contain small gaps in its proofs or in how its assumptions are stated, and the best person to close them is the author, with the machine helping.

A pipeline from LaTeX to Lean

The process starts with the source file. PaperFormalizer transcribes the paper into a dependency graph of statements: which lemmas each theorem needs and what rests on what. Each statement then goes through a natural-language audit along three axes: fidelity to the original meaning, ambiguity and correctness. Only after that does the system formalize the statements and prove them in Lean.

For the proofs, the pipeline draws on several sources:

  • Mathlib, the main mathematical library for Lean;
  • optional domain libraries for a specific field;
  • the author's personal toolkit, meaning their own lemmas and definitions.

This toolkit accumulates over time. The more papers an author runs through the system, the more ready-made building blocks are available for the next one.

The author decides what the paper claims

Autoformalization often suffers from a silent substitution of meaning. A model can prove a formally flawless theorem that does not say what the author meant. PaperFormalizer's creators start from the premise that only the author knows what a statement is supposed to mean and how best to close a formalization gap.

The system therefore follows several rules:

  • if a statement allows more than one reading, the pipeline stops and asks a question;
  • every fix is presented in natural language and in TeX symbols as a suggestion that the author can accept, reject or redirect;
  • any decision that could change what the paper claims stays with the author.

Unlike systems that try to formalize other people's work entirely on their own, here the human acts as the arbiter of meaning, while the machine handles the heavy mechanics of proving.

What the author gets

The result consists of three parts:

  • an annotated and corrected version of the paper;
  • a report on all changes made;
  • Lean code in which every declaration is linked to the statement it formalizes.

That last link matters for readers. They can open any theorem in the text and see the corresponding verified Lean object, rather than hunting for the match by hand.

A shared library of verified papers

The authors also propose an ecosystem layer. Researchers can publish verified papers on paperformalizer.org, and those who build on these results can reuse the ready-made Lean code. This lowers the cost of formalizing the next paper in the same field: the necessary definitions and lemmas already exist and have been verified.

The tool is published on GitHub in the Jiyuan-Tan/PaperFormalizer repository. The paper came out on 22 October 2026 and made it into Hugging Face Papers' daily digest; the organization is listed on the page as Stanford University.

What this means for researchers

For mathematicians and theorists in statistics, economics and machine learning, whose conclusions rest on proofs, this is a way to get an independent check before submitting to a journal. It is especially useful where errors in assumptions slip through peer review unnoticed. The barrier to entry is lower than for manual formalization in Lean: you need a LaTeX source, access to Claude Code or Codex, and a willingness to answer the system's questions.

Caution is also warranted. The pipeline checks that a formal statement is proven, but a human still has to confirm that the formalization matches the intent. The quality of the result therefore depends on the author's attention at exactly those points where the system stops and asks.

Story

Key Questions Answered

What are the key details on A pipeline from LaTeX to Lean?

The process starts with the source file. PaperFormalizer transcribes the paper into a dependency graph of statements: which lemmas each theorem needs and what rests on what. Each statement then goes through a natural-language audit along three axes: fidelity to the original meaning, ambiguity and correctness. Only after that does the system formalize the statements and prove them in Lean. For the proofs, the pipeline draws on several sources: Mathlib, the main mathematical library for Lean; optional domain libraries for a specific field; the author's personal toolkit, meani

What are the key details on The author decides what the paper claims?

Autoformalization often suffers from a silent substitution of meaning. A model can prove a formally flawless theorem that does not say what the author meant. PaperFormalizer's creators start from the premise that only the author knows what a statement is supposed to mean and how best to close a formalization gap. The system therefore follows several rules: if a statement allows more than one reading, the pipeline stops and asks a question; every fix is presented in natural language and in TeX symbols as a suggestion that the author can accept, reject or redirect; any decisi

What the author gets?

The result consists of three parts: an annotated and corrected version of the paper; a report on all changes made; Lean code in which every declaration is linked to the statement it formalizes. That last link matters for readers. They can open any theorem in the text and see the corresponding verified Lean object, rather than hunting for the match by hand.

ZK
Zhemal Khamidun — CPO at Alpina Digital, product manager of AlpinaGPT. Building AI products since 2019. Hamidun News is a pet project that grew into a production aggregator with 6,000+ readers.
✦ Hands-On AI Engineering · Hamidun Academy

Build & Ship Production AI Agents Without Boilerplate Code

Start your free 72-hour trial at Hamidun Academy (academy.hamidun.com) — interactive lessons on Claude Code & Cursor, live Tech Radar, and production agent templates.

Start 72h Free Trial →Vibe-Coding Intensive
What do you think?
Loading comments…