Manuscript Offprint
arXiv:2611.01357ProofPatch: Reviewing Lean Statements and Keeping the Reviews Valid as Formalizations Evolve
Xujun Che, Depeng Xu, Jian Xiang, and Taufiqua Khan
University of North Carolina at Charlotte, Charlotte, NC, USA {xche,dxu7,jxiang1,tkhan13}@charlotte.edu
Abstract. The kernel of the Lean proof assistant checks that a proof establishes its statement. Whether the statement says what was intended is left to human reviewers. This is the old problem of validating a specification, and it grows more pressing as language models write formal statements in bulk and agents edit formal developments continuously. We present ProofPatch, a tool that helps reviewers judge Lean statements and keeps their judgments valid while the development changes. A reviewer can ask the kernel targeted questions about a statement, such as whether a hypothesis is needed or whether a counterexample exists. Each decision is stored with fingerprints of the statement as Lean elaborated it and of the definitions it depends on, and any declaration can be pinned so that a patch changing it is blocked, whether a person or an agent built on a large language model (LLM) wrote the patch. Working on elaborated terms rather than source text is the central design choice: notation and formatting changes leave a decision intact, and a changed definition reaches every theorem that uses it. On 229 pairs of consecutive revisions of Mathlib, Lean's mathematics library, ProofPatch sends 118 of 12,898 synthetic decisions back for review. Every text-based alternative misses at least 38 of these or sends back at least 13 times as many. On 1,527 labeled statements, kernel evidence flags unfaithful ones with precision 0.88 to 0.96, and in 344 runs of an LLM agent no change to a pinned statement got through.
Keywords: Lean · specification validation · proof review · change impact analysis · autoformalization
1 Introduction
A machine-checked proof is only as good as its statement. The kernel of the Lean proof assistant [26], its small trusted proof checker, guarantees that a proof establishes the statement it is given, but not that the statement is the theorem anyone meant. Checking that is the long-standing problem of validating a specification [30,38], and in practice it falls to people who read the formal statement next to its informal counterpart. Tools help them: counterexample generators in Isabelle [3,5] and Coq [28] refute wrong conjectures before anyone tries a proof, and vacuity detection [2,20] catches properties that hold for a trivial reason.
X. Che et al.
Two developments make this review harder. The first is volume. Large language models (LLMs) now prove competition problems in Lean [31] and translate informal statements into Lean at scale [36], and compiling is a weak sign of being right: on 227 graduate-level statements, a tool-augmented GPT-5.2 agent compiles 87.2% but is faithful on only 57.7% [40]. The second is durability. Formal developments change constantly, increasingly through agents, and a review decision goes stale without notice when something it relied on changes. A theorem can keep every character of its statement while a definition it uses is rewritten. A line diff then shows nothing on the theorem, and continuous integration re-checks the proofs but not the review.
We present ProofPatch, a tool for reviewing Lean statements and keeping the outcome of that review valid as the development evolves. Its central design choice is to work on elaborated terms rather than on source text. An elaborated term is the statement as the kernel sees it, after Lean has expanded notation, inserted implicit arguments and coercions, and resolved type-class instances. Two commits to Mathlib, Lean's community library of mathematics [35], show why this matters. One rewrote statements such as ContMDiffWithinAt I I' n f s x into a new notation, CMDiffAt[s] n f x. The text changed, but the elaborated statement stayed the same up to definitional equality, the equality the kernel itself checks by unfolding definitions and computing, so a review of the old statement still applies. Another replaced open Classical in by open scoped Classical in above a definition. The definition's text stayed the same, but its elaborated body now uses a different decidability instance, the term that decides the condition of an if-then-else. Reviews of the 26 theorems whose statements use the definition relied on the old body, yet a line diff shows nothing on any of them.
On this choice ProofPatch builds the review loop of Figure 1. A reviewer can challenge a statement: modify it in a small, typed way, for instance by dropping a hypothesis, and let the kernel check the result, which yields evidence such as a counterexample or a proof that the hypothesis was never needed. The decision is recorded as a receipt, which stores fingerprints of the elaborated statement and of every definition it depends on, so that it can be re-checked mechanically after any change. A reviewer can also lock a declaration to pin it. A gate runs on every patch, written by a person or by an LLM agent, and reports which receipts no longer apply and which locks are violated. Two versions of a declaration count as the same when their elaborated terms coincide after a small canonicalization, or when the kernel confirms that they are definitionally equal. This notion is precise and checkable, and deliberately conservative: a change the kernel cannot see through goes back to the reviewer.
ProofPatch applies to any Lean development. Machine-generated formalizations make it necessary by multiplying what there is to review and how often it changes. This paper makes four contributions:
- a way to record review decisions against elaborated statements and their dependencies, with precise guarantees about what a kept receipt implies;

