skip to main content
10.1145/3018610.3018614acmotherconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
research-article

Formalising real numbers in homotopy type theory

Published:16 January 2017Publication History

ABSTRACT

Cauchy reals can be defined as a quotient of Cauchy sequences of rationals. In this case, the limit of a Cauchy sequence of Cauchy reals is defined through lifting it to a sequence of Cauchy sequences of rationals.

This lifting requires the axiom of countable choice or excluded middle, neither of which is available in homotopy type theory. To address this, the Univalent Foundations Program uses a higher inductive-inductive type to define the Cauchy reals as the free Cauchy complete metric space generated by the rationals.

We generalize this construction to define the free Cauchy complete metric space generated by an arbitrary metric space. This forms a monad in the category of metric spaces with Lipschitz functions. When applied to the rationals it defines the Cauchy reals. Finally, we can use Altenkirch and Danielson (2016)'s partiality monad to define a semi-decision procedure comparing a real number and a rational number.

The entire construction has been formalized in the Coq proof assistant. It is available at https://github.com/SkySkimmer/HoTTClasses/tree/CPP2017 .

References

  1. The Univalent Foundations Program, Institute for Advanced Study. Homotopy Type Theory: Univalent Foundations of Mathematics, first edition. http://homotopytypetheory.org/book/ (2013) Bas Spitters and Eelis van der Weegen. Type Classes for Mathematics in Type Theory. https://math-classes.github.io/ (2011) T. Altenkirch and N. A. Danielsson and N. Kraus. Partiality, Revisited: The Partiality Monad as a Quotient Inductive-Inductive Type. ArXiv e-prints (2016). https://arxiv.org/abs/1610.Google ScholarGoogle Scholar
  2. 09254 Russell O’Connor. A Monadic, Functional Implementation of Real Numbers. Mathematical Structures in Computer Science 17(1): 129-159 (2007) Introduction Context Premetric Spaces Continuity Notions The Premetric Space of Functions Cauchy Completion Definition and Eliminators Properties of the Completion Monadic Structure of the Completion Cauchy Reals Addition and Order Relations Multiplication Multiplicative Inverse A Partial Function on Cauchy Reals The Partiality Monad The Sierpinski Space Interleaving Partial Comparison of Real Numbers with Rational Numbers Conclusion Acknowledgements Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Formalising real numbers in homotopy type theory

      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
      • Published in

        cover image ACM Other conferences
        CPP 2017: Proceedings of the 6th ACM SIGPLAN Conference on Certified Programs and Proofs
        January 2017
        234 pages
        ISBN:9781450347051
        DOI:10.1145/3018610

        Copyright © 2017 ACM

        Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 16 January 2017

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • research-article

        Acceptance Rates

        Overall Acceptance Rate18of26submissions,69%

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader