What Lean Actually Checks in a Formal Proof
A formal proof checker verifies a precise Lean statement, not every sentence around it. Learn how propositions, proof terms, tactics, the kernel, mathlib, and AI theorem provers fit together—and how to read a formalization catalog without overstating what was checked. This audio was created with Boson AI's Higgs Audio — https://www.boson.ai/higgs-audio
Listen on Spotify · Watch on YouTube · Pocket Casts
What does a computer check when it checks a proof?
Eris: When Lean checks a proof, it verifies that a submitted proof matches one precisely written proposition. Lean is a proof assistant, meaning software that helps write and check formal proofs. <|emotion:surprise|>The sharp part is this: the hard question is whether that proposition says what the mathematician meant.
Vestra: A formal proposition is a mathematical claim rewritten in a language with exact rules. It names the objects, the definitions used for them, any assumptions, and the conclusion. If an informal sentence says “for every number,” the formal version has to settle whether “number” means a natural number, an integer, a rational number, or a real number. Those are different collections, so a result about one does not automatically say the same thing about another.
Eris: And it has to say what the symbols mean. Take “adding zero leaves a number unchanged.” In Lean, we have to identify the kind of number, use the defined addition operation for that kind, and state that the result equals the original number for every permitted input. <|prosody:pause|>Can the checker tell us whether we chose the right kind of number?
Vestra: No. A checker can verify whether a submitted proof proves that exact statement. It cannot infer that the author intended some broader sentence that was never encoded. That boundary is narrower than the phrase “Lean checked it” can make it sound.
Eris: <|emotion:relief|>That gives us the right boundary: formalizing a claim means choosing the mathematical objects and definitions, then translating the intended assertion into Lean. Proving the formal claim means supplying a derivation that follows from those choices.
Vestra: A perfect proof of the wrong translation is still a proof of the wrong translation. The formalization can go wrong before proof search even begins.
Eris: That gap matters in AI research because a model can help with either job, but those are separate opportunities for error. It might misread the English and encode a different theorem; or it might encode the right theorem and fail to find a proof. A successful check addresses the second question only after somebody has settled the first.
Vestra: So “Lean checked it” should make us ask what “it” points to. The useful object is the formal theorem statement together with the file and its dependencies, not just a sentence in a paper or a headline about the result.
A proof is something that fits the proposition
Vestra: Lean’s basic idea is simple to state: a proposition is represented as a type, and a proof is a piece of Lean code that has that type. Lean calls a piece of code an expression or term. A type specifies what kind of thing an expression must be. For a proposition, the things of the right type are its proofs.
Eris: Here is a tiny example before the jargon gets in the way. Let P mean “the key fits this lock.” If I already have a proof of P, then I can prove P again by returning the proof I was given. In Lean that pattern is `P → P`: the arrow means “if P, then P.” A proof can be written as a function that accepts a proof called `hp` and returns `hp` unchanged.
Vestra: <|emotion:amusement|>It does look almost silly, but that tiny function exposes the mechanism. Lean checks that the function accepts exactly the kind of input promised by the proposition and returns exactly the required kind of output. If I tried to return a proof of some unrelated claim Q, the types would not match.
Eris: So the proposition is acting like a precise contract, and the proof term has to satisfy it. Does that same shape hold once a theorem has several assumptions?
Vestra: Yes. If a theorem says “assuming A and B, conclude C,” then its proof receives evidence for A and B and constructs evidence for C. If it says “for every natural number n,” the proof has to work for an arbitrary n of that type. The assumptions are visible in the theorem’s type instead of being hidden in a paragraph around the proof.
Eris: <|prosody:expressive_high|>That makes the type do real work: it records what the proof is allowed to rely on and what it must deliver. The technical name for this connection is propositions-as-types, also called the Curry–Howard correspondence.
Vestra: You do not need the name to use the idea: a statement specifies what counts as a proof, and a proof is accepted when its formal expression has the specified type. Lean’s kernel checks that match.
Eris: <|prosody:expressive_high|>But there’s a limit to what that neat match tells us. It tells us the proof term fits the proposition Lean was given. It does not establish that P is the right translation of “the key fits the lock” in an informal description. The type can be perfectly clear while the human choice of meaning is mistaken.
Tactics propose a proof; Lean checks the resulting term
Vestra: LeanDojo gives a language model an interactive way to search for formal proofs: it can see the current goal, try a tactic, and use Lean’s feedback to continue. A person writing a Lean proof rarely has to construct one enormous expression by hand. They can write tactics: commands that inspect the current goal and try to make progress. A tactic might introduce an assumption, split a goal into cases, simplify an expression, or apply an existing theorem. Automation can try many such moves for the writer.
Eris: Think of the goal as a question on a workbench, with the assumptions and definitions needed to answer it laid out beside it. Each tactic changes that workbench. Some commands solve the goal; others replace it with smaller goals. If any obligation remains unsolved, there is no completed proof to accept.
Vestra: <|emotion:enthusiasm|>Here’s the part I find elegant: tactics are convenient instructions, not the final certificate. Lean’s elaborator turns the user’s compact input into a fully specified expression. It fills in details that can be inferred, resolves names, and makes implicit arguments explicit.
Eris: Then the kernel checks that expression against the requested proposition and the rules of the logic. So the parser and elaborator translate what the author typed; the kernel decides whether the resulting term is valid. <|prosody:pause|>That’s a much smaller checking step than searching for a proof.
Vestra: The model or tactic may search. LeanDojo makes that search loop usable by a language model. In the paper, the system can show a model the current proof state—the remaining goal and assumptions—run a suggested tactic, and return either a changed state or an error.
Eris: And when it needs a result from the library, it has another way to get unstuck. Its ReProver model retrieves potentially useful definitions and theorems from mathlib before proposing a next tactic. Those earlier definitions and theorems are called premises.
Vestra: Right, because a proof may depend on a lemma already in the library, but the model has to find it and know it is available here. The paper treats Lean 3 as the default and reports separate Lean 4 support too.
Eris: <|prosody:expressive_high|>Does that retrieval help on the actual theorem tests, or is it only a convenient workflow?
Vestra: The paper’s experiment starts with formal theorem statements and tests whether a prover can find proofs. The authors compare their retrieval-based prover with a tactic generator that has no retrieval, along with other baselines, on a separate test set of Lean theorems. Retrieval improved the reported results on both the random and novel-premise splits, including the split where each test proof had to use a premise unseen in training. That is evidence about this system and these theorem sets, not a guarantee that a language model can prove arbitrary new mathematics.
Eris: <|emotion:relief|>And the feedback makes the improvement understandable: if a tactic is invalid or leaves the wrong goal, Lean can say so, and the model can try another step. The useful cycle is proposal, formal feedback, revision. The successful final proof still has to be a term the checker accepts.
Translating the claim and proving the translation are different AI jobs
Eris: DeepSeek-Prover is a clear example of two AI jobs that sound alike but are not the same. First, a system translates a problem written in ordinary mathematical language into a Lean statement. Then a prover searches for a proof of that formal statement. The authors treat formalization, filtering, proof generation, and checking as separate stages.
Vestra: Their pipeline starts from high-school and undergraduate competition problems. A model proposes formal statements, another stage scores them for quality, and a rejection step looks for assumptions that cannot all be true at once. From a contradiction, Lean can prove any conclusion, so a statement that passes for that reason is not a faithful math problem. The prover then generates candidate proofs, and Lean checks them. Accepted statement–proof pairs become machine-generated training examples for another iteration.
Eris: The authors’ own example makes the translation risk concrete. <|emotion:surprise|>A generated version of a determinant problem turned its conditions into a universal assumption that was impossible to satisfy. From that contradiction, Lean could derive the stated conclusion for the wrong reason.
Vestra: <|sfx:sigh|>Uh, and the checker had still done its job: it verified the formal statement it received. The mismatch happened earlier, when that statement failed to preserve the intended problem.
Eris: That distinction is unsettling. So even a model filter that catches some bad statements can’t settle whether the formalization matches the original question?
Vestra: That’s right. In this paper’s system, models also try to catch some bad statements, but a model filter is another fallible step, not a semantic guarantee. A human still has to compare the premises and conclusion with the original question.
Eris: For this system, the model generates candidate Lean proofs and Lean checks them. The authors also search for proofs of the negated statements: proving that a statement is false lets their pipeline discard it, while accepted proofs of either side can add training data. Their experiments use formalized contest-math problems. They show that machine-generated proof examples can make this particular prover more successful on those evaluations. They do not show that the system has learned to formalize every kind of mathematics faithfully.
Vestra: LeanDojo and DeepSeek-Prover therefore illuminate different parts of the chain. LeanDojo studies tools for extracting proof states and retrieving relevant library results while a model proposes tactics. DeepSeek-Prover studies a pipeline that also generates formal statements and large amounts of training data. In both cases the proof assistant is the verifier of the formal artifact, while the model’s proposal and the human’s interpretation remain separate questions.
Reuse helps proofs grow, but imports define what they rely on
Eris: A formal proof rarely starts from bare logic. Lean projects import a mathematical library: a reusable collection of definitions, structures, theorems, and tools. Mathlib lets a new proof build on established language for things like rational numbers or linear programs instead of recreating those foundations every time.
Vestra: <|emotion:enthusiasm|>That reuse is powerful, and it makes dependencies part of the evidence. A theorem may rely on earlier lemmas, definitions, and declared axioms brought in through imports. To understand what was checked, we need to know not only the final theorem, but also which environment gives its symbols meaning and which earlier results it uses.
Eris: Today’s OpenAI math repository is a useful case study. Its README says the collection contains manuscripts at different stages and that not every result has a Lean formalization. It describes a formalization catalog that maps particular statements to Lean code.
Vestra: <|prosody:expressive_high|>So the catalog gives us a way to check the scope statement by statement. Compare one manuscript claim with the exact proposition listed there, not with a broad label like “the paper was proved.”
Eris: The linked manuscript’s headline says rational linear programming is solvable in strongly polynomial time. A rational linear program uses fractions as coefficients in linear constraints and in the quantity being optimized. The scope page makes the headline more exact: fixed programs for an idealized random-access computer with exact fraction arithmetic solve a system written A x less than or equal to b, with at least one constraint and one variable. It counts the program’s elementary instructions.
Vestra: For feasibility—whether any solution meets the constraints—it returns a suitable point or a Farkas certificate, a short algebraic witness that no such point exists. That certificate uses at most one more nonzero entry than the rank of A, the number of its independent rows.
Eris: <|prosody:pause|>And optimization is the other task. The formal program returns a proof that no solution exists, or an optimal solution paired with a matching bound from the dual problem, a related formulation that can certify no better value is possible. If the objective can increase forever, it instead returns a feasible point and a direction that improves it by one unit per step.
Vestra: The instruction count is bounded by a fixed power of the number of constraints and variables; the page separately bounds the stored fractions’ bit lengths by a polynomial in the input size. Those details are part of the proposition matched to the manuscript claim.
Eris: <|emotion:surprise|>The page also lists the companion manuscript’s polytope results, and their scope is quite specific. A polytope is a bounded shape described by linear inequalities; rational means those inequalities use fraction coefficients. A facet is one of its flat boundary sides. The formalized family is simple: in a shape with d independent directions, exactly d facets meet at each corner.
Vestra: Its dimension grows more slowly than any fixed power of its number of facets. Along its edges, some shortest paths eventually require more steps than every fixed power of that facet count. The page also lists related statements about vertices whose values differ by a specified amount for a chosen objective, and about moves across lower-dimensional boundary faces.
Eris: Does that edge-path result mean every way of solving every linear program has a superpolynomial running time?
Vestra: No. It is a claim about specific shapes and allowed moves, not a general running-time claim about solving linear programs.
Eris: The catalog links to individual Lean theorem statements for feasibility, optimization, instruction and bit-length bounds, and these polytope claims. So a careful report says those linked statements are formalized in this artifact. It does not extend the result to every manuscript in the repository, every stronger variant, or every surrounding sentence in a PDF.
Vestra: And the mathlib paper explains why a shared library matters: structures and theorems connect so a result can be stated in a consistent mathematical vocabulary and reuse earlier work. That makes formalization more scalable.
Eris: <|prosody:expressive_high|>It also means the dependency list is not housekeeping. It tells us which definitions and assumptions the checked theorem rests on.
What a successful Lean check does and does not establish
Vestra: A successful Lean check establishes that the kernel accepted a proof term for the exact proposition, under the formal logic, its definitions, and the available assumptions. That trust boundary is the logic, assumptions, and software whose correctness the result relies on. An axiom is a statement the system accepts as a starting point rather than proving in that file; imported lemmas can depend on axioms too. Lean also permits a placeholder called `sorry` while a proof is unfinished, so a real audit checks that no such placeholder remains.
Eris: <|prosody:pause|>The kernel checks the term, while the parser and elaborator translate the text into that term. So even a successful check relies on the software that translates it—and a mismatch in the translation can undermine what we think was checked.
Vestra: <|emotion:contemplation|>The boundary is precise, but it is not the whole paper. Lean does not automatically check that an informal explanation matches the theorem statement, that the chosen definitions capture what the authors intended, or that every claim and corollary in a manuscript has its own formal proof. Nor does machine acceptance tell us whether the result is important or whether experts have independently reviewed the mathematics.
Eris: When you hear that a proof was checked, ask four things. What exact statement was proved? Which assumptions, axioms, imports, and definitions does it use? Does that statement match the claim being repeated? Which parts of the paper remain informal, and what independent review has happened?
Vestra: <|emotion:relief|>A formal check answers a sharp logical question. It is valuable precisely because the question is inspectable. But the answer only travels as far as the statement and dependencies that were checked.
Eris: Today’s OpenAI catalog is useful because it lets us see that boundary theorem by theorem. That’s what makes the questions answerable rather than abstract.
Follow AI in Detail
Eris: Today’s separate news brief covers the other stories from the day. Ground Truth at groundtruth.day is where you can follow the stories behind the show every day.
Vestra: Follow AI in Detail wherever you listen, and tell us in the comments which you would check first: the exact theorem, its assumptions, or its imports.