Fig. 1. One review in ProofPatch. The reviewer acts on the artifacts in the middle row. Every fact in them comes from the kernel and from elaborated terms, not from text or from a model.
-
kernel-based evidence for reviewers, obtained by counterexample search and mutation on elaborated statements, with the guarantee that the statement the kernel checks is the statement the reviewer sees;
-
a gate that applies these checks to every patch, in continuous integration, in the editor and inside an agent loop that feeds the gate's report back to the model, implemented for Lean 4 and Mathlib;
-
an evaluation on 229 pairs of Mathlib revisions against text-based baselines, on 1,527 labeled statements, and on 344 agent runs.
2.1 The example and its review state
Figure 2 lists the running example. The definition clamp lo hi x moves an integer x into the interval from lo to hi, and score x clamps it into [0,100]. Five theorems state properties of the two. The remaining four illustrate further kinds of evidence. Every theorem carries an informal statement, which the tool shows next to the formal one. For clamp_le_hi it reads for any non-empty interval (lo ≤ hi), the clamped value never exceeds hi.
X. Che et al.
| declaration, proof elided | receipts | lock | after patch |
|---|---|---|---|
| def clamp (lo hi x : Z) : Z := max lo (min hi x) | definition | ✗lock fails | |
| theorem clamp_le_hi (lo hi x : Z) (h : lo ≤ hi) : clamp lo hi x ≤ hi | ✓alice | statement | re-review |
| theorem lo_le_clamp (lo hi x : Z) (h : lo ≤ hi) : lo ≤ clamp lo hi x | ✗alice | re-review | |
| theorem clamp_of_mem (lo hi x : Z) (h1 : lo ≤ x) (h2 : x ≤ hi) : clamp lo hi x = x | ✓alice | statement | re-review |
| theorem two_mult_le_sq_add_sq (a b : Z) : 2 * a * b ≤ a * a + b * b | ✓alice | statement | ✓kept |
| def score (x : Z) : Z := clamp 0 100 x | |||
| theorem score_nonneg (x : Z) : 0 ≤ score x | ✓alice | ✓bob | statement re-review ×2 |
| theorem score_le_hundred (x : Z) : score x ≤ 100 | ✓bob | statement | re-review |
| theorem sub_add_cancel_of_le (n m : N) (h : m ≤ n) : n - m + m = n | |||
| theorem vacuous (n : N) (h1 : n < 3) (h2 : 5 < n) : n = 100 | |||
| theorem strict_of_le (n : N) (h : 0 ≤ n) : n ≤ n ^ 2 |
Fig. 2. The running example with its review state, and the gate's verdict on a patch that rewrites the body of clamp as min hi (max lo x). Shaded: clamp and the declarations whose statements depend on it. There are seven receipts on six theorems, five statement locks and one definition lock.
2.2 Reviewing a statement
A reviewer opens clamp_le_hi:
theorem clamp_le_hi (lo hi x : Z) (h : lo ≤ hi) :
clamp lo hi x ≤ hi
The kernel has already checked the proof. The reviewer must decide whether the formal statement says the same as the informal one, and the hypothesis h is the obvious place to look: does it express the non-empty interval, and is it needed? The tool shows the statement split into its parts, namely the variables, the hypothesis and the conclusion, each with the challenges that apply to it. Dropping a hypothesis is one of them. Others substitute a boundary value, change a constant or strengthen the conclusion.
When the reviewer drops h, the tool elaborates the modified statement in an isolated branch of the file, replays the original proof, tries a fixed set of automatic provers and searches for a counterexample. The proof fails, and random testing finds , , x = 1, for which clamp returns 1, above the upper bound 0. The hypothesis is needed: an empty interval has no meaningful clamp. The reviewer, alice, accepts the theorem. The receipt cites this evidence and stores fingerprints of the statement and of clamp, the definition it depends on. By project policy, accepting a theorem also locks its statement.
The same challenge on lo_le_clamp tells a different story. The original proof still goes through without h, so the hypothesis was never used, and the informal statement has no such assumption. Here alice rejects the theorem because of the spurious hypothesis, and also locks the body of clamp, since every statement about clamp depends on it. Figure 2 shows the resulting review state: seven receipts on six theorems, two of them on score_nonneg, five statement locks and one definition lock.
2.3 A patch
Later, an agent or a colleague rewrites the body of clamp as min hi (max lo x). The two bodies agree whenever lo ≤ hi and differ otherwise: clamp 5 0 7 was 5 and is now 0. Every proof in the file still compiles, and a line diff shows one changed line, inside a definition that has no receipt. The gate blocks the patch because the lock on the body of clamp fails. It also sends six of the seven receipts back for re-review: those on the five theorems whose statements depend on clamp, directly or through score. Two of these, score_nonneg and score_le_hundred, never mention clamp in their text. The receipt on two_mul_le_sq_add_sq, which does not depend on clamp, is kept, and the five statement locks hold, because no statement changed.
The reviewer now decides whether the six decisions still stand. They do: all five theorems still hold, and score is the same function as before, because its interval is not empty. What changed is clamp on empty intervals, and that is what the definition lock reports.
3 Receipts and locks
This section defines what a receipt records and when it stays valid. The next two describe how the evidence it cites is produced and how the gate applies receipts and locks to a patch.
3.1 Elaborated statements and fingerprints
Lean elaborates a declaration's source into a term of its type theory, expanding notation, filling in implicit arguments, resolving type-class instances and inserting coercions. Two sources can elaborate to the same term, and one source can elaborate to different terms in different contexts [37], so ProofPatch fingerprints elaborated terms. The statement fingerprint of a declaration is a hash of a canonical serialization of its elaborated statement, that is, its elaborated type. A definition also has a value fingerprint of its body. Proofs are not fingerprinted: the kernel checks them, and they are not what a reviewer decides about.
Canonicalization removes differences that do not affect the logical content of a term: it erases binder names, renames universe parameters by position and drops metadata. It also applies three normalizations that real Mathlib commits showed to be necessary. It unfolds identity wrappers such as id and inferInstanceAs. It reduces a type-class argument reached through a chain of projections to the instance it denotes, because the chain the elaborator picks depends on the imports. Finally, it erases the source positions that panic! writes into its error message,
X. Che et al.
which the logical definition of panic ignores. Each step replaces a term by a definitionally equal one, so equal fingerprints imply definitionally equal terms, up to hash collisions. Binder kinds, such as explicit or instance-implicit, are kept as part of a declaration's interface.
3.2 Statement dependencies and closure fingerprints
A declaration depends on other declarations in two ways. Its statement dependencies are the constants in its elaborated statement and, for a definition, in its body. A change to one of them can change what the declaration says. Its proof dependencies are the constants that occur only in a theorem's proof. A change to one of them can break the proof, which the kernel reports, but cannot change the statement. Review follows statement dependencies only, and the declarations reachable from through them form its dependency closure. In Figure 2, score_nonneg depends on score, which depends on clamp, while its proof uses Mathlib lemmas that are irrelevant to its review.
The closure fingerprint summarizes a declaration together with everything its statement depends on:
where is a cryptographic hash function, is the set of statement dependencies of inside the project, and is for a theorem and the pair for a definition. Mutually recursive declarations form a single node of the dependency graph, whose members enter with their names. Declarations outside the project, from Mathlib or the core library, enter by name only, because the environment identity below pins their content. The name of itself enters neither nor , so renaming a declaration leaves its closure fingerprint unchanged. A dependent whose statement mentions it does change, because its elaborated statement now refers to the new name.
3.3 Environment identity
Fingerprints are comparable only within one environment. The environment identity hashes the Lean toolchain, the dependency manifest, which pins every package such as Mathlib to a commit, and the source of the project's own modules that the file imports. Adding or removing an import of a pinned package does not change , because every constant that an elaborated term mentions is already pinned. Changing the toolchain, the manifest or an imported project module does change . Every receipt on the file is then sent back for review, and every lock on it fails.
3.4 Validity of receipts and locks
A receipt records that reviewer made decision , one of accept, reject or unsure, about declaration , against the informal statement with hash , at a time when the declaration had fingerprint , closure fingerprint and environment . In a later revision of the project , the receipt is kept if the informal statement, , and are all unchanged, up to the definitional rewrites described below. Otherwise it is invalidated and sent back to the reviewer with the first reason that applies: the informal statement changed, the environment changed, the declaration is gone, its statement changed, or a declaration in its closure changed.
A lock pins one declaration or the whole project. A statement lock on holds in if still exists there with the same and , again up to definitional rewrites. A definition lock also requires the same . A trust lock holds if no declaration in its scope depends on an axiom outside an allowed set. By default this set contains Lean's three standard axioms, procontext, Classical, choice and Quot.sound, and excludes sorryAx, the axiom behind sorry, Lean's placeholder for a missing proof. An environment lock holds if is unchanged. A lock whose target has disappeared fails.
3.5 What the gate guarantees
Write when two elaborated terms have equal fingerprints, or when the kernel has confirmed that they are definitionally equal. In both cases and are definitionally equal, so is a sound approximation of definitional equality.
Proposition 1 (Locks). If the gate accepts a revision of , then for every statement lock on the elaborated statement of in is to the locked one, so the kernel accepts a proof of either as a proof of the other. For every definition lock, the same holds for the body. Every declaration in the scope of a trust lock depends only on allowed axioms.
Proof sketch. The gate accepts only if every lock holds, and a statement lock holds only if is unchanged and either is unchanged or the kernel confirmed definitional equality in the new environment. Both imply, up to hash collisions, that the two statements are definitionally equal, and the kernel's conversion rule then lets a proof of one stand for the other. Definition locks add the same argument for . Trust locks are checked against the axioms the kernel reports for each declaration of .
Proposition 2 (Receipts). If a receipt on is kept from to , then the informal statement and the environment are unchanged, and the elaborated statement of , as well as the statement and body of every project declaration in its dependency closure, is to the version that was reviewed.
Proof sketch. A receipt is kept only if , , and are unchanged, where uses the old fingerprint for every declaration the kernel confirmed definitionally equal. Since hashes with the closure fingerprints of the named dependencies, recursively, an unchanged implies, up to hash collisions, unchanged fingerprints or confirmed definitional equality along the whole closure. Declarations outside the project are pinned by .
X. Che et al.
Invalidation is safe in the sense of regression test selection [34]: whenever a term in the closure changes beyond , the receipt goes back to the reviewer. This covers definitions that are provably but not definitionally equal, such as the one in the introduction, and definitional equalities that the kernel's incomplete check misses [6]. The reviewer then decides again. Whether a statement is faithful in the first place is the reviewer's judgment, and the evidence that challenges produce supports it.
3.6 Definitional rewrites and renames
Equal fingerprints are a stricter requirement than definitional equality. A Mathlib commit that removed set_option backward.inferInstanceAs.wrap false added an auxiliary definition to the elaborated body of an instance, and another commit spelled out a default field of a structure instance. The gate therefore has a second stage. When a declaration's fingerprint changed and every project declaration its old term depends on has an unchanged closure fingerprint, so that the old term can be read in the new environment, the gate asks the kernel whether the old and the new term are definitionally equal there, within a fixed resource budget. If the kernel confirms it, the change is reported as a definitional rewrite: locks hold, receipts are kept, and closure fingerprints are computed with the old fingerprint. A timeout counts as a change.
Renames are detected by fingerprint: a declaration that disappears under one name and reappears under another with the same kind, universe parameters and fingerprints is reported as renamed if the match is one-to-one. Its locks follow it, and its receipts are evaluated under the new name. Statements that mention it are reported as changed, because they refer to it by name. A rename combined with a change of statement counts as a removal and an addition.
4 Challenges: evidence about a statement
Challenges turn the kernel into a source of evidence about a statement. A challenge mutates the statement, as in mutation testing [17]. A vacuity check applies vacuity detection [2,20] to theorem statements, and refutation combines decision procedures with random testing [9], as counterexample generators for proof assistants do [3,5,28]. In ProofPatch the operations act on elaborated statements, every outcome is reported with a fixed wording, and the statement the kernel checks is guaranteed to be the one the reviewer sees.
4.1 Operations
The tool presents a statement as its parts: the variables and hypotheses in front of the colon, and the conclusion. A hypothesis can be dropped, or weakened by turning < into or keeping one side of a conjunction. The conclusion can be strengthened by turning into < or keeping one side of a disjunction. The -th occurrence of a numeral can be replaced, a variable can be instantiated with a
challenge sub_add_cancel_of_1e drop hypothesis h : n ≤ n
before ∀ (n m : N), m ≤ n → n - m + m = n after ∀ (n m : N), n - m + m = n
replay X fails original proof (omega) on the new statement
alternatives X none none of the nine provers, among them simp, omega, nlinarith,
aesop, decide
refutation candidate random testing: n = 0, m = 1 gives 0 - 1 + 1 = 1 ≠ 0. The
negation is not kernel-checked
downstream none no declaration depends on the changed statement
fidelity ✓ executed = displayed checked and displayed statement have one fingerprint
grade counterexample candidate Random testing found a candidate counterexample to
the modified statement. It is not kernel-checked.
Fig. 3. The evidence of one challenge as the reviewer sees it, from a real run that took 0.4s. The hypothesis is needed, because subtraction on N truncates at zero. The last two rows are what a reviewer can rely on without reading the rest.
term the reviewer types, and a definition can be replaced by an approved alternative. Each operation is a typed transformation of the elaborated statement, and one that would leave a dangling reference, such as dropping a hypothesis that another one mentions, is refused. Two further operations act on the whole statement: identity searches for a counterexample to the statement as written, and vacuity replaces the conclusion by False, so that a proof of the result shows the hypotheses to be contradictory. Identity, vacuity and dropping each hypothesis need no input from the reviewer, so the tool runs them on every statement in advance. We call these challenges probes.
4.2 Judging a challenge
The modified statement is elaborated in an isolated branch of the file, and four things are tried in order, as in the evidence of Figure 3. The original proof is replayed. Nine automatic provers are run, among them the simplifier simp, the arithmetic procedures omega and nlinarith, the proof search aesop [22] and the decision procedure decide. The negation is attempted with decide, and random testing searches for a counterexample. The outcome is one of six grades, each with a fixed wording. Replay passes means the original proof never used what was changed, and alternative proof that the modified statement holds. Refuted rests on a kernel-checked negation, counterexample candidate on random testing. Proof sensitivity means only the replay fails, and its wording says this does not make the assumption mathematically necessary. Otherwise the grade is inconclusive.
4.3 Fidelity
The reviewer acts on a displayed statement and the kernel checks an elaborated one. ProofPatch guarantees that they are the same: the branch records the fingerprint of the statement that Lean checked, the tool compares it with the fingerprint of the statement it displayed, and a mismatch is reported as an error without a grade. Every challenge is stored with both fingerprints, and a receipt cites the challenges it relies on, so its evidence can be re-run later.
X. Che et al.
5 The gate
5.1 Verdict
The gate compares two revisions of a file: the base from version control, and the head from the working tree, a commit or an agent's worktree. It classifies the effect of the patch on every declaration (added, removed, renamed, proof changed, statement changed, body changed, closure changed, definitional rewrite) and evaluates every lock and every receipt. The patch is accepted if the kernel accepts the head revision, every lock holds, no declaration gained a disallowed axiom, and the project's policy allows the number of invalidated receipts. Otherwise the report lists each violated lock and invalidated receipt with its reason. The same function drives continuous integration through its exit status, the browser interface, the editor and the agent loop.
5.2 Policy and trust
A project's policy fixes the allowed axioms, whether invalidated receipts block a patch, whether accepting a theorem locks it, which automatic provers challenges may use, and whether the definitional-equality stage runs. The trust check is per declaration, so a theorem that newly depends on sorryAx is caught even if another theorem already did.
5.3 Agents in the loop
The agent loop is where machine-generated code enters ProofPatch. An agent task names a file, a goal in natural language and an adapter, and runs in its own git worktree so that nothing it does touches the reviewer's files. The bundled adapter for language models sends the model the file, the goal and the contracts in force, that is, which statements are locked and which axioms are allowed, asks for the complete revised file, and runs the gate on it. If the gate blocks, the model receives the gate's report as feedback, and the loop repeats for a configured number of rounds. An accepted task is applied to the reviewer's files with one action, which also carries locks and receipts over renames. The gate, not the prompt, enforces the contracts: a model that is told not to change a locked statement and changes it anyway is refused like a person who does.
6 Implementation
All formal facts come from one long-running Lean 4 process per project, the kernel service, driven over a JSON-lines protocol. It elaborates a file command by command and keeps the state after each command, so a challenge runs in the state just before its target, in a branch that never touches the file, and a reload after an edit re-elaborates only from the first changed command. Indexing yields, for every declaration, its kind, source range, fingerprints, statement and proof dependencies and axioms, and marks declarations that Lean generates automatically, such as recursors and equation lemmas, which reviewers do not see.
A daemon written in Python stores the review state as append-only JSON lines under version control, runs the gate and the agents, and serves the browser interface. A command-line tool exposes the same operations to continuous integration, and a VS Code extension shows each theorem's review status in the editor. Figure 5 in Appendix A shows how these components fit together.
7 Evaluation
We ask five research questions (RQs). RQ1: do receipts follow real changes, and how do they compare with text-based methods? RQ2: can a reviewer rely on the evidence that challenges produce? RQ3: what does this evidence add to an LLM judge? RQ4: does the gate hold an LLM agent to its contracts? RQ5: is the tool fast enough?
7.1 Data
Revision pairs. We took pairs of consecutive commits to one Mathlib [35] file, from a ten-week window before a pinned Mathlib revision, and kept the 229 pairs in which both versions elaborate against that revision: the 40 pairs with the smallest diffs, all single-line, and two random samples of 100 pairs stratified by the number of changed lines, up to 80, with 11 pairs in two of the three sets. No real review state exists for these commits, so each pair gets a synthetic one: a receipt on every theorem of the earlier version, 12,898 in total, and a lock on every declaration. Labeled statements. We use 1,527 compiling statements with a faithfulness label. Of these, 1,321 are model-generated formalizations of textbook exercises from ProofNetVerif [29], labeled by one annotator in two passes, and 149 are graduate-level formalizations from the human audit of Beyond Compilation [40], scored 0 to 10 by three reviewers, where a mean of at least 8 counts as faithful and at most 5 as unfaithful. The other 57 are synthetic, each unfaithful one realizing a known kind of fault. Agent tasks. There are 72 repair tasks, in which a theorem's proof was replaced by sorry, 41 on small example developments and 31 on Mathlib files, and 50 adversarial tasks, in which a theorem's statement was first mutated, mostly into a false one, and then locked. Each ran once without feedback and once with the gate's report fed back for up to three rounds. The adversarial tasks also ran with a second prompt. Kernel facts come from Lean 4.32, and the LLM is Qwen3.5-122B at temperature 0.
7.2 RQ1: Do receipts follow real changes?
Baselines. A receipt should go back to the reviewer when the elaborated statement, or a project declaration in its dependency closure, changed beyond definitional equality. The gate computes this by construction. We ask how well
X. Che et al.
Table 1. Receipts sent back for re-review over the 229 revision pairs, out of 12,898. Needless: the elaborated statement and its dependency closure are unchanged up to definitional equality. Missed: the closure changed, but the method keeps the receipt.
| Method | sent back needless missed | ||
|---|---|---|---|
| statement diff | 94 | 54 | 78 |
| file diff | 12,898 | 12,780 | 0 |
| text closure | 308 | 237 | 47 |
| text closure with context | 1,831 | 1,714 | 1 |
| text closure on the kernel's graph | 290 | 210 | 38 |
| text closure with context on the kernel's graph | 1,612 | 1,495 | 1 |
| gate, statement fingerprints only | 62 | 0 | 56 |
| gate | 118 | 0 | 0 |
six cheaper, text-based methods approximate it. Each compares a declaration's own text, without comments, whitespace, attributes and in prefixes. The statement diff re-reviews a theorem when its statement text changes. The file diff re-reviews every theorem in a changed file, the granularity at which continuous integration notices a change. The text closure re-reviews a theorem when its statement text, or the text of any declaration its statement names, transitively, changes. The variant with context also reacts to their attributes and in prefixes and to commands above them, such as variable, open or set_option, which can generate declarations or change elaboration. These two are what a careful tool can do from source. Running both along the kernel's graph, the dependencies that elaborated terms reveal, including instances found by type-class resolution, separates the effect of comparing terms rather than text from that of knowing the true dependencies. We also run the gate on statement fingerprints alone.
Results. Table 1 shows the trade-off that text forces on a tool. The statement diff sends back 94 receipts, 54 of them needlessly, and misses 78 of the 118 whose closure changed. Following the names a statement mentions sends back 308 and still misses 47, because many changes reach a statement through something its text does not name: the open scoped change of the introduction, a renamed instance and section variables. Taking this context into account catches all but one change at the price of 1,831 receipts, more than 15 times as many as the gate. The true dependencies do not remove the trade-off: along the kernel's graph, text alone still misses 38, and text with context sends back 1,612. The one change that only the file diff catches is an import that changes how an instance is found. Without closures, the gate itself would miss 56 of its 118.
What the gate sends back. Of the 118 receipts that the gate sends back, 78 belong to theorems whose statement text did not change. Of these, 27 come from a commit that rebuilt TensorAlgebra on a different quotient construction, and 27 from the commit of the introduction: the definition's unfolding lemma and 26 theorems that state the same facts as before, since the new definition is provably but not definitionally equal to the old one. The other 24 come from a renamed instance, removed section variables, a rebuilt definition, a removed option and a changed import. Conversely, 54 statements changed their text but not their elaborated term, mostly through new notation for differential geometry or deprecated aliases. A diff sends them to the reviewer, but the gate does not.
What a fingerprint must ignore. Elaborated terms carry details that the source does not show, and a fingerprint that keeps them raises false alarms. In a first version of the tool, whose environment identity covered the whole import graph, two commits that only removed an import caused 110 lock violations and 88 invalidated receipts on the 40 single-line pairs. Restricting the environment identity, unfolding identity wrappers, normalizing instance arguments, erasing source positions and accepting definitionally equal terms brought both counts to zero, step by step.
Locks. Over the 229 pairs, the gate keeps 12,780 of the 12,898 receipts and blocks 28 patches, each of which changes, removes or regenerates a locked declaration. No commit that only changes imports violates a lock, but one that only removes an option does, because the option controlled how an attribute generates two statements. The definitional-equality stage keeps 21 declarations whose fingerprint changed, and the gate follows seven renames.
7.3 RQ2: Can a reviewer rely on the evidence?
The evidence a reviewer sees comes from the same probes that we ran on every labeled statement: identity, vacuity and dropping each hypothesis. Table 2 scores it. Read strictly, so that only a counterexample or contradictory hypotheses count, the evidence flags 47 statements and is wrong on two, a precision of 0.96. All 41 counterexamples among them come from random testing, and the kernel confirms each. Read broadly, so that a removable hypothesis also counts, it flags 85 and is wrong on ten, eight of them redundant hypotheses inside faithful statements, a precision of 0.88. The tool presents these as a remark, not a verdict. Recall is 5 to 8 %: it measures how much unfaithfulness is visible in the statement alone. The rest consists of statements that are true, consistent and about the wrong thing, such as a quantifier in the wrong place or an unintended domain, which only the informal text reveals. On the synthetic items, the probes find three of the four vacuous statements and one statement whose new domain made a hypothesis redundant. A flag is reliable evidence of a fault, but without a flag, the judgment rests with the reviewer.
7.4 RQ3: What does the evidence add to an LLM judge?
We asked the model that serves as the agent, acting as an LLM judge [42], whether each statement is faithful to its informal one. The judge is a balanced detector, with accuracy 0.845, and appending the evidence to its prompt does not change that (0.840), because the judge already flags most of what the evidence
X. Che et al.
Table 2. Flagging unfaithful statements. Precision per source, with the number of statements flagged in parentheses, and recall and accuracy (acc.) over all statements. The judge rows cover the 1,487 statements with a parsable verdict.
| Flagger | ProofNetVerif | graduate | synthetic | recall | acc. |
|---|---|---|---|---|---|
| strict evidence | 0.953 (43) | 1.000 (1) | 1.000 (3) | 0.049 | 0.424 |
| broad evidence | 0.928 (69) | 0.875 (8) | 0.500 (8) | 0.081 | 0.439 |
| LLM judge | 0.905 (799) | 0.513 (78) | 1.000 (29) | 0.872 | 0.845 |
| judge with strict veto | 0.903 (806) | 0.513 (78) | 1.000 (29) | 0.878 | 0.847 |

