under construction
natural deduction metalanguage, practical foundations
type theory (dependent, intensional, observational type theory, homotopy type theory)
computational trinitarianism = propositions as types +programs as proofs +relation type theory/category theory
type theory? and certain kinds of category theory are closely related. One may view type theory as a formal syntactic language or calculus for category theory, and conversely one may think of category theory as providing semantics for type theory. The flavor of category theory used depends on the flavor of type theory; this also extends to homotopy type theory and certain kind sof (∞,1)-category theory.
| flavor of type theory | equivalent to | flavor of category theory | |
|---|---|---|---|
| intuitionistic propositional logic?/simply-typed lambda calculus? | cartesian closed category | ||
| intuitionistic linear logic? | monoidal closed category | ||
| classical linear logic? | star-autonomous category | ||
| first-order logic | hyperdoctrine | (Seely 1984a) | |
| Martin-Löf dependent type theory | locally cartesian closed category | (Seely 1984b) | |
| homotopy type theory | locally cartesian closed (∞,1)-category | (conjectural) | |
| homotopy type theory with higher inductive types and univalence | elementary (∞,1)-topos | (conjectural) |
We discuss here formalizations and proofs of the relation/equivalence between various flavors of type theories and the corresponding flavors of categories.
Martin-Löf Dependent type theory and locally cartesian closed categories
Homotopy type theory and locally cartesian closed (∞,1)-categories
Homotopy type theory with univalence and elementary (∞,1)-toposes
The functors
, that form a category of contexts of a first-order theory;
, that forms the internal language of a hyperdoctrine
constitute an equivalence of categories
There are 2-functors
, that forms a category of contexts of a Martin-Löf dependent type theory;
that forms the internal language of a locally cartesian closed category
that constitute an equivalence of 2-categories
This was originally claimed as an equivalence of categories (Seely, theorem 6.3). However, that argument did not properly treat a subtlety central to the whole subject: that substitution of terms for variables composes strictly, while its categorical semantics by pullback is by the very nature of pullbacks only defined up to isomorphism. This problem was pointed out and ways to fix it were given in (Curien) and (Hofmann); see categorical model of dependent types for the latter. However, the full equivalence of categories was not recovered until (Clairambault-Dybjer) solved both problems by promoting the statement to an equivalence of 2-categories.
We now indicate some of the details.
For definiteness, self-containedness and for references below, we say what a dependent type theory is, following (Seely, def. 1.1).
A Martin-Löf dependent type theory is a theory with some signature of dependent function symbols with values in types and in terms (…) subject to the following rules
type formation rules
is a type (the unit type);
if are terms of type , then is a type (the equality type);
if and are types, depending on a free variable of type , then the following symbols are types
(dependent product), written also if in fact does not depend on ;
(dependent sum), written also if in fact does not depend on ;
term formation rules
is a term of the unit type;
(…)
equality rules
Given a dependent type theory , its category of contexts is the category whose
morphisms are the terms of function type .
Composition is given in the evident way.
has finite limits and is a cartesian closed category.
Constructions are straightforward. We indicated some of them.
Notice that all finite limits (as discussed there) are induced as soon as there are all pullbacks and equalizers. A pullback in
is given by
The equalizer
is given by
Next, the internal hom/exponential object is given by function type
Define the -indexed hyperdoctrine by taking for the category to have as objects the -dependent types and as morphisms the terms of dependent function type .
This is cartesian closed by the same kind of argument as in the previous proof. It is now sufficient to exhibit a compatible equivalence of categories with the slice category .
In one direction, send a morphism to the dependent type
Conversely, for a dependent type, send it to the projection .
One shows that this indeed gives an equivalence of categories which is compatible with base change (Seely, prop. 3.2.4).
For a dependent type theory and a locally cartesian closed category, an interpretation of in is a morphism of locally cartesian closed categories
An interpretation of in another dependent type theory is a morphism of locally cartesian closed categories
Given a locally cartesian closed category , define the corresponding dependent type theory as follows
the non-dependent types of are the objects of ;
the -dependent types are the morphisms ;
a context is a tower of morphisms
the terms are the sections in
the equality type is the diagonal
…
(…)
(…)
The equivalence of categories between first order theories and hyperdoctrines is discussed in
A lecture reviewing aspects involved in this equivalence is (see the discussion building up to the theorem on slide 96)
An adjunction between the category of type theories with product types and toposes is discussed in chapter II of
The equivalence of categories between locally cartesian closed categories and dependent type theories was originally claimed in
following a statement earlier conjectured in
The problem with strict substitution compared to weak pullback in this argument was discussed and fixed in
but in the process the equivalence of categories was lost. This was finally all rectified in
The analogous statement relating homotopy type theory and locally cartesian closed (infinity,1)-categories was conjectured around
The suggestion that with univalence this is refined to (∞,1)-topos theory appears around
A precise definition of elementary (infinity,1)-topos inspired by giving a natural equivalence to homotopy type theory with univalence was then proposed in
A discussion of the correspondence between type theories and categories of various sorts, from lex categories to toposes is in