skip to main content
research-article
Open Access
Artifacts Available
Artifacts Evaluated & Functional

Equivalences for free: univalent parametricity for effective transport

Published:30 July 2018Publication History
Skip Abstract Section

Abstract

Homotopy Type Theory promises a unification of the concepts of equality and equivalence in Type Theory, through the introduction of the univalence principle. However, existing proof assistants based on type theory treat this principle as an axiom, and it is not yet clear how to extend them to handle univalence internally. In this paper, we propose a construction grounded on a univalent version of parametricity to bring the benefits of univalence to the programmer and prover, that can be used on top of existing type theories. In particular, univalent parametricity strengthens parametricity to ensure preservation of type equivalences. We present a lightweight framework implemented in the Coq proof assistant that allows the user to transparently transfer definitions and theorems for a type to an equivalent one, as if they were equal. Our approach handles both type and term dependency. We study how to maximize the effectiveness of these transports in terms of computational behavior, and identify a fragment useful for certified programming on which univalent transport is guaranteed to be effective. This work paves the way to easier-to-use environments for certified programming by supporting seamless programming and proving modulo equivalences.

References

  1. Thorsten Altenkirch and Ambrus Kaposi. 2017. Towards a cubical type theory without an interval. Leibniz International Proceedings in Informatics.Google ScholarGoogle Scholar
  2. Thorsten Altenkirch, Conor McBride, and Wouter Swierstra. 2007. Observational equality, now!. In Proceedings of the Workshop on Programming Languages meets Program Verification (PLPV 2007). 57–68. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Abhishek Anand and Greg Morrisett. 2017. Revisiting Parametricity: Inductives and Uniformity of Propositions. CoRR abs/1705.01163 (2017). http://arxiv.org/abs/1705.01163Google ScholarGoogle Scholar
  4. John Bacon. 1974. The Untenability of Genera. Logique et Analyse 17, 65/66 (jan-apr 1974), 197–208.Google ScholarGoogle Scholar
  5. Andrej Bauer, Jason Gross, Peter LeFanu Lumsdaine, Michael Shulman, Matthieu Sozeau, and Bas Spitters. 2017. The HoT T Library: A Formalization of Homotopy Type Theory in Coq. In Proceedings of the 6th ACM SIGPLAN Conference on Certified Programs and Proofs (CPP 2017). ACM, New York, NY, USA, 164–172. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Jean-Philippe Bernardy, Thierry Coquand, and Guilhem Moulin. 2015. A Presheaf Model of Parametric Type Theory. Electronic Notes in Theoretical Computer Science 319 (2015), 67–82. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Jean-Philippe Bernardy, Patrik Jansson, and Ross Paterson. 2012. Proofs for free: Parametricity for dependent types. Journal of Functional Programming 22, 2 (March 2012), 107–152. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Simon Boulier, Pierre-Marie Pédrot, and Nicolas Tabareau. 2017. The next 700 syntactical models of type theory. In Certified Programs and Proofs (CPP 2017). Paris, France, 182 – 194. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Cyril Cohen, Thierry Coquand, Simon Huber, and Anders Mörtberg. 2016. Cubical Type Theory: a constructive interpretation of the univalence axiom. (Oct. 2016). https://hal.inria.fr/hal- 01378906 Accepted for publication in LIPIcs.Google ScholarGoogle Scholar
  10. Cyril Cohen, Maxime Dénès, and Anders Mörtberg. 2013. Refinements for Free!. In Proceedings of the International Conference on Certified Programming and Proofs (CPP 2013) (Lecture Notes in Computer Science), G. Gonthier and M. Norrish (Eds.), Vol. 8307. Springer-Verlag, 147–162. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. The Coq Development Team. 2016. The Coq proof assistant reference manual. http://coq.inria.fr Version 8.6.Google ScholarGoogle Scholar
  12. Nicola Gambino and Martin Hyland. 2004. Wellfounded trees and dependent polynomial functors. In Proceedings of Types for Proofs and Programs (TYPES 2003) (Lecture Notes in Computer Science), Vol. 3085. Springer-Verlag, 210–225.Google ScholarGoogle ScholarCross RefCross Ref
  13. Florian Haftmann, Alexander Krauss, Ondřej Kunčar, and Tobias Nipkow. 2013. Data Refinement in Isabelle/HOL. In Proceedings of the 4th International Conference on Interactive Theorem Proving (ITP 2013) (Lecture Notes in Computer Science), S. Blazy, C. Paulin-Mohring, and D. Pichardie (Eds.), Vol. 7998. Springer-Verlag, 100–115. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Brian Huffman and Ondřej Kunčar. 2013. Lifting and Transfer: A Modular Design for Quotients in Isabelle/HOL. In Proceedings of the 3rd International Conference on Certified Programs and Proofs (CPP 2013). Springer-Verlag, Melbourne, Australia, 131–146. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Neelakantan R. Krishnaswami and Derek Dreyer. 2013. Internalizing Relational Parametricity in the Extensional Calculus of Constructions. In Proceedings of the Conference for Computer Science Logic (CSL 2013). 432–451.Google ScholarGoogle Scholar
  16. Peter Lammich. 2013. Automatic Data Refinement. In Proceedings of the 4th International Conference on Interactive Theorem Proving (ITP 2013) (Lecture Notes in Computer Science), S. Blazy, C. Paulin-Mohring, and D. Pichardie (Eds.), Vol. 7998. Springer-Verlag, 84–99. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Nicolas Magaud. 2003. Changing Data Representation within the Coq system. In International Conference on Theorem Proving in Higher Order Logics (TPHOLs 2003) (Lecture Notes in Computer Science), D. Basin and B. Wolff (Eds.), Vol. 2758. Springer-Verlag.Google ScholarGoogle ScholarCross RefCross Ref
  18. Nicolas Magaud and Yves Bertot. 2000. Changing Data Structures in Type Theory: A Study of Natural Numbers. In International Workshop on Types for Proofs and Programs (TYPES 2000) (Lecture Notes in Computer Science), P. Callaghan, Z. Luo, J. McKinna, and R. Pollack (Eds.), Vol. 2277. Springer-Verlag, 181–196. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Per Martin-Löf. 1971. An Intuitionistic Theory of Types. Unpublished manuscript.Google ScholarGoogle Scholar
  20. Christine Paulin-Mohring. 2015. Introduction to the Calculus of Inductive Constructions. In All about Proofs, Proofs for All, Bruno Woltzenlogel Paleo and David Delahaye (Eds.). Studies in Logic (Mathematical logic and foundations), Vol. 55.Google ScholarGoogle Scholar
  21. Simon Peyton Jones, Dimitrios Vytiniotis, Stephanie Weirich, and Geoffrey Washburn. 2006. Simple unification-based type inference for GADTs. In Proceedings of the 11th ACM SIGPLAN Conference on Functional Programming (ICFP 2006). ACM Press, Portland, Oregon, USA, 50–61. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. John C. Reynolds. 1983. Types, Abstraction and Parametric Polymorphism. In IFIP Congress. 513–523.Google ScholarGoogle Scholar
  23. Matthieu Sozeau and Nicolas Oury. 2008. First-Class Type Classes. In Proceedings of the 21st International Conference on Theorem Proving in Higher-Order Logics. Montreal, Canada, 278–293. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. The Univalent Foundations Program. 2013. Homotopy Type Theory: Univalent Foundations of Mathematics. Institute for Advanced Study.Google ScholarGoogle Scholar
  25. Philip Wadler. 1989. Theorems for Free!. In Functional Programming Languages and Computer Architecture. ACM Press, 347–359. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Theo Zimmermann and Hugo Herbelin. 2015. Automatic and Transparent Transfer of Theorems along Isomorphisms in the Coq Proof Assistant. arXiv:1505.05028v4.Google ScholarGoogle Scholar

Index Terms

  1. Equivalences for free: univalent parametricity for effective transport

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in

        Full Access

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader
        About Cookies On This Site

        We use cookies to ensure that we give you the best experience on our website.

        Learn more

        Got it!