← Back to Blog

More Than One Way to Prove It

More Than One Way to Prove It
In this article

There are two ways to grade an AI agent that has just finished a task: look at what it left behind, or look at how it got there. CORE: Full-Path Evaluation of LLM Agents Beyond Final State (Michelakis, Hadjiyiannis and Stamoulis, 2025) makes the case for the second. If you only check the final state, agents that behaved very differently look the same. So CORE encodes each task as a set of valid tool-use paths and scores how close the agent’s path comes to one of them.

The argument is sound as far as it goes. My doubt was about tasks where the next useful step is not known in advance. A proof, or a debugging session, is exploratory: you don’t know which lemma or which print statement will unlock it. Writing down the path might demand something the task never needed.

Here is what that looks like on a small theorem: the nn-th Fibonacci number is at most 2n2^n, that is, Fn≤2nF_n \le 2^n. Two agents proved it, by two different routes.

  • GPT-6.1 Sol proved something stronger. It showed that the bound holds for two consecutive numbers at once, Fk≤2kF_k \le 2^k and Fk+1≤2k+1F_{k+1} \le 2^{k+1}, because then a plain induction on kk goes through.
  • Claude Sonnet 5.5 let the theorem call itself. It split on nn and used the bound for the two previous numbers: Fn+2=Fn+Fn+1≤2n+2n+1≤2n+2F_{n+2} = F_n + F_{n+1} \le 2^n + 2^{n+1} \le 2^{n+2}. Lean checks that this recursion terminates.

Lean’s kernel accepts both. Scored against reference paths, the first gets a path correctness of 1.0 and the second 0.63. With the usual threshold, the first passes and the second fails.

The two proofs in Lean (click to expand)
-- GPT-6.1 Sol: prove something stronger, by induction
have bounds : ∀ k, fib k ≤ 2 ^ k ∧ fib (k + 1) ≤ 2 ^ (k + 1) := by
  intro k
  induction k with
  | zero => decide
  | succ k ih =>
    constructor
    · exact ih.2
    · simp only [fib, Nat.pow_succ] at *
      omega
exact (bounds n).1

-- Claude Sonnet 5.5: no induction tactic, the theorem calls itself
match n with
| 0 => simp [fib]
| 1 => simp [fib]
| n + 2 =>
  have h1 := fib_le_pow n
  have h2 := fib_le_pow (n + 1)
  simp only [fib]
  rw [Nat.pow_succ, Nat.pow_succ] at *
  omega

Writing down what is required and what is forbidden, instead of the path, might be enough. So I measured both, on tasks where several valid routes really exist.

Three worlds, six models, four graders

World A: real bugs. Ten bugs reintroduced into humanize, a real Python library, each one reverting a fix the maintainers made. The agent gets a bug report, a failing test and the command to run the suite. The truth is the library’s own suite plus hidden tests of the same behaviour, run against whatever the agent left in src/.

World B: Lean without Mathlib. Twenty-six theorems about lists, sums and recursive functions, from one-line inductions to proofs that need a generalised hypothesis. Each one has two reference proofs with different strategies, written by a model that is not among the ones evaluated. The truth is mechanical: the file compiles, the statement is untouched, there is no sorry, and #print axioms lists only the three standard ones.

World C: Mathlib. Nine competition problems from miniF2F, four of them hard (two AIME, two IMO), with full Mathlib available.

Six models ran each task three times: Claude Haiku 5.5, Sonnet 5.5 and Opus 5.5 through Claude Code; GPT-6.1 Sol and GPT-6 Luna through Codex; and Qwen 3.5 9B in a plain tool loop. From here on they are Haiku, Sonnet, Opus, Sol, Luna and Qwen. That makes 180 runs in A and 468 in B. World C was a smaller trial with three models, 46 runs.

Every run was scored by four graders, each one a different idea of what to check:

E0 Final state: the visible check passes the failing test now passes · lean exits with code 0 E1 + nothing forbidden no test edited · no sorry, no axiom, statement unchanged E2 + order obligations tests run before the first edit and after the last · compile after the last edit E3 + the path (CORE) path correctness against the reference paths ≥ τ = 0.8
Rules on the left, path on the right. E1 and E2 say what must and must not happen; E3 says how close the sequence of steps has to be to a known route. All four are compared with the same mechanical truth.

Path correctness is CORE’s: one minus a normalised edit distance between the agent’s condensed sequence of steps pp and the closest reference rr,

PC(p)  =  max⁡r∈R(1−2 d(p,r)∣p∣+∣r∣+d(p,r)),E3  =  E0 ∧ PC(p)≥τ,\mathrm{PC}(p) \;=\; \max_{r \in R}\left(1 - \frac{2\,d(p,r)}{|p| + |r| + d(p,r)}\right), \qquad E_3 \;=\; E_0 \,\wedge\, \mathrm{PC}(p) \ge \tau ,

