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.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
Ahrens, B., Kapulkin, C., Shulman, M.: Univalent categories and the Rezk completion. In: ArXiv e-prints (March 2013)
Awodey, S.: Category theory, 2nd edn. Oxford University Press
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)
Bertot, Y.: Private Inductive Types: Proposing a language extension (April 2013), http://coq.inria.fr/files/coq5_submission_3.pdf
Bishop, E.: Foundations of Constructive Analysis. McGraw-Hill series in higher mathematics. McGraw-Hill (1967)
Formalizations of category theory in proof assistants. MathOverflow, http://mathoverflow.net/questions/152497/formalizations-of-category-theory-in-proof-assistants
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)
Harper, R., Pollack, R.: Type checking with universes. Theoretical Computer Science 89(1), 107–136 (1991), ISSN: 0304-3975
Harrison, J.: Formalized mathematics. TUCS technical report. Turku Centre for Computer Science (1996) ISBN: 9789516508132
HoTT/HoTT Categories, https://github.com/HoTT/HoTT/tree/master/theories/categories
Huet, G., Saïbi, A.: Constructive category theory. In: Proof, Language, and Interaction, pp. 239–275. MIT Press (2000)
Krebbers, R., Spitters, B., van der Weegen, E.: Math Classes
Leinster, T.: Higher Operads, Higher Categories. Cambridge Univ. Press
Mac Lane, S.: Categories for the working mathematician
Megacz, A.: Category Theory Library for Coq. Coq, http://www.cs.berkeley.edu/~megacz/coq-categories/
Miquel, A.: The Implicit Calculus of Constructions. In: Abramsky, S. (ed.) TLCA 2001. LNCS, vol. 2044, pp. 344–359. Springer, Heidelberg (2001)
O’Keefe, G.: Towards a readable formalisation of category theory. Electronic Notes in Theoretical Computer Science 91, 212–228 (2004)
Peebles, D., Vezzosi, A., Cook, J.: copumpkin/categories, https://github.com/copumpkin/categories
Pierce, B.: A taste of category theory for computer scientists. Tech. rep.
Saïbi, A.: Constructive Category Theory, http://coq.inria.fr/pylons/pylons/contribs/view/ConCaT/v8.4
Shulman, M.: An Interval Type Implies Function Extensionality, http://homotopytypetheory.org/2011/04/04
Sozeau, M., et al.: HoTT/coq, https://github.com/HoTT/coq
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)
The Coq Proof Assistant. INRIA, http://coq.inria.fr
The Univalent Foundations Program. Homotopy Type Theory: Univalent Foundations of Mathematics (2013)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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)