Manuscript Offprint
arXiv:2610.36328How Stable Are LLM-Generated Proofs Under Program Refactoring? A Stress Test for Verifiable Code Generation
Abstract
Benchmarks for verifiable code generation usually test a proof against one fixed implementation. We ask whether the same proof remains valid after a program refactoring that preserves behavior. We introduce RefactorProof, which derives 458 Lean-certified variants from the 185 VERINA tasks that compile in our pinned environment while holding the specification and evaluated proof fixed byte-for-byte. VERINA supplies reference proofs for 46 tasks, all from its basic split; the primary model-versus-reference comparisons further match on 21–25 short, non-recursive tasks. Structural refactorings expose substantial brittleness across proof sources: task-normalized structural PSR is 4.3% for the supplied references and 13.3–26.8% for the specialized provers. On the matched tasks, specialized prover proofs nevertheless have higher overall unchanged-proof survival than the supplied reference artifacts: +15.6 points for DeepSeek-Prover-V2-7B, +18.8 for Goedel-Prover-V2-32B, and +20.3 for Goedel-Prover-V2-8B; all three 95% CIs exclude zero. The ordering persists after excluding universally survived T1 variants, under family-balanced aggregation, and under alternative deployable valid-proof selection rules. However, unchanged-proof failure is not the same as high repair cost: predefined one-identifier edits repair 51/54 eligible reference structural failures and 58/85 eligible prover failures. RefactorProof therefore measures unchanged-proof stability under program refactoring, not the cost of maintaining a proof after it breaks.
1 Introduction
A machine-checked proof establishes that an implementation satisfies its specification. That guarantee is strong, but it is usually evaluated on one fixed version of the program. Real programs are refactored, and proofs can break even when those changes preserve behavior. Proof maintenance is a longstanding problem in formal methods. A Lean user may expect some scripts that unfold definitions to break after helper extraction; the empirical question is whether this brittleness differs systematically across proof sources and transformation mechanisms. The new setting considered here is that language models now generate such proofs at scale, while current verifiable-code benchmarks still score whether a proof verifies once.
We introduce RefactorProof to measure this gap. A VERINA task contains an implementation C, a specification S, and a proof P. We mechanically construct a refactored implementation , ask Lean to certify in a separate file, and then re-check the unchanged proof P against . The proof survival rate (PSR) is the fraction of certified refactorings of a task on which the same proof still verifies. RefactorProof uses five deterministic transformation families grouped into three operational classes: definitional (D), structural (S), and theorem-certified semantic (E). These
NeurIPS 2026 Workshop on AI for Verifiable Coding.
labels describe the source-level change being tested. They do not classify Lean’s definitional equality: T2 and T5 alter source structure even though Lean can reduce the transformed implementation to the original behavior definitionally.
Contributions. (i) A semantics-preserving evaluation in which only the implementation changes, while the specification and proof are byte-fixed and every retained transformation has a separate Lean certificate. (ii) RefactorProof, a benchmark of 458 certified variants, together with matched proof-survival comparisons and sensitivity analyses for proof selection, aggregation, common support, and certification artifacts. (iii) Artifact-level analysis of how proof strategies fail under different refactorings, plus a controlled mechanical-repair experiment that separates unchanged-proof stability from simple repair effort. We do not claim that proof brittleness itself is new. The supplied VERINA reference proofs are available for only 46 basic-split tasks, and the primary model-versus-reference comparisons match on 21–25 short, non-recursive tasks. We therefore interpret the source-level differences as comparisons of proof artifacts on this subset, not as checkpoint-wide robustness rankings over VERINA. Code, benchmark artifacts, and analysis scripts are available at https://github.com/aravind-mandiga/refactorproof.
Proof engineering, neural provers, and repair. Proof evolution is an established concern in proof engineering. Ringer et al. [2019] survey proof maintenance and automation as central challenges in large formal developments. PUMPKIN PATCH [Ringer et al., 2018] learns patches from related changes to Coq specifications and proofs, while PUMPKIN Pi transports proofs across equivalent type changes [Ringer et al., 2021]. Modern prover-specialized models include Goedel-Prover [Lin et al., 2025, 2026] and DeepSeek-Prover-V2 [Ren et al., 2025]. COPRA uses proof-environment feedback with backtracking search [Thakur et al., 2024], while Lean Copilot integrates tactic suggestion, proof search, and premise selection [Song et al., 2025]. Baldur [First et al., 2023] repairs whole proofs from compiler feedback, and BlueprintRepair [Khrulev, 2026] repairs Lean proof blueprints with typed local edits. These systems generate, search, or repair proofs after failure. RefactorProof instead freezes the proof and changes only the implementation, so we measure unchanged-proof survival before any repair is attempted.
Robustness to semantics-preserving perturbations. ReCode [Wang et al., 2023] evaluates code generators under semantics-preserving rewrites of prompt and program; recent work perturbs the natural-language input of Lean 4 autoformalization [Gui et al., 2026]. Mariposa [Zhou et al., 2023] measures SMT proof instability under semantically irrelevant changes to verification queries. RefactorProof instead changes the program implementation while holding a checked Lean proof and its specification fixed. Each retained program change also has a separate Lean equivalence certificate.
3 Method
3.1 Setting and invariants
A VERINA task file contains marker-delimited regions for imports, auxiliary definitions, the precondition, the implementation body (code), the postcondition, and the proof of f_postcond_satisfied. A transformation rewrites only the code region (and, for helper extraction, appends to the implementation-helper region). Six invariants are enforced mechanically: (A) the specification regions are unchanged (SHA-256 asserted); (B) the evaluated proof is byte-identical to the proof that verified on the original (SHA-256); (C) behavior preservation is certified by Lean in a separate file;
(D) that certificate is never imported by, or textually present in, the survival file; (E) no sorry, admit or new axioms anywhere; (F) the public function name and signature are unchanged. The certificate file and survival file are rendered from the same variant record, and the survival file's specification and proof hashes are checked against the hashes stored in that record before compilation. For (E), we also ask Lean directly. We append #print axioms to copies of all 458 certified equivalence files and all 423 surviving proof files in the released evaluation and re-check them. None depends on sorryAx or on an axiom beyond propext, Classical.choice, and Quot.sound; 223 depend on no axioms. Two VERINA tasks declare upstream axioms about Float, but no audited certificate or surviving proof depends on them.
3.2 Transformation classes
T1 whole-body let introduction (D). def f xs : T := E becomes let tmp : T := E; tmp: definitionally equal by -reduction, a term-level no-op.
T2 helper extraction (S). The body moves verbatim into a fresh private def and f becomes a call to it. The helper remains definitionally reducible, but unfold f and simp [f] expose the helper application rather than placing the helper equation in the simplifier.
T3 commutative operand swap (E). One occurrence of A op B with op ∈ {+,*,&&,||,∧,∨} and atomic operands becomes B op A (precedence-checked); certified with commutativity/associativity lemmas (Nat.add_comm, ...), no type assumed.
T4 conditional inversion (E). The tail-position if c then A else B becomes if ¬c then B else A; certified via ite_not or case analysis on c.
T5 branch extraction (S). When the body is a tail if, its else branch moves into a fresh private def with the same binders; delta-equivalent like T2 but partial, since the conditional stays and only one branch is extracted.
The D/S/E labels refer to source-level transformation mechanisms. In particular, T2 and T5 are structural source refactorings even though their equivalence certificates can close by definitional reduction in Lean. All transformations are deterministic text rewrites given (task, seed); no model is involved. Transformation applicability and rewrite locations are determined from the implementation region alone; neither the specification nor any proof artifact is inspected when constructing a candidate. Applicability rules (e.g. no def-level termination_by, no where clause) and every inapplicable or failed candidate are logged (Table 2).
3.3 Certification
For each candidate we emit a file that defines the original and transformed implementations in two namespaces (sharing the unchanged helpers) and states pointwise equality. A fixed sequence of independent certificate tactics is attempted in one compile: plain rfl; rfl with smart unfolding disabled (needed for structurally recursive bodies applied to variables); delta of the definitions and their let rec auxiliaries, then rfl; simp only and simp with the family's laws; and family-specific tactics (ac_nf, by_cases). A variant is certified if any level succeeds and rfl-certified if one of the first three (definitional) levels does. Where Lean 4.18's code generator refuses a wrapped body, the definition is marked noncomputable (name and signature unchanged) and the retry is recorded.
3.4 Survival evaluation and metrics
For each certified variant and each proof artifact we rebuild the task file with only the implementation regions changed and compile it in the pinned VERINA environment (Lean v4.18.0 [de Moura and Ullrich, 2021], Mathlib [The mathlib Community, 2020] pinned by lake-manifest.json). Errors are attributed to the proof region; failures elsewhere are excluded as build errors (none occurred).
Definitions. For a task with a fixed proof artifact and certified variants of its implementation , where every variant satisfies the Lean-checked certificate
Table 1: Task populations and original-proof coverage. Reference proofs are supplied upstream. Model Coverage@k is the fraction of all 189 tasks with a Lean-valid proof within the first k samples; “valid artifacts” counts all valid samples among K = 5.
| Population / proof source | Tasks | Coverage@1 (%) | Coverage@5 (%) | Valid artifacts |
|---|---|---|---|---|
| VERINA source benchmark | 189 | – | – | – |
| RefactorProof construction | 185 | – | – | – |
| VERINA reference proofs | 46 | – | – | 46 supplied |
| DeepSeek-Prover-V2-7B | 31/189 | 12.7 | 16.4 | 111 |
| Goedel-Prover-V2-32B | 26/189 | 11.6 | 13.8 | 108 |
| Goedel-Prover-V2-8B | 29/189 | 9.5 | 15.3 | 100 |
| Qwen3-14B | 5/189 | 0.5 | 2.6 | 8 |
| Qwen3-32B | 5/189 | 1.6 | 2.6 | 7 |
the per-task survival rate and the task-normalized aggregate over the N tasks that have a valid proof are
with 95% intervals from a cluster bootstrap over tasks (10,000 replicates). We report overall and within each transformation class . For a class-specific PSR, variants in that class are first averaged within task, and the resulting task rates are then averaged over tasks that have at least one certified variant in the class. RefactorProof construction uses the 185 tasks whose original files compile in the pinned environment; model coverage uses all 189 VERINA tasks attempted by the generation protocol. For a model with K samples per task in fixed order, coverage is
over all attempted tasks; the primary artifact is the first verifying sample. Two proof sources are compared on the matched task set where both have a valid proof, by the paired difference
with a task-cluster bootstrap interval. Sign-flip permutation tests are also computed and released, but the main text emphasizes effect sizes and confidence intervals because the class-specific comparisons are exploratory and are not multiplicity-corrected. Both sources are evaluated on identical variants, so isolates the proof.
3.5 Evaluation populations and reference-proof availability
VERINA contains 189 tasks, but ground-truth proofs are optional in the source benchmark. The VERINA authors manually provide reference proofs for 46 tasks for quality assurance [Ye et al., 2026]. They are correctness witnesses for the upstream benchmark, not proofs written or reviewed for robustness under program change, and their style reflects that purpose: 45 of the 46 open by unfolding the target definition. All 46 are in VERINA's basic split. Their median implementation length is one line and 6.5% are recursive. Among the other 139 tasks in the RefactorProof construction population, the median is eight lines, 54.0% are recursive, and 56.1% are in the advanced split. Reference-proof PSR therefore describes a simpler upstream subset rather than the full benchmark. These 46 tasks contribute 130 certified variants. RefactorProof construction instead uses the 185 original task files that compile in our pinned environment. Model coverage is measured over all 189 attempted tasks, and model PSR is conditional on the model first producing a Lean-valid proof of the original program. Table 1 makes these denominators explicit.
3.6 LLM proofs
Proofs are generated on the original implementations only with VERINA's prompting code. We draw independent samples per task in fixed order and use the first Lean-valid sample as the primary proof. The evaluated checkpoints are Qwen/Qwen3-14B, Qwen/Qwen3-32B [Yang et al., 2025], Goedel-LM/Goedel-Prover-V2-8B, Goedel-LM/Goedel-Prover-V2-32B, and deepseek-ai/DeepSeek-Prover-V2-7B. General models use VERINA's proof-generation prompt; the specialized provers use VERINA's prover template. All requests use temperature 1.0 and a 16,000-token output limit. Qwen3-14B, Qwen3-32B, and Goedel-8B inherit model defaults of top-p = 0.95 and top-k = 20; Goedel-32B and DeepSeek-7B use top-p = 1.0 with no top-k truncation. Each model is served with vLLM [Kwon et al., 2023] on one NVIDIA A100-80GB. The two 32B models use FP8 weight-only quantization; the others use their bf16 checkpoints. Individual generation runs require 1.5 to 9 GPU-hours. Lean checking runs on 24-core CPU nodes: the dedicated Lean jobs consume 24.9 CPU-hours of CPU time out of 39.9 allocated, and further Lean checking runs inside the generation jobs, whose 146.1 CPU-hours cover generation and checking together. Counting every scheduled job, including failed and exploratory runs, the project used 35.3 GPU-hours. Lean validation uses v4.18.0 with VERINA's pinned Mathlib and a 300-second timeout per file.
To test dependence on the first-valid rule, we re-check all 334 Lean-valid samples on every certified variant and recompute matched comparisons using the first valid proof, the shortest valid proof, a fixed-seed random valid proof, and the average over all valid proofs. We also recompute PSR after excluding T1, with family-balanced and one-per-task-family weighting, and on common task-family support across proof sources.
Figure 1 summarizes the certification and survival pipeline and gives a concrete T2 helper-extraction example.
(a) Evaluation pipeline

(b) Example: T2 helper extraction (lastDigit)
Original implementation C
def lastDigit (n : Nat)
(h_precond : lastDigit_precond n) : Nat :=
n % 10
Refactored implementation (T2)
private def lastDigit_rp_helper_8d571788
(n : Nat) (h_precond : lastDigit_precond n) : Nat :=
n % 10
def lastDigit (n : Nat)
(h_precond : lastDigit_precond n) : Nat :=
lastDigit_rp_helper_8d571788 n h_precond
Reference proof fragment (fails)
unfold lastDigit lastDigit_postcond
...
simp
...
Fails after helper extraction:
'simp' makes no progress.
Model-generated proof fragment (succeeds)
have : lastDigit n h_precond = n % 10 := rfl
rw [h1]
...
Succeeds via definitional-equality bridge
('rfl' then 'rw').
Figure 1: RefactorProof evaluation design and a T2 helper-extraction example. (a) Each candidate refactoring is kept only if Lean separately proves . ; candidates for which the fixed automatic certificate search finds no proof are excluded and are not thereby shown incorrect. The specification S and proof P remain byte-identical, the certificate is never imported into the survival file, and is averaged over tasks with a valid proof for that source. (b) VERINA task lastDigit. The supplied reference proof fails after T2 helper extraction with simp made no progress; the two model lines shown are verbatim from the DeepSeek-Prover-V2-7B primary proof and survive via definitional equality.
4 Results
4.1 RefactorProof construction
Certification succeeds for nearly all T1, T2, T4, and T5 candidates (Table 2). T3 is different: only 50/122 candidates certify, and the rejected cases are overwhelmingly recursive (98.6%, compared with 14.0% among certified candidates). The fixed certificate search does not synthesize the induction often needed for recursive swaps. T3 results therefore describe a selected, mostly non-recursive subset; additional construction diagnostics are reported in Appendix A.
Table 2: RefactorProof construction over the 185 VERINA tasks whose originals compile in the pinned environment. Certification rate is over generated candidates; “rfl” is the share of certified variants closed at a definitional level.
| Transformation | Class | Applicable tasks | Candidates | Certified | Cert. rate (%) | rfl (%) | Tasks w/ variant |
|---|---|---|---|---|---|---|---|
| T1 LET_intro | D | 181/185 | 181 | 180 | 99.4 | 100.0 | 180 |
| T2 helper_extract | S | 179/185 | 179 | 178 | 99.4 | 100.0 | 178 |
| T3 comm_swap | E | 77/185 | 122 | 50 | 41.0 | 4.0 | 34 |
| T4 cond_invert | E | 32/185 | 32 | 32 | 100.0 | 0.0 | 32 |
| T5 branch_extract | S | 18/185 | 18 | 18 | 100.0 | 100.0 | 18 |
4.2 Proof stability by source
Coverage and PSR answer different questions. Coverage@5 is only 13.8–16.4% for the three specialized provers (Table 1), so their PSR estimates are conditional on first producing a valid proof of the original task. On the matched supplied-reference subset, however, all three specialized provers have higher overall PSR than the reference proofs: the differences range from +15.6 to +20.3 percentage points, and all three overall 95% bootstrap intervals exclude zero (Table 4). We therefore use the overall matched comparison as the primary source-level result; the family-specific rows are exploratory.
Table 3: Task-normalized PSR for the reference proofs and specialized provers. Coverage columns report Coverage@1 and Coverage@5 over all 189 attempted tasks; reference proofs are supplied rather than generated. T3 can contribute more than one variant per task, so each reported group is first averaged within task.
| Panel A: Overall and transformation class | Panel B: Transformation family | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Proof source | C@1 | C@5 | Tasks | Overall PSR (%) [95% CI] | D | S | E | Proof source | T1 | T2 | T3 | T4 | T5 |
| DeepSeek-Prover-V2-7B | 12.7 | 16.4 | 31 | 59.3 [52.4, 66.4] | 100.0 | 13.3 | 72.2 | DeepSeek-Prover-V2-7B | 100.0 | 10.0 | 54.5 | 100.0 | 22.2 |
| Goedel-Prover-V2-32B | 11.6 | 13.8 | 26 | 64.5 [56.5, 72.8] | 100.0 | 26.0 | 67.6 | Goedel-Prover-V2-32B | 100.0 | 24.0 | 57.6 | 87.5 | 25.0 |
| Goedel-Prover-V2-8B | 9.5 | 15.3 | 29 | 64.6 [57.8, 72.1] | 100.0 | 26.8 | 72.4 | Goedel-Prover-V2-8B | 100.0 | 25.0 | 60.6 | 90.0 | 20.0 |
| reference | - | - | 46 | 47.9 [44.0, 52.0] | 100.0 | 4.3 | 44.2 | reference | 100.0 | 2.2 | 18.2 | 66.7 | 18.2 |
Coverage changes the end-to-end interpretation. Over the 180 tasks with at least one certified variant, the joint rate that a valid proof artifact is available for a source and survives a uniformly sampled certified variant is 12.2% for the supplied reference proofs, compared with 9.3–10.4% for the three specialized provers. For the reference source, availability means that VERINA supplies a proof; for a model, it means that the model produces a Lean-valid proof. Thus, the provers' higher conditional PSR does not yield a higher artifact-availability-and-survival rate. The Qwen controls cover only five tasks each, so we do not draw source-level robustness conclusions from them.
Table 4: Matched model versus supplied-reference comparison on identical certified variants. Values are paired PSR differences with task-cluster bootstrap 95% CIs. Overall sensitivity checks remain positive: excluding T1 gives +24.3, +32.9, and +31.3 points for DeepSeek-7B, Goedel-8B, and Goedel-32B; family-balanced aggregation gives +13.7, +18.6, and +17.3 points. PSR columns are rounded independently; PSR is computed from the unrounded task-level values. Appendix A reports full sensitivity results.
| Model | Class | Matched tasks | Ref. PSR | Model PSR | ΔPSR | 95% CI |
|---|---|---|---|---|---|---|
| deepseek-prover-v2-7b | all | 25 | 43.6 | 59.2 | +15.6 | [8.0, 24.3] |
| deepseek-prover-v2-7b | structural | 25 | 2.0 | 16.0 | +14.0 | [2.0, 30.0] |
| deepseek-prover-v2-7b | semantic | 15 | 35.6 | 73.3 | +37.8 | [13.3, 62.2] |
| goedel-prover-v2-32b | all | 21 | 43.5 | 62.4 | +18.8 | [10.1, 28.1] |
| goedel-prover-v2-32b | structural | 21 | 2.4 | 26.2 | +23.8 | [4.8, 45.2] |
| goedel-prover-v2-32b | semantic | 14 | 38.1 | 67.9 | +29.8 | [0.0, 58.3] |
| goedel-prover-v2-8b | all | 23 | 43.0 | 63.4 | +20.3 | [12.0, 29.0] |
| goedel-prover-v2-8b | structural | 23 | 2.2 | 23.9 | +21.7 | [4.3, 39.1] |
| goedel-prover-v2-8b | semantic | 15 | 35.6 | 78.3 | +42.8 | [11.1, 71.1] |
The overall matched ordering is stable under alternative valid-proof selection rules, exclusion of T1, family-balanced aggregation, and common task-family support (Appendix A). The class-specific intervals are less stable: the Goedel-32B semantic interval reaches zero, and the DeepSeek structural lower bound varies from 0.0 to 2.0 across bootstrap seeds, so we treat family-level rows as exploratory. Taskwise win/loss/tie counts show that the overall differences are not driven by a few reference-favoring reversals. T4 is the clearest family-level case, while T3 and T5 have only 7–9 matched tasks. Full sensitivity and proof-length checks are reported in Appendix A.
4.3 Why proof strategies respond differently to refactoring
Reference proofs usually begin with unfold, whereas the specialized provers more often name the implementation in simp or dsimp and continue with automation (Table 5). This stylistic difference is not itself a causal explanation. Inspection of compiled survivors and failures instead points to one specific mechanism: an explicit definitional bridge of the form have h : f args = body := rf1.
Table 5: Tactic profile of the fixed reference and specialized-prover proof artifacts.
| Proof source | n | unfold target (%) | simp[target] (%) | med. LoC | med. tactics |
|---|---|---|---|---|---|
| deepseek-prover-v2-7b | 31 | 9.7 | 77.4 | 25 | 23 |
| goedel-prover-v2-32b | 26 | 0.0 | 84.6 | 36 | 33 |
| goedel-prover-v2-8b | 29 | 0.0 | 79.3 | 32 | 30 |
| reference | 46 | 97.8 | 2.2 | 11 | 12 |
Under structural helper extraction, such bridges are associated with much higher survival. At task level, bridge proofs survive in 6/6 tasks where they occur, compared with 6/31 tasks for other strategies; on the same refactored variants, the corresponding counts are 9/9 and 2/9 (Table 6). Figure 1 illustrates the mechanism: the bridge rewrites the function call to its body using definitional equality, whereas later syntax-specific steps can stall after a helper is introduced.
Table 6: Mechanism checks that reduce dependence among repeated records. Task-level rows count tasks with at least one survival in the indicated category. Same-variant rows compare proof categories on the same refactored variants.
| Setting | Comparison level | Group A | Group B | Evidence |
|---|---|---|---|---|
| Structural | task | rfl bridge: 6/6 | other: 6/31 | Fisher p = 0.0004 |
| Structural | same variant | rfl bridge: 9/9 | other: 2/9 | 6 variants, 5 tasks |
| Semantic | task | rfl bridge: 0/3 | simp[f]: 17/19 | Fisher p = 0.0065 |
| Semantic | same variant | rfl bridge: 0/4 | simp[f]: 3/5 | 3 variants |
The same bridge is not uniformly stable. Semantic refactorings change the literal body, so an rfl equation tied to the original body can stop typechecking, while normalization-based proofs can still absorb the rewrite. At task level, rfl-bridge proofs survive 0/3 semantic cases, compared with 17/19 for simp [f]-style proofs; on the same semantic variants the counts are 0/4 and 3/5 (Table 6). Stability therefore depends on how a proof is coupled to the implementation, not on one uniformly robust tactic. A prompt-time intervention does not produce a consistent causal effect of forcing one tactic, so we treat these mechanism results as descriptive associations; record-level breakdowns and intervention details are in Appendix A.
4.4 Mechanical repair of structural failures
PSR asks whether a proof survives unchanged, not how difficult it is to repair after failure. We therefore predefine three one-identifier edits that add the extracted helper name to an existing unfold, simp, or dsimp call and recompile the edited proof on the same variant. An unedited control reproduces all 139 attempted failures. The predefined edit repairs 109/139 eligible failures, including 51/54 reference-proof failures and 58/85 prover failures, with a median edit of two tokens on one line. Many structural failures are therefore cheap under this narrow repair template even when the original proof does not survive unchanged. The source- and template-level breakdown is reported in Appendix A.
5 Limitations
Design-time versus post hoc choices. The five transformation families, the sampling protocol with first-valid selection, the task-normalized PSR, the ladder, and the bootstrap settings were fixed in a frozen configuration before any proof was generated. The mechanism categories, repair templates, alternative weightings, and the selection-rule and bootstrap-seed sensitivity analyses were specified after the survival outcomes were known. We report these later analyses as exploratory. For the repair experiment specifically, the three templates were fixed before any repair outcomes were evaluated.
Certification selection. Only certified RefactorProof variants enter PSR. T3 is strongly selected by certificate strength: 14.0% of certified candidates are recursive versus 98.6% of rejected candidates. The automatic sequence does not synthesize the induction needed for many recursive swaps. T3 results therefore apply to the certified, mostly non-recursive subset rather than to all behavior-preserving commutative rewrites.
Reference population, coverage, and proof selection. The reference arm is limited to 46 basic-split VERINA tasks and is substantially simpler than the rest of the construction population. The primary matched comparisons further narrow to 21–25 short, non-recursive basic-split tasks; source-level differences therefore characterize proof artifacts on this slice, not checkpoint-wide robustness over VERINA. Model PSR is also conditional on solving the original task, with Coverage@5 between 13.8% and 16.4% for the three specialized provers. Alternative deployable selection rules preserve every overall matched advantage, but a post hoc least-robust-valid bound can remove the structural advantage. Structural robustness therefore depends in part on which valid proof is selected. The specialized provers evaluated here are open-weight models no larger than 32B parameters, and the two Qwen controls cover only five tasks each.
Benchmark exposure. VERINA is publicly available and predates the checkpoints we evaluate, so we cannot rule out that these tasks, or proofs of them, appeared in pretraining. Such exposure could inflate original-task coverage. Its effect on survival is less direct because the refactored implementations and their certificates are generated here and were not public before this work.
Prompt and strategy confounds. Proof length does not explain the source gap in our regression or overlapping-length analysis, but the source comparison remains observational. The general-model and prover templates differ, model-specific decoding defaults differ, and the 32B runs use FP8 weight-only quantization. The within-prover intervention also fails to establish a common causal effect of one tactic. We therefore treat the between-source tactic profile as descriptive and ground mechanism claims in compiled survivor, failure, task-level, and same-variant checks.
Statistics and mechanism sample size. Class- and family-specific comparisons are exploratory and are not multiplicity-corrected. T3 and T5 have only 7–9 matched tasks. Two class-level percentile-bootstrap intervals also touch zero under seed sensitivity, so we do not describe them as excluding zero. Mechanism support is small: the structural rf1-bridge pattern spans six tasks and the semantic pattern three. The categories were developed post hoc from the observed artifacts. Task-level Fisher tests, leave-one-task-out checks, and same-variant comparisons reduce dependence concerns but do not turn these associations into causal tactic effects.
Transformation scope and practical maintenance. RefactorProof uses one pinned Lean/Mathlib environment and five local, mechanical transformation families. They do not cover algorithm changes, data-representation changes, argument reordering, inlining, or the full distribution of refactorings encountered in software projects. Four VERINA tasks do not compile in the pinned environment. Two certified variants require noncomputable to work around a Lean code-generation limitation. Their pointwise equivalence certificates remain kernel-checked, but the transformed definitions are not compiled by Lean's code generator, so this workaround does not preserve ordinary executability. Excluding these two variants changes no reported statistic by more than 0.2 points. We retain them in the primary benchmark because inclusion is defined by kernel-checked pointwise equivalence rather than code-generation eligibility; the exclusion analysis quantifies the effect of adopting the stricter executable-only criterion. The repair experiment covers only failures eligible for three predefined unfold/simp/dsimp edits. It is not a re-proving experiment and does not estimate general maintenance cost after arbitrary refactorings. The T2 and T5 results also depend on Lean's transparency settings: the extracted helper is a private def that remains definitionally reducible, which allows reflexivity-style bridges to survive. Marking such a helper @[irreducible] or changing unfolding behavior through set_option could change which proofs survive; we did not vary this.
6 Conclusion
RefactorProof tests whether an already valid Lean proof remains valid after a certified behavior-preserving change to the implementation. On the short, non-recursive matched VERINA tasks with supplied reference proofs, the three specialized provers have higher overall unchanged-proof survival, although family-specific evidence is strongest for conditional inversion and helper extraction. The inspected artifacts remain coupled to implementation details through different mechanisms: syntax-specific rewrites, definitional-equality bridges, and normalization fail under different changes. Many eligible structural failures are repaired by a one-identifier edit, so PSR should be read as proof-artifact stability rather than maintenance cost. One-time verification does not establish that the same proof will remain reusable unchanged after refactoring.
Acknowledgments and Disclosure of Funding
The authors received no specific funding for this work.
References
Yifan Bai, Xiaoyang Liu, Zihao Mou, Guihong Wang, Jian Yu, Shuhan Xie, Yantao Li, Yangyu Zhang, Jingwei Liang, and Tao Luo. VeriScale: Adversarial test-suite scaling for verifiable code generation. arXiv preprint arXiv:2605.22368, 2026. doi: 10.48550/arXiv.2605.22368.
Sergiu Bursuc, Theodore Ehrenborg, Shaowei Lin, Lacramioara Astefanoaei, Ionel Emilian Chiosa, Jure Kukovec, Alok Singh, Oliver Butterley, Adem Bizid, Quinn Dougherty, Miranda Zhao, Max Tan, and Max Tegmark. A benchmark for vericoding: formally verified program synthesis. arXiv preprint arXiv:2509.22908, 2025. doi: 10.48550/arXiv.2509.22908.
Leonardo de Moura and Sebastian Ullrich. The Lean 4 theorem prover and programming language. In Automated Deduction – CADE 28, volume 12699 of Lecture Notes in Computer Science, pages 625–635. Springer, 2021. doi: 10.1007/978-3-030-79876-5_37.
Quinn Dougherty and Ronak Mehta. Proving the coding interview: A benchmark for formally verified code generation. In 2025 IEEE/ACM 2nd International Workshop on Large Language Models for Code (LLM4Code), pages 72–79. IEEE, 2025. doi: 10.1109/LLM4Code66737.2025.00014.
Emily First, Markus N. Rabe, Talia Ringer, and Yuriy Brun. Baldur: Whole-proof generation and repair with large language models. In Proceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering, pages 1229–1241, 2023. doi: 10.1145/3611643.3616243.
Zhengtao Gui, Sheng Yang, and Zhouxing Shi. Evaluating the robustness of proof autoformalization in Lean 4. arXiv preprint arXiv:2606.14867, 2026. doi: 10.48550/arXiv.2606.14867.
Ruslan Khrulev. BlueprintRepair: Typed local edits for failed lean proof blueprints. arXiv preprint arXiv:2607.28110, 2026. doi: 10.48550/arXiv.2607.28110.
Woosuk Kwon, Zhuohan Li, Siyuan Zhuang, Ying Sheng, Lianmin Zheng, Cody Hao Yu, Joseph E. Gonzalez, Hao Zhang, and Ion Stoica. Efficient memory management for large language model serving with PagedAttention. In Proceedings of the 29th Symposium on Operating Systems Principles, pages 611–626. ACM, 2023. doi: 10.1145/3600006.3613165.
Yong Lin, Shange Tang, Bohan Lyu, Jiayun Wu, Hongzhou Lin, Kaiyu Yang, Jia Li, Mengzhou Xia, Danqi Chen, Sanjeev Arora, and Chi Jin. Goedel-Prover: A frontier model for open-source automated theorem proving. In Conference on Language Modeling, 2025. doi: 10.48550/arXiv.2502.07640.
Yong Lin, Shange Tang, Bohan Lyu, Ziran Yang, Jui-Hui Chung, Haoyu Zhao, Lai Jiang, Yihan Geng, Jiawei Ge, Jingruo Sun, Jiayun Wu, Jiri Gesi, Ximing Lu, David Acuna, Kaiyu Yang, Hongzhou Lin, Yejin Choi, Danqi Chen, Sanjeev Arora, and Chi Jin. Goedel-Prover-V2: Scaling formal theorem proving with scaffolded data synthesis and self-correction. In International Conference on Learning Representations, 2026. doi: 10.48550/arXiv.2508.03613.
Evan Lohn and Sean Welleck. miniCodeProps: a minimal benchmark for proving code properties. In NeurIPS 2024 Workshop on Safe Generative AI, 2024. doi: 10.48550/arXiv.2406.11915. URL https://arxiv.org/abs/2406.11915.
Chloe Loughridge, Qinyi Sun, Seth Ahrenbach, Federico Cassano, Chuyue Sun, Ying Sheng, Anish Mudide, Md Rakib Hossain Misu, Nada Amin, and Max Tegmark. DafnyBench: A benchmark for formal software verification. Transactions on Machine Learning Research, 2025. ISSN 2835-8856. doi: 10.48550/arXiv.2406.08467. URL https://openreview.net/forum?id=yBgTVWccIx.
Z. Z. Ren, Zhihong Shao, Junxiao Song, Huajian Xin, Haocheng Wang, Wanjia Zhao, Liyue Zhang, Zhe Fu, Qihao Zhu, Dejian Yang, Z. F. Wu, Zhibin Gou, Shirong Ma, Hongxuan Tang, Yuxuan Liu, Wenjun Gao, Daya Guo, and Chong Ruan. DeepSeek-Prover-V2: Advancing formal mathematical reasoning via reinforcement learning for subgoal decomposition. arXiv preprint arXiv:2504.21801, 2025. doi: 10.48550/arXiv.2504.21801.
Talia Ringer, Nathaniel Yazdani, John Leo, and Dan Grossman. Adapting proof automation to adapt proofs. In Proceedings of the 7th ACM SIGPLAN International Conference on Certified Programs and Proofs, pages 115–129, 2018. doi: 10.1145/3167094.
Talia Ringer, Karl Palmskog, Ilya Sergey, Milos Gligoric, and Zachary Tatlock. QED at large: A survey of engineering of formally verified software. Foundations and Trends in Programming Languages, 5(2–3):102–281, 2019. doi: 10.1561/2500000045.
Talia Ringer, RanDair Porter, Nathaniel Yazdani, John Leo, and Dan Grossman. Proof repair across type equivalences. In Proceedings of the 42nd ACM SIGPLAN International Conference on Programming Language Design and Implementation, pages 112–127, 2021. doi: 10.1145/3453483.3454033.
Peiyang Song, Kaiyu Yang, and Anima Anandkumar. Lean Copilot: Large language models as copilots for theorem proving in Lean. In Proceedings of the International Conference on Neurosymbolic Systems, volume 288 of Proceedings of Machine Learning Research, pages 144–169. PMLR, 2025. doi: 10.48550/arXiv.2404.12534. URL https://proceedings.mlr.press/v288/song25a.html.
Amitayush Thakur, George Tsoukalas, Yeming Wen, Jimmy Xin, and Swarat Chaudhuri. An in-context learning agent for formal theorem-proving. In First Conference on Language Modeling, 2024. doi: 10.48550/arXiv.2310.04353.
Amitayush Thakur, Jasper C. H. Lee, George Tsoukalas, Meghana Sistla, Matthew Zhao, Stefan Zetzsche, Greg Durrett, Yisong Yue, and Swarat Chaudhuri. CLEVER: A curated benchmark for formally verified code generation. In Advances in Neural Information Processing Systems, 2025. doi: 10.52202/085713-3857.
The mathlib Community. The Lean mathematical library. In Proceedings of the 9th ACM SIGPLAN International Conference on Certified Programs and Proofs, CPP 2020, pages 367–381. ACM, 2020. doi: 10.1145/3372885.3373824.
Shiqi Wang, Zheng Li, Haifeng Qian, Chenghao Yang, Zijian Wang, Mingyue Shang, Varun Kumar, Samson Tan, Baishakhi Ray, Parminder Bhatia, Ramesh Nallapati, Murali Krishna Ramanathan, Dan Roth, and Bing Xiang. ReCode: Robustness evaluation of code generation models. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 13818–13843, 2023. doi: 10.18653/v1/2023.acl-long.773.
Zichen Xie, Mrigank Pawagi, Yuxin Liu, Aaditi Rai, Lize Shao, John Berberian Jr., Sicong Che, and Wenxi Wang. VeriContest: A competitive-programming benchmark for verifiable code generation. arXiv preprint arXiv:2605.08553, 2026. doi: 10.48550/arXiv.2605.08553.
An Yang, Anfeng Li, Baosong Yang, Beichen Zhang, Binyuan Hui, Bo Zheng, Bowen Yu, Chang Gao, Chengen Huang, Chenxu Lv, Chujie Zheng, Dayiheng Liu, Fan Zhou, Fei Huang, Feng Hu, Hao Ge, Haoran Wei, Huan Lin, Jialong Tang, Jian Yang, Jianhong Tu, Jianwei Zhang, Jianxin Yang, Jiaxi Yang, Jing Zhou, Jingren Zhou, Junyang Lin, Kai Dang, Keqin Bao, Kexin Yang, Le Yu, Lianghao Deng, Mei Li, Mingfeng Xue, Mingze Li, Pei Zhang, Peng Wang, Qin Zhu, Rui Men, Ruize Gao, Shixuan Liu, Shuang Luo, Tianhao Li, Tianyi Tang, Wenbiao Yin, Xingzhang Ren, Xinyu Wang, Xinyu Zhang, Xuancheng Ren, Yang Fan, Yang Su, Yichang Zhang, Yinger Zhang, Yu Wan, Yuqiong Liu, Zekun Wang, Zeyu Cui, Zhenru Zhang, Zhipeng Zhou, and Zihan Qiu. Qwen3 technical report. arXiv preprint arXiv:2505.09388, 2025. doi: 10.48550/arXiv.2505.09388.
Zhe Ye, Zhengxu Yan, Jingxuan He, Timothe Kasriel, Kaiyu Yang, and Dawn Song. VERINA: Benchmarking verifiable code generation. In International Conference on Learning Representations, 2026. doi: 10.48550/arXiv.2505.23135.
Haoyu Zhao, Ziran Yang, Jiawei Li, Deyuan He, Zenan Li, Chi Jin, Venugopal V. Veeravalli, Aarti Gupta, and Sanjeev Arora. AlgoVeri: An aligned benchmark for verified code generation on classical algorithms. arXiv preprint arXiv:2602.09464, 2026. doi: 10.48550/arXiv.2602.09464.
Yi Zhou, Jay Bosamiya, Yoshiki Takashima, Jessica G. Li, Marijn J. H. Heule, and Bryan Parno. Mariposa: Measuring SMT instability in automated program verification. In Proceedings of the 23rd Conference on Formal Methods in Computer-Aided Design (FMCAD 2023), pages 178–188. TU Wien Academic Press, 2023. doi: 10.34727/2023/isbn.978-3-85448-060-0_26.
A Additional sensitivity analyses
This appendix reports the additional analyses used to test the main comparisons and their scope. All values come from the same frozen generation outputs or from Lean re-checks in the pinned VERINA environment; no new model proof is generated for these analyses.
A.1 Valid-proof selection
All 334 Lean-valid samples are re-checked on every certified variant. The first-valid re-evaluation reproduces 301/301 frozen primary survival outcomes. Table 7 reports overall matched PSR under four deployable summaries. Every overall task-cluster bootstrap interval excludes zero under each rule. Class-specific conclusions are less stable: the DeepSeek structural interval touches zero under first-valid selection and crosses zero under shortest-valid selection; the Goedel-32B semantic interval also reaches or crosses zero under these rules.
Table 7: Overall matched PSR (percentage points) under valid-proof selection rules. “All valid” averages each task across all valid samples.
| Model | First valid | Shortest valid | Random valid | All valid |
|---|---|---|---|---|
| DeepSeek-Prover-V2-7B | +15.6 | +11.3 | +15.6 | +15.5 |
| Goedel-Prover-V2-8B | +20.3 | +22.4 | +20.7 | +20.7 |
| Goedel-Prover-V2-32B | +18.8 | +24.5 | +20.9 | +20.9 |
A post hoc least-robust-valid bound is deliberately not treated as a deployable selection rule. Under that bound, structural PSR is [-4.3, 19.6] for Goedel-8B, [-7.1, 14.3] for Goedel-32B, and [-6.0, 0.0] for DeepSeek-7B. This shows that structural robustness can depend on which valid proof a model happens to emit.
A.2 Within-task variability across valid proofs
The proof-selection analysis re-checks every Lean-valid sample on every certified variant of its task, which also lets us measure variation among valid proofs of the same model–task pair. We summarize the three specialized provers because the Qwen controls have only two tasks each with multiple valid proofs.
Table 8: Within-task variability across independently sampled Lean-valid proofs. “Identical” is the share of tasks on which all valid samples have the same survive/fail vector over certified variants. Ranges are mean within-task max–min PSR differences in percentage points; S and E restrict to structural and semantic variants.
| Model | Tasks (≥ 2 valid) | Identical (%) | PSR range | S range | E range | Within-var. share (%) | |first-mean| |
|---|---|---|---|---|---|---|---|
| DeepSeek-7B | 26 | 46 | 17.4 | 48.0 | 35.3 | 41 | 6.7 |
| Goedel-8B | 25 | 44 | 15.1 | 36.0 | 45.4 | 29 | 4.7 |
| Goedel-32B | 24 | 29 | 22.4 | 54.2 | 55.9 | 54 | 8.6 |
Different valid proofs disagree on at least one variant for 54%, 56%, and 71% of the multi-proof tasks for DeepSeek-7B, Goedel-8B, and Goedel-32B, respectively. Mean within-task PSR ranges are 15.1–22.4 points, and within-task variance accounts for 29–54% of the combined within- and between-task variance. Structural survival is especially sample-dependent, with mean within-task ranges of 36–54 points. Survival therefore varies materially across valid proof artifacts from the same model and task. However, the first-valid artifact differs from the within-task mean by only 4.7–8.6 points on average, and every deployable selection rule we test preserves the direction of all three overall matched differences (Table 7). Thus, proof choice contributes substantial within-task variation, but the primary overall matched ordering is not an artifact of the first-valid selection rule. Because most tasks have only a few certified variants, these ranges are coarse; the identical-outcome share is the cleaner summary.
A.3 Aggregation and common support
The end-to-end quantity combines proof-artifact availability with survival on a uniformly sampled certified variant. For the reference source, availability means that VERINA supplies a proof; for a model, it means that the model produces a Lean-valid proof. Table 9 reports the estimates and their uncertainty.
Table 9: Artifact-availability-and-survival rate over the 180 tasks with at least one certified variant.
| Proof source | Rate (%) | 95% CI |
|---|---|---|
| VERINA supplied reference | 12.2 | [9.0, 15.5] |
| DeepSeek-Prover-V2-7B | 10.2 | [6.8, 13.8] |
| Goedel-Prover-V2-8B | 10.4 | [6.9, 14.2] |
| Goedel-Prover-V2-32B | 9.3 | [5.9, 13.0] |
T1 and T2 contribute 358/458 certified variants, so we also vary the aggregation and support used for the matched comparison. Table 10 collects the corresponding model-minus-reference PSR values. Excluding T1, source-level PSR is for reference proofs, for DeepSeek-7B, for Goedel-8B, and for Goedel-32B. Family-balanced and one-per-task-family weighting move any source's PSR by at most 3.8 points, and the reference source remains lowest under all tested weightings.
Table 10: Matched PSR sensitivity to aggregation and common support. Values are percentage points with task-cluster bootstrap intervals. The final row uses the 65 task-family cells shared by all four sources (21 tasks).
| Analysis | DeepSeek-7B | Goedel-8B | Goedel-32B |
|---|---|---|---|
| Exclude T1 | +24.3 [11.5, 38.9] | +32.9 [18.4, 48.6] | +31.3 [15.7, 48.7] |
| Family-balanced within task | +13.7 [6.8, 21.5] | +18.6 [10.9, 26.6] | +17.3 [9.2, 26.2] |
| Exclude T1 and T2 | +28.7 [13.3, 46.0] | +30.7 [4.0, 54.7] | +20.7 [-4.3, 45.7] |
| Common task-family support | +17.4 [8.3, 26.8] | +21.1 [12.3, 30.2] | +18.8 [9.9, 27.8] |
For the T1-and-T2-excluded comparison, only 14–15 matched tasks remain; sign-flip -values are 0.017, 0.066, and 0.216 for DeepSeek-7B, Goedel-8B, and Goedel-32B, respectively. Thus, on the semantic-and-T5 remainder the point estimate stays positive for all three sources, but the Goedel-32B interval crosses zero.
Taskwise direction of matched effects. The aggregate matched differences are not produced by repeated reversals in favor of the reference proofs. Table 11 counts tasks according to which source has the higher per-task PSR. In the overall comparisons, no task favors the reference proof; in the class-specific comparisons, the reference proof leads on at most one task.
Table 11: Taskwise direction of matched PSR differences. “Model higher” and “Reference higher” compare the per-task PSR of the two proof artifacts; the remaining tasks tie.
| Model | Class | Tasks | Model higher | Reference higher | Tie | PSR |
|---|---|---|---|---|---|---|
| DeepSeek-7B | all | 25 | 10 | 0 | 15 | +15.6 |
| DeepSeek-7B | structural | 25 | 5 | 1 | 19 | +14.0 |
| DeepSeek-7B | semantic | 15 | 6 | 0 | 9 | +37.8 |
| Goedel-8B | all | 23 | 12 | 0 | 11 | +20.3 |
| Goedel-8B | structural | 23 | 6 | 1 | 16 | +21.7 |
| Goedel-8B | semantic | 15 | 8 | 1 | 6 | +42.8 |
| Goedel-32B | all | 21 | 10 | 0 | 11 | +18.8 |
| Goedel-32B | structural | 21 | 6 | 1 | 14 | +23.8 |
| Goedel-32B | semantic | 14 | 6 | 1 | 7 | +29.8 |
A.4 Matched-subset characterization
The primary matched comparisons use 21–25 tasks from the 46-task supplied-reference subset. Table 12 characterizes those tasks relative to the full construction population and the supplied-reference subset.
Table 12: Characteristics of the task populations entering the matched comparisons. T3–T5 columns give the share of tasks with at least one certified variant of that family. T1 and T2 are available for every matched task.
| Population | Tasks | Basic (%) | Recursive (%) | Med. impl. LoC | Med. postcond. LoC | T3 (%) | T4 (%) | T5 (%) |
|---|---|---|---|---|---|---|---|---|
| Construction population | 185 | 58 | 42.2 | 6 | 3 | 18 | 17 | 10 |
| Supplied-reference subset | 46 | 100 | 6.5 | 1 | 2 | 24 | 26 | 24 |
| Matched, DeepSeek-7B | 25 | 100 | 0.0 | 1 | 1 | 36 | 32 | 32 |
| Matched, Goedel-8B | 23 | 100 | 0.0 | 1 | 1 | 39 | 35 | 35 |
| Matched, Goedel-32B | 21 | 100 | 0.0 | 1 | 1 | 43 | 33 | 33 |
The matched subsets are a particularly simple slice of VERINA: all are basic-split, none is recursive, and the median implementation and postcondition are each one line. By comparison, 42.2% of the construction population is recursive and its median implementation is six lines. The matched tasks nevertheless have higher T3–T5 availability than the full population. The model-versus-reference comparison should therefore be read as evidence for short, non-recursive programs on which several refactoring families are testable; it does not establish the same source ordering for the benchmark's recursive or longer tasks.
A.5 Matched effects by transformation family
Table 13: Matched model-minus-reference PSR by transformation family. Task counts differ because a family must be present on a task for both sources. T1 is omitted because both sources survive it universally.
| Model | Family | Matched tasks | ΔPSR | 95% CI |
|---|---|---|---|---|
| DeepSeek-Prover-V2-7B | T2 | 25 | +12.0 | [0.0, 24.0] |
| Goedel-Prover-V2-8B | T2 | 23 | +21.7 | [4.3, 39.1] |
| Goedel-Prover-V2-32B | T2 | 21 | +23.8 | [9.5, 42.9] |
| DeepSeek-Prover-V2-7B | T3 | 9 | +33.3 | [0.0, 66.7] |
| Goedel-Prover-V2-8B | T3 | 9 | +40.7 | [-3.7, 81.5] |
| Goedel-Prover-V2-32B | T3 | 9 | +25.9 | [-14.8, 66.7] |
| DeepSeek-Prover-V2-7B | T4 | 8 | +50.0 | [12.5, 87.5] |
| Goedel-Prover-V2-8B | T4 | 8 | +50.0 | [12.5, 87.5] |
| Goedel-Prover-V2-32B | T4 | 7 | +42.9 | [14.3, 85.7] |
| DeepSeek-Prover-V2-7B | T5 | 8 | +12.5 | [-25.0, 50.0] |
| Goedel-Prover-V2-8B | T5 | 8 | +0.0 | [-37.5, 37.5] |
| Goedel-Prover-V2-32B | T5 | 7 | +0.0 | [-42.9, 42.9] |
A.6 Mechanism sensitivity
The mechanism audit contains 185 annotated records and reports unambiguous assignments under the fixed priority rules used by the analysis. For structural refactorings, the record-level rfl-versus-other difference is +89.8 points and ranges from +89.1 to +92.6 under leave-one-task-out analysis. At task level, rfl-bridge proofs survive in 6/6 tasks versus 6/31 for other bridges (Fisher ); on identical variants the counts are 9/9 versus 2/9. For semantic refactorings, the record-level rfl-versus-simp difference is -83.6 points and ranges from -86.2 to -81.0 leave-one-task-out. At task level the counts are 0/3 versus 17/19 (Fisher ); on identical variants they are 0/4 versus 3/5. Because the rfl groups cover only six structural and three semantic tasks, these categories are descriptive rather than population-level tactic effects.
At record level, the three specialized provers contribute 110 structural model–task–variant records, of which 22 survive. All 12 records with an explicit rfl bridge survive, compared with 10/98 records without one. The 98 non-bridge records comprise 92 simp/dsimp-style records, four unfold records, and two other records. Among the 92 simp/dsimp-style records, 10 survive; their residual helper goals close with rfl (2), exact (1), aesop (5), or tauto (2). Targeted probes confirm that these residual goals are definitionally reducible even when simp [f] alone does not close them. For semantic refactorings, explicit rf1-equation bridges survive 0/4 prover records, while simp [f]-style bridges survive 56/67. The T4 contrast is especially clear: all 24 prover records with a simp [f]-style bridge survive conditional inversion. The T3 failure logs show the complementary brittleness of syntax-specific steps. Among 13 reference T3 failures, seven are rw pattern mismatches, three stop because simp makes no progress, two leave the commuted equality unsolved, and one has a term-mode type mismatch. Prover T3 failures likewise include residual commuted goals and literal rf1, exact, or rewrite steps that expect the original term.
A within-prover prompt intervention also fails to isolate one tactic as a common cause. Forcing an initial unfold f f_postcond changes Goedel's structural and semantic PSR by -17.3 and +23.6 points, respectively, while DeepSeek changes by +5.2 and -13.9 points. The pooled transformation-class interaction is +4.9 points with 95% CI [-18.8, 30.6]. We therefore use these tactic categories as descriptive summaries of whole-proof strategies rather than as causal effects of one tactic.
A.7 Mechanical repair
Table 14: Predefined one-identifier repair of eligible structural failures. The unedited control reproduces all 139 attempted failures.
| Source / template | Repaired | Attempted |
|---|---|---|
| Reference | 51 | 54 |
| DeepSeek-Prover-V2-7B | 21 | 32 |
| Goedel-Prover-V2-8B | 19 | 28 |
| Goedel-Prover-V2-32B | 18 | 25 |
| dsimp add helper | 40 | 45 |
| simp add helper | 16 | 37 |
| unfold add helper | 53 | 57 |
The edit succeeds for 109/139 eligible failures, corresponding to of all 142 structural failures, with a median change of two tokens on one line. These rates are conditional on template eligibility and do not measure general proof repair or re-proving.
A.8 Other sensitivity checks
Excluding the two variants that require noncomputable changes no headline statistic by more than 0.18 points. For T3, 50/122 candidates certify; of certified candidates are recursive versus of rejected candidates (Fisher ), and median implementation length is 10.5 versus 13.0 lines (). Re-running the primary matched percentile bootstrap with 50 random seeds shows discrete endpoint variation for two rows: the DeepSeek structural lower bound ranges from 0.0 to 2.0, and the Goedel-32B semantic lower bound ranges from -1.2 to 0.0. We therefore do not treat either class-specific interval as excluding zero. The other seven matched rows exclude zero under every tested bootstrap seed.
Proof length does not account for the source difference in a task-clustered logistic regression over 269 structural and semantic records. The prover coefficient changes from 1.404 without proof length to 1.370 after adding log proof length (), while the proof-length coefficient is 0.030 (). Among 10–30-line proofs, prover records survive of variants compared with for reference records. This remains an observational comparison because prompt templates, decoding settings, and FP8 quantization also differ by source.