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. By a syntax-semantics duality 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 kinds of (∞,1)-category theory.
flavor of type theory | $\;$equivalent to$\;$ | flavor of category theory | |
---|---|---|---|
intuitionistic propositional logic/simply-typed lambda calculus? | cartesian closed category | ||
multiplicative intuitionistic linear logic | symmetric closed monoidal category | (various authors since ~68) | |
first-order logic | hyperdoctrine | (Seely 1984a) | |
classical linear logic | star-autonomous category | (Seely 89) | |
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) |
computational trinitarianism = propositions as types +programs as proofs +relation type theory/category theory
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
The functors
$Cont$, that form a category of contexts of a first-order theory;
$Lang$, that forms the internal language of a hyperdoctrine
constitute an equivalence of categories
There are 2-functors
$Cont$, that forms a category of contexts of a Martin-Löf dependent type theory;
$Lang$ 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 $T$ 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
$1$ is a type (the unit type);
if $a, b$ are terms of type $A$, then $(a = b)$ is a type (the equality type);
if $A$ and $B[x]$ are types, $B$ depending on a free variable of type $A$, then the following symbols are types
$\prod_{a : A} B[a]$ ([dependent product]), written also $(A \to B)$ if $B[x]$ in fact does not depend on $x$;
$\sum_{a : A} B[a]$ (dependent sum), written also $A \times B$ if $B[x]$ in fact does not depend on $x$;
term formation rules
$* \in 1$ is a term of the unit type;
(…)
equality rules
Given a dependent type theory $T$, its category of contexts $Con(T)$ is the category whose
morphisms $f : A \to B$ are the terms $f$ of function type $A \to B$.
Composition is given in the evident way.
$Con(T)$ 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 $Con(T)$
is given by
The equalizer
is given by
Next, the internal hom/exponential object is given by function type
$Con(T)$ is a locally cartesian closed category.
Define the $Con(T)$-indexed hyperdoctrine $P(T)$ by taking for $A \in Con(T)$ the category $P(T)(A)$ to have as objects the $A$-dependent types and as morphisms $(a : A \vdash X(a) : type) \to (a : A \vdash Y(a) : type)$ the terms of dependent function type $(a : A \vdash t : (X(a) \to Y(a)))$.
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 $Con(T)_{/A}$.
In one direction, send a morphism $f : X \to A$ to the dependent type
Conversely, for $a : A \vdash X(a)$ a dependent type, send it to the projection $\sum_{a : A} X(a) \to A$.
One shows that this indeed gives an equivalence of categories which is compatible with base change (Seely, prop. 3.2.4).
For $T$ a dependent type theory and $C$ a locally cartesian closed category, an interpretation of $T$ in $C$ is a morphism of locally cartesian closed categories
An interpretation of $T$ in another dependent type theory $T'$ is a morphism of locally cartesian closed categories
Given a locally cartesian closed category $C$, define the corresponding dependent type theory $Lang(C)$ as follows
the non-dependent types of $Lang(C)$ are the objects of $C$;
the $A$-dependent types are the morphisms $B \to A$;
a context $x_1 : X , x_2 : X, \cdots , x_n : X_n$ is a tower of morphisms
the terms $t[x_A] : B[x_A]$ are the sections $A \to B$ in $C_{/A}$
the equality type $(x_A = y_A)$ is the diagonal $A \to A \times A$
…
All of the avive has an analog in (∞,1)-category theory and homotopy type theory.
Every presentable and locally cartesian closed (∞,1)-category has a presentation by a type-theoretic model category. This provides the categorical semantics for homotopy type theory (without, possibly, the univalence axiom).
This includes in particular all (∞-stack-) (∞,1)-toposes (which should in addition satisfy univalence). See also at internal logic of an (∞,1)-topos.
Some form of this statement was originally formally conjectured in (Joyal 11), following (Awodey 10). For more details see at locally cartesian closed (∞,1)-category.
A (locally presentable) locally Cartesian closed (∞,1)-category (as above) which in addition has a system of object classifiers is an ((∞,1)-sheaf-)(∞,1)-topos.
It has been conjectured in (Awodey 10) that this object classifier is the categorical semantics of a univalent type universe (type of types), hence that homotopy type theory with univalence has categorical semantics in (∞,1)-toposes. This statement was proven for the canonical $(\infty,1)$-topos ∞Grpd in (Kapulkin-Lumsdaine-Voevodsky 12), and more generally for (∞,1)-presheaf $(\infty,1)$-toposes over elegant Reedy categories in (Shulman 13).
In these proofs the type-theoretic model categories which interpret the homotopy type theory syntax are required to provide type universes that behave strictly under pullback. This matches the usual syntactically convenient universes in type theory (either a la Russell or a la Tarski), but more difficult to implement in the categorical semantics. More flexibly, one may consider syntactic type universes weakly à la Tarski. These are more complicated to work with syntactically, but should have interpretations in a (type-theoretic model categories presenting) any (∞,1)-topos. Discussion of in this general flexible sense is in (Gepner-Kock 12).
While (∞,1)-sheaf (∞,1)-toposes are those currently understood, the basic type theory with univalent universes does not see or care about their local presentability as such (although it is used in other places, such as the construction of higher inductive types). It is to be expected that there is a decent concept of elementary (∞,1)-topos such that homotopy type theory with univalent type universes and some supply of higher inductive types has categorical semantics precisely in elementary (∞,1)-toposes (as conjectured in Awodey 10). But the fine-tuning of this statement is currently still under investigation.
Notice that this statement, once realized, makes (or would make) Univalent HoTT+HITs a sort of homotopy theoretic refinement of foundations of mathematics in topos theory as proposed by William Lawvere. It could be compared to his elementary theory of the category of sets, although being a type theory rather than a theory in first-order logic, it is more analogous to the internal type theory of an elementary topos.
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)
See also
The equivalence between linear logic and star-autonomous categories is due to
and reviews/further developments are in
G. M. Bierman, What is a Categorical Model of Intuitionistic Linear Logic? (web)
Andrew Graham Barber, Linear Type Theories, Semantics and Action Calculi, 1997 (web, pdf)
Paul-André Melliès , Categorial Semantics of Linear Logic, in Interactive models of computation and program behaviour, Panoramas et synthèses 27, 2009 (pdf)
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 fromally conjectured around
following earlier suggestions by Steve Awodey. Explicitly, the suggestion that with the univalence axiom added this is refined to (∞,1)-topos theory appears around
Details on this higher categorical semantics of homotopy type theory are in
with lecture notes in
Mike Shulman, Categorical models of homotopy type theory, April 13, 2012 (pdf)
André Joyal, Remarks on homotopical logic, Oberwolfach (2011) (pdf)
André Joyal, Categorical homotopy type theory, March 17, 2014 (pdf)
A precise definition of elementary (infinity,1)-topos inspired by giving a natural equivalence to homotopy type theory with univalence was then proposed in
Categorical semantics of univalent type universes is discussed in
Steve Awodey, Type theory and homotopy (2010) (pdf)
Chris Kapulkin, Peter LeFanu Lumsdaine, Vladimir Voevodsky, The Simplicial Model of Univalent Foundations (arXiv:1211.2851)
Michael Shulman, The univalence axiom for elegant Reedy presheaves (arXiv:1307.6248)
David Gepner, Joachim Kock, Univalence in locally cartesian closed ∞-categories (arXiv:1208.1749)
A discussion of the correspondence between type theories and categories of various sorts, from lex categories to toposes is in