arXiv:2610.36669cs.PLOct 2026

Manuscript Offprint

arXiv:2610.36669

Proof Repair and (Co)algebra Equivalences

E. G Plante, Eric Paul, Cosmo Viola, G. A. Kavvos, Talia Ringer

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

E.G. PLANTE III, University of Illinois at Urbana-Champaign, USA

ERIC PAUL, University of Illinois at Urbana-Champaign, USA

COSMO VIOLA, University of Illinois at Urbana-Champaign, USA

G.A. KAVVOS, University of Bristol, United Kingdom

TALIA RINGER, University of Illinois at Urbana-Champaign, USA

Maintaining formal proofs in response to breaking changes in their dependencies is a major challenge of proof engineering. Proof repair is a kind of proof automation that lessens the burden of this challenge by automatically adapting proofs in response to those changes. While proof repair is well understood through an algorithmic lens, it has, until now, been poorly understood through a theoretical lens. We address this gap by giving the first foundational treatment of proof repair, focusing in particular on type-theoretic proof repair in response to changes in datatypes. Our key insight is that the core component of a proof repair algorithm—a “configuration”—is exactly an algebra isomorphism. We formalize and prove this insight, answering open questions from prior work. We then take this one step further and show that, by taking the dual of this representation, we obtain proof repair over coinductive types. All of our results are formalized in Agda.

CCS Concepts: • Theory of computation → Type theory; • Software and its engineering → Software verification.

Additional Key Words and Phrases: Proof Repair, Type Theory, Category Theory

1 Introduction

Formal proof developments in proof assistants like Agda, Rocq, and Lean [3, 38, 40] have grown larger as the technology has grown more accessible. One timeless challenge in large formal proof developments is the burden of change [47]. Proof repair has emerged as a promising tool to cope with change by automatically fixing formal proofs in response to breaking changes.

This paper is about a class of tools for coping with changes in datatypes in proof developments that we refer to as type-theoretic proof repair [46, 48, 58]: given an old and a new version of a datatype, these tools automatically rewrite the programs and proofs stated over the old version into programs and proofs stated over the new one. Type-theoretic proof repair leverages the underlying type theory of a proof assistant to establish relationships between datatypes across which programs and proofs can be repaired. This is, of course, not the only kind of proof repair—other repair tools exist that, for example, repair proofs concerning higher-order imperative code [25], or leverage non-type-theoretic methods like large language models [34] (see Section 5 for more).

The objective of this paper is to provide a mathematical foundation for type-theoretic proof repair tools that clarifies the scope of changes contemporary tools can handle and the extensions future repair tools can support. To this end, we develop the connection between proof repair and the categorical notion of algebras on endofunctors, from which results concerning the limits, scope, and extensions of repair follow directly. Our treatment characterizes the objects at the heart of repair tools; the syntactic transformations the tools perform over terms are beyond our present scope.

The principal theme of our work is that proof repair is an algebra isomorphism. We bring this conclusion to light by relating prior proof repair work to the type-theoretic understanding of datatypes; the goal is to connect these two fields and leverage type theory to obtain formal results about proof repair tools. Once established, the connection between algebra and repair gives

Authors' Contact Information: E.G. Plante III, University of Illinois at Urbana-Champaign, USA; Eric Paul, University of Illinois at Urbana-Champaign, USA; Cosmo Viola, University of Illinois at Urbana-Champaign, USA; G.A. Kavvos, University of Bristol, United Kingdom; Talia Ringer, University of Illinois at Urbana-Champaign, USA.

E.G. Plante III et al.

a mathematical explanation for why repair works, settles questions left open in prior work, and relaxes assumptions repair was thought to require. It also points beyond current tools, to repair for types no existing tool can handle. All of our results and examples are marked with a blue checkmark linking to the corresponding Agda formalization.

Contributions. Concretely, our contributions are:

  • We give a formal account of proof repair within type theory, which lays the groundwork for its connection to algebras (Section 2). In doing so, we formally establish results about the fundamental constructs of repair tools that prior work had only conjectured informally.

  • We demonstrate that proof repair can be understood through the notion of initial algebras on a suitable functor (Section 3). This new viewpoint clarifies the class of relationships between types that configuration-based repair captures, characterizing them exactly in terms of universal properties. We recast a case study from the original work on proof repair in terms of algebras, and formalize the connection to proof repair algorithms. Our main result asserts that configurations are algebra isomorphisms.

  • We find that repair does not require univalence, as was previously thought, and so applies to type theories that are inconsistent with univalence. This opens the door for new implementations of repair in proof assistants like Lean (Section 3.4).

  • With our new categorical perspective on proof repair, we develop the foundations for repair algorithms that handle a new class of types: coinductive types (Section 4).

References (25)