Paper2Lean: what does a successful Lean build prove about a math paper?

BlogEasyLaTeXPublished

Lean checks the proof of the proposition written in code. To know whether it proves the result in a paper, compare the Lean statement with the paper's definitions, assumptions, and conclusion. The Paper2Lean preprint, posted on November 19, 2026, illustrates the gap: all 20 optimization projects built, and human reviewers still found 21 discrepancies with the source papers.

How Paper2Lean turns a paper into a Lean project

Paper2Lean starts with a PDF. MinerU extracts Markdown and LaTeX, then the system identifies mathematical items and maps their dependencies. Definitions and lemmas come before the theorems that use them. The system writes Lean statements and proofs using mathlib and a shared foundation library, then builds the combined project. Extracted LaTeX helps recover the notation; the Lean declaration still has to specify the types and mathematical conditions behind it.

An overview of the workflow from extracting the paper to auditing the Lean statements against it.

What the 473 out of 494 figure measures

In section 4.2 of the preprint, the authors report that all 20 generated projects built without sorry placeholders. Before manual correction, reviewers judged 473 of 494 items (95.7%) faithful to the source. They found 21 mismatches across seven papers. The denominator counts reviewed mathematical items in this optimization sample. The revised formalizations are available in the OptPaper repository.

In section 5.2, the source uses the Kadec–Klee property to establish strong convergence of a trajectory. The generated Lean statement repeats the property as both hypothesis and conclusion. The proof id works because the two are the same, and the claim about the trajectory is missing.

Try two Lean statements that both compile

Suppose the paper says that for every natural number n, if 0 < n, then 1 ≤ n. The second declaration below keeps the conclusion but raises the threshold to 1 < n. Save the file as audit.lean and run it with Lean 4. It uses only the standard Lean environment, with no mathlib dependency.

lean
theorem sourceClaim (n : Nat) (h : 0 < n) : 1 ≤ n := h​theorem narrowedClaim (n : Nat) (h : 1 < n) : 1 ≤ n :=  Nat.le_of_lt h​#print axioms sourceClaim#print axioms narrowedClaim​example : 0 < (1 : Nat) := by decideexample : ¬ (1 < (1 : Nat)) := by decide
Shell
lean audit.lean

Both declarations pass on Lean 4.30.0-rc2, and #print axioms reports that neither depends on axioms. The last two examples check the boundary: n = 1 satisfies the original premise and falls outside the second declaration's scope. When you spot a stronger premise, try an input the paper allows and the Lean statement excludes.

The proof check tests the Lean declaration. The source check compares its meaning with the paper's claim.

Audit a theorem from your own manuscript

  1. Record the paper version, theorem number, LaTeX \label, and Lean declaration name. Include the standing assumptions in the surrounding section and definitions the result uses.
  2. Read the declaration's type before its proof. Compare domains, the order of ∀ and ∃, inequality boundaries, and the object the conclusion describes.
  3. Trace each added assumption to its source. Restoring a standing assumption may be appropriate; assuming a fact the paper derives calls for revisiting the statement and proof.
  4. Build the project and run #print axioms on the main theorems. Investigate sorryAx and unexpected project axioms. Have a reviewer compare the formal statement with the source before marking the result checked.

In an EasyLaTeX manuscript, use LaTeX labels and cross-references to give results stable identifiers. For the earlier stage of drafting a paper, see PaperOrchestra's workflow from experiment logs to a LaTeX draft.