Skip to main content

Experience Implementing a Performant Category-Theory Library in Coq

  • Conference paper
Interactive Theorem Proving (ITP 2014)

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

Included in the following conference series:

Abstract

We describe our experience implementing a broad category-theory library in Coq. Category theory and computational performance are not usually mentioned in the same breath, but we have needed substantial engineering effort to teach Coq to cope with large categorical constructions without slowing proof script processing unacceptably. In this paper, we share the lessons we have learned about how to represent very abstract mathematical objects and arguments in Coq and how future proof assistants might be designed to better support such reasoning. One particular encoding trick to which we draw attention allows category-theoretic arguments involving duality to be internalized in Coq’s logic with definitional equality. Ours may be the largest Coq development to date that uses the relatively new Coq version developed by homotopy type theorists, and we reflect on which new features were especially helpful.

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 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

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Ahrens, B., Kapulkin, C., Shulman, M.: Univalent categories and the Rezk completion. In: ArXiv e-prints (March 2013)

    Google Scholar 

  2. Awodey, S.: Category theory, 2nd edn. Oxford University Press

    Google Scholar 

  3. Barras, B., Bernardo, B.: The implicit calculus of constructions as a programming language with dependent types. In: Amadio, R.M. (ed.) FOSSACS 2008. LNCS, vol. 4962, pp. 365–379. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  4. Bertot, Y.: Private Inductive Types: Proposing a language extension (April 2013), http://coq.inria.fr/files/coq5_submission_3.pdf

  5. Bishop, E.: Foundations of Constructive Analysis. McGraw-Hill series in higher mathematics. McGraw-Hill (1967)

    Google Scholar 

  6. Formalizations of category theory in proof assistants. MathOverflow, http://mathoverflow.net/questions/152497/formalizations-of-category-theory-in-proof-assistants

  7. Garillot, F., Gonthier, G., Mahboubi, A., Rideau, L.: Packaging Mathematical Structures. In: Berghofer, S., Nipkow, T., Urban, C., Wenzel, M. (eds.) TPHOLs 2009. LNCS, vol. 5674, pp. 327–342. Springer, Heidelberg (2009)

    Chapter  Google Scholar 

  8. Harper, R., Pollack, R.: Type checking with universes. Theoretical Computer Science 89(1), 107–136 (1991), ISSN: 0304-3975

    Google Scholar 

  9. Harrison, J.: Formalized mathematics. TUCS technical report. Turku Centre for Computer Science (1996) ISBN: 9789516508132

    Google Scholar 

  10. HoTT/HoTT Categories, https://github.com/HoTT/HoTT/tree/master/theories/categories

  11. Huet, G., Saïbi, A.: Constructive category theory. In: Proof, Language, and Interaction, pp. 239–275. MIT Press (2000)

    Google Scholar 

  12. Krebbers, R., Spitters, B., van der Weegen, E.: Math Classes

    Google Scholar 

  13. Leinster, T.: Higher Operads, Higher Categories. Cambridge Univ. Press

    Google Scholar 

  14. Mac Lane, S.: Categories for the working mathematician

    Google Scholar 

  15. Megacz, A.: Category Theory Library for Coq. Coq, http://www.cs.berkeley.edu/~megacz/coq-categories/

  16. Miquel, A.: The Implicit Calculus of Constructions. In: Abramsky, S. (ed.) TLCA 2001. LNCS, vol. 2044, pp. 344–359. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  17. O’Keefe, G.: Towards a readable formalisation of category theory. Electronic Notes in Theoretical Computer Science 91, 212–228 (2004)

    Article  MathSciNet  Google Scholar 

  18. Peebles, D., Vezzosi, A., Cook, J.: copumpkin/categories, https://github.com/copumpkin/categories

  19. Pierce, B.: A taste of category theory for computer scientists. Tech. rep.

    Google Scholar 

  20. Saïbi, A.: Constructive Category Theory, http://coq.inria.fr/pylons/pylons/contribs/view/ConCaT/v8.4

  21. Shulman, M.: An Interval Type Implies Function Extensionality, http://homotopytypetheory.org/2011/04/04

  22. Sozeau, M., et al.: HoTT/coq, https://github.com/HoTT/coq

  23. 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)

    Chapter  Google Scholar 

  24. The Coq Proof Assistant. INRIA, http://coq.inria.fr

  25. The Univalent Foundations Program. Homotopy Type Theory: Univalent Foundations of Mathematics (2013)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2014 Springer International Publishing Switzerland

About this paper

Cite this paper

Gross, J., Chlipala, A., Spivak, D.I. (2014). Experience Implementing a Performant Category-Theory Library in Coq. In: Klein, G., Gamboa, R. (eds) Interactive Theorem Proving. ITP 2014. Lecture Notes in Computer Science, vol 8558. Springer, Cham. https://doi.org/10.1007/978-3-319-08970-6_18

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-08970-6_18

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-08969-0

  • Online ISBN: 978-3-319-08970-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics