nLab categorical semantics of dependent type theory

Redirected from "comprehension category".
Categorical semantics of dependent types

Context

Type theory

natural deduction metalanguage, practical foundations

  1. type formation rule
  2. term introduction rule
  3. term elimination rule
  4. computation rule

type theory (dependent, intensional, observational type theory, homotopy type theory)

syntax object language

computational trinitarianism =
propositions as types +programs as proofs +relation type theory/category theory

logicset theory (internal logic of)category theorytype theory
propositionsetobjecttype
predicatefamily of setsdisplay morphismdependent type
proofelementgeneralized elementterm/program
cut rulecomposition of classifying morphisms / pullback of display mapssubstitution
introduction rule for implicationcounit for hom-tensor adjunctionlambda
elimination rule for implicationunit for hom-tensor adjunctionapplication
cut elimination for implicationone of the zigzag identities for hom-tensor adjunctionbeta reduction
identity elimination for implicationthe other zigzag identity for hom-tensor adjunctioneta conversion
truesingletonterminal object/(-2)-truncated objecth-level 0-type/unit type
falseempty setinitial objectempty type
proposition, truth valuesubsingletonsubterminal object/(-1)-truncated objecth-proposition, mere proposition
logical conjunctioncartesian productproductproduct type
disjunctiondisjoint union (support of)coproduct ((-1)-truncation of)sum type (bracket type of)
implicationfunction set (into subsingleton)internal hom (into subterminal object)function type (into h-proposition)
negationfunction set into empty setinternal hom into initial objectfunction type into empty type
universal quantificationindexed cartesian product (of family of subsingletons)dependent product (of family of subterminal objects)dependent product type (of family of h-propositions)
existential quantificationindexed disjoint union (support of)dependent sum ((-1)-truncation of)dependent sum type (bracket type of)
logical equivalencebijection setobject of isomorphismsequivalence type
support setsupport object/(-1)-truncationpropositional truncation/bracket type
n-image of morphism into terminal object/n-truncationn-truncation modality
equalitydiagonal function/diagonal subset/diagonal relationpath space objectidentity type/path type
completely presented setsetdiscrete object/0-truncated objecth-level 2-type/set/h-set
setset with equivalence relationinternal 0-groupoidBishop set/setoid with its pseudo-equivalence relation an actual equivalence relation
equivalence class/quotient setquotientquotient type
inductioncolimitinductive type, W-type, M-type
higher inductionhigher colimithigher inductive type
-0-truncated higher colimitquotient inductive type
coinductionlimitcoinductive type
presettype without identity types
set of truth valuessubobject classifiertype of propositions
domain of discourseuniverseobject classifiertype universe
modalityclosure operator, (idempotent) monadmodal type theory, monad (in computer science)
linear logic(symmetric, closed) monoidal categorylinear type theory/quantum computation
proof netstring diagramquantum circuit
(absence of) contraction rule(absence of) diagonalno-cloning theorem
synthetic mathematicsdomain specific embedded programming language

homotopy levels

semantics

Category theory

Categorical semantics of dependent types

Idea

In the relation between type theory and category theory, dependent types (in dependent type theory) have categorical semantics given by morphisms which are the bundles whose fibers are the families indexed by the base (see also at dependent type – Relation to families of elements).

More concretely: if a type AA interprets as an object in some category 𝒞\mathcal{C}, then an AA-dependent type

(x:A)B(x)Type (x \colon A) \;\;\;\vdash\;\;\; B(x) \;Type

interprets as a morphism BAB \to A in 𝒞\mathcal{C} (hence as an object in the slice category 𝒞 /A\mathcal{C}_{/A}). We may think of this morphism as a bundle or fibration, whose fiber over x:Ax \colon A is the type B(x)B(x). We can then say that type forming operations such as dependent sum type and dependent product type correspond to category-theoretic operations of dependent sum and dependent product.

However, this correspondence is not quite precise; in the case of dependent types there are extra coherence issues. Substitution in type theory should correspond to pullback in category theory (but see at substitution – Categorical semantics for more); that is, given a term

(y:C)(f(y):A) (y:C) \;\vdash\; (f(y) : A)

corresponding to a morphism f:CAf:C\to A, the substituted dependent type

(y:C)(B(f(y))type) (y:C) \;\vdash\; (B(f(y)) \;type)

