[Math] Formalizations of category theory in proof assistants

big-listcoqct.category-theoryformalizationproof-assistants

What are the existing formalizations of category theory in proof assistants?

I'm primarily interested in public-domain code implementing category theory in a proof assistant (Coq, Agda, Isabelle/HOL, Mizar, NuPRL, Twelf, Lego, Idris, Matita, etc.), though I'm also interested in papers about formalizations of category theory in proof assistants.

I've added answers to this question for all of the papers and formalizations that I know about, and details about the constructions in my own repository as of the date of adding. In addition to adding formalizations that you don't see on here, you should feel free to add details and improve the formatting of the other entries (especially including what language the formalization is in, what category theory it covers, links to papers presenting it and/or publicly available source code, whether or not it's under active development, what the newest version of the proof assistant it compiles with is, etc.).

Best Answer

HoTT/HoTT Categories

Links: https://github.com/HoTT/HoTT/tree/master/theories/Categories (current), https://github.com/JasonGross/HoTT-categories (old), https://bitbucket.org/JasonGross/catdb (oldest). Interactive index, non-interactive index, top-level wiki

Language: Coq 8.6; will compile with 8.7 when it comes out; the oldest version compiled with Coq 8.4)

Author: Jason Gross

Active Development: No, but actively maintained in its present form (as of June 2017)

Concepts Formalized:

  • 1-precategories (in the sense of the HoTT Book)

  • univalent/saturated categories (or just categories, in the HoTT Book)

  • functor precategories $\mathcal C \to \mathcal D$

  • dual functor isomorphisms $\text{Cat} \to \text{Cat}$; and $(\mathcal{C} \to \mathcal{D})^{\text{op}} \to (\mathcal{C}^{\text{op}} \to \mathcal{D}^{\text{op}})$

  • the category Prop of ($U$-small) hProps

  • the category Set of ($U$-small) hSets

  • the category Cat of ($U$-small) strict (pre)categories (strict in the sense of the objects being hSets)

  • pseudofunctors

  • profunctors

    • identity profunction (the hom functor $\mathcal C^\text{op} \times \mathcal C \to \text{Set}$)
  • adjoints

    • equivalences between a number of definitions:
      • unit-counit + zig-zag definition
      • unit + UMP definition
      • counit + UMP definition
      • universal morphism definition
      • hom-set definition (porting from old version in progress)
    • composition, identity, dual
    • pointwise adjunctions in the library, $G^\mathcal{E} \dashv F^\mathcal{C}$ and $\mathcal{E}^F \dashv \mathcal{C}^G$ from an adjunction $F \dashv G$ for functors $F : \mathcal C \leftrightarrows \mathcal D : G$ and $\mathcal E$ a precategory (still too slow to be merged into the library proper; code here)
  • Yoneda lemma

  • Exponential laws

    • $\mathcal C^0 \cong 1$; $0^{\mathcal C} \cong 0$ given an object in $\mathcal C$
    • $\mathcal C^1 \cong \mathcal C$; $1^{\mathcal C} \cong 1$
    • $\mathcal C^{\mathcal A + \mathcal B} \cong \mathcal C^{\mathcal A} \times \mathcal C^{\mathcal B}$
    • $(\mathcal A \times \mathcal B)^{\mathcal C} \cong \mathcal A^{\mathcal C} \times \mathcal B^{\mathcal C}$
    • $(\mathcal A^{\mathcal B})^{\mathcal C} \cong \mathcal A^{\mathcal B \times \mathcal C}$
  • Product laws
    • $\mathcal C \times \mathcal D \cong \mathcal D \times \mathcal C$
    • $\mathcal C \times 0 \cong 0 \times \mathcal C \cong 0$
    • $\mathcal C \times 1 \cong 1 \times \mathcal C \cong \mathcal C$
  • Grothendieck construction (oplax colimit) of a pseudofunctor to Cat
  • Category of sections (gives rise to oplax limit of a pseudofunctor to Cat when applied to Grothendieck construction
  • functor composition is functorial (there's a functor $\Delta : (\mathcal C \to \mathcal D) \to (\mathcal D \to \mathcal E) \to (\mathcal C \to \mathcal E)$, where each $\mathcal A \to \mathcal B$ is a functor category)
  • Kan extensions are adjoints to the functorial composition functor
  • (co)limits defined as Kan extensions when one of the categories is terminal
  • The comma functor $\left(\mathcal C^{\mathcal A}\right)^{\text{op}} \times \mathcal C^{\mathcal B} \to \text{Cat}_{/ \mathcal A \times \mathcal B}$ which sends $\mathcal A \xrightarrow{f} \mathcal C \xleftarrow{g} \mathcal B$ to the comma category $(f / g)$ and it's projection functor to $\mathcal A \times \mathcal B$
  • monoidal categories (porting from the oldest version still in progress)
  • enriched categories (porting from the oldest version still in progress)

Concepts currently under construction:

  • pseudonatural transformations
  • (op)lax comma categories
  • pointwise Kan extensions
  • Cartesian closed categories

Construction Choices:

  • Morphisms are dependently typed $\text{Hom}_{\mathcal C} : \text{Ob}_{\mathcal C} \to \text{Ob}_{\mathcal C} \to \text{Type}$
  • Morphisms land in Type; propositional equality is used; higher inductive types are used for quotients
  • Categories are records with no parameters and all fields
  • Based on homotopy type theory; morphisms are hSets (0-truncated; satisfy UIP)