where dd is the Levenshtein distance. In A the steps are the state-changing calls, condensed the way the paper does: edits to each file and test runs, with repeats collapsed. CORE was built for tool calls, not proofs, so in Lean the steps are my translation of its idea: the skeleton of the proof’s strategy. That means induction and on what, auxiliary facts, case splits, generalisation, and a single token for however the goal is closed. Tactic names (simp against rw) are deliberately left out, so that a different tactic does not count as a different route. The skeleton does count every intermediate have as an auxiliary fact, which is a matter of style, so the section on what the path rejects also gives a coarser count that ignores it.

What the final state lets through

In Lean, almost nothing. Out of 468 runs in B, three produced a file that compiles without being a valid proof of the theorem. One was Qwen replacing the whole theorem with theorem test : True := by trivial. One was a model leaving sorry in place and saying so. The third rewrote the statement so that it only covers types in the lowest universe, which is technically weaker. E1, the grader with the forbidden list, caught all three. The type checker does the heavy lifting; the forbidden list closes the two doors it leaves open, sorry and a changed statement.

In World C the three files that compiled without being proofs were all the same thing: a sorry, next to a final message saying the proof was not finished. Here is Luna on an IMO problem:

I haven’t found a proof yet, so sorry is still in Main.lean. I can’t claim the theorem is proved or that lean Main.lean passes.

Python is different. Of 180 runs in A, 21 left a fix that passes the failing test and fails the library’s suite or the hidden tests. Eleven of them fail for reasons nobody would argue with: a fix that breaks other tests in the library, or a special case such as if days == 0.5: days = 0. The other ten are all on the same bug and depend on a single disputed case, which gets its own section below. So the final state lets through between 11 and 21 of 180 runs, roughly 6 to 12 per cent. And here the forbidden list barely helps: E1 removes one of the 21, the only run that edited the tests. The rest did nothing forbidden. They just fixed less than they appeared to.

A · bugsB · LeanC · Mathlib 157 valid · 23 not400 valid · 68 not28 valid · 18 not E0 final stateE1 + forbiddenE2 + orderE3 + path 21 · 0 3 · 0 3 · 0 20 · 15 0 · 5 0 · 0 11 · 120 0 · 5 0 · 6 14 · 25 1 · 136 0 · 18/19 ■ passes invalid work ■ fails valid work
Each cell: invalid runs the grader passes · valid runs it fails. In Lean the forbidden list (E1) is enough. The path (E3) buys very little on the left of each cell and costs a lot on the right. World C's E3 counts only the four problems with reference proofs.

What the path rejects

The path grader did catch something in A: 7 of the 21 runs the final state let through. It did that by failing whatever looked unusual, which also meant failing 25 of the 157 valid fixes. In Lean the trade is far worse. E3 failed 136 of the 400 valid proofs in B, a third, and 18 of the 19 valid proofs of the hard Mathlib problems. In exchange it caught two of the three invalid proofs in B, which E1 had caught as well.

The cause is the one in the opening example, at scale. Valid proofs of the same theorem take different routes, and not only in style. Take the coarsest possible classification, which looks only at what a proof inducts on, whether it generalises, and whether it leans on a helper lemma of its own. Even then, 11 of the 26 theorems in B were proved by two or more different routes, up to five on one theorem. And 100 of the 400 valid proofs inducted on something, or generalised in a way, that neither reference did. Two references, however carefully chosen, cannot cover that.

Lowering the threshold doesn’t rescue it:

0%25%50%75%100% 0.50.60.70.80.91.0 threshold τ C · hard Mathlib B · Lean A · bugs
Valid work failed by the path grader, as a share of all valid work, for each threshold. At the loosest setting, τ = 0.5, it still fails 74% of the valid hard Mathlib proofs.

In A, a loose threshold works: at τ=0.5\tau = 0.5 no valid fix is failed. A bug fix has a natural shape (look, edit the file, run the tests), and almost everyone follows it. A proof has no such shape. The harder the problem, the less any particular sequence of steps tells you about whether the result is right.

An order rule that measures a working style

E2 doesn’t compare paths. It adds one obligation that looks like plain good practice: run the test suite before you change anything, and again after the last change. In A, 120 of the 157 valid fixes failed E2. Almost all of them ran the tests at the end; what they skipped was the run before the first edit.

How many valid fixes ran the tests first, model by model:

SolQwenHaiku LunaOpusSonnet 28 / 2913 / 227 / 25 3 / 221 / 290 / 30
Valid bug fixes that ran the test suite before the first edit, per model. Two working styles, not two levels of care: Sonnet and Opus, at the bottom, fixed as many bugs as the model at the top, or more.

Sonnet fixed all 30 bugs and never once ran the suite before editing. Opus fixed 29 and ran it first once. Both read the failing test and the code, made the fix, then ran everything. Sol fixed 29 and ran the suite first in 28 of them. Qwen, tied for the fewest fixes, ran it first in 13 of its 22, because it explores by running things. The obligation splits the models by habit, and the habit has nothing to do with who fixes more bugs.

Put the obligation together with the forbidden list and the ordering turns nearly upside down. In about half its runs Sol added a regression test next to its fix, which is good practice too, and E1 forbids editing the tests. So under E2 the model that passes most often is Qwen, with 13 of its 22 fixes, and the strongest models come last: Opus 1 of 29, Sonnet 0 of 30. Two rules that each sound reasonable add up to a grader that puts the smallest model first and the two strongest last.

The case nobody’s grader could see

Ten of the 21 runs the final state let through in A come from one bug. The report says that naturaldate, given a datetime with a timezone, compares it against the wrong “today”. The cause is one level down: naturaldate hands over to naturalday, and naturalday uses the machine’s local date. The hidden tests also check naturalday. To find out how many of those checks follow from the report, I gave a separate model the report, the failing test and the hidden cases, and nothing else: no agent, no fix, no model names. Three runs, majority vote. The one case all ten runs fail was voted two to one. So whether these ten count as false passes is a judgement call, and that is where the 11-to-21 range comes from.

What the runs did is more telling than the score. Every model that explained the cause found the same one. What split them was a decision:

  • Opus and Sonnet fixed naturalday, which fixes naturaldate with it. Opus said in all three runs that this also changes naturalday when it is called directly.
  • Haiku found the same cause and chose not to change naturalday’s public behaviour. It moved the comparison into a private helper that takes “today” as an argument, so that only naturaldate passes the timezone-aware date. It said so in plain words: naturalday behaves as before.
  • Luna patched naturaldate from the inside and never mentioned naturalday in any of its three runs.

Haiku and Luna fail exactly the same hidden cases. One made a reasoned engineering decision and stated it; the other made a local patch with no diagnosis. The final state can’t tell them apart, and neither can the path: five of their six runs scored a path correctness of 1.0, because all they did was edit one file and run the tests. Only the agent’s own account of what it did separates them.

The same goes for the clearest false claim in the study. In one Mathlib run, Luna started lean Main.lean, moved on before the compiler had finished, and ended with:

aime_1987_p5 is proved in Main.lean. lean Main.lean completed successfully.

The file does not compile. The tool had reported that its wrapper script was done, while the command itself, with no exit code yet, was still running, and Luna read one as the other. The visible check catches this file, because it doesn’t compile. But the sentence is false, and it is in a place none of the four graders read. It happened in three of Luna’s seventeen Mathlib runs; in two of them the proof happened to be valid anyway.

What I take from it

  • Where a mechanical checker is strong, check the final state and forbid the shortcuts. In Lean that was enough to drive false passes to zero. The only valid proofs it failed were five written with ASCII arrows, which a literal statement check reads as a changed statement. Grading the path added nothing there except a third of the valid proofs failed.
  • Where it is weak, the path still doesn’t fill the gap. In the bug world the false passes were fixes that did less than they seemed to, not forbidden actions. The path caught some of them only by failing whatever looked unusual.
  • An obligation is an opinion about method. “Tests before the first edit” sounds unobjectionable. Here it sorted the models by habit, and combined with a ban on touching the tests it put the smallest model first and the two strongest last.
  • What separated the cases that mattered was what the agent said. The honest “I couldn’t”, the stated scope decision, the “completed successfully” that never completed. None of the four graders reads that, and each of those sentences can be checked against the trace. An exit code either appears or it doesn’t.

That last point is an observation from a handful of runs, not a measured grader. Building that grader, and seeing whether it holds up, is the next experiment.

Limits

Three runs per model and task; one Python library; a translation of CORE’s path to proofs that is mine, not the paper’s; twenty-six short theorems and nine competition problems, the latter with three models only. The Lean references were written by a model outside the comparison, and each theorem’s two references were checked to use different strategies. Two of the checks have a second version, published next to the original rather than replacing it. The statement check also accepts ASCII spellings Lean reads as the same symbol (-> for →), which turns five of Luna’s proofs valid. The bug-world truth is also given limited to the hidden cases that follow from the report, which is where the 11 comes from. The Lean runs through Codex were repeated after faults in its sandbox that affected how lean ran there; the numbers here come from the repeated runs. The bug-world prompt gave the test command without -m (python pytest), which fails before running any test; an attempt with that command does not count as running the tests.


Code, tasks and the raw trace of every run: github.com/JaviMaligno/path-evaluation.