VeriBase generalizes verified code together with its theorems: a general library lifts task success from 63.0% to 73.0%
Synopsis
Proving software correct is often more expensive than writing it, and finished verification work rarely becomes a reusable theorem library. VeriBase treats code and its associated theorems as one declaration family and builds Lean libraries automatically through proving, generalization and harvesting, updating dependent declarations as interfaces change. A general library built from 4,191 independent programs raised average task success from 63.0% to 73.0% across three single-file benchmarks and three backend models, while cutting average completion time by 13.2%.
Interpretation
VeriBase turns a successful verification from a one-off answer into code and theorems that later tasks can call directly. Previously, converting verification results into a library required experts to spot reusable functionality, design general interfaces and integrate dependencies, and such theorem libraries remain comparatively scarce in software verification. Across nine benchmark-backend combinations on Verina, FVAPPS and VeriContest, a general library built from 4,191 programs outside those benchmarks raised the macro-average task success rate from 63.0% to 73.0%.
Construction runs in three phases: an agent first solves tasks in Lean, then abstracts implementations and intermediate proof facts into general forms, and finally merges overlapping declarations from different tasks into shared interfaces. Generalization is code-first and theorems-second, so when a code interface changes, the dependent theorem statements and proofs are rewritten and checked by Lean. Harvesting integrates candidates in source-task batches, applying add, skip or merge to each declaration and compiling affected modules after every batch; the resulting general library holds 1,609 code declarations and 3,239 theorems.
On repository-level proof tasks, the automatically built library comes close to the role played by human-developed supporting theorems. VeriSoftBench normally relies on human-developed supporting theorems, which were removed before the library was constructed for evaluation. With those human theorems removed, the constructed library raised average success across three backends from 56.3% to 77.0%; for GLM 5.2 it reached 81.0%, against 84.0% with the original supporting theorems.
Perspective
The demonstrated scope is software verification in Lean 4: three single-file benchmarks and one repository-level benchmark, with DeepSeek V4 Pro, GLM 5.2 and Qwen 3.7 Max as backend models, and libraries held fixed during evaluation. For software in other languages such as C and Rust, reuse additionally requires establishing a semantic connection between source programs and their Lean representations.
API cost varies by backend model: with the general library, DeepSeek V4 Pro costs rise by 18.3% to 33.3%, while GLM 5.2 and Qwen 3.7 Max show mixed changes, since retrieval adds input context while reusing declarations reduces later generation. The library-size experiment shows efficiency gains largely saturating beyond 500 construction tasks, while final task coverage continues to improve.
