OPAL turns Lean blueprint maintenance into a repository-level agent task
A new benchmark asks coding agents to optimize whole Lean proof repositories against measurable goals, while a checker ensures the underlying mathematics stays intact.
In plain words
Lean is a language for writing machine-checked mathematical proofs, and large collections of these proofs need ongoing cleanup as tools improve. The OPAL paper defines a task where an AI agent reorganizes an entire proof project to make it shorter or faster, guided by six measurable goals. A separate checker verifies the mathematics is unchanged.
What was announced
The authors frame the problem with maintenance data: in the widely used mathlib library, 41% of commits add no new mathematics but improve existing proofs, and 62% of those changes span multiple files, which theorem-level methods cannot handle. OPAL therefore defines optimization at the repository level, with six metrics mined from human maintenance habits, including proof length, import closure, mathlib duplication, and elaboration cost.
Free optimization invites reward hacking, such as deleting a theorem to shorten code. The paper's answer is that blueprint structure supplies a contract: links in the blueprint pin down the final target theorems, 5-19% of declarations, whose statements must be preserved, while the remaining 81-95% of auxiliary code may be refactored. This contract is enforced by an executable semantic-preservation checker. The released OPAL-Bench contains 162 task instances from 18 real-world Lean blueprint projects plus a sandboxed agent harness. Experiments reported in the paper show agents achieving gains beyond single human commits, though ablations found that without the contract in the agent's view, nearly half of accepted improvements failed semantic verification.
What it does not show
- The evidence is the paper's abstract only; full experimental details, baselines, and independent evaluation are not available in the supplied passages.
- Reported agent gains and ablation results are the authors' own claims and have not been independently confirmed.
For security and IT teams
- Scope
- OPAL-Bench covers 162 task instances drawn from 18 real-world Lean blueprint projects, with a sandboxed agent harness for running the tasks.
Sources
Source-support review completed 2 Dec 2026. This story was drafted with AI assistance and checked against retained source passages. Automated checking is not independent verification.
Coverage: arXiv: abstract.
Updates and corrections
No corrections so far.
First published 2 Dec 2026
New to the subject? AI from the Ground Up starts from the beginning.