Fig. 4. Kernel evidence beside the LLM judge. Left: precision per source, with the number of statements flagged. Right: on the flagged statements with a parsable judge verdict, whether the judge agrees and, if not, which side the label takes.
flags. Figure 4 shows that the two are wrong in different places. On the graduate-level statements, the judge flags 78 of 143 and is right on 40, whereas the evidence flags eight and is right on seven. Of the 47 statements the evidence refutes or finds contradictory, the judge agrees on 40, and in five of the other seven the label sides with the kernel. The remaining two formalize exercise 3.10 of Ireland and Rosen over N: the label calls them faithful, but both are false at n = 0, which the reference formalization of ProofNetVerif excludes. Used as a veto over the judge, the evidence changes seven verdicts and improves five of them.
7.5 RQ4: Does the gate hold an agent to its contracts?
Table 3 reports the agent runs. The runs with feedback repair 37 instead of 34 of 41 tasks on the example developments and 7 instead of 4 of 31 on Mathlib files of 100 to 400 lines. The adversarial tasks test the gate itself: a statement was mutated, by dropping a hypothesis or by turning into < or = into , then locked, and the model was asked to prove it. With the default prompt, the model declined 78 times, returned six files that did not compile, proved a mutated statement that happened to remain true 11 times, and five times returned a file that the gate must refuse: once with the hypothesis restored, the run of Figure 11 in Appendix A, and four times with the sorry left in. The gate refused all five. A prompt that forbids giving up raised the number of such files to eight, all refused. In 344 runs, no file with a sorry or a changed locked statement was accepted.
Table 3. Agent runs with Qwen3.5-122B, each task once in a single round and once over up to three rounds with feedback from the gate. Declined: the model returned the file unchanged. Kernel error: the returned file did not compile. Caught: the gate refused a changed locked statement or a sorry.
| Tasks | n | single round / with feedback | |||
|---|---|---|---|---|---|
| accepted | declined | kernel error | caught | ||
| repair, examples | 41 | 34 / 37 | 1 / 0 | 6 / 4 | 0 / 0 |
| repair, Mathlib | 31 | 4 / 7 | 0 / 6 | 27 / 18 | 0 / 0 |
| adversarial, default prompt | 50 | 5 / 6 | 41 / 37 | 4 / 2 | 0 / 5 |
| adversarial, second prompt | 50 | 6 / 6 | 9 / 16 | 31 / 24 | 4 / 4 |
7.6 RQ5: Is it fast enough?
Table 5 in Appendix A lists the latencies on our cluster, which has network storage and shared CPUs. A challenge on the example project returns in 0.4s at the median, a statement probe on a file that imports Mathlib in 0.3s, and a gate comparison in 10ms once both revisions are indexed. The cost a reviewer notices is the first elaboration of a file that imports Mathlib, 13.5s at the median, paid once per file and session. On the 458 file versions of the evaluation, the tool indexed up to 1,437 lines and 400 declarations, with 396 lines and 41 declarations at the median and up to 306 receipts on one file.
7.7 Scope
The labels of the statements are those of their sources. The review state on the revision pairs covers every theorem, so the numbers of receipts sent back are upper bounds for a reviewer who has reviewed only part of a file. RQ1 takes definitional equality of elaborated terms as the reference notion of change, and the judge and the agent use one open-weight model.
8 Related work
Validating specifications. Whether a formal statement says what was meant is the problem of validating a specification, as old as formal verification [30,38]. Large verification projects treat their top-level specification as the part that people must read and trust [19]. Counterexample generators run on conjectures before any proof is attempted, as Nitpick [3] and Quickcheck [5] do in Isabelle and QuickChick [28] in Coq. Model finders show instances of a specification, as in Alloy [15]. Vacuity detection [2,20] and coverage metrics [8] ask whether a property holds for a trivial reason or constrains too little, and mutation testing [17] asks what a test suite notices. ProofPatch's challenges apply these ideas to elaborated Lean statements and feed their results into review decisions that are kept valid across revisions. Pollack-inconsistency [37], a mismatch between
X. Che et al.
the statement a system displays and the one it checks, is why the reviewed object is the elaborated term. The de Bruijn criterion [1], which places trust in a small proof checker and the axioms it accepts, is why locks also pin axioms.
Change impact and regression selection. Deciding which receipts a patch invalidates is change impact analysis [4] for review decisions. It is closest to regression test selection, which must re-run every test a change may affect while re-running as few as possible [34]. Selection by file dependencies [12] corresponds to our file-diff baseline, and Palmskog et al. prove such analyses over dependency graphs correct in Coq [27]. Semantic differencing compares program versions by what they compute, using dependence analysis [16] or equivalence checking [13,21]. The gate's comparison is a cheap instance of the latter, with definitional equality as the equivalence the kernel checks quickly. Proof engineering keeps proofs working across changes, by re-checking only affected proofs [7] or repairing proofs after definitions change [32,33]. ProofPatch maintains what proofs do not capture, the human judgment that a statement is the right one [18].
Faithfulness of autoformalization. BEq+ [29] judges a formalization by provable equivalence with a reference, ShadowBench [14] by implication of hidden statements, and FormalAlign [23] by an alignment score. The Faithfulness Gap [25] classifies failure modes. Beyond Compilation [40] and Meek et al. [24] measure how far compiling overstates faithfulness, with LLM judges checked against human reviewers. These methods produce a score or a label, whereas ProofPatch produces evidence a reviewer can check without a reference and keeps the reviewer's decision valid afterwards.
Human-AI formalization environments. Lean Atlas [39] shows a project's dependency graph and selects the declarations a person should review. Like ProofPatch, it separates the dependencies of a statement from those of its proof, but it decides where to review rather than how to record a review and keep it valid. EconCSLib [11] stores human validations with a hash of each validated statement and marks a review stale when that hash changes. ProofPatch also follows the definitions a statement depends on and compares elaborated terms. LeanMarathon [41] coordinates agents that construct, audit, prove and repair a blueprint. Collins et al. [10] study what control mathematicians want over such tools, and ProofPatch keeps that control in the receipts and the gate.
9 Conclusion
ProofPatch attaches a reviewer's decision to the statement the kernel checked and to the definitions it depends on, and keeps the decision only as long as those terms stay the same up to definitional equality. Working on elaborated terms lets it ignore changes of notation and see changes that never touch a theorem's text, with far less re-review than text-based methods that miss almost nothing. Next, we intend to add probes that a model proposes and the kernel checks, aimed at statements that are true and consistent but about the wrong thing.
References
- Barendregt, H., Wiedijk, F.: The challenge of computer mathematics. Philosophical Transactions of the Royal Society A 363(1835), 2351–2375 (2005)
- Beer, I., Ben-David, S., Eisner, C., Rodeh, Y.: Efficient detection of vacuity in temporal model checking. Formal Methods in System Design 18(2), 141–163 (2001)
- Blanchette, J.C., Nipkow, T.: Nitpick: A counterexample generator for higher-order logic based on a relational model finder. In: Interactive Theorem Proving (ITP). LNCS, vol. 6172, pp. 131–146. Springer (2010)
- Bohner, S.A., Arnold, R.S. (eds.): Software Change Impact Analysis. IEEE Computer Society Press (1996)
- Bulwahn, L.: The new Quickcheck for Isabelle: Random, exhaustive and symbolic testing under one roof. In: Certified Programs and Proofs (CPP). LNCS, vol. 7679, pp. 92–108. Springer (2012)
- Carneiro, M.: The type theory of Lean. Master's thesis, Carnegie Mellon University (2019)
- Celik, A., Palmskog, K., Gligoric, M.: iCoq: Regression proof selection for large-scale verification projects. In: Automated Software Engineering (ASE). pp. 171–182. IEEE (2017)
- Chockler, H., Kupferman, O., Vardi, M.Y.: Coverage metrics for formal verification. International Journal on Software Tools for Technology Transfer 8(4–5), 373–386 (2006)
- Claessen, K., Hughes, J.: QuickCheck: A lightweight tool for random testing of Haskell programs. In: International Conference on Functional Programming (ICFP). pp. 268–279. ACM (2000)
- Collins, K.M., et al.: Human agency in initial human-AI proof formalization workflows. arXiv preprint arXiv:2606.04273 (2026)
- Garg, N.: EconCSLib: AI-assisted Lean formalization for economics & computation research. arXiv preprint arXiv:2606.13306 (2026)
- Gligoric, M., Eloussi, L., Marinov, D.: Practical regression test selection with dynamic file dependencies. In: International Symposium on Software Testing and Analysis (ISSTA). pp. 211–222. ACM (2015)
- Godlin, B., Strichman, O.: Regression verification. In: Design Automation Conference (DAC). pp. 466–471. ACM (2009)
- Han, H., et al.: ShadowBench: Toward reliable automatic evaluation of semantic alignment in autoformalization. In: Empirical Methods in Natural Language Processing (EMNLP) (2026), arXiv:2608.29270
- Jackson, D.: Alloy: A lightweight object modelling notation. ACM Transactions on Software Engineering and Methodology 11(2), 256–290 (2002)
- Jackson, D., Ladd, D.A.: Semantic Diff: A tool for summarizing the effects of modifications. In: International Conference on Software Maintenance (ICSM). pp. 243–252. IEEE (1994)
- Jia, Y., Harman, M.: An analysis and survey of the development of mutation testing. IEEE Transactions on Software Engineering 37(5), 649–678 (2011)
- Klein, G.: Proof engineering considered essential. In: FM 2014: Formal Methods. LNCS, vol. 8442, pp. 16–21. Springer (2014)
- Klein, G., et al.: seL4: Formal verification of an OS kernel. In: ACM Symposium on Operating Systems Principles (SOSP). pp. 207–220. ACM (2009)
- Kupferman, O., Vardi, M.Y.: Vacuity detection in temporal model checking. International Journal on Software Tools for Technology Transfer 4(2), 224–233 (2003)
X. Che et al.
-
Lahiri, S.K., Hawblitzel, C., Kawaguchi, M., Rebêlo, H.: SYMDIFF: A language-agnostic semantic diff tool for imperative programs. In: Computer Aided Verification (CAV). LNCS, vol. 7358, pp. 712–717. Springer (2012)
-
Limperg, J., From, A.H.: Aesop: White-box best-first proof search for Lean. In: Certified Programs and Proofs (CPP). pp. 253–266. ACM (2023)
-
Lu, J., et al.: FormalAlign: Automated alignment evaluation for autoformalization. In: International Conference on Learning Representations (ICLR) (2025)
-
Meek, T., et al.: Formalizing numerical analysis: An agent pipeline and quality audit beyond kernel acceptance. arXiv preprint arXiv:2606.14000 (2026)
-
Mohammad, N.I.S., Sheikh, T.: The faithfulness gap: Certifying semantic equivalence between natural-language and formal mathematical statements. arXiv preprint arXiv:2606.16541 (2026)
-
de Moura, L., Ullrich, S.: The Lean 4 theorem prover and programming language. In: Automated Deduction (CADE). LNCS, vol. 12699, pp. 625–635. Springer (2021)
-
Palmskog, K., Celik, A., Gligoric, M.: Practical machine-checked formalization of change impact analysis. In: Tools and Algorithms for the Construction and Analysis of Systems (TACAS). pp. 137–157. Springer (2020)
-
Paraskevopoulou, Z., et al.: Foundational property-based testing. In: Interactive Theorem Proving (ITP). LNCS, vol. 9236, pp. 325–343. Springer (2015)
-
Poiroux, A., Weiss, G., Kunçak, V., Bosselut, A.: Reliable evaluation and benchmarks for statement autoformalization. In: Empirical Methods in Natural Language Processing (EMNLP) (2025), arXiv:2406.07222
-
Pollack, R.: How to believe a machine-checked proof. In: Sambin, G., Smith, J.M. (eds.) Twenty Five Years of Constructive Type Theory. Oxford University Press (1998)
-
Ren, Z.Z., et al.: DeepSeek-Prover-V2: Advancing formal mathematical reasoning via reinforcement learning for subgoal decomposition. arXiv preprint arXiv:2504.21801 (2025)
-
Ringer, T., et al.: QED at large: A survey of engineering of formally verified software. Foundations and Trends in Programming Languages 5(2-3), 102–281 (2019)
-
Ringer, T., et al.: Proof repair across type equivalences. In: Programming Language Design and Implementation (PLDI). pp. 112–127. ACM (2021)
-
Rothermel, G., Harrold, M.J.: A safe, efficient regression test selection technique. ACM Transactions on Software Engineering and Methodology 6(2), 173–210 (1997)
-
The mathlib Community: The Lean mathematical library. In: Certified Programs and Proofs (CPP). pp. 367–381. ACM (2020)
-
Weng, K., et al.: Autoformalization in the era of large language models: A survey. arXiv preprint arXiv:2505.23486 (2025)
-
Wiedijk, F.: Pollack-inconsistency. Electronic Notes in Theoretical Computer Science 285, 85–100 (2012)
-
Woodcock, J., Larsen, P.G., Bicarregui, J., Fitzgerald, J.: Formal methods: Practice and experience. ACM Computing Surveys 41(4), 1–36 (2009)
-
Yanahama, B., Sannai, A.: Lean Atlas: An integrated proof environment for scalable human-AI collaborative formalization. arXiv preprint arXiv:2604.16347 (2026)
-
Zhang, K., et al.: Beyond compilation: Evaluating faithful natural-language-to-Lean statement formalization. arXiv preprint arXiv:2606.31002 (2026)
-
Zhang, Y., et al.: LeanMarathon: Toward reliable AI co-mathematicians through long-horizon Lean autoformalization. arXiv preprint arXiv:2606.05400 (2026)
-
Zheng, L., et al.: Judging LLM-as-a-judge with MT-Bench and Chatbot Arena. In: Advances in Neural Information Processing Systems (NeurIPS), Datasets and Benchmarks Track (2023)
A Demonstration
The demonstration runs on a laptop with Lean 4.32 and Mathlib and takes about ten minutes. It uses the running example of Section 2, a file of eleven declarations that ships with the tool together with its review state: the informal statements, the receipts of alice and bob, and the locks of Figure 2. Figure 5 shows the components involved.