should correspond to the pullback of BAB\to A along ff. However, substitution in type theory is strictly associative. That is, given also g:DCg:D\to C, the dependent type

(z:D)(B(f(g(z)))type) (z:D) \;\vdash\; (B(f(g(z))) \;type)

is syntactically the same regardless of whether we obtain it by substituting yg(z)y \coloneqq g(z) into B(f(y))B(f(y)), or xf(g(z))x \coloneqq f(g(z)) into B(x)B(x). In category theory, however, pullback is not generally strictly associative, so there is a mismatch. Similarly, every type-forming operation must also be strictly preserved by substitition/pullback.

The way this is generally dealt with is to introduce a category-theoretic structure which does have a “substitution” operation which is strictly associative, hence does correspond directly to type theory, and then show that any category can be “strictified” into such a stricter structure. Unfortunately, there are many different such structures which have been used, differing only slightly. On this page we define and compare them all.

One of these structures is called “contextual categories” (definition below).

This and other kinds of categories-with-extra-structure may hence be thought of as stand-ins for the syntax of a type theory:

Rather than constructing an interpretation of the syntax directly, we may work via the intermediary notion of contextual categories, a class of algebraic objects abstracting the key structure carried by the syntax. The plain definition of a contextual category corresponds to the structural core of the syntax; further syntactic rules (logical constructors, etc.) correspond to extra algebraic structure that contextual categories may carry. Essentially, contextual categories provide a completely equivalent alternative to the syntactic presentation of type theory.

Why is this duplication of notions desirable? The trouble with the syntax is that it is mathematically tricky to handle. Any full presentation must account for (among other things) variable binding, capture-free substitution, and the possibility of multiple derivations of a judgement; and so a direct interpretation must deal with all of these, at the same time as tackling the details of the particular model in question. By passing to contextual categories, one deals with these subtleties and bureaucracy once and for all, and obtains a clear framework for subsequently constructing models. Conversely, why not work only with contextual categories, dispensing with syntax entirely?

The trouble on this side is that working with higher-order logical structure in contextual categories quickly becomes unreadable. The reader preferring to take contextual categories as primary may regard the syntax as essentially a notation for working within them: a powerful, flexible, and intuitive notation, but one whose validity requires non-trivial work to establish. (The situation is comparable to that of string diagrams, as used in monoidal and more elaborately structured categories.)

(from Kapulkin-Lumsdaine 12)

Definitions

In all the definitions, CC will be a category. Generally, we will regard the objects of CC as contexts in a type theory.

So far, we do not assume anything about CC as a category. Usually, one at least wants CC to have a terminal object, representing the empty context, although this is not always included in the definitions. The additional structures we impose on CC below will imply in particular that certain pullbacks exist in CC.

Sometimes, we want to consider CC as a strict category, that is, we consider its objects up to equality rather than isomorphism. However, for most of the definitions below (until we get to contextual categories), it is still sensible to treat CC in an ordinary category-theoretic way, with the strictness living in the additional structure.

All of this could be made more precise by assembling the structures considered below into categories, 2-categories, and/or strict 2-categories.

Comprehension categories

Definition

A comprehension category consists of a strictly commutative triangle of functors

E C I cod C \array{ E && \to && C^I\\ & \searrow && \swarrow {\scriptsize cod} \\ && C }

where C IC^I is the arrow category of CC and cod:C ICcod \colon C^I \to C denotes the codomain projection (which is a fibration if CC has pullbacks), and such that

  1. ECE\to C is a Grothendieck fibration,

  2. EC IE\to C^I takes cartesian morphisms in EE to cartesian morphisms in C IC^I (i.e. to pullback squares in CC).

Remark

In def we do not ask that C ICC^I \to C be a fibration (that would require CC to have all pullbacks), only that the particular morphisms in the image of EE are cartesian.

Definition

A comprehension category (def. ) is called

In the latter case, we must consider EE at least to be a strict category (that is, we consider its objects up to equality rather than isomorphism) for the notion to make sense.

Remark

The interpretation of def. is as follows:

In a comprehension category, we may regard the objects of CC as contexts, and the fiber E ΓE^\Gamma of ECE\to C over an object Γ\Gamma as the category of dependent types in context Γ\Gamma. If the comprehension category is split (def. ), then such dependent types have strictly associative substitution.

