Internalizing Representation Independence with Univalence
Preprint
Abstract
In their usual form, representation independence metatheorems provide an external guarantee that two implementations of an abstract interface are interchangeable when they are related by an operation-preserving correspondence. If our programming language is dependently-typed, however, we would like to appeal to such invariance results within the language itself, in order to obtain correctness theorems for complex implementations by transferring them from simpler, related implementations. Recent work in proof assistants has shown that Voevodsky's univalence principle allows transferring theorems between isomorphic types, but many instances of representation independence in programming involve non-isomorphic representations. In this paper, we develop techniques for establishing internal relational representation independence results in dependent type theory, by using higher inductive types to simultaneously quotient two related implementation types by a heterogeneous correspondence between them. The correspondence becomes an isomorphism between the quotiented types, thereby allowing us to obtain an equality of implementations by univalence. We illustrate our techniques by considering applications to matrices, queues, and finite multisets. Our results are all formalized in Cubical Agda, a recent extension of Agda which supports univalence and higher inductive types in a computationally well-behaved way.Keywords
All Related Versions
This publication has 48 references indexed in Scilit:
- Homotopy Type Theory in Lean2017
- The Lean Theorem Prover (System Description)2015
- A Computer-Algebra-Based Formal Proof of the Irrationality of ζ(3)2014
- Refinements for Free!2013
- Automatic Data Refinement2013
- Data Refinement in Isabelle/HOL2013
- Bag Equivalence via a Proof-Relevant Membership Relation2012
- Changing Data Representation within the Coq SystemLecture Notes in Computer Science, 2003
- Changing Data Structures in Type Theory: A Study of Natural NumbersLecture Notes in Computer Science, 2002
- On observational equivalence and algebraic specificationJournal of Computer and System Sciences, 1987