DeepAI
Log In Sign Up

Internalizing Representation Independence with Univalence

09/11/2020
by   Carlo Angiuli, et al.
0

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.

READ FULL TEXT
01/02/2019

Parametric Cubical Type Theory

We exhibit a computational type theory which combines the higher-dimensi...
05/22/2020

Internal Parametricity for Cubical Type Theory

We define a computational type theory combining the contentful equality ...
08/24/2018

Code Generation for Higher Inductive Types

Higher inductive types are inductive types that include nontrivial highe...
11/28/2018

Adventures in Formalisation: Financial Contracts, Modules, and Two-Level Type Theory

We present three projects concerned with applications of proof assistant...
07/01/2020

The Integers as a Higher Inductive Type

We consider the problem of defining the integers in Homotopy Type Theory...
01/23/2019

The Size-Change Principle for Mixed Inductive and Coinductive types

This paper describes how to use Lee, Jones and Ben Amram's size-change p...
07/12/2018

Gradual Parametricity, Revisited

Bringing the benefits of gradual typing to a language with parametric po...