The functor EC IE\to C^I assigns to each “type AA in context Γ\Gamma” a new context which we think of as Γ\Gamma extended by a fresh variable of type AA, and write as Γ.A\Gamma.A. This new context Γ.A\Gamma.A comes with a projection Γ.AΓ\Gamma.A\to \Gamma (which forgets the fresh variable), and all substitutions in EE are realized as pullbacks in CC.

Display map categories

Definition

A display map category consists of a category CC together with a class DD of morphisms in CC, called display maps, such that all pullbacks of display maps exist and are themselves display maps.

If CC is a display map category, then by defining EE to be the full subcategory of C IC^I whose objects are display maps, we obtain a full comprehension category (def. ). Thus, we have:

Lemma

Display map categories (def. ) may be identified with those comprehension categories, def. , for which the functor EC IE\to C^I is the inclusion of a full subcategory.

Remark

Working up to equivalence of categories, as is usual in category theory, it is natural to consider display map categories to also be equivalent to full comprehension categories, def. , (those where EC IE\to C^I is merely fully faithful).

However, this breaks down when we are interested in split comprehension categories, def. , for modeling substitution with strict associativity, since then EE at least must be regarded as a strict category and considered up to isomorphism rather than equivalence. Thus, display map categories may be said to be equivalent to non-split full comprehension categories, but “split display map categories” are not equivalent to split full comprehension categories. (In fact, split display map categories are not very useful; usually in order to make pullbacks strictly associative we have to introduce extra “names” for the same objects.)

Categories with attributes

Definition

A category with attributes is a comprehension category, def. , for which ECE\to C is a discrete fibration.

Remark

That is, in a category with attributes (def. ) we demand only that each context comes with a set of dependent types in that context, rather than a category of such. The intent is that the morphisms between two types in context Γ\Gamma should be determined by the morphisms in CC between the extended contexts over Γ\Gamma.

Another way to convey this same intent with a comprehension category would be to ask that it be full, def. , i.e. that the functor EC IE\to C^I be fully faithful.

In fact, any category with attributes gives rise to a full comprehension category by factoring the functor EC IE\to C^I into a bijective on objects functor followed by a fully faithful functor. In this way, we obtain:

Lemma

The category CwA\mathbf{CwA} of categories with attributes (def. ) is equivalent to the category CompCat full,split\mathbf{CompCat}_{\text{full,split}} of full split comprehension categories (def. ).

(These are, however, quite different as subcategories of CompCat\mathbf{CompCat}.)

Categories with families

A category with attributes specifies for each “context” only a set of “types” in that context. A comprehension category, by contrast, specifies a whole category of “types” in each context. If A,BE ΓA,B\in E^\Gamma, then we may think of a morphism f:ABf:A\to B in E ΓE^\Gamma as a term

(1)(x:Γ),(a:A(x))(f(x,a):B(x)) (\vec{x} : \Gamma), (a:A(\vec{x})) \;\vdash\; (f(\vec{x},a) : B(\vec{x}))

in type theory.
A category with families specifies instead, for each context and each type in that context, a set of “terms belonging to that type”. These should be thought of as terms

(2)(x:Γ)(f(x):B(x)) (\vec{x} : \Gamma) \;\vdash\; (f(\vec{x}) : B(\vec{x}))

in type theory.

Remark

A term of the form (1) can equivalently be regarded as a term of the form (2) by replacing Γ\Gamma by the extended context Γ.A\Gamma.A, and BB by its substitution along the projection Γ.AΓ\Gamma.A \to \Gamma.

The additional insight in the following definition is that if we expect all of these terms to be determined by the morphisms in CC, as in a category with attributes or a full comprehension category, then instead of specifying the functor EC IE\to C^I and then asking either that it be fully faithful or that EE be discrete (removing the information about extra morphisms in EE), if we specify the terms of the form (2), then the functor EC IE\to C^I is determined by a universal property.

Let FamFam denote the category of families of sets. Its objects are set-indexed families (A i) iI(A_i)_{i\in I}, and its morphisms (A i) iI(B j) jJ(A_i)_{i\in I} \to (B_j)_{j\in J} consist of a function f:IJf\colon I\to J and functions g i:A iB f(i)g_i \colon A_i \to B_{f(i)}. We can equivalently, of course, regard this as the arrow category Set ISet^I of Set, where (B j) jJ(B_j)_{j\in J} corresponds to the arrow BJ\coprod B \to J.