Fig. 5. Components of ProofPatch. All clients run the same functions, and only the kernel service runs Lean. A challenge runs in a branch from the state before its target. An agent's patch reaches the reviewer's files only through the gate.
Setup. The tool needs the project's Lean toolchain with Mathlib's prebuilt cache, Python 3.9 for the daemon, which uses only the standard library, and Node.js once to build the browser interface. A lake build compiles the kernel service. In the project directory, proofpatch serve starts the daemon and serves the interface on a local port, while proofpatch gate and the other commands run the same functions without a daemon. The VS Code extension connects to the running daemon. The kernel service has about 1,700 lines of Lean, the daemon about 3,900 lines of Python with 50 unit tests, the browser interface about 2,100 lines of TypeScript and CSS, and the extension 200 lines. The policy of the example allows the three standard axioms, locks a statement when a reviewer accepts it, blocks a patch that sends any receipt back, and runs the definitional-equality stage.
- Reviewing a statement. Figure 6 shows the statement screen of clamp_le_hi, with the informal statement above the formal one, split into the parts a challenge can modify. Clicking the hypothesis h and choosing drop hypothesis runs the challenge in about half a second: the original proof fails, no prover proves the modified statement, and random testing finds lo = 1, hi = 0, x = 1. Then alice accepts the theorem and cites the challenge. The receipt stores the fingerprints F, R and E, and the project policy locks the statement.
X. Che et al.

