A Verified Proof Can Still Answer the Wrong Question

Berkeley Advanced Large Language Model Agents — Lecture 9: Autoformalization and Theorem Proving

Kaiyu Yang’s lecture connects retrieval-augmented proof search to the harder problem of preserving meaning when natural-language mathematics becomes Lean.
Author

Chao Ma

Published

September 23, 2026

A proof assistant can certify every step of a proof. That sounds like the end of the reliability problem—until the model proves a different statement from the one a human meant.

This lecture separates two gates: Did we formalize the right theorem? and Did we prove that theorem? The second has a strong checker in Lean. The first is a semantic translation problem, and it is often the harder one to evaluate. Kaiyu Yang’s ninth lecture in Berkeley’s Advanced Large Language Model Agents connects this gap to theorem-proving systems such as LeanDojo and to the domain-specific LeanEuclid benchmark.

Two horizontal gates: translation fidelity from informal question to formal theorem, and proof validity from proposed proof to Lean acceptance. An orange warning says that passing gate two does not imply passing gate one.

Two gates in formal mathematics. A natural-language question becomes a Lean statement, which must preserve its intended meaning; a proposed proof then goes to a proof assistant, which checks only that formal statement. Passing the second gate cannot repair a wrong first gate.

Source and scope

Lecture recording (52:06) · Official 114-page slides · Course schedule

These notes are grounded in the April 7, 2025 recording’s exported English transcript, the slides, and the cited original papers. I inspected the transcript and relevant slides; I did not claim to watch all 52 minutes visually. Timestamps below refer to that transcript. The explanatory figures are newly constructed, not screenshots of a model run or a Lean execution.

1. A proof checker is a local guarantee, not an intent checker

The lecture defines two related tasks [18:28–19:13]:

  1. Formal theorem proving: start with a statement already expressed in Lean, then produce a proof Lean accepts.
  2. Autoformalization: translate informal mathematics into a formal statement, or translate an informal proof into a formal proof.

If Lean accepts a proof, we have strong evidence that the formal statement follows within the formal system and its assumptions. That does not establish that the statement is the one the textbook, problem setter, or user intended. The distinction matters because a changed quantifier, a missing non-degeneracy condition, or a wrong domain can make the proof both valid and irrelevant.

Consider the sentence “there are infinitely many primes.” It can be expressed as “for every natural number \(n\), some prime \(p\) is at least \(n\).” Replacing \(p\ge n\) by \(p>n\) still expresses infinitude. A literal text match between generated Lean and a reference formalization would count one of these as wrong despite their equivalent mathematical meaning. But allowing arbitrary changes without semantic checking could accept an easier, non-equivalent statement. Yang uses this example at [34:17–35:58] to explain why compilation is not the same as semantic fidelity, and why generic equivalence checking is not a cheap universal solution.

NoteThe diagnostic question

Before celebrating a checked proof, ask: Which exact theorem did the checker prove, with which assumptions? Then separately ask how that theorem was shown to match the original problem.

3. Autoformalization has two different failure modes

Yang distinguishes the statement and proof sides at [33:27–36:52].

Statement translation is hard to evaluate. There may be many valid formal equivalents of one informal claim. Syntactic similarity is too strict; a model can also emit a well-typed but subtly weaker theorem. General semantic equivalence is computationally difficult.

Proof translation must fill gaps. A human proof may say “obvious from the diagram,” or leave a case to the reader. A proof assistant has no privileged access to that omitted reasoning. The model or a domain-specific reasoning tool must supply it.

These are not the same problem. A perfect Lean proof checker resolves neither the intended meaning of a translated statement nor a missing human step on its own.

Worked example: Euclid’s first construction

Euclid’s Elements, Book I, Proposition 1 constructs an equilateral triangle on a segment \(AB\). Draw a circle centered at \(A\) through \(B\), draw another centered at \(B\) through \(A\), choose an intersection \(C\), and connect \(AC\) and \(BC\). The equal radii then give \(AB=AC=BC\).

But “choose an intersection” silently assumes the two circles actually meet. The diagram makes that visually immediate; a formal proof needs an existence justification in its chosen geometry system. Yang uses this at [46:21–49:01] to show a diagrammatic reasoning gap. In LeanEuclid, domain-specific geometric rules and SMT-based automation help discharge such gaps. This is not a general theorem saying any natural-language proof can be filled in automatically.

Constructed geometry diagram with points A and B at the circle centers, upper intersection C, an equilateral triangle, and an orange callout highlighting the hidden circle-intersection existence step.

Two circles of equal radius centered at the segment endpoints meet at C, forming an equilateral triangle. A highlighted question asks what justifies the existence of C in the formal system.

There is a second lesson in Euclid’s Proposition 24. Yang shows a familiar-looking argument that works for one configuration but omits another arrangement of the points [40:23–44:42]. The theorem can still be repaired; the flaw is an unhandled case in the proof, not a claim that the theorem is false. Formalization made that omission visible.

4. What LeanEuclid makes measurable—and what it does not

The LeanEuclid paper builds a controlled geometry benchmark with human formalizations of problems from Euclid and UniGeo. In this restricted domain, the authors test a generated statement against a reference by checking both directions of implication with symbolic tools [45:04–45:58]. They also use domain rules to fill or test certain diagrammatic proof gaps [49:04–50:07]. The lecture’s slides list 48 Euclid Book I problems and 125 UniGeo problems; that is a benchmark description, not a success rate.

The generalization boundary is the result worth remembering. A domain with explicit axioms and tractable reasoning procedures makes some semantic checks possible that are infeasible in unrestricted mathematics. The lecture’s closing question [51:20–51:48] is how far that strategy can travel beyond geometry—not a claim that the translation problem is solved.

How I would use this distinction

For an AI mathematics workflow, I would record two artifacts for each solved problem: the exact formal statement plus a justification for its fidelity, and the checker-accepted proof with its environment/version. I would track translation errors separately from proof-search failures. Otherwise a high “proof success” number can hide a system that proves the wrong things reliably.

This is the bridge from Lecture 8’s AlphaProof note: verified feedback can improve search, but its usefulness depends on the question submitted to the checker. In this lecture, retrieval improves the proof search gate; domain-specific semantic evaluation addresses part of the translation gate. Neither substitutes for the other.

References