Definition

A category with families is a category CC together with

  • A functor F:C opFamF:C^{op} \to Fam, written F(Γ)=(Tm(A)) ATy(Γ)F(\Gamma) = (Tm(A))_{A\in Ty(\Gamma)}.

  • For each ΓC\Gamma\in C and ATy(Γ)A\in Ty(\Gamma), a representing object for the functor

    (C/Γ) op Set (ΔfΓ) Tm(f *(A)) \begin{aligned} (C/\Gamma)^{op} & \to Set\\ (\Delta \xrightarrow{f} \Gamma) & \mapsto Tm(f^*(A)) \end{aligned}

Intuitively, F(Γ)F(\Gamma) is the set of terms in the context Γ\Gamma indexed by their type, and the representing object for the map (C/Γ) opSet(C/\Gamma)^{op} \to Set is the projection from context Γ;A\Gamma; A to context Γ\Gamma.

We can then prove:

Lemma

Categories with attributes, def. are equivalent to categories with families, def. .

Proof

Given a category with families, let ECE\to C be the Grothendieck construction of the functor Ty:C opSetTy:C^{op}\to Set, and let EC IE\to C^I take each ATy(Γ)A\in Ty(\Gamma) to the above representing object. This is a category with attributes.

Conversely, given a category with attributes, let Ty:C opSetTy:C^{op}\to Set be the functor corresponding to the discrete fibration ECE\to C, and for ATy(Γ)A\in Ty(\Gamma) let Tm(A)Tm(A) be the set of sections of the morphism in CC that is the image of AA in C IC^I. These constructions are inverses up to isomorphism.

Natural Models

Awodey 2016 presented the following “natural model” of type theory as an alternative to categories with families.

Theorem

If we modify Def. by requiring only that the functors (ΔfΓ)Tm(f *(A))(\Delta \xrightarrow{f} \Gamma) \mapsto Tm(f^*(A)) be representable (rather than equipped with representing objects), then it is equivalent to giving

  1. a category CC, together with
  2. a morphism TmTyTm \to Ty in the category of presheaves on CC which is a representable morphism.

The category CC models the category of contexts and substitutions, and the morphism TmTyTm \to Ty models the bundle of (context-dependent) terms over (context-dependent) types. The representability models the extension of a context with a new typed variable.

The condition that TmTyTm \to Ty is a representable morphism in presheaves can be reformulated in terms of adjoints as follows: TmTyTm \to Ty is representable just if the associated functor TmTy{\int Tm} \to {\int Ty} has a right adjoint. Thus a natural model can be equivalently described as a category CC equipped with a natural transformation of presheaves TmTyTm \to Ty for which TmTy{\int Tm} \to {\int Ty} has a right adjoint.

This specification can be related to that of a , by reformulating the representability of the morphism TmTyTm \to Ty in terms of representable profunctors as follows. A natural model is equivalently described as:

  1. a category CC,
  2. a presheaf Ty:C^Ty : \hat C of types in context.
  3. a presheaf Tm:Ty^Tm : \widehat {\int Ty} of typed terms in context.
  4. a functor ext:Ty^Cext : \widehat {\int Ty} \to C of context extension with data that represents the profunctor Ty(ty,=)C(,ctx(ty(=))):TyC{\int Ty}(ty-,=) \odot C(-,ctx(ty(=))) : \int Ty ⇸ C where ty:TmTyty : \int Tm \to \int Ty and ctx:TyCctx : \int Ty \to C are the projections of the Grothendieck construction.

Writing the profunctor as P, it is equivalent to the following definition:

P(Δ,(Γ,A))=(γ:ΔΓ)×(a:Tm(Δ,A[γ]))P(\Delta, (\Gamma, A)) = (\gamma : \Delta \to \Gamma) \times (a : Tm(\Delta, A[\gamma]))

then the universal property of the context extension is that there is a natural isomorphism Δext(Γ,A)P(Δ,(Γ,A))\Delta \to ext(\Gamma, A) \cong P(\Delta,(\Gamma,A))

Categories with Representable Maps