Fig. 6. Statement screen for clamp_le_hi. Left: the informal statement above the formal one, split into its parts. Right: the evidence of the challenge that drops h, ending with the grade's fixed wording, and alice's receipt, which cites it. Bottom: the form that records a decision.
- Other outcomes of a challenge. The same operation grades the three theorems of Figure 7 differently. On lo_1e_clamp the original proof goes through without h, which was never used, and alice rejects it. On vacuous, whose hypotheses contradict each other, decide proves the negation of the modified statement, which the kernel checks. On strict_of_le the original proof fails, but nlinearith proves the modified one. A sweep challenges every hypothesis at once.

Fig. 7. Dropping a hypothesis from three other theorems of the example: replay passes (lo_le_clamp), refuted with a kernel-checked negation (vacuous), and an alternative proof (strict_of_le).
- Locks. The contracts screen in Figure 8 lists every lock of the project with the fingerprint it pins, who set it and why. The statement locks come from accepted receipts, and all but the first are on theorems of the running example. The definition lock on clamp was set by alice after reviewing its body. Removing a lock requires a reason and is recorded in the ledger, the project's log of review actions.

Fig. 8. Locks of the example project with their baseline fingerprints.
- A patch. Replacing the body of clamp by min hi (max lo x) keeps every proof working. The gate screen in Figure 9, run against HEAD, blocks the patch: the definition lock fails, the five statement locks hold, and six receipts go back to their reviewers because their closures changed. Continuous integration runs the same check from the command line and posts the report of Figure 10. Undoing the edit makes the gate accept the file again with every receipt kept.
X. Che et al.

