Category theory in Coq 8.5: Extended version

We report on our experience implementing category theory in Coq 8.5. Our work formalizes most of basic category theory, including concepts not covered by existing formalizations, in a library that is fit to be used as a general-purpose category-theoretical foundation. Our development particularly takes advantage of two features new to Coq 8.5: primitive projections for records and universe polymorphism. Primitive projections allow for well-behaved dualities while universe polymorphism provides a relative notion of largeness and smallness. The latter is one of the main contributions of this paper. It pushes the limits of the new universe polymorphism and constraint inference algorithm of Coq 8.5. In this paper we present in detail smallness and largeness in categories and the foundation they are built on top of. We furthermore explain how we have used the universe polymorphism of Coq 8.5 to represent smallness and largeness arguments by simply ignoring them and entrusting them to the universe inference algorithm of Coq 8.5. We also discuss our experience throughout this implementation, discuss concepts formalized in this development and give a comparison with a few other developments of similar extent. Furthermore, we discuss (future) works on top of or related to this development including our experience regarding our ongoing effort of porting a version of this development on top of the HoTT library. Category Theory in Coq 8.5: Extended Version Amin Timany Bart Jacobs iMinds-DistriNet – KU Leuven firstname.lastname@cs.kuleuven.be

[1]  Gérard P. Huet,et al.  Constructive category theory , 2000, Proof, Language, and Interaction.

[2]  Bart Jacobs,et al.  The category-theoretic solution of recursive ultra-metric space equations , 2016 .

[3]  Bengt Nordström,et al.  Programming in Martin-Lo¨f's type theory: an introduction , 1990 .

[4]  Antonino Salibra,et al.  Scott Is Always Simple , 2012, MFCS.

[5]  Bart Jacobs,et al.  Categorical Logic and Type Theory , 2001, Studies in logic and the foundations of mathematics.

[6]  Lars Birkedal,et al.  ModuRes: A Coq Library for Modular Reasoning About Concurrent Higher-Order Imperative Programming Languages , 2015, ITP.

[7]  Samson Abramsky,et al.  Introduction to Categories and Categorical Logic , 2011, ArXiv.

[8]  Steve Awodey,et al.  Voevodsky's Univalence Axiom in homotopy type theory , 2013 .

[9]  Thierry Coquand,et al.  Isomorphism is equality , 2013 .

[10]  S. Lane Categories for the Working Mathematician , 1971 .

[11]  Adam Chlipala,et al.  Experience Implementing a Performant Category-Theory Library in Coq , 2014, ITP.

[12]  Michael Shulman,et al.  Univalent categories and the Rezk completion , 2013, Mathematical Structures in Computer Science.

[13]  Matthieu Sozeau,et al.  Subset Coercions in Coq , 2006, TYPES.

[14]  M. Barr,et al.  Toposes, Triples and Theories , 1984 .

[15]  Rasmus Ejlers Møgelberg,et al.  First Steps in Synthetic Guarded Domain Theory: Step-Indexing in the Topos of Trees , 2011, LICS.

[16]  Nicolas Tabareau,et al.  Universe Polymorphism in Coq , 2014, ITP.

[17]  Lars Birkedal,et al.  The category-theoretic solution of recursive metric-space equations , 2010, Theor. Comput. Sci..

[18]  Bart Jacobs,et al.  Category Theory in Coq 8.5 , 2016, FSCD.

[19]  John C. Mitchell,et al.  Foundations for programming languages , 1996, Foundation of computing series.

[20]  Lars Birkedal,et al.  BI-hyperdoctrines, higher-order separation logic, and abstraction , 2007, TOPL.

[21]  Bart Jacobs,et al.  First Steps Towards Cumulative Inductive Types in CIC , 2015, ICTAC.

[22]  M. Hofmann,et al.  The groupoid interpretation of type theory , 1998 .

[23]  Steve Awodey,et al.  Category Theory , 2006 .

[24]  Robert Harper,et al.  Type Checking with Universes , 1991, Theor. Comput. Sci..

[25]  Dominique Devriese,et al.  Pattern matching without K , 2014, ICFP.

[26]  Thierry Coquand,et al.  An Analysis of Girard's Paradox , 1986, LICS.

[27]  Colin McLarty,et al.  Elementary categories, elementary toposes , 1992 .