Taichi Uemura introduced categories with representable maps? as a functorial semantics approach to type theory generalizing the notion of a Category with Families/Natural Model. A category with representable maps (CwR) is a category with finite limits with a specified class of “representable” arrows that are pullback-stable and exponentiable. The motivating examples are presheaf categories where the representable arrows are the representable morphisms in the usual sense. Then any CwR can be considered to be a type theory: for instance, the free CwR with a representable map TmTyTm \to Ty has as models precisely the natural models, and so can be thought of as the embodiment of the judgments of Martin-Lof Type Theory (with no connectives).

Contextual categories, or C-systems

Recall that

Definition

If CC is a comprehension category (def. ), ΓC\Gamma\in C is a “context” and AE ΓA\in E^\Gamma is a “type” in context Γ\Gamma, then we denote by Γ.A\Gamma.A the “extended context” in CC (remark ).

Definition

A contextual category (Cartmell 86, Streicher 91) or C-system (Voevodsky 15) is a category with attributes CC (def. ) together with a length function :ob(C)\ell : ob(C) \to \mathbb{N} such that

  1. There is a unique object of length 00, which is a terminal object.
  2. For any ΓC\Gamma\in C and AE ΓA\in E^\Gamma, we have (Γ.A)=(Γ)+1\ell(\Gamma.A) = \ell(\Gamma)+1.
  3. For any ΔC\Delta\in C with (Δ)>0\ell(\Delta)\gt 0, there exists a unique ΓC\Gamma\in C and AE ΓA\in E^\Gamma such that Δ=Γ.A\Delta = \Gamma.A (with notation as in def. ).
Remark

Since def. refers to equality of objects, a contextual category CC must be a strict category.

Remark

The idea which distinguishes a contextual category is that “every context must be built out of types” in a unique way.

This makes for the closest match with type theory; in fact we have:

Theorem

The category of contextual categories, def. , and (strictly) structure-preserving functors is equivalent to the category of dependent type theories and interpretations?.

Remark

Since contextual categories are strict categories, the category of such is really a 1-category, or perhaps a strict 2-category.

Example

Given any category with attributes CC, def. , possessing a terminal object, there is a canonical way to build a contextual category cxt(C)cxt(C), def. , from it.

  1. Choose a terminal object 1C1\in C (the resulting contextual category does not depend on this choice, up to isomorphism).

  2. The objects of cxt(C)cxt(C) are the finite lists

    (A 0,A 1,,A n)(A_0,A_1,\dots,A_n)

    such that A 0E 1A_0 \in E^1 and A k+1E 1.A 0.A 1..A kA_{k+1} \in E^{1.A_0.A_1.\cdots .A_k} for all kk.

  3. The morphisms (A 0,,A n)(B 0,,B m)(A_0,\dots,A_n) \to (B_0,\dots,B_m) in cxt(C)cxt(C) are the morphisms 1.A 0.A 1..A n1.B 0.B 1..B m1.A_0.A_1.\cdots.A_n \to 1.B_0.B_1.\cdots.B_m in CC.

All the rest of the structure on cxt(C)cxt(C) is induced in an evident way from CC. This construction is in fact right adjoint to the inclusion of contextual categories in categories with attributes; see Kapulkin-Lumsdaine, Proposition 4.4.

Examples

Comprehension categories and display map categories are easy to come by “in nature”, but it is more difficult to find examples of the “split” versions of the above structure (which are what is needed for modeling type theory). Here we summarize some basic known constructions.

However, first we should mention the examples that come from type theory itself.

Syntactic categories

Example

The syntactic category of any dependent type theory has all of the above structures. Its objects are contexts in the theory, and the types in context Γ\Gamma form the set or category E ΓE^\Gamma. The strict associativity of substitution in type theory makes this fibration automatically split.

Splitting fibrations

There are standard constructions which can replace any Grothendieck fibration by an equivalent split fibration. Therefore,

Example

Given any comprehension category, def. ,

  1. we may replace it by a split comprehension category, def. ,

  2. then consider the underlying category with attributes, def. ,

  3. and finally pass to a contextual category by the construction in example .

Of course, comprehension categories are easy to come by; perhaps they arise most commonly as display map categories. For instance, if CC has all pullbacks, then we can take all maps to be display maps. If CC is a category of fibrant objects, we can take the fibrations to be the display maps.

So, for the record, we have in particular:

Example

For CC a locally cartesian closed category CC, it becomes a model for dependent type theory by regarding its codomain fibration C ICC^I \to C as a comprehension category, def. , and then strictifying that as in example .

