Skip to main content

Homotopy Type Theory in Lean

  • Conference paper
Book cover Interactive Theorem Proving (ITP 2017)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 10499))

Included in the following conference series:

Abstract

We discuss the homotopy type theory library in the Lean proof assistant. The library is especially geared toward synthetic homotopy theory. Of particular interest is the use of just a few primitive notions of higher inductive types, namely quotients and truncations, and the use of cubical methods.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    Available as part of: https://github.com/leanprover/lean2.

  2. 2.

    https://github.com/AlDanial/cloc.

  3. 3.

    http://www.nuprl.org/wip/Mathematics/cubical!type!theory/.

  4. 4.

    https://github.com/leanprover/lean2/blob/master/hott/book.md.

  5. 5.

    It has 7 700 lines of code and 1 400 lines of comments. It is available at https://github.com/cmu-phil/Spectral.

  6. 6.

    Although we use syntax inspired by the Lean syntax for inductive types, this is not valid syntax in Lean.

  7. 7.

    For the n-truncation we treat the fact that the new type is n-truncated as a “path-constructor.” In [21, Sect. 7.3] it is explained that the fact that a type is n-truncated can be reduced to (recursive) path constructors.

References

  1. Ahrens, B., Kapulkin, K., Shulman, M.: Univalent categories and the Rezk completion. Mathe. Struct. Comput. Sci. 25(5), 1010–1039 (2015)

    Article  MathSciNet  Google Scholar 

  2. Angiuli, C., Harper, R., Wilson, T.: Computational higher-dimensional type theory. In: Proceedings of the 44th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2017. ACM (2017)

    Google Scholar 

  3. Awodey, S., Warren, M.A.: Homotopy theoretic models of identity types. In: Mathematical Proceedings of the Cambridge Philosophical Society, vol. 146, no. 1, pp. 45–55 (2009)

    Google Scholar 

  4. Bauer, A., Gross, J., LeFanu Lumsdaine, P., Shulman, M., Sozeau, M., Spitters, B.: The HoTT library: a formalization of homotopy type theory in Coq. ArXiv e-prints, October 2016

    Google Scholar 

  5. Brunerie, G., Hou (Favonia), K.B., Cavallo, E., Finster, E., Cockx, J., Sattler, C., Jeris, C., Shulman, M., et al.: Homotopy Type Theory in Agda (2017). Code library. https://github.com/HoTT/HoTT-Agda

  6. Buchholtz, U., Rijke, E.: The cayley-dickson construction in homotopy type theory. ArXiv e-prints, October 2016

    Google Scholar 

  7. Cohen, C., Coquand, T., Huber, S., Mörtberg, A.: Cubical type theory. Code library. https://github.com/mortberg/cubicaltt

  8. Cohen, C., Coquand, T., Huber, S., Mörtberg, A.: Cubical type theory: a constructive interpretation of the univalence axiom. In: 21st International Conference on Types for Proofs and Programs (TYPES 2015). LIPIcs. Leibniz International Proceedings in Informatics, Schloss Dagstuhl. Leibniz-Zent. Inform., Wadern (2016, to appear)

    Google Scholar 

  9. van Doorn, F.: Constructing the propositional truncation using non-recursive hits. In: Proceedings of the 5th ACM SIGPLAN Conference on Certified Programs and Proofs, pp. 122–129. ACM (2016)

    Google Scholar 

  10. Dybjer, P.: Inductive families. Formal Aspects Comput. 6(4), 440–465 (1994)

    Article  Google Scholar 

  11. Goguen, H., McBride, C., McKinna, J.: Eliminating dependent pattern matching. In: Futatsugi, K., Jouannaud, J.-P., Meseguer, J. (eds.) Algebra, Meaning, and Computation. LNCS, vol. 4060, pp. 521–540. Springer, Heidelberg (2006). doi:10.1007/11780274_27

    Chapter  Google Scholar 

  12. Hedberg, M.: A coherence theorem for Martin-Löf’s type theory. J. Funct. Program. 8(4), 413–436 (1998)

    Article  MathSciNet  Google Scholar 

  13. Hofmann, M., Streicher, T.: The groupoid interpretation of type theory. In: Twentyfive Years of Constructive Type Theory (Venice, 1995). Oxford Logic Guides, vol. 36, pp. 83–111. Oxford University Press, New York (1998)

    Google Scholar 

  14. Kapulkin, C., Lumsdaine, P.L.: The simplicial model of univalent foundations (after voevodsky) (2012, preprint)

    Google Scholar 

  15. Licata, D.: Running circles around (in) your proof assistant; or, quotients that compute. blog post, April 2011. http://homotopytypetheory.org/2011/04/23/running-circles-around-in-your-proof-assistant/

  16. Licata, D., Brunerie, G.: A cubical approach to synthetic homotopy theory. In: Proceedings of the 2015 30th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS), LICS 2015, pp. 92–103. IEEE Computer Society, Washington, DC (2015)

    Google Scholar 

  17. de Moura, L., Ebner, G., Roesch, J., Ullrich, S.: The Lean theorem prover. Slides, January 2017. https://leanprover.github.io/presentations/20170116_POPL

  18. de Moura, L., Kong, S., Avigad, J., van Doorn, F., van Raumer, J.: The lean theorem prover (system description). In: Felty, A.P., Middeldorp, A. (eds.) CADE 2015. LNCS, vol. 9195, pp. 378–388. Springer, Cham (2015). doi:10.1007/978-3-319-21401-6_26

    Chapter  Google Scholar 

  19. Rijke, E.: The join construction. ArXiv e-prints, January 2017

    Google Scholar 

  20. Spitters, B., van der Weegen, E.: Developing the algebraic hierarchy with type classes in Coq. In: Kaufmann, M., Paulson, L.C. (eds.) ITP 2010. LNCS, vol. 6172, pp. 490–493. Springer, Heidelberg (2010). doi:10.1007/978-3-642-14052-5_35

    Chapter  Google Scholar 

  21. The Univalent Foundations Program: Homotopy Type Theory: Univalent Foundations of Mathematics. Institute for Advanced Study (2013). http://homotopytypetheory.org/book

  22. Voevodsky, V.: A very short note on the homotopy \(\lambda \)-calculus (2006). http://www.math.ias.edu/vladimir/Site3/Univalent_Foundations_files/Hlambda_short_current.pdf

  23. Voevodsky, V., Mörtberg, A., Ahrens, B., Lelay, C., Pannila, T., Matthes, R.: UniMath: Univalent Mathematics (2017). Code library. https://github.com/UniMath

Download references

Acknowledgments

We wish to thank the members of the HoTT group at Carnegie Mellon University for many fruitful discussions and Lean hacking sessions, and in particular Steve Awodey and Jeremy Avigad who have been very supportive of our work. Additionally, we deeply appreciate all the times Leonardo de Moura fixed an issue in the Lean kernel to accommodate our library. Lastly, we want to thank all contributors to the HoTT library and the Spectral repository, most notably Egbert Rijke and Mike Shulman.

The first and second authors gratefully acknowledge the support of the Air Force Office of Scientific Research through MURI grant FA9550-15-1-0053. Any opinions, findings and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of the AFOSR.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Ulrik Buchholtz .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2017 Springer International Publishing AG

About this paper

Cite this paper

van Doorn, F., von Raumer, J., Buchholtz, U. (2017). Homotopy Type Theory in Lean. In: Ayala-Rincón, M., Muñoz, C.A. (eds) Interactive Theorem Proving. ITP 2017. Lecture Notes in Computer Science(), vol 10499. Springer, Cham. https://doi.org/10.1007/978-3-319-66107-0_30

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-66107-0_30

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-66106-3

  • Online ISBN: 978-3-319-66107-0

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics