🤖 AI Summary
Formal proofs in proof assistants like Coq often break under semantic changes—e.g., modifications to equivalence relations in quotient types—posing challenges for existing automated repair techniques, which lack support for behavioral-level alterations. This work introduces the first proof repair algorithm tailored to quotient-type equivalence changes. We propose a setoid-based external modeling of quotient types, enabling joint handling of representation and behavioral changes. Furthermore, we construct the first internal correctness proof of the algorithm in Cubical Agda, grounded in univalent semantics to guarantee semantic consistency. Empirical evaluation demonstrates successful repair of multiple previously intractable quotient-type equivalence changes, substantially reducing manual intervention. The approach is validated across both Coq and Cubical Agda, confirming its feasibility, cross-platform applicability, and formal correctness.
📝 Abstract
Proofs in proof assistants like Coq can be brittle, breaking easily in response to changes. To address this, recent work introduced an algorithm and tool in Coq to automatically repair broken proofs in response to changes that correspond to type equivalences. However, many changes remained out of the scope of this algorithm and tool -- especially changes in underlying behavior. We extend this proof repair algorithm so that it can express certain changes in behavior that were previously out of scope. We focus in particular on equivalences between quotient types -- types equipped with a relation that describes what it means for any two elements of that type to be equal. Quotient type equivalences can be used to express interesting changes in representations of mathematical structures, as well as changes in the underlying implementations of data structures. We extend this algorithm and tool to support quotient type equivalences in Coq. Notably, since Coq lacks quotient types entirely, our extensions use Coq's setoid machinery to represent quotients externally. Specifically, (1) our extension to the algorithm supports new changes corresponding to setoids, and (2) our extension to the tool supports this new class of changes and further automates away some of the new proof obligations. We demonstrate our extensions on proof repair case studies for previously unsupported changes. We also perform manual proof repair in Cubical Agda, a language with a univalent metatheory, which allows us to construct the first ever internal proofs of correctness for proof repair.