Remark

It turns out that for modeling additional type-forming operations, however, not all splitting constructions are created equal.

Given ECE\to C, one construction due to Benabou (called the “right adjoint splitting”), defines ECE'\to C, where the objects of EE' over ΓC\Gamma\in C are functors C/ΓEC/\Gamma \to E over CC which map every morphism of C/ΓC/\Gamma to a cartesian arrow. Type-theoretically, we can think of such an object as a type together with specified compatible substitutions along any possible morphism. That type-formers may be extended in this case was proven by Martin Hofmann for dependent sums and dependent products and the identity types of extensional type theory. But this is not generally possible for the identity types of intensional type theory (particularly not their eliminator), which do not have a 1-categorical universal property and hence are not stable under pullback up to isomorphism.

A different construction (due to John Power, called the “left adjoint splitting”) defines an object of EE' over ΓC\Gamma\in C to consist of a morphism f:ΓΔf:\Gamma \to \Delta in CC along with an object AA of EE over Δ\Delta. Type-theoretically, we can regard (f,A)(f,A) as a type AA with a “delayed substitution” ff. This produces a split fibration (the chosen cartesian arrows are given by composition of morphisms in CC), and it was proven by Lumsdaine & Warren (2015) that essentially all type formers can be extended to it from EE.

Universes

Suppose given a particular morphism p:U˜Up:\widetilde{U} \to U in CC. We can then define a category with attributes, def. , as follows: the discrete fibration ECE\to C corresponds to the representable presheaf C(,U)C(-,U), and the functor EC IE\to C^I is defined by pullback of pp. We are thus treating UU as a “universe” of types. We may then of course pass to a contextual category, via example .

Type-forming operations may be extended strictly in this case by performing them once in the “universal” case, then acting by composition. This construction is due to Voevodsky. It also meshes quite well with type theories that contain internal universes – a type of types– , and in particular for modeling the univalence axiom.

Particular important universes include:

Simple fibrations

Let CC be any category with finite products, and define ECE\to C to be the discrete fibration corresponding to the presheaf C opSetC^{op}\to Set which is constant at ob(C)ob(C). Thus, the objects of EE are pairs (Γ,A)(\Gamma,A) of objects of CC, with the only morphisms being of the form (Γ,A)(Δ,A)(\Gamma,A) \to (\Delta,A) induced by a morphism ΓΔ\Gamma\to\Delta in CC.

Define the functor EC IE\to C^I to take (Γ,A)(\Gamma,A) to the projection Γ×AΓ\Gamma\times A \to \Gamma. It is straightforward to check that this defines a category with attributes. The corresponding (split) full comprehension category is called the simple fibration of CC.

The dependent type theory which results from this structure “has no nontrivial dependency”. That is, whenever we have a dependent type Γ(Atype)\Gamma \vdash (A \;type), it is already the case that AA is a type in the empty context (that is, we have (Atype)\vdash (A\; type)), and so it cannot depend nontrivially on Γ\Gamma. In effect, it is not really a dependent type theory, but a simple (non-dependent) type theory — hence the name “simple fibration”.

The big model of locally cartesian closed categories

Example

Ignoring coherence issues, the CwF induced by a locally cartesian closed (lcc) category 𝒞\mathcal{C} (example ) is given explicitly by the “Explicit” column of the following table:

In 𝒞\mathcal{C}: ExplicitIn terms of slices of 𝒞\mathcal{C}Big model
ContextsObjects Γ𝒞\Gamma \in \mathcal{C}Slice categories 𝒞 /Γ\mathcal{C}_{/ \Gamma}Lcc categories Γ\Gamma
Context MorphismsMorphisms f:ΓΔf : \Gamma \rightarrow \DeltaLcc functors f *:𝒞 /Δ𝒞 /Γf^* : \mathcal{C}_{/ \Delta} \rightarrow \mathcal{C}_{/ \Gamma} over 𝒞\mathcal{C}Lcc functors f:ΔΓf : \Delta \rightarrow \Gamma
TypesMorphisms σ:domσΓ\sigma : \operatorname{dom} \sigma \rightarrow \GammaObjects σ𝒞 /Γ\sigma \in \mathcal{C}_{/ \Gamma}Objects σΓ\sigma \in \Gamma
TermsSections s:Γdomσ:σs : \Gamma \leftrightarrows \operatorname{dom} \sigma : \sigmaMorphisms s:id Γσs : \mathrm{id}_\Gamma \rightarrow \sigma in 𝒞 /Γ\mathcal{C}_{/ \Gamma}Morphisms s:1σs : 1 \rightarrow \sigma in Γ\Gamma, where 11 is a terminal object.
SubstitutionPullback along ffApplication of f *f^*Application of ff

