[Paper Review] Automatic and Transparent Transfer of Theorems along Isomorphisms in the Coq Proof Assistant
This paper presents a Coq plugin that enables automatic and transparent transfer of theorems across isomorphic data-types using a novel 'exact modulo' tactic. By leveraging user-declared surjective functions and transfer lemmas, the algorithm infers and inserts missing proof steps, allowing mathematicians to reason uniformly across isomorphic constructions without manual proof re-implementation.
In mathematics, it is common practice to have several constructions for the same objects. Mathematicians will identify them modulo isomorphism and will not worry later on which construction they use, as theorems proved for one construction will be valid for all. When working with proof assistants, it is also common to see several data-types representing the same objects. This work aims at making the use of several isomorphic constructions as simple and as transparent as it can be done informally in mathematics. This requires inferring automatically the missing proof-steps. We are designing an algorithm which finds and fills these missing proof-steps and we are implementing it as a plugin for Coq.
Motivation & Objective
- To automate the transfer of theorems between isomorphic data-types in Coq, mimicking informal mathematical practice where isomorphic structures are treated as interchangeable.
- To reduce the burden of manual proof re-implementation when switching between different representations of the same mathematical object (e.g., unary vs. binary natural numbers).
- To provide a lightweight, extensible framework that requires minimal user input—only surjections and transfer lemmas—while enabling automatic inference of proof obligations.
- To generalize the transfer mechanism beyond strict isomorphisms to include weaker correspondences such as surjections and bounded quantification, increasing usability.
- To improve usability in formal proof assistants by introducing a plugin with a simple, composable tactic ('exact modulo') that integrates seamlessly into Coq's interactive environment.
Proposed method
- The method relies on user-provided declarations: surjective functions with right inverses (i.e., f ∘ g = id) and transfer lemmas that relate relations on source and target types via f.
- The plugin maintains internal tables to store surjections and transfer lemmas, indexed by type pairs and relation pairs, respectively.
- The core mechanism uses a new tactic, 'exact modulo', which automatically infers and inserts the necessary proof steps to transfer a theorem from a source type to a target type.
- The algorithm is designed to handle first-order formulas with universal quantifiers, implications, and relations, ensuring logical correctness through structural correspondence.
- The approach generalizes beyond isomorphisms by supporting weaker conditions such as surjectivity and bounded quantification, enabling transfer even when full isomorphism is not present.
- The plugin supports compositional transfer by enabling chains of transfers through intermediate types, even when direct links are not declared.
Experimental results
Research questions
- RQ1How can we automatically transfer theorems from one data-type to another isomorphic or structurally related data-type in Coq without requiring manual proof reconstruction?
- RQ2What minimal user-provided declarations are sufficient to enable reliable and transparent theorem transfer across isomorphic constructions?
- RQ3Can the transfer mechanism be generalized to work with surjections and weaker equivalences rather than requiring full isomorphisms?
- RQ4How can we design a plugin-based system that integrates seamlessly into Coq’s interactive proof environment while maintaining transparency and correctness?
- RQ5To what extent can the transfer mechanism be compositional, allowing indirect transfers through intermediate types when direct declarations are missing?
Key findings
- The plugin successfully automates the transfer of theorems across isomorphic data-types using only surjective functions with right inverses and transfer lemmas, significantly reducing proof engineering overhead.
- The 'exact modulo' tactic enables transparent theorem transfer, allowing users to write proofs on one representation and automatically transfer them to another without rewriting proof steps.
- The approach supports non-isomorphic but structurally related types, such as when transferring properties from a subset to a superset via bounded quantification.
- The algorithm generalizes beyond isomorphisms to work with surjections and weaker equivalences, increasing its applicability to real-world formalizations.
- The plugin's architecture supports compositional transfer, enabling indirect transfers through chains of intermediate types, even when direct links are not declared.
- The method outperforms prior approaches like Magaud's proof transfer by requiring less complex infrastructure and avoiding the need to redefine constructors and recursion operators.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.