Fig. 9. Gate report on the patch that rewrites clamp: the source diff, the effect on every declaration, the lock results, and the six receipts sent back for re-review.
$ proofpatch gate ProofPatch/Examples/Demo.lean --base HEAD --md
### ProofPatch gate - X Blocked: definition lock on clamp violated
| Lock | Target | Holds | Reason |
|---|---|---|---|
| statement | `clamp_of_mem` | ✓ | statement unchanged | (four more hold)
| definition | `clamp` | X | definition body changed |
| Declaration | Formal effect |
| `clamp` | body changed |
| `clamp_le_hi` | closure changed | (five more)
Receipts needing re-review:
- ○ `clamp_of_mem` - closure changed (five more)
_5 proof-only change(s) · 1 receipt(s) preserved · 29.58 s_
$ echo $?
1
Fig. 10. The same gate from the command line, as continuous integration runs it. The report, shortened here, is Markdown for a pull-request comment, and the exit status blocks the merge.
- Other patches. Table 4 shows the gate, run from the command line, on the patch of step 4 and on five more, each applied alone to the example. Rewriting clamp as the conditional that max unfolds to changes its fingerprint, but the kernel confirms that the old and the new body are definitionally equal, so the definition lock holds and every receipt is kept. New names for the bound variables of clamp leave its fingerprints unchanged, and a renamed theorem keeps its lock and its receipt under the new name. Replacing a proof by sorry changes no statement, so every receipt is kept, but the trust check blocks the patch. Weakening a locked statement fails its lock and sends its receipt back.
Table 4. The gate on six patches to the running example, each applied alone and checked from the command line against HEAD. The file holds six locks and seven receipts. The columns count the locks that hold and the receipts that are kept.
| Patch | Reported effect | Locks | Receipts | Verdict |
|---|---|---|---|---|
| body of clamp becomes min hi (max lo x) | body changed, six closures changed | 5 of 6 | 1 of 7 | blocked |
| body of clamp becomes if lo ≤ min hi x then min hi x else lo | definitional rewrite | 6 of 6 | 7 of 7 | accepted |
| bound variables of clamp become a b y | no change | 6 of 6 | 7 of 7 | accepted |
| clamp_of_mem becomes clamp_eq_self | renamed | 6 of 6 | 7 of 7 | accepted |
| proof of score_le_hundred becomes sorry | sorryAx added | 6 of 6 | 7 of 7 | blocked |
| statement of score_le_hundred becomes score x ≤ 101 | statement changed | 5 of 6 | 6 of 7 | blocked |
- An agent in the loop. With a model endpoint set in the policy, the agents screen creates a task from a goal in natural language. The agent edits a copy of the file in its own git worktree. Every answer goes through the gate, whose
X. Che et al.
report is fed back for up to three rounds, and an accepted result is applied to the reviewer's files with one action. Figure 11 shows one adversarial run of the evaluation, in which the third answer restores the dropped hypothesis and the gate refuses it.