The next column describes the same CwF in the terminology of slice categories: Every object of 𝒞\mathcal{C} corresponds to a slice category 𝒞 /Γ\mathcal{C}_{/ \Gamma} over 𝒞\mathcal{C}, and 𝒞 /Γ\mathcal{C}_{/ \Gamma} is also lcc. Every morphism f:ΓΔf : \Gamma \rightarrow \Delta in 𝒞\mathcal{C} induces a pullback functor f *:𝒞 /Δ𝒞 /Γf^* : \mathcal{C}_{/ \Delta} \rightarrow \mathcal{C}_{/ \Gamma}. f *f^* preserves the finite limits and dependent products of 𝒞 /Δ\mathcal{C}_{/ \Delta} (i.e. it is an lcc functor), and the diagram

𝒞 Δ * Γ * 𝒞 /Δ f * 𝒞 /Γ \array{ && \mathcal{C} \\ & {}_{\Delta^*} \swarrow && \searrow_{\Gamma^*} \\ \mathcal{C}_{/ \Delta} && \stackrel{\to}{f^*} && \mathcal{C}_{/ \Gamma} }

commutes (up to unique isomorphism). Conversely, every lcc functor 𝒞 /Δ𝒞 /Γ\mathcal{C}_{/ \Delta} \rightarrow \mathcal{C}_{/ \Gamma} under 𝒞\mathcal{C} is uniquely isomorphic to the pullback functor along some morphism ΓΔ\Gamma \rightarrow \Delta.

The last column describes the big model of type theory in the opposite category of lcc categories and lcc functors. Since the contexts of this model are itself models of type theory, it can be understood as a “model of models”. The definition of the big model can be arrived at by removing all reference to the fixed lcc category 𝒞\mathcal{C} in the previous column. Instead of just the slice categories of 𝒞\mathcal{C}, now all lcc categories are allowed as contexts. Context morphisms are generalized to general lcc functors instead of just the pullback functors of 𝒞\mathcal{C}. The identity morphism on an object Γ\Gamma of 𝒞\mathcal{C} is a terminal object in the slice category 𝒞 /Γ\mathcal{C}_{/ \Gamma} and is thus generalized to a terminal object in any lcc category.

The usual model in a fixed lcc category 𝒞\mathcal{C} can be recovered from the big model by slicing: The contextual core (example ) of the slice of the big model over 𝒞\mathcal{C} is equivalent to 𝒞\mathcal{C}.

However, the naive definition of the big model above suffers from the same coherence issues as the standard models in individual lcc categories: Lcc functors preserve lcc structure (i.e. type formers) up to isomorphism, but not necessarily up to equality. These coherence problems can be resolved by working with a suitable model categorical presentation of the (2,1)(2, 1)-category of lcc categories, lcc functors and natural isomorphisms. Note that the model category presenting a higher category is unique up to zig-zag of Quillen equivalences, but that the underlying 1-categories of these model categories can vary non-trivially. Because coherence issues are ultimately about equations in the underlying 1-category, we can thus hope that some model categories presenting the category of lcc categories will be better behaved than others for our purpose.

One possible way to construct such a well-behaved model category is as follows (see (Bidlingmaier 2020) for details):

  1. First one defines a model category Lcc\mathrm{Lcc} of lcc sketches. An lcc sketch is a category with some diagrams marked as finite limits cones and evalution maps of dependent products. These marked diagrams do not need to satisfy the corresponding universal property, however. The model category structure is set up such that every object is cofibrant, and the fibrant objects are precisely the lcc categories with diagrams marked if and only if they satisfy the corresponding universal property. Thus the subcategory of fibrant objects of Lcc\mathrm{Lcc} corresponds to the usual category of lcc categories. Note however, that lcc categories in the sense of fibrant lcc sketches “have” finite limits and dependent products in the sense that these universal objects merely exist; there are no distinguished/assigned choices of universal objects. Thus preservation of universal objects by functors up to equality (i.e. strictness of substitution) cannot even be stated in Lcc\mathrm{Lcc}.

  2. The model category sLcc\mathrm{sLcc} of strict lcc categories is defined as the category of algebraically fibrant objects of Lcc\mathrm{Lcc}; it is Quillen equivalent to Lcc\mathrm{Lcc}. Assigned lifts against the trivial cofibrations of Lcc\mathrm{Lcc} correspond to distinguished choices of universal objects, and these choices are preserved by the morphisms of sLcc\mathrm{sLcc}, the strict lcc functors. Thus sLcc\mathrm{sLcc} supports substitutions that preserve type formers up to equality.

    However, it does not support some dependent type formers in any obvious way, notably not Σ\Sigma and Π\Pi types. The problem is that the context extension Γ.σ\Gamma.\sigma of some ΓObsLcc\Gamma \in \operatorname{Ob} \mathrm{sLcc} by a type (i.e. object) σ\sigma of Γ\Gamma is given by freely (in the 1-categorical sense) adjoining a morphism 1σ1 \rightarrow \sigma to Γ\Gamma. To interpret Σ\Sigma and Π\Pi types, one has to relate Γ.σ\Gamma.\sigma with the slice category Γ /σ\Gamma_{/ \sigma} in some way, and it appears that this is not generally possible. Note that Γ /σ\Gamma_{/ \sigma} has the universal property of a context extension in the higher/bicategorical sense, but that Γ.σ\Gamma.\sigma is defined purely 1-categorically.

  3. To reconcile context extensions Γ.σ\Gamma.\sigma with slice categories Γ /σ\Gamma_{/ \sigma}, one can work with the algebraically cofibrant objects of sLcc\mathrm{sLcc}. An algebraically cofibrant object of sLcc\mathrm{sLcc} is a coalgebra for a fixed cofibrant replacement comonad. The category of such coalgebras has model category structure, and this model category is again Quillen equivalent to sLcc\mathrm{sLcc}.

    A cofibrant object Γ\Gamma of sLcc\mathrm{sLcc} has the property that every non-strict lcc functor (i.e. morphism of underlying lcc sketches) out of Γ\Gamma is isomorphic to a strict lcc functor. This property turns out to be sufficient to construct a weak equivalence Γ.σΓ /σ\Gamma.\sigma \rightarrow \Gamma_{/ \sigma} in sLcc\mathrm{sLcc}. For algebraically cofibrant Γ\Gamma, this weak equivalence is structure and hence preserved by coalgebra morphisms up to equality. This turns out to be sufficient to endow the category of algebraically cofibrant objects of sLcc\mathrm{sLcc} with CwF structure that supports finite limit, Σ\Sigma and Π\Pi type constructors.

References

The general idea of categorical semantics of dependent types goes back at least to Seely 1984, a first formalization via categories with display maps (“clans”) is due to:

General overview:

which originates as

Texbook accounts:

Comprehension categories are defined in

A 2-categorical treatment of variant kinds of comprehension category is given in

A correspondence with orthogonal factorization systems is discussed in

  • Clemens Berger, Ralph M. Kaufmann, Comprehensive factorisation systems (pdf)

Categories with attributes are discussed in

Categories with families are defined in

and shown to be equivalent to categories with attributes in Hofmann (1997)

The formulation in terms of representable natural transformations (natural models of homotopy type theory) is due to:

See also

A proof of initiality for dependent type theory is claimed in

  • Simon Castellan, Dependent type theory as the initial category with families, 2014 (pdf)

This was formalized inside type theory with set quotients of higher inductive types in:

Contextual categories were defined in

Review:

Contextual categories as models for homotopy type theory are discussed in

Further discussion of contextual categories is in

Discussion of B-systems, another essentially algebraic model, is in

The model of dependent type theory with dependent product types/dependent function types in locally cartesian closed categories was first made explicit 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

and

See also:

Comparisons of various models can be found in

Recent work on abstract definitions of (models of) type theory include:

A category with families structure is constructed on the (2,1)(2,1)-category of all locally cartesian closed categories, which since locally presentable may be treated via model categories, in:

An equivalence between contextual categories and B-systems is in:

Last revised on June 6, 2024 at 18:38:13. See the history of this page for a list of all contributions to it.