Executive summary
A machine-checked proof can fail after code restructuring that preserves behavior. This makes neither the original claim false nor the modified code automatically defective. RefactorProof examines how unchanged proofs, including proofs generated with artificial intelligence (AI), respond to such changes. Quality managers need three separate answers: how often is a valid proof obtained initially, how often does it remain usable unchanged, and how difficult is repair? These questions require different assessments and denominators rather than a single headline success rate.
FQI takeaway
- After code changes, check both behavioral equivalence and continued validity of the associated proofs.
- Report initial proof coverage separately from subsequent stability.
- Measure actual repair effort; unchanged proof failure is not a substitute for that measure.
The principle at a glance
Restructuring code aims to preserve behavior but may change internal names and representations. A proof can depend closely on those representations. Moving a calculation into a helper function may prevent an old proof step from finding the form it expects.
Lean is a proof assistant that mechanically checks formally expressed statements. In the study, Lean first certifies equivalence between the original and modified program. Researchers then separately assess whether the same original proof still works. The specification and assessed proof remain unchanged. The equivalence certificate is not introduced as additional help in this second check.
Deep dive
RefactorProof produces 458 certified variants from 185 tasks whose original files compile in a fixed environment. The variants cover several local restructuring families. Failed equivalence certification leads to exclusion; it is not described as a demonstrated behavior change. Inclusion therefore depends partly on what the certification process can establish.
Structural changes cause many unchanged proofs to fail. The task-averaged survival rate for these changes is 4.3 percent for existing reference proofs and 13.3–26.8 percent for specialized AI provers. These figures apply to restricted task subsets. They are not a general comparison of human and machine proof capability.
The authors also examine narrowly defined repairs. Simple changes to one identifier repair 51 of 54 eligible reference failures and 58 of 85 eligible model failures. Low stability of an unchanged artifact can therefore coexist with limited repair effort. This does not cover other failures or more extensive restructuring.
FQI proposes three separate entries in a change record. First, record which original tasks receive a valid proof at all. Second, assess stability within that set. Third, document actual corrections and successful rechecking. The joint proportion of available and stable proofs complements the individual measures.
A simplified FQI example involves a team extracting a calculation into a helper function. The old proof fails because it directly refers to the original function body. The team checks the permitted change, adapts the specific proof step and reruns the complete verification. A claim that the proof is repaired becomes meaningful only with the new successful check.
Version references should cover the program, specification, proof and checking environment together. This makes it possible to distinguish a representation adjustment from changes to the claim, assumptions or libraries. Each kind of change may require different follow-up checks.
Limitations and risks
Direct comparisons use small, mostly simple task sets. Specialized models solve only a limited fraction of the complete starting collection. Some transformations are strongly filtered by certification capability. The results consequently do not provide a ranking of generally maintainable proofs.
The repair study covers only three predefined templates. It does not measure complete maintenance costs in real software projects. FQI reviewed the reported proofs but did not compile them independently. Operational adoption needs assessment with the team’s own language, library version and change practices.
FQI conclusion
A proof belongs to a specific artifact version and needs controlled rechecking after changes. RefactorProof helps define that work more precisely: availability, unchanged stability and repairability are different properties. Teams cannot directly equate low stability with high maintenance cost. Conversely, an initially successful AI prover does not establish continuing assurance. Documented change assessment, repair and renewed checking together make the evidence usable for subsequent versions, with the specification and assumptions still visible to the people responsible for acceptance.
Sources & transparency
Primary source: How Stable Are LLM-Generated Proofs Under Program Refactoring? A Stress Test for Verifiable Code Generation; original full text reviewed. Preliminary research; no independent reproduction. Methods, relevant results and limitations were assessed for this review.
Operational examples and inspection proposals are FQI interpretations. AI-assisted article, approved for publication by Johann Fischer on 2026-10-28.
Open full-size graphic