Fig. 11. One adversarial task of the evaluation, run with Qwen3.5-122B. The task cannot be solved as posed. The third answer changes what was asked, and the gate refuses it.
Scale. On the 458 file versions of the 229 Mathlib revision pairs, the tool indexed up to 1,437 lines and 400 declarations that a reviewer sees, 396 lines and 41 declarations at the median, with up to 306 receipts on one file. Table 5 gives the latencies: the first elaboration of a file that imports Mathlib dominates, and everything a reviewer does after it, from a challenge to a gate comparison, takes well under a second.
Table 5. Latency on the evaluation cluster, which has network storage and shared CPUs, as the median and the 90th percentile (p90). Interactive challenges and the reload, measured once, ran on the example project, probes on the labeled statements, and gates on Mathlib files.
| Operation | n | median | p90 |
|---|---|---|---|
| interactive challenge: replay, provers, refutation | 21 | 0.40 s | 0.57 s |
| statement probe on a file that imports Mathlib | 5,839 | 0.33 s | 1.96 s |
| first elaboration of a Mathlib file, imports loaded once | 458 | 13.5 s | 43.3 s |
| reload after an edit to the last declaration | 1 | 0.10 s | |
| gate comparison, both revisions indexed | 229 | 10 ms | 34 ms |
| agent task, up to three rounds with the gate | 244 | 26.8 s | 116.8 s |