Back to AI News
arxiv

OPAL introduces repository-level optimization of Lean proofs with coding agents

OPAL is presented as the first repository-level, metric-driven proof-optimization task, in which an agent refactors Lean blueprint repositories toward repository-level objectives. It uses six metrics based on human maintenance patterns, including proof length, import closure, mathlib duplication, and elaboration cost. The work releases OPAL-Bench with 162 task instances from 18 real-world Lean blueprint projects and an executable semantic-preservation checker that uses blueprint links to define which theorem statements must remain intact. Experiments report that coding agents can achieve optimization gains beyond single human commits, while ablations show that without the preservation contract, nearly half of accepted improvements fail semantic verification.

AI Brief

It provides a concrete benchmark and evaluation method for AI coding agents working on large-scale formal proof maintenance, a setting where correctness-preserving refactoring is critical.

arXiv:2611.40707v1 Announce Type: new Abstract: Driven by rapid progress in autoformalization and automated theorem proving, formal mathematics is scaling up: mathematicians, often with AI assistance, advance large formalization projects around Lean blueprints, which tightly link a LaTeX proof plan to the Lean codebase. As mathlib and proof automation evolve, finished proofs accumulate optimization opportunities. Yet even in the mature mathlib library, 41% of commits add no new mathematics but improve existing proofs (shortening, deduplication, faster compilation), and 62% of these span multiple files, beyond the reach of theorem-level methods. We introduce OPAL, the first repository-level, metric-driven proof-optimization task, where an agent freely refactors a blueprint repository toward repository-level objectives. We instantiate OPAL with six metrics grounded in empirically mined human maintenance tendencies, including proof length, import closure, mathlib duplication, and elaboration cost. Optimizing these metrics freely, however, invites reward hacking, such as deleting a theorem to shorten the code, so evaluation needs a contract on what must stay intact. Our key observation is that blueprint structure itself supplies this contract: \lean{} links pin down which theorems constitute a project's final targets (5-19% of all declarations), whose statements must be preserved, while the remaining 81-95% of auxiliary code may be freely refactored. We implement this contract as an executable semantic-preservation checker. Building on it, we release OPAL-Bench, comprising 162 task instances from 18 real-world Lean blueprint projects, together with a sandboxed agent harness. Experiments show that coding agents can deliver genuine optimization gains beyond the level of single human commits, while ablations show that with the contract absent from the agent's world nearly half of accepted improvements do not survive semantic verification.
Be the first to rate this article.

Comments & Questions (0)

Captcha
Please be respectful — let's keep the conversation friendly.

No comments yet

Be the first to comment!