Hostname: page-component-78c5997874-v9fdk Total loading time: 0 Render date: 2024-11-05T19:48:07.998Z Has data issue: false hasContentIssue false

A general framework for the semantics of type theory

Published online by Cambridge University Press:  24 July 2023

Taichi Uemura*
Affiliation:
Institute for Logic, Language and Computation, University of Amsterdam, Amsterdam, Netherlands Email: [email protected]
Rights & Permissions [Opens in a new window]

Abstract

We propose an abstract notion of a type theory to unify the semantics of various type theories including Martin–Löf type theory, two-level type theory, and cubical type theory. We establish basic results in the semantics of type theory: every type theory has a bi-initial model; every model of a type theory has its internal language; the category of theories over a type theory is bi-equivalent to a full sub-2-category of the 2-category of models of the type theory.

Type
Special Issue: Homotopy Type Theory 2019
Creative Commons
Creative Common License - CCCreative Common License - BY
This is an Open Access article, distributed under the terms of the Creative Commons Attribution licence (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted re-use, distribution and reproduction, provided the original article is properly cited.
Copyright
© The Author(s), 2023. Published by Cambridge University Press

1 Introduction

One of the key steps in the semantics of type theory and logic is to establish a correspondence between theories and models. Every theory generates a model called its syntactic model, and every model has a theory called its internal language. Classical examples are simply typed $\lambda$ -calculi and cartesian closed categories (Lambek and Scott Reference Lambek and Scott1986); generalized algebraic theories and contextual categories (Cartmell Reference Cartmell1978); extensional Martin–Löf theories and locally cartesian closed categories (Seely Reference Seely1984); first-order theories and hyperdoctrines (Seely Reference Seely1983); higher order theories and elementary toposes (Lambek and Scott Reference Lambek and Scott1986). Recently, homotopy type theory (The Univalent Foundations Program 2013) is expected to provide an internal language for what should be called “elementary $(\infty, 1)$ -toposes.” As a first step, Kapulkin and Szumiło (2019) showed that there is an equivalence between intensional Martin–Löf theories and finitely complete $(\infty,1)$ -categories.

As there exist correspondences between theories and models for almost all type theories and logics, it is natural to ask if one can define a general notion of a type theory or logic and establish correspondences between theories and models uniformly. First, we clarify what we informally mean by “type theory,” “logic,” “theory,” and “model”. By a type theory or logic, we mean a formal system for deriving judgments which is specified by a collection of inference rules. For example, first-order logic is a logic and has inference rules for logical connectives and quantifiers such as $\land$ and $\forall$ . For a type theory or logic $\mathbb{T}$ , by a $\mathbb{T}$ -theory or theory over $\mathbb{T}$ we mean a set of constants and axioms written in $\mathbb{T}$ , while by a model of $\mathbb{T}$ we mean a mathematical structure that admits an interpretation of the inference rules of $\mathbb{T}$ . For example, a first-order theory is a theory over first-order logic and consists of type constants, term constants, predicate constants, and axioms, while a hyperdoctrine is a model of first-order logic and interprets, for instance, the universal quantifier $\forall$ as a right adjoint.

A successful syntactic approach to defining general type theories and logics is a logical framework such as the Edinburgh Logical Framework (Harper et al. Reference Harper, Honsell and Plotkin1993) and Martin–Löf’s logical framework (Nordström et al. Reference Nordström, Petersson and Smith1990). A logical framework is a special kind of type theory such that a variety of type theories are encoded by a theory over the logical framework which is also called a signature. However, a logical framework often lacks a good notion of a model of a signature. Models of a signature may not even form a category (Capriotti Reference Capriotti2016).

In this paper, we propose an abstract notion of a type theory from a semantic point of view and establish a correspondence between theories and models. Our notion of a type theory includes a wide range of type theories: Martin–Löf type theory (Martin-Löf Reference Martin-Löf1975); two-level type theory (Altenkirch et al. Reference Altenkirch, Capriotti, Kraus, Talbot and Regnier2016; Annenkov et al. Reference Annenkov, Capriotti, Kraus and Sattler2023; Voevodsky Reference Voevodsky2013); cubical type theory (Cohen et al. Reference Cohen, Coquand, Huber, Mörtberg and Uustalu2018). Roughly speaking, our type theories are the type theories that admit semantics based on categories with families (cwfs) (Dybjer Reference Dybjer, Berardi and Coppo1996). Our contribution is to establish a correspondence between theories and cwf-like models for a wide variety of type theories.

Our notion of a type theory is inspired by the notion of a natural model of homotopy type theory given by Awodey (Reference Awodey2018). He pointed out that a category with families is the same thing as a representable map of presheaves Footnote 1 and that type and term constructors are modeled by algebraic operations on presheaves. Thus, a cwf-model of a type theory is a diagram in a presheaf category in which some maps are required to be representable. In other words, a cwf-model is a functor F from a category $\mathbb{T}$ to a presheaf category such that some arrows in $\mathbb{T}$ are marked “representable” and F sends representable arrows in $\mathbb{T}$ to representable maps of presheaves. The category $\mathbb{T}$ is considered to encode derivations as arrows, and the functor F is considered to interpret derivations as maps of presheaves. From this observation, we define a type theory to be a category with representable arrows and a model of a type theory to be a functor to a presheaf category that sends representable arrows to representable maps of presheaves.

For a type theory $\mathbb{T}$ in this sense, a $\mathbb{T}$ -theory is also defined as a functor from $\mathbb{T}$ but to the category of sets. The intuition behind this definition is different from that of a model of $\mathbb{T}$ : for a model of $\mathbb{T}$ , the values at arrows are relevant; for a $\mathbb{T}$ -theory, the values at objects are relevant. Objects in $\mathbb{T}$ are domains and codomains of derivations and thought of as judgment forms such as “is a type” and “is a term of a type” in Martin–Löf type theory (Nordström et al. Reference Nordström, Petersson and Smith1990). We identify a $\mathbb{T}$ -theory K with the assignment to each object $A \in \mathbb{T}$ of the set of closed derivations of judgment form A that are derivable using inference rules of $\mathbb{T}$ and constants of K.

With these definitions of a type theory, a model of a type theory and a theory over a type theory, we establish a correspondence between theories and models in a purely categorical way. For a type theory $\mathbb{T}$ , the models of $\mathbb{T}$ form a 2-category $\mathfrak{Mod}_{\mathbb{T}}$ and the theories over $\mathbb{T}$ form a category $\mathbf{Th}_{\mathbb{T}}$ . We construct a 2-functor $\mathrm{L}_{\mathbb{T}} : \mathfrak{Mod}_{\mathbb{T}} \to \mathbf{Th}_{\mathbb{T}}$ (regarding $\mathbf{Th}_{\mathbb{T}}$ as a locally discrete 2-category) which assigns to each model of $\mathbb{T}$ its internal language. We have two main results. The first main result is that the 2-functor $\mathrm{L}_{\mathbb{T}}$ has a left bi-adjoint $\mathbf{M}_{\mathbb{T}}$ (Theorem 7.20), which assigns to each theory over $\mathbb{T}$ its syntactic model. It will turn out that the left bi-adjoint $\mathbf{M}_{\mathbb{T}}$ is locally an equivalence and thus induces a bi-equivalence between $\mathbf{Th}_{\mathbb{T}}$ and the bi-essential image of $\mathbf{M}_{\mathbb{T}}$ . The second main result is a characterization of the models of $\mathbb{T}$ that belong to the bi-essential image of $\mathbf{M}_{\mathbb{T}}$ . We introduce a notion of a democratic model of $\mathbb{T}$ , generalizing the notion of a democratic cwf (Clairambault and Dybjer Reference Clairambault and Dybjer2014), and show that the bi-essential image of $\mathbf{M}_{\mathbb{T}}$ is precisely the class of democratic models. Consequently, we have a bi-equivalence between the locally discrete 2-category $\mathbf{Th}_{\mathbb{T}}$ and the full sub-2-category $\mathfrak{Mod}_{\mathbb{T}}^{\mathrm{dem}} \subset \mathfrak{Mod}_{\mathbb{T}}$ consisting of democratic models (Theorem 7.31).

A logical framework is still useful to construct concrete examples of our type theories. We introduce a logical framework whose signatures can be identified with type theories in our sense. This logical framework is semantically motivated and thus designed to have a nice 2-category of models of a signature. At the same time, this logical framework is sufficiently expressive to encode various type theories including Martin–Löf type theory, two-level type theory, and cubical type theory as promised.

1.1 Organization

In Section 3, we review natural models of type theories. Natural models are described in terms of presheaves, but we will work with discrete fibrations instead of presheaves. In Section 4, we introduce a notion of a category equipped with a class of representable arrows and call it a representable map category. A type theory is then defined to be a (small) representable map category. We also define the 2-category $\mathfrak{Mod}_{\mathbb{T}}$ of models of a type theory $\mathbb{T}$ .

The rest of the paper splits into two branches independent of each other. One branch (Section 5) is devoted to giving examples of our type theories. We introduce a logical framework whose signatures can be identified with representable map categories. We construct a syntactic representable map category from a signature of the logical framework and show that the syntactic representable map category of a signature has an appropriate universal property (Theorem 5.17). Using the universal property, we concretely describe the 2-category of models of a type theory defined in the logical framework (Theorem 5.19).

On the other branch (Sections 6 and 7), we develop the semantics of our type theories. In Section 6, we construct a bi-initial model of a type theory (Theorem 6.10). We also introduce the notion of a democratic model here. In Section 7, we define the category $\mathbf{Th}_{\mathbb{T}}$ of theories over a type theory $\mathbb{T}$ and show the main results. Using bi-initial models we construct the left bi-adjoint of the internal language 2-functor $\mathrm{L}_{\mathbb{T}} : \mathfrak{Mod}_{\mathbb{T}} \to \mathbf{Th}_{\mathbb{T}}$ (Theorem 7.20). We then show that this bi-adjunction induces a bi-equivalence $\mathfrak{Mod}_{\mathbb{T}}^{\mathrm{dem}} \simeq \mathbf{Th}_{\mathbb{T}}$ (Theorem 7.31).

1.2 Related work

Bauer et al. (Reference Bauer, Haselwarter and Lumsdaine2020) propose a general definition of syntax and rules for dependent type theories. Properties on sets of rules such as admissibility of substitution are proved at a high level of generality. Such properties are not in the scope of our semantic framework because we take substitution for granted as part of the structure of a model of a type theory. The author’s PhD thesis (Uemura Reference Uemura2021, Chapter 4) contains a generalization of Bauer et al.’s approach as syntactic counterparts of representable map categories.

Our style of the semantics of type theories is a variant of the functorial semantics initiated by Lawvere (Reference Lawvere1963). The original work is the functorial semantics of algebraic theories in which an algebraic theory is identified with a category of some sort and a model of an algebraic theory is identified with a set-valued functor from that category. A noticeable difference is that a model in our functorial semantics of type theories is a functor valued in presheaves over a category instead of sets. The base category plays the role of the category of contexts and substitutions and is essential to interpretation of context extensions.

One limitation of our framework is that nontrivial operations on contexts are not allowed. Thus, type theories with “dual-contexts” (e.g. Licata et al. Reference Licata, Orton, Pitts, Spitters and Kirchner2018; Pfenning and Davies Reference Pfenning and Davies2001; Shulman Reference Shulman2018) or modal type theories (e.g. Birkedal et al. Reference Birkedal, Clouston, Mannaa, Ejlers Møgelberg, Pitts and Spitters2020; Gratzer et al. Reference Gratzer, Kavvos, Nuyts and Birkedal2021) are not covered by our definition. The framework of Licata et al. (Reference Licata, Shulman, Riley and Miller2017) is suitable for defining simple type theories with operations on contexts, but its dependently typed version (Licata et al. Reference Licata, Riley and Shulman2019) has not been finished.

After the manuscript of this paper had been written, Hoang Kim Nguyen and the author have developed a theory of an $\infty$ -categorical generalization of type theories called $\infty$ -type theories (Nguyen and Uemura Reference Nguyen and Uemura2022). The results of Sections 6 and 7 are subsumed by analogous results on $\infty$ -type theories. Nevertheless, it is still worth presenting the 1-categorical case because all the constructions in this paper are explicit, while the $\infty$ -categorical proofs are nonconstructive in the current foundations for $\infty$ -category theory using quasicategories (Cisinski Reference Cisinski2019; Lurie Reference Lurie2009). Also, a logical framework for $\infty$ -type theories has not yet been developed.

2. Preliminaries

We fix terminology and notation on categories and 2-categories.

  1. (1) We refer the reader to Kelly and Street (Reference Kelly, Street and Kelly1974) for basic concepts of 2-category theory.

  2. (2) In general we use prefix “2-” for strict 2-categorical notions and prefix “bi-” or “pseudo-” for weak 2-categorical notions: the composition of 1-cells in a 2-category is associative up to equality, while that in a bi-category is associative only up to coherent isomorphism; a 2-functor preserves composition of 1-cells on the nose, while a pseudo-functor does only up to coherent isomorphism. An exception is that pseudo-(co)limits satisfy strict 2-categorical universal properties.

  3. (3) Let P be some property on a functor. We say a 2-functor $F : \mathfrak{A} \to \mathfrak{B}$ is locally P if the functor $F : \mathfrak{A}(A, A') \to \mathfrak{B}(FA, FA')$ satisfies P for all objects $A, A' \in \mathfrak{A}$ . For example, F is locally fully faithful if the functor $F : \mathfrak{A}(A, A') \to \mathfrak{B}(FA, FA')$ is fully faithful for all objects $A, A' \in \mathfrak{A}$ .

  4. (4) Let $F : \mathfrak{A} \to \mathfrak{B}$ be a 2-functor. We say F is bi-essentially surjective on objects if, for any object $B \in \mathfrak{B}$ , there exists an object $A \in \mathfrak{A}$ such that FA is equivalent to B in $\mathfrak{B}$ . We say F is a bi-equivalence if it is bi-essentially surjective on objects, locally essentially surjective on objects and locally fully faithful.

  5. (5) A 2-functor $F : \mathfrak{A} \to \mathfrak{B}$ is said to have a left bi-adjoint if, for any object $B \in \mathfrak{B}$ , there exist an object $GB\in \mathfrak{A}$ and a 1-cell $\eta_{B} : B \to F GB$ such that, for any object $A \in \mathfrak{A}$ , the composite

    is an equivalence of categories. The 1-cell $\eta_{B} : B \to FGB$ is called the unit. For an object $A \in \mathfrak{A}$ , we have a 1-cell $\varepsilon_{A} : GFA \to A$ called the counit such that $F \varepsilon_{A} \circ \eta_{FA}$ is isomorphic to the identity on FA.
  6. (6) One can show that if a 2-functor F has a left bi-adjoint and the unit and counit are equivalences, then F is a bi-equivalence.

  7. (7) We say a category $\mathcal{C}$ is contractible if the unique functor $\mathcal{C} \to 1$ into the terminal category is an equivalence. In other words, $\mathcal{C}$ has some object and, for any objects $A, B \in \mathcal{C}$ , there exists a unique arrow $A \to B$ .

  8. (8) An object A of a 2-category $\mathfrak{A}$ is bi-initial if the category $\mathfrak{A}(A, B)$ is contractible for any object $B \in \mathfrak{A}$ .

  9. (9) For a category $\mathcal{C}$ , we denote by $|\mathcal{C}|$ the largest groupoid contained in $\mathcal{C}$ , that is, the subcategory of $\mathcal{C}$ consisting of all the objects and the isomorphisms.

  10. (10) A cartesian category is a category that has finite limits. A cartesian functor between cartesian categories is a functor that preserves finite limits.

  11. (11) We fix a Grothendieck universe $\mathscr{U}$ . By “small” we mean “ $\mathscr{U}$ -small”.

  12. (12) $\mathbf{Set}$ denotes the category of small sets. $\mathfrak{Cat}$ denotes the 2-category of small categories.

  13. (13) For a functor $K : \mathcal{C} \to \mathbf{Set}$ and an arrow $f : A \to A'$ in $\mathcal{C}$ , we denote by $(f \cdot {-})$ the map $K(f) : K(A) \to K(A')$ . For a contravariant functor $P : \mathcal{C}^{\mathrm{op}} \to \mathbf{Set}$ , we denote by $({-} \cdot f)$ the map $P(f) : P(A') \to P(A)$ for an arrow $f : A \to A'$ in $\mathcal{C}$ . We use similar notation for pseudo-functors $\mathcal{C} \to \mathfrak{Cat}$ .

3. Natural Models of Type Theory

We review natural models of dependent type theory (Awodey Reference Awodey2018). Natural models are described in terms of presheaves and representable natural transformations, but we prefer to work with discrete fibrations instead of presheaves. While presheaves are intuitive and convenient to describe concrete examples of models of a type theory, discrete fibrations are convenient for the study of the 2-category of models of a type theory. Concretely, a model of a type theory will simply be a $\mathfrak{Cat}$ -valued 2-functor (Remark 4.7). This section is mostly devoted to rephrasing the theory of natural models in terms of discrete fibrations. Proposition 3.21 might be new to the reader: the pushforward along a representable map of discrete fibrations is given by the pullback along the right adjoint of the representable map.

3.1 Discrete fibrations

Definition 3.1 A discrete fibration is a functor $p : A \to \mathcal{S}$ such that, for any object $a \in A$ and arrow $u : J \to p(a)$ in $\mathcal{S}$ , there exists a unique arrow $m : b \to a$ such that $p(m) = u$ . Such a unique arrow is denoted by $\overline{u}_{a} : u^{*}a \to a$ or $a \cdot u \to a$ . When $p : A \to \mathcal{S}$ is a discrete fibration, we say A is a discrete fibration over $\mathcal{S}$ and refer to the functor p as $p_{A}$ . For a discrete fibration A over $\mathcal{S}$ , a discrete fibration B over $\mathcal{T}$ and a functor $F : \mathcal{S} \to \mathcal{T}$ , a map $A \to B$ of discrete fibrations over F is a functor $f : A \to B$ such that $p_{B} \circ f = F \circ p_{A}$ . A map of discrete fibrations over the identity functor on $\mathcal{S}$ is called a map of discrete fibrations over $\mathcal{S}$ . For discrete fibrations A and B over $\mathcal{S}$ , we denote by $\mathbf{DFib}_{\mathcal{S}}(A, B)$ the class of maps $A \to B$ of discrete fibrations over $\mathcal{S}$ . For a small category $\mathcal{S}$ , we will refer to the category of small discrete fibrations over $\mathcal{S}$ and their maps as $\mathbf{DFib}_{\mathcal{S}}$ .

We recall some basic properties on discrete fibrations.

Proposition 3.2. For a functor $p : A \to \mathcal{S}$ , the following are equivalent.

  1. (1) p is a discrete fibration.

  2. (2) The diagram

    is a pullback.
  3. (3) For any object $a \in A$ , the functor $A/a \to \mathcal{S}/p(a)$ induced by p is an isomorphism.

Proof. The implications and are immediate. To see , suppose that p is a discrete fibration. By definition, the functor $A^{\to} \to A \times_{\mathcal{S}} \mathcal{S}^{\to}$ is bijective on objects. To see that this functor is also fully faithful, let $f_{1} : a_{1} \to a_{1}'$ and $f_{2} : a_{2} \to a_{2}'$ be objects in $A^{\to}$ , let $g : a_{1}' \to a_{2}'$ be an arrow in A, let $u : p(a_{1}) \to p(a_{2})$ be an arrow in $\mathcal{S}$ , and suppose that $p(f_{2}) \circ u = p(g) \circ p(f_{1})$ . We have to show that there exists a unique arrow $\widehat{u} : a_{1} \to a_{2}$ in A such that $p(\widehat{u}) = u$ and $f_{2} \circ \widehat{u} = g \circ f_{1}$ . Such a $\widehat{u}$ must be $\overline{u}_{a_{2}} : u^{*} a_{2} \to a_{2}$ by the condition $p(\widehat{u}) = u$ , and it indeed satisfies $f_{2} \circ \overline{u}_{a_{2}} = g \circ f_{1}$ since both $f_{2} \circ \overline{u}_{a_{2}}$ and $g \circ f_{1}$ have the same codomain and are sent by p to $p(f_{2}) \circ u = p(g) \circ p(f_{1})$ .

Proposition 3.3. A discrete fibration $p : A \to \mathcal{S}$ is faithful and reflects isomorphisms: an arrow $f : a \to a'$ in A is an isomorphism whenever p(f) is.

Proof. Let $f, g : a \to a'$ be arrows in A such that $p(f) = p(g)$ . Then both f and g must be equal to $\overline{p(f)}_{a'} : p(f)^{*}a' \to a'$ , and thus p is faithful. A morphism $f : a \to a'$ in A is an isomorphism if and only if it is the terminal object in $A/a'$ . Therefore, by item:3 of Proposition 3.2, p reflects isomorphisms.

For a small category $\mathcal{S}$ , the category $\mathbf{DFib}_{\mathcal{S}}$ is equivalent to the category of presheaves over $\mathcal{S}$ : for a presheaf P over $\mathcal{S}$ , its category of elements $\int_{\mathcal{S}}P$ together with the projection $\int_{\mathcal{S}}P \to \mathcal{S}$ is a discrete fibration over $\mathcal{S}$ ; for a discrete fibration A over $\mathcal{S}$ , we have a presheaf $I \mapsto A(I)$ where A(I) denotes the fiber $p_{A}^{-1}(I)$ . A representable presheaf $\mathcal{S}({-}, I)$ corresponds to the slice category $\mathcal{S}/I$ with domain functor $\mathcal{S}/I \to \mathcal{S}$ . We say a discrete fibration A over $\mathcal{S}$ is representable if it is isomorphic to $\mathcal{S}/I$ for some $I \in \mathcal{S}$ . We call the functor $\mathcal{S} \ni I \mapsto \mathcal{S}/I \in \mathbf{DFib}_{\mathcal{S}}$ the Yoneda embedding. The Yoneda Lemma for discrete fibrations is formulated as follows.

Theorem 3.4. The Yoneda Lemma Let $\mathcal{S}$ be a category and A a discrete fibration over $\mathcal{S}$ . For any object $I \in \mathcal{S}$ , the map

$$ \mathbf{DFib}_{\mathcal{S}}(\mathcal{S}/I, A) \ni f \mapsto f(\mathrm{id}_{I}) \in A(I) $$

is bijective.

By the Yoneda Lemma, we identify an element $a \in A(I)$ with the corresponding map $\mathcal{S}/I \to A$ of discrete fibrations over $\mathcal{S}$ . We also recall the following criterion for representability.

Proposition 3.5. Let $\mathcal{S}$ be a category and A a discrete fibration over $\mathcal{S}$ . Then A is representable if and only if it has a terminal object. More precisely, for any object $a \in A$ , the corresponding map $\mathcal{S}/p_{A}(a) \to A$ of discrete fibrations over $\mathcal{S}$ is an isomorphism if and only if a is the terminal object.

Discrete fibrations are stable under “base change”.

Proposition 3.6. Let $p_{A} : A \to \mathcal{S}$ be a discrete fibration.

  1. (1) If

    is a pullback of categories, then $p_{A'} : A' \to \mathcal{S}'$ is a discrete fibration called the base change of A along F and denoted by $F^{*}A$ .
  2. (2) If $\sigma : F \Rightarrow G : \mathcal{S}' \to \mathcal{S}$ is a natural transformation and

    are pullbacks, then there exists a unique pair $(\sigma^{*}_{A}, \overline{\sigma}_{A})$ consisting of a map $\sigma^{*}_{A} : A'_{2} \to A'_{1}$ of discrete fibrations over $\mathcal{S}'$ and a natural transformation $\overline{\sigma}_{A} : \overline{F} \sigma^{*}_{A} \Rightarrow \overline{G}$ such that $p_{A}\overline{\sigma}_{A} = \sigma p_{A'_{2}}$ .

Proof. These are special cases of the base change of fibrations (e.g. Jacobs Reference Jacobs1999, Lemma 1.5.1 and Lemma 1.7.10).

Corollary 3.7. The assignment $\mathcal{S} \mapsto \mathbf{DFib}_{\mathcal{S}}$ determines a pseudo-functor from $\mathfrak{Cat}$ to the 2-category of large categories that is contravariant on both 1-cells and 2-cells. More precisely, a functor $F : \mathcal{S}' \to \mathcal{S}$ is mapped to the base change functor $F^{*} : \mathbf{DFib}_{\mathcal{S}} \to \mathbf{DFib}_{\mathcal{S}'}$ , and a natural transformation $\sigma : F \Rightarrow G : \mathcal{S}' \to \mathcal{S}$ is mapped to the natural transformation $\sigma^{*} : G^{*} \Rightarrow F^{*}$ determined by Proposition 3.6.

Proof. Let $\mathbf{DFib} \subset \mathfrak{Cat}^{\to}$ denote the full sub-2-category spanned by the discrete fibrations. Proposition 3.6 implies that the codomain functor $\mathbf{DFib} \to \mathfrak{Cat}$ is a so-called 2-fibration (Buckley Reference Buckley2014; Hermida Reference Hermida1999) fibred in categories. Then the claim is a special case of Buckley (Reference Buckley2014, Theorem 2.2.11).

3.2 Representable maps of discrete fibrations

Definition 3.8 Let $f : A \to B$ be a map of discrete fibrations over a category $\mathcal{S}$ . We say f is representable if it has a right adjoint as a functor $A \to B$ .

Remark 3.9. Representable maps of presheaves are usually defined by the equivalent condition of Corollary 3.13 below (The Stacks Project Authors 2019, Tag 0023). Definition 3.8 is is a more natural definition when working with discrete fibrations.

Remark 3.10. For a discrete fibration A over a category $\mathcal{S}$ , the following are not equivalent in general.

  1. (1) The discrete fibration A is representable.

  2. (2) The unique map $A \to \mathcal{S}$ of discrete fibrations over $\mathcal{S}$ is representable.

It follows from Corollary 3.13 below that if $\mathcal{S}$ has a terminal object then 2 is equivalent to that the discrete fibration A over $\mathcal{S}$ is representable by, say, I and $\mathcal{S}$ has products with I. In particular, if $\mathcal{S}$ has finite products then 1 and 2 are equivalent.

Proposition 3.11. For a category $\mathcal{S}$ , the identity maps of discrete fibrations over $\mathcal{S}$ are representable and representable maps of discrete fibrations over $\mathcal{S}$ are closed under composition.

Proof. By definition.

Proposition 3.12. Let $f : A \to B$ be a map of discrete fibrations over a category $\mathcal{S}$ . For objects $b \in B$ and $a \in A$ and an arrow $m : fa \to b$ in B, the following are equivalent.

  1. (1) $m : fa \to b$ is the terminal object in the comma category $(f \downarrow b)$ .

  2. (2) The square

    is a pullback.

Proof. By Item 3 of Proposition 3.2, Item 2 is equivalent to that the square

is a pullback, where the left functor sends $(n : a' \to a) \in A/a$ to $(m \circ fn : fa' \to b) \in B/b$ . This is equivalent to that the map $A/a \ni (n : a' \to a) \mapsto (m \circ fn) : fa' \to b) \in f^{*}(B/b)$ of discrete fibrations over A is an isomorphism. By Proposition 3.5, this is equivalent to that $m \circ f(\mathrm{id}_{a}) = m$ is the terminal object in $f^{*}(B/b) \cong (f \downarrow b)$ .

Corollary 3.13 Let $f : A \to B$ be a map of discrete fibrations over a category $\mathcal{S}$ . Then f is representable if and only if, for any object $I \in \mathcal{S}$ and element $b : \mathcal{S}/I \to B$ , the pullback $b^{*}A$ is a representable discrete fibration over $\mathcal{S}$ . More precisely, the right adjoint $\delta : B \to A$ and the counit $\varepsilon$ of f fit into the pullback square

for any element $b : \mathcal{S}/I \to B$ .

Proof. Recall that the right adjoint and the counit of f assign the terminal object of $(f \downarrow b)$ to each element $b \in B$ . Then apply Proposition 3.12.

Definition 3.14 Let

be a square of categories that commutes up to isomorphism, and suppose that f and f’ have right adjoints $\delta$ and $\delta'$ , respectively. We say this square satisfies the Beck–Chevalley condition if the canonical natural transformation $g \delta' \Rightarrow \delta h$ defined by the following diagram is an isomorphism.

Here $\varepsilon'$ is the counit of the adjunction $f' \dashv \delta'$ and $\eta$ is the unit of $f \dashv \delta$ .

Corollary 3.15. Let

be a commutative square of discrete fibrations over a category $\mathcal{S}$ where f is representable. If this square is a pullback, then f’ is representable and this square satisfies the Beck–Chevalley condition.

Proof. Let $\delta : B \to A$ denote the right adjoint of f. Let $b : \mathcal{S}/I \to B'$ be an arbitrary element. Since $A' \cong h^{*}A$ , we have $b^{*} A' \cong (hb)^{*}A$ . Thus, by Corollary 3.13, $b^{*}A'$ is representable by $p_{A}(\delta(hb))$ . Let $\delta'(b)$ denote the composite $\mathcal{S}/p_{A}(\delta(hb)) \cong b^{*}A' \to A'$ . Then, again by Corollary 3.13>, $\delta'$ determines a right adjoint of f’. By construction, we have $g\delta' \cong \delta h$ , and thus the Beck–Chevalley condition is satisfied.

Remark 3.16. The converse of Corollary 3.15 also holds: if f and f’ are representable and if the square satisfies the Beck–Chevalley condition, then the square is a pullback. See Uemura (2021, Proposition 3.1.15)for a proof.

3.3 Modeling type theory

A representable map $f : A \to B$ of discrete fibrations over $\mathcal{S}$ is considered to be a model of dependent type theory. We think of objects $I \in \mathcal{S}$ as contexts, elements $b \in B(I)$ as types over I and elements $a \in A(I)$ as terms over I. For a term $a \in A(I)$ , the type of a is $f(a) \in B(I)$ . The representability of f is used for modeling context extensions.

Definition 3.17. Let $f : A \to B$ be a representable map of discrete fibrations over $\mathcal{S}$ . We denote by $\delta^{f} : B \to A$ the right adjoint to f and by $\varepsilon^{f}$ the counit of the adjunction $f \dashv \delta^{f}$ . For an object $I \in \mathcal{S}$ and an element $b \in B(I)$ , we write $\{b\}^{f}$ for the object $p_{A}(\delta^{f}_{b}) \in \mathcal{S}$ . Let $\pi^{f}_{b} = p_{B}(\varepsilon^{f}_{b}) : \{b\}^{f} \to I$ . We call $\{b\}^{f}$ the context extension of b with respect to f. By Corollary 3.13, these fit into the pullback

Syntactically, the context extension $B(I) \ni b \mapsto \{b\}^{f}\in \mathcal{S}$ models the rule for extending a context by a type

and $\pi_{b}^{f}$ corresponds to the context morphism $(I, x : b) \to I$ and $\delta_{b}^{f}$ corresponds to the term $I, x : b \vdash x : b$ .

We demonstrate how to model type constructors using representable maps of discrete fibrations. First, we recall the notions of a pushforward and a polynomial functor.

Definition 3.18. Let $\mathcal{C}$ be a cartesian category. We say an arrow $f : A \to B$ in $\mathcal{C}$ is exponentiable if the pullback functor $f^{*} : \mathcal{C}/B \to \mathcal{C}/A$ has a right adjoint. When f is exponentiable, the right adjoint of $f^{*}$ is called the pushforward or dependent product along f and denoted by $f_{*}$ .

Definition 3.19. For an exponentiable arrow $f : A \to B$ in a cartesian category $\mathcal{C}$ , we define a functor $\mathrm{P}_{f} : \mathcal{C} \to \mathcal{C}$ called the polynomial functor associated with f to be the composite

where $A^{*}$ is the pullback functor along $A \to 1$ and $B_{!}$ is the forgetful functor.

Since the category of discrete fibrations over a category $\mathcal{S}$ is equivalent to the category of presheaves over $\mathcal{S}$ , the pushforward along an arbitrary map exists. But the pushforward along a representable map has a simple description.

Lemma 3.20. Let

be a commutative triangle of categories and suppose that p is a discrete fibration. Then f is a discrete fibration if and only if q is. Consequently, the isomorphism $(\mathfrak{Cat}/\mathcal{S})/A \cong \mathfrak{Cat}/A$ restricts to an isomorphism $(\mathbf{DFib}_{\mathcal{S}})/A \cong \mathbf{DFib}_{A}$ .

Proof. By 2 of Proposition 3.2, this follows from the cancellation property of pullback squares.

Proposition 3.21 Let $f : A \to B$ be a representable map of discrete fibrations over a category $\mathcal{S}$ . The pushforward along f is given by the base change along the right adjoint $\delta^{f} : B \to A$ to f.

Proof. By Corollary 3.7, the adjunction $f \dashv \delta^{f}$ is mapped to the adjunction

By Lemma 3.20, $f^{*}$ is isomorphic to the pullback functor $(\mathbf{DFib}_{\mathcal{S}})/B \to (\mathbf{DFib}_{\mathcal{S}})/A$ , and thus $(\delta^{f})^{*}$ is the pushforward along f.

Let $f : A \to B$ be a representable map of discrete fibrations over a category $\mathcal{S}$ . Consider the discrete fibration $\mathrm{P}_{f}B$ over $\mathcal{S}$ . It is the pullback

by the construction of $f_{*}$ given in Proposition 3.21. Hence, an element of $\mathrm{P}_{f}B$ over $I \in \mathcal{S}$ is a pair $(b_{1}, b_{2})$ of elements $b_{1} \in B(I)$ and $b_{2} \in B(\{b_{1}\}^{f})$ . One can think of $b_{2}$ as a type family over $b_{1}$ . Then a map $g : \mathrm{P}_{f}B \to B$ is thought of as a type constructor that takes types $b_{1} \in B(I)$ and $b_{2} \in B(\{b_{1}\}^{f})$ and returns a type $g(b_{1}, b_{2}) \in B(I)$ . Syntactically, g is a type constructor of the form

where the expression $x.b_{2}$ means that the variable x is bound. Similarly, a map $h : \mathrm{P}_{f}A \to A$ is a term constructor that takes a type $b_{1} \in B(I)$ and a term $a_{2} \in A(\{b_{1}\}^{f})$ and returns a term $h(b_{1}, a_{2}) \in A(I)$ . For example, dependent products are modeled by maps $\Pi : \mathrm{P}_{f}B \to B$ and $\mathsf{abs} : \mathrm{P}_{f}A \to A$ of discrete fibrations over $\mathcal{S}$ such that the square

commutes and is a pullback (Awodey Reference Awodey2018, Section 2.1). The commutativity means that $\mathsf{abs}$ has a typing rule

and being a pullback means that $\mathsf{abs}$ induces a bijection between the set of terms $I, x : b_{1} \vdash a_{2} : b_{2}$ and the set of terms $I \vdash a : \Pi(b_{1}, x.b_{2})$ . We refer the reader to Awodey (Reference Awodey2018), Newstead (Reference Newstead2018) for further examples.

4. Type Theories and Their Models

In this section, we introduce notions of a type theory and a model of a type theory.

We have seen in Section 3 that the vocabulary for describing models of type theories is:

  • representable maps;

  • finite limits;

  • pushforwards along representable maps

in categories of discrete fibrations. The idea is to identify a type theory with a category equipped with structures of representable arrows, finite limits, and pushforwards along representable arrows so that a model of a type theory is just a structure-preserving functor into a category of discrete fibrations.

Definition 4.1. Let $\mathcal{C}$ be a cartesian category. A stable class of exponentiable arrows in $\mathcal{C}$ is a class R of arrows in $\mathcal{C}$ satisfying the following conditions:

  • identity arrows are in R and R are closed under composition;

  • arrows in R are stable under pullbacks: if

    is a pullback square and f is in R, then f’ is in R;
  • arrows in R are exponentiable.

Definition 4.2. A representable map category consists of the following data:

  • a cartesian category $\mathcal{C}$ ;

  • a stable class of exponentiable arrows of $\mathcal{C}$ . Arrows in this class are called representable arrows or representable maps.

A representable map functor $\mathcal{C} \to \mathcal{D}$ between representable map categories is a functor $F : \mathcal{C} \to \mathcal{D}$ preserving finite limits, representable arrows and pushforwards along representable arrows. For representable map categories $\mathcal{C}$ and $\mathcal{D}$ , we write $\mathfrak{Rep}(\mathcal{C}, \mathcal{D})$ for the category of representable map functors $\mathcal{C} \to \mathcal{D}$ and natural transformations. We will refer to the 2-category of small representable map categories, representable map functors, and natural transformations as $\mathfrak{Rep}$ .

Example 4.3. For a small category $\mathcal{S}$ , the category $\mathbf{DFib}_{\mathcal{S}}$ is a representable map category where the representable maps are defined in Definition 3.8.

Definition 4.4. A type theory is a small representable map category.

Definition 4.5. Let $\mathbb{T}$ be a type theory. A model of $\mathbb{T}$ consists of the following data:

  • a small category $\mathcal{S}$ called the base category with a terminal object 1;

  • a representable map functor $\mathbb{T} \to \mathbf{DFib}_{\mathcal{S}}$ denoted by $A \mapsto A^{\mathcal{S}}$ .

Definition 4.6. Let $\mathcal{S}$ be a model of a type theory $\mathbb{T}$ . For a representable arrow $f : A \to B$ in $\mathbb{T}$ and an object $b \in B^{\mathcal{S}}$ , we simply write $\{b\}^{f}$ for the context extension $\{b\}^{f^{\mathcal{S}}}$ of b with respect to $f^{\mathcal{S}} : A^{\mathcal{S}} \to B^{\mathcal{S}}$ and use similar notations for $\pi^{f^{\mathcal{S}}}_{b}$ and $\delta^{f^{\mathcal{S}}}_{b}$ .

Remark 4.7 Since a model $\mathcal{S}$ of a type theory $\mathbb{T}$ sends the terminal object $1 \in \mathbb{T}$ to the terminal discrete fibration which is the identity functor $\mathrm{id}_{\mathcal{S}} : \mathcal{S} \to \mathcal{S}$ , the base category $\mathcal{S}$ is a redundant piece of data. We may define a model of $\mathbb{T}$ as a 2-functor $\mathcal{S} : \mathbb{T} \to \mathfrak{Cat}$ satisfying, among other things, that $\mathcal{S}(A) \to \mathcal{S}(1)$ is a discrete fibration for any $A \in \mathbb{T}$ . Thus, the 2-category of models of $\mathbb{T}$ (Definition 4.14) will simply be a sub-2-category of the 2-category of $\mathfrak{Cat}$ -valued 2-functors. This clear description of the 2-category of models is the reason why we prefer discrete fibrations to presheaves.

We will give interesting examples of representable map categories in Sections 4.1 and 5. Here we introduce a couple of constructions of representable map categories.

Example 4.8. Let $\mathcal{C}$ be a representable map category. For an object $A \in \mathcal{C}$ , the slice category $\mathcal{C}/A$ carries a structure of a representable map category: an arrow in $\mathcal{C}/A$ is representable if it is a representable arrow in $\mathcal{C}$ . For an arrow $f : A \to B$ , the pullback functor $f^{*} : \mathcal{C}/B \to \mathcal{C}/A$ is a representable map functor. Thus, $A \mapsto \mathcal{C}/A$ is part of a pseudo-functor $\mathcal{C}^{\mathrm{op}} \to \mathfrak{Rep}$ when $\mathcal{C}$ is small.

Example 4.9. It is known that exponentiable arrows in a cartesian category $\mathcal{C}$ are stable under pullbacks (Niefield Reference Niefield1982, Corollary 1.4). By definition, all the identity arrows are exponentiable and exponentiable arrows are closed under composition. Hence, for any class E of exponentiable arrows in $\mathcal{C}$ , we can take the smallest stable class of exponentiable arrows containing E, that is, the class of composites of pullbacks of arrows from E.

We introduce some notations and terminology for future use.

Definition 4.10. Let $\mathcal{C}$ be a representable map category. We denote by $(\mathcal{C}^{\to})_{\mathrm{r}}$ the full subcategory of $\mathcal{C}^{\to}$ consisting of the representable arrows. For an object $A \in \mathcal{C}$ , we denote by $(\mathcal{C}/A)_{\mathrm{r}}$ the full subcategory of $\mathcal{C}/A$ consisting of the representable arrows $B \to A$ .

Definition 4.11. Let $\mathcal{C}_{0}$ be a representable map category. A representable map category under $\mathcal{C}_{0}$ is a representable map category $\mathcal{C}$ equipped with a representable map functor $I_{\mathcal{C}} : \mathcal{C}_{0} \to \mathcal{C}$ . A representable map functor $\mathcal{C} \to \mathcal{D}$ under $\mathcal{C}_{0}$ between representable map categories under $\mathcal{C}_{0}$ is a pair $(F, \sigma)$ consisting of a representable map functor $F : \mathcal{C} \to \mathcal{D}$ and a natural isomorphism $\sigma : F I_{\mathcal{C}} \cong I_{\mathcal{D}}$ . A natural transformation $(F, \sigma) \Rightarrow (G, \tau)$ under $\mathcal{C}_{0}$ between representable map functors under $\mathcal{C}_{0}$ is a natural transformation $\varphi : F \Rightarrow G$ such that $\tau \circ \varphi I_{\mathcal{C}} = \sigma$ . For representable map categories $\mathcal{C}$ and $\mathcal{D}$ under $\mathcal{C}_{0}$ , we denote by $(\mathcal{C}_{0} / \mathfrak{Rep})(\mathcal{C}, \mathcal{D})$ the category of representable map functors under $\mathcal{C}_{0}$ and natural transformations under $\mathcal{C}_{0}$ . For a representable map category $\mathcal{C}$ under $\mathcal{C}_{0}$ and a representable map functor $F : \mathcal{C}_{0} \to \mathcal{D}$ , we say F extends to a representable map functor $G : \mathcal{C} \to \mathcal{D}$ when G is part of a representable map functor $\mathcal{C} \to \mathcal{D}$ under $\mathcal{C}_{0}$ .

4.1 Example: Basic dependent type theory

Most examples of type theories in the sense of Definition 4.4 are constructed using a logical framework introduced in Section 5. Here we only give a simple example which naturally arises from the syntax of dependent type theory.

Let $\mathbb{G}$ denote the opposite of the category of finite generalized algebraic theories (Cartmell Reference Cartmell1978) and interpretations between them. We do not need the precise definition of a generalized algebraic theory, but remember that a generalized algebraic theory consists of sets of type constants, term constants, type equations and term equations. $\mathbb{G}$ has finite limits, or equivalently $\mathbb{G}^{\mathrm{op}}$ has finite colimits: coproducts of generalized algebraic theories are given by disjoint union; coequalizers of generalized algebraic theories are obtained by adjoining equations.

Let $U_{n}$ be the generalized algebraic theory consisting of type constants $({} \vdash A_{0}), (x_{0} : A_{0} \vdash A_{1}), \dots, (x_{0} : A_{0}, \dots,x_{n-1} : A_{n-1}(x_{0}, \dots, x_{n-2}) \vdash A_{n})$ and let $E_{n}$ be the extension of $U_{n}$ by a term constant $(x_{0} : A_{0}, \dots, x_{n-1} : A_{n-1}(x_{0}, \dots, x_{n-2}) \vdash a_{n} : A_{n}(x_{0}, \dots, x_{n-1}))$ . We denote by $\partial_{n} : U_{n} \to E_{n}$ and $\mathrm{ft}_{n} : U_{n-1} \to U_{n}$ the obvious inclusions (in $\mathbb{G}^{\mathrm{op}}$ ), where we define $U_{-1}$ to be the empty theory. We also regard $\partial_{n}$ and $\mathrm{ft}_{n}$ as arrows $\partial_{n} : E_{n} \to U_{n}$ and $\mathrm{ft}_{n} : U_{n} \to U_{n-1}$ , respectively, in $\mathbb{G}$ . The category $\mathbb{G}$ is “freely generated by an exponentiable arrow” in the following sense.

Theorem 4.12. (Uemura Reference Uemura2022).

  1. (1) The arrow $\partial_{0} : E_{0} \to U_{0}$ in $\mathbb{G}$ is exponentiable.

  2. (2) For any cartesian category $\mathcal{C}$ and exponentiable arrow $f : A \to B$ in $\mathcal{C}$ , there exists a unique, up to unique isomorphism, cartesian functor $F : \mathbb{G} \to \mathcal{C}$ that sends $\partial_{0}$ to f and pushforwards along $\partial_{0}$ to those along f.

  3. (3) $\mathrm{P}_{\partial_{0}}U_{n} \cong U_{n+1}$ and $\mathrm{P}_{\partial_{0}}E_{n} \cong E_{n+1}$ .

By Item 1 of Theorem 4.12, we regard $\mathbb{G}$ as a representable map category with the smallest stable class of exponentiable arrows containing $\partial_{0} : E_{0} \to U_{0}$ and call it the basic dependent type theory. Item 2 of Theorem 4.12 can be rephrased as follows.

Corollary 4.13. For any representable map category $\mathcal{C}$ and representable arrow $f : A \to B$ in $\mathcal{C}$ , there exists a unique, up to unique isomorphism, representable map functor $F : \mathbb{G} \to \mathcal{C}$ that sends $\partial_{0}$ to f.

By this universal property, a model $\mathcal{S}$ of the type theory $\mathbb{G}$ consists of the following data:

  • a category $\mathcal{S}$ with a terminal object;

  • a representable map $\partial_{0}^{\mathcal{S}} : E_{0}^{\mathcal{S}} \to U_{0}^{\mathcal{S}}$ of discrete fibrations over $\mathcal{S}$ .

This is precisely a natural model (category with families).

4.2 The 2-category of models of a type theory

The models of a type theory are part of a 2-category.

Definition 4.14. Let $\mathcal{S}$ and $\mathcal{T}$ be models of a type theory $\mathbb{T}$ . A morphism $\mathcal{S} \to \mathcal{T}$ of models of $\mathbb{T}$ consists of the following data:

  • a functor $F : \mathcal{S} \to \mathcal{T}$ between the base categories;

  • for each object $A \in \mathbb{T}$ , a map $F_{A} : A^{\mathcal{S}} \to A^{\mathcal{T}}$ of discrete fibrations over $F : \mathcal{S} \to \mathcal{T}$

satisfying the following conditions:

  • the functor $F : \mathcal{S} \to \mathcal{T}$ preserves terminal objects;

  • $A \mapsto F_{A}$ is natural: for any arrow $f : A \to B$ in $\mathbb{T}$ , the diagram

    (1)
    commutes;
  • for any representable arrow $f : A \to B$ in $\mathbb{T}$ , the naturality square (1) satisfies the Beck-Chevalley condition.

A 2-morphism $\sigma : F \Rightarrow G : \mathcal{S} \to \mathcal{T}$ of morphisms of models of $\mathbb{T}$ is a natural transformation $\sigma : F \Rightarrow G$ between the underlying functors such that, for any object $A \in \mathbb{T}$ , there exists a (necessarily unique) natural transformation $\sigma_{A} : F_{A} \Rightarrow G_{A}$ such that $p_{(A^{\mathcal{T}})} \sigma_{A} = \sigma p_{(A^{\mathcal{S}})}$ .

We denote by $\mathfrak{Mod}_{\mathbb{T}}$ the 2-category of models of $\mathbb{T}$ and their morphisms and 2-morphisms.

Remark 4.15. The Beck–Chevalley condition for a morphism $F : \mathcal{S} \to \mathcal{T}$ of models of a type theory $\mathbb{T}$ forces F to preserve context extensions up to isomorphism: for a representable arrow $f : A \to B$ in $\mathbb{T}$ and an element $b \in B^{\mathcal{S}}(I)$ , the canonical arrow $F \{b\}^{f} \to \{F_{B} b\}^{f}$ is an isomorphism. As a special case, it will turn out in Example 5.20 that morphisms of models of $\mathbb{G}$ correspond to pseudo cwf-morphisms of cwfs (Clairambault and Dybjer 2014) and, equivalently, to weak morphisms of natural models (Newstead 2018).

4.3 Another definition of morphisms of models

Results in this subsection are required only in proofs of some propositions, so the reader may skip this subsection until needed.

A model of a type theory is defined to be a representable map functor into a category of discrete fibrations. In this subsection, we see that morphisms and 2-morphisms of models of a type theory are also regarded as representable map functors into suitable representable map categories.

Definition 4.16. Let $\mathfrak{I}$ be a small 2-category and $\mathcal{S} : \mathfrak{I} \to \mathfrak{Cat}$ a 2-functor. We define a category $(\mathbf{DFib}^{\mathfrak{I}})_{\mathcal{S}}$ as follows:

  • the objects are the 2-functors $A : \mathfrak{I} \to \mathfrak{Cat}$ equipped with a 2-natural transformation $p_{A} : A \Rightarrow \mathcal{S}$ such that each component $(p_{A})_{i} : A i \to \mathcal{S} i$ is a discrete fibration;

  • the maps $A \to B$ are the 2-natural transformations $f : A \Rightarrow B$ such that $p_{B} f = p_{A}$ .

We say a map $f : A \to B$ in $(\mathbf{DFib}^{\mathfrak{I}})_{\mathcal{S}}$ is representable if every component $f_{i} : A i \to B i$ is a representable map of discrete fibrations over $\mathcal{S} i$ and, for any 1-cell $u : i \to i'$ in $\mathfrak{I}$ , the square

satisfies the Beck–Chevalley condition.

Proposition 4.17. Representable maps in $(\mathbf{DFib}^{\mathfrak{I}})_{\mathcal{S}}$ are stable under pullbacks.

Proof. Let

be a pullback in $(\mathbf{DFib}^{\mathfrak{I}})_{\mathcal{S}}$ and suppose that f is representable. One can check that pullbacks in $(\mathbf{DFib}^{\mathfrak{I}})_{\mathcal{S}}$ are componentwise, which means that

is a pullback in $\mathbf{DFib}_{\mathcal{S}i}$ for every $i \in \mathfrak{I}$ . By Corollary 3.15 each $f'_{i}$ is representable. To see the Beck–Chevalley condition, let $u : i \to i'$ be a 1-cell in $\mathfrak{I}$ . Consider the following commutative diagram.

The front square satisfies the Beck–Chevalley condition by assumption. The left and right squares satisfy the Beck-Chevalley condition by Corollary 3.15. The functor $g_{i'} : A'i' \to Ai'$ is a discrete fibration by Lemma 3.20 and thus reflects isomorphisms by Proposition 3.3. Hence, it follows that the back square satisfies the Beck–Chevalley condition.

Let $f : A \to B$ be a representable map in $(\mathbf{DFib}^{\mathfrak{I}})_{\mathcal{S}}$ . Although the right adjoint $\delta^{f} : B \to A$ to f is only a pseudo-natural transformation, we can define the base change $(\delta^{f})^{*}C \to B$ of C along $\delta^{f}$ for a map $C \to A$ in $(\mathbf{DFib}^{\mathfrak{I}})_{\mathcal{S}}$ as follows:

  • for an object $i \in \mathfrak{I}$ , we define $((\delta^{f})^{*}C)i = (\delta^{f}_{i})^{*}(C i)$ ;

  • for a 1-cell $u : i \to i'$ in $\mathfrak{I}$ , we have a natural isomorphism

    Using Proposition 3.6, we have a unique pair $((\delta^{f}_{u})^{*}(C u), \overline{\delta}^{f}_{u})$ consisting of a map $(\delta^{f}_{u})^{*}(C u) : (\delta^{f}_{i})^{*}(C i) \to (\delta^{f}_{i'})^{*}(C i')$ of discrete fibrations over B u and a natural isomorphism
    over $\delta^{f}_{u}$ . We define $((\delta^{f})^{*} C) u = (\delta^{f}_{u})^{*}(C u)$ ;
  • the 2-cell part is defined in a natural way.

Then we can prove the following in the same way as Proposition 3.21.

Proposition 4.18. Let $f : A \to B$ be a representable map in $(\mathbf{DFib}^{\mathfrak{I}})_{\mathcal{S}}$ . Then the pushforward along f exists and is given by the base change along the right adjoint $\delta^{f} : B \to A$ to f.

Corollary 4.19

  1. (1) For a 2-functor $\mathcal{S} : \mathfrak{I} \to \mathfrak{Cat}$ , the category $(\mathbf{DFib}^{\mathfrak{I}})_{\mathcal{S}}$ is a representable map category where the representable maps are defined in Definition 4.16.

  2. (2) For 2-functors $\mathcal{S} : \mathfrak{I} \to \mathfrak{Cat}$ and $F : \mathfrak{I}' \to \mathfrak{I}$ , the precomposition with F induces a representable map functor $F^{*} : (\mathbf{DFib}^{\mathfrak{I}})_{\mathcal{S}} \to (\mathbf{DFib}^{\mathfrak{I}'})_{\mathcal{S} F}$ .

We consider the case that $\mathfrak{I}$ is the category $\{0 \to 1\}$ . In this case, we write $(\mathbf{DFib}^{\to})_{F}$ for $(\mathbf{DFib}^{\mathfrak{I}})_{F}$ . Let $F : \mathcal{S} \to \mathcal{T}$ be a functor between small categories. By definition, an object of $(\mathbf{DFib}^{\to})_{F}$ is a commutative square

of categories such that $p_{A}$ and $p_{B}$ are small discrete fibrations, and a map $(A, B, G) \to (A', B', G')$ is a square

of categories such that f and g are maps of discrete fibrations over $\mathcal{S}$ and $\mathcal{T}$ , respectively. Such a square is representable if f and g are representable maps of discrete fibrations and the square satisfies the Beck–Chevalley condition. There are representable map functors $\mathbf{dom} : (\mathbf{DFib}^{\to})_{F} \to \mathbf{DFib}_{\mathcal{S}}$ and $\mathbf{cod} : (\mathbf{DFib}^{\to})_{F} \to \mathbf{DFib}_{\mathcal{T}}$ induced by the inclusions $\{0\} \to \{0 \to 1\}$ and $\{1\} \to \{0 \to 1\}$ respectively.

Proposition 4.20. Let $\mathbb{T}$ be a type theory, $\mathcal{S}$ and $\mathcal{T}$ models of $\mathbb{T}$ , and $F : \mathcal{S} \to \mathcal{T}$ be a functor between the base categories preserving terminal objects. There is a bijection between the following sets:

  1. (1) the set of morphisms of models $\mathcal{S} \to \mathcal{T}$ whose underlying functor is F;

  2. (2) the set of representable map functors $F_{({-})} : \mathbb{T} \to (\mathbf{DFib}^{\to})_{F}$ such that $\mathbf{dom} F_{({-})} = ({-})^{\mathcal{S}}$ and $\mathbf{cod} F_{({-})} = ({-})^{\mathcal{T}}$ .

Proof. By the definition of representable maps in $(\mathbf{DFib}^{\to})_{F}$ , Item2 is just another way of describing a morphism of models of $\mathbb{T}$ . Note that, because $(\mathbf{dom}, \mathbf{cod})$ reflects isomorphisms, $F_{({-})}$ automatically preserves finite limits and pushforwards along representable maps whenever it preserves representable maps.

Remark 4.21 Note that the functor $(\mathbf{dom}, \mathbf{cod}) : (\mathbf{DFib}^{\to})_{F} \to \mathbf{DFib}_{\mathcal{S}} \times \mathbf{DFib}_{\mathcal{T}}$ is a discrete isofibration: for any object $G \in (\mathbf{DFib}^{\to})_{F}$ and isomorphisms $f : \mathbf{dom} G \cong A$ in $\mathbf{DFib}_{\mathcal{S}}$ and $g : \mathbf{cod} G \cong B$ in $\mathbf{DFib}_{\mathcal{T}}$ , there exists a unique isomorphism $h : G \cong H$ in $\mathbf{DFib}_{\mathcal{S}}$ such that $\mathbf{dom} h = f$ and $\mathbf{cod} h = g$ . Thus, to extend the functor F to a morphism $\mathcal{S} \to \mathcal{T}$ of models of $\mathbb{T}$ , it suffices to give a representable map functor $F'_{({-})} : \mathbb{T} \to (\mathbf{DFib}^{\to})_{F}$ and natural isomorphisms $\mathbf{dom} F'_{({-})} \cong ({-})^{\mathcal{S}}$ and $\mathbf{cod} F'_{({-})} \cong ({-})^{\mathcal{T}}$ .

Consider the 2-category $\Theta$ consisting of two 0-cells 0 and 1, two 1-cells $a, b : 0 \to 1$ , and one 2-cell $a \Rightarrow b$ .

For a natural transformation $\sigma : F \Rightarrow G : \mathcal{S} \to \mathcal{T}$ , we have the representable map functors $\mathbf{dom} : (\mathbf{DFib}^{\Theta})_{\sigma} \to (\mathbf{DFib}^{\to})_{F}$ and $\mathbf{cod} : (\mathbf{DFib}^{\Theta})_{\sigma} \to (\mathbf{DFib}^{\to})_{G}$ induced by the inclusions $\{0 \overset{a}{\to} 1\} \to \Theta$ and $\{0 \overset{b}{\to} 1\} \to \Theta$ , respectively.

Proposition 4.22. Let $\mathbb{T}$ be a type theory, $\mathcal{S}$ and $\mathcal{T}$ models of $\mathbb{T}$ , $F, G : \mathcal{S} \to \mathcal{T}$ morphism of models of $\mathbb{T}$ , and $\sigma : F \Rightarrow G$ a natural transformation between the underlying functors. Then $\sigma$ (necessarily uniquely) extends to a 2-morphism $F \Rightarrow G$ of models of $\mathbb{T}$ if and only if there exists a (necessarily unique) representable map functor $\tilde{\sigma} : \mathbb{T} \to (\mathbf{DFib}^{\Theta})_{\sigma}$ such that $\mathbf{dom} \tilde{\sigma} = F_{({-})}$ and $\mathbf{cod} \tilde{\sigma} = G_{({-})}$ .

Proof. This is a rephrasing of the definition of a 2-morphism of models of $\mathbb{T}$ .

5. Logical Framework

This section is devoted to giving examples of representable map categories using a logical framework. We will not use the results of this section in the rest of the paper other than for giving examples.

Our logical framework is classified as a semantic logical framework and close to Martin-Löf’s logical framework (Nordström et al. Reference Nordström, Petersson and Smith1990). Another kind of logical framework is a syntactic logical framework whose typical example is the Edinburgh Logical Framework (Harper et al. Reference Harper, Honsell and Plotkin1993). A syntactic logical framework does not have equality types so that terms exactly correspond to derivations in the object language. A semantic logical framework has equality types and terms correspond to semantic derivations, that is, derivations modulo equality in the object language. Since the subject of this paper is the semantics of type theory, a semantic logical framework is our choice.

We design our logical framework to give syntactic counterparts of representable map categories. Since representable map categories have finite limits, the logical framework is a dependent type theory with equality types $a = b$ . Corresponding to representable arrows, the logical framework has a notion of a representable type. We write $A : {\Box}$ when A is a type and $A : {*}$ when A is a representable type. ${*}$ is considered to be a subsort of ${\Box}$ in the sense that the rule

$$ \frac {\Gamma \vdash A : {*}} {\Gamma \vdash A : {\Box}}$$

is derivable. Pushforwards along representable arrows correspond to dependent product types of the form

The way to encode a type theory in our framework is to declare symbols. Each symbol $\alpha$ must have its context $\Gamma$ and sort s. When $\alpha$ is a symbol of a sort s over a context $\Gamma$ , we write $\alpha : \Gamma \Rightarrow s$ . So an encoding of a type theory is a well-ordered set of symbols like

which we call a signature. $\Gamma_{i}$ must be a context defined only using symbols $(\alpha_{j})_{j < i}$ . The sort $s_{i}$ can be ${\Box}$ , ${*}$ or a type A over $\Gamma_{i}$ defined only using $(\alpha_{j})_{j < i}$ . An equation is encoded to a symbol of the form $\alpha : \Gamma \Rightarrow a = b$ , but we just write $\_ : \Gamma \Rightarrow a = b$ when the name $\alpha$ of the equation is irrelevant.

We give a formal definition of our logical framework in Section 5.1. In Section 5.2, we give several examples of encodings of type theories in our logical framework. In Section 5.3, the syntactic representable map category of a signature is constructed and shown to satisfy an appropriate universal property. We further describe the 2-category of models of the syntactic representable map category in Section 5.4.

5.1 Formal definition

We assume that we are given an infinite set of variables $x, y, \dots$ and sufficiently many symbols $\alpha, \beta, \dots$ .

Definition 5.1. Preterms are defined by the following grammar:

The expression $x.B$ means that the variable x is considered to be bound. We always identify $\alpha$ -equivalent preterms. We use the following notations:

  • $((x : A) \to B) :\equiv \Pi(A, x.B)$

  • $(\lambda(x : A).b) :\equiv \mathsf{abs}(A, x.b)$

  • $(a =_{A} b) :\equiv \mathsf{Eq}(A, a, b)$

We write b a for $\mathsf{app}(A, x.B, b, a)$ when the terms A and $x.B$ are clear from the context. The type annotations in $\lambda(x : A).b$ and $a =_{A} b$ are often omitted, and we simply write $\lambda x.b$ and $a = b$ respectively. For preterms a, b and a variable x, the substitution $a[b/x]$ is defined in the ordinary way.

Definition 5.2. A pre-context is a finite sequence of the form

$$ (x_{1} : A_{1}, \dots, x_{n} : A_{n}) $$

with pre-terms $A_{1}, \dots, A_{n}$ and distinct variables $x_{1}, \dots, x_{n}$ . We denote precontexts by $\Gamma, \Delta, \dots$ . We write $x \in \Gamma$ when $\Gamma = (x_{1} : A_{1}, \dots, x_{n} : A_{n})$ and $x = x_{i}$ for some i.

Definition 5.3. A presignature $\Sigma$ consists of a well-ordered set $|\Sigma|$ of symbols and a function $\Sigma$ that assigns to each symbol in $|\Sigma|$ a pair consisting of a precontext and a preterm. We write

$$ \Sigma = (\alpha_{0} : \Gamma_{0} \Rightarrow A_{0}, \alpha_{1} : \Gamma_{1} \Rightarrow A_{1}, \alpha_{2} : \Gamma_{2} \Rightarrow A_{2}, \dots) $$

to mean that $|\Sigma| = \{\alpha_{0} < \alpha_{1} < \alpha_{2} < \dots\}$ and the value $\Sigma(\alpha_{i})$ is $(\Gamma_{i}, A_{i})$ for each $\alpha_{i} \in |\Sigma|$ . We write $(\alpha : \Gamma \Rightarrow A) \in \Sigma$ when $\alpha \in |\Sigma|$ and $\Sigma(\alpha) = (\Gamma, A)$ . For a symbol $\alpha \in |\Sigma|$ , we write $\Sigma|_{\alpha}$ for the restriction of $\Sigma$ to $\{\beta \in |\Sigma| \mid \beta < \alpha\}$ .

Definition 5.4. A judgment is one of the following forms.

For precontexts $\Gamma$ and $\Delta = (y_{1} : B_{1}, \dots, y_{m} : B_{m})$ and a finite sequence of preterms $f = (f_{1}, \dots, f_{m})$ , we write $\Sigma \mid f : \Gamma \to \Delta$ for the finite sequence of judgments

$$ ((\Sigma \mid \Gamma \vdash f_{1} : B_{1}), \dots, (\Sigma \mid \Gamma \vdash f_{m} : B_{m}[f_{1}/y_{1}, \dots, f_{m-1}/y_{m-1}])). $$

For such $\Sigma \mid f : \Gamma \to \Delta$ , we write [f] for the substitution operator $[f_{1}/y_{1}, \dots, f_{m}/y_{m}]$ . We define the set of legal judgments to be the smallest set of judgments closed under the rules listed in Fig. 1. Here we omit the obvious rules for $\equiv$ to be a congruence relation.

Fig. 1. Legal judgments.

Definition 5.5. A signature is a presignature $\Sigma$ such that $\Sigma \vdash \mathsf{sig}$ is a legal judgment. A context over $\Sigma$ is a precontext $\Gamma$ such that $\Sigma \mid \Gamma \vdash \mathsf{ctx}$ is a legal judgment. For contexts $\Gamma$ and $\Delta$ over $\Sigma$ , a context morphism $\Gamma \to \Delta$ is a finite sequence of preterms f such that $\Sigma \mid f : \Gamma \to \Delta$ is a finite sequence of legal judgments. Assume $\Delta = (y_{1} : B_{1}, \dots, y_{m} : B_{m})$ . We say context morphisms $f, g : \Gamma \to \Delta$ are equivalent, written $f \equiv g$ , if $(\Sigma \mid \Gamma \vdash f_{1} \equiv g_{1} : B_{1}), \dots, (\Sigma \mid \Gamma \vdash f_{m} \equiv g_{m} : B_{m}[f_{1}/y_{1}, \dots, f_{m-1}/y_{m-1}])$ are legal judgments. A type over a context $\Gamma$ over a signature $\Sigma$ is a pre-term A such that $\Sigma \mid \Gamma \vdash A : {\Box}$ is a legal judgment. We say a type A is representable if $\Sigma \mid \Gamma \vdash A : {*}$ is a legal judgment. For a type A, a term of A is a preterm a such that $\Sigma \mid \Gamma \vdash a : A$ is a legal judgment.

Our logical framework has the usual weakening and substitution properties. The following weakening on signatures might be nonstandard since signatures can be infinite.

Proposition 5.6. (Weakening on signatures) Let $\Sigma, \Sigma', \Sigma''$ be presignatures with pairwise disjoint domains. If $\Sigma, \Sigma' \vdash \mathsf{sig}$ and $\Sigma, \Sigma'' \vdash \mathcal{J}$ are legal judgments, then so is $\Sigma, \Sigma', \Sigma'' \vdash \mathcal{J}$ , where $\Sigma \vdash \mathcal{J}$ denotes a judgment of the form $\Sigma \vdash \mathsf{sig}$ , $\Sigma \mid \Gamma \vdash \mathsf{ctx}$ , $\Sigma \mid \Gamma \vdash a : A$ or $\Sigma \mid \Gamma \vdash a \equiv b : A$ .

Proof. By induction on the derivation of $\Sigma, \Sigma'' \vdash \mathcal{J}$ .

5.2 Coding type theories

We give several examples of encodings of type theories in our logical framework.

Example 5.7. We define $\Sigma_{DTT}$ to be the following signature.

( $\mathsf{el}$ stands for element.) We call $\Sigma_{DTT}$ the signature for basic dependent type theory. We will see that $\Sigma_{DTT}$ represents the basic dependent type theory $\mathbb{G}$ (Example 5.18).

We consider extending $\Sigma_{DTT}$ by adjoining type constructors.

Example 5.8. $\Pi$ -types in $\mathsf{Type}$ are encoded as follows.

Example 5.9 Identity types in $\mathsf{Type}$ are encoded as follows.

Equality types are encoded as identity types with the following equations called equality reflection.

Example 5.10. A universe (à la Tarski) is encoded by the following symbols.

For nested universes $\mathsf{U}_{0} : \mathsf{U}_{1}$ , we add two pairs of such symbols $(\mathsf{U}_{0}, \mathsf{el}_{\mathsf{U}_{0}})$ and $(\mathsf{U}_{1}, \mathsf{el}_{\mathsf{U}_{1}})$ and a “name” of $\mathsf{U}_{0}$ in $\mathsf{U}_{1}$ :

Since our logical framework can have an infinitely long signature, one can encode infinitely many universes

$$ \mathsf{U}_{0} : \mathsf{U}_{1} : \mathsf{U}_{2} : \dots. $$

One can add dependent products on $\mathsf{U}$ in two ways. In both ways, we add a type constructor

$$ \Pi_{\mathsf{U}} : (A : \mathsf{el}(\mathsf{U}), B : \mathsf{el}(\mathsf{el_{U}}(A)) \to \mathsf{el}(\mathsf{U})) \Rightarrow \mathsf{el}(\mathsf{U}). $$

One way is to add an equation

$$ \_ : (A : \mathsf{el}(\mathsf{U}), B : \mathsf{el}(\mathsf{el_{U}}(A)) \to \mathsf{el}(\mathsf{U})) \Rightarrow \mathsf{el_{U}}(\Pi_{\mathsf{U}}(A, B)) = \Pi(\mathsf{el_{U}}(A), \lambda x.\mathsf{el_{U}}(B x)) $$

assuming $\mathsf{Type}$ has dependent products. The other way is to add symbols and equations in a similar manner to dependent products in $\mathsf{Type}$ . In the latter way, the equation

$$ A : \mathsf{el}(\mathsf{U}), B : \mathsf{el}(\mathsf{el_{U}}(A)) \to \mathsf{el}(\mathsf{U}) \vdash \mathsf{el_{U}}(\Pi_{\mathsf{U}}(A, B)) \equiv \Pi(\mathsf{el_{U}}(A), \lambda x.\mathsf{el_{U}}(B x)) : \mathsf{Type} $$

need not hold, but one can show that $\mathsf{el_{U}}(\Pi_{\mathsf{U}}(A, B))$ and $\Pi(\mathsf{el_{U}}(A), \lambda x.\mathsf{el_{U}}(B x))$ are isomorphic in an appropriate sense.

Example 5.11 Various two-level type theories (Altenkirch et al. Reference Altenkirch, Capriotti, Kraus, Talbot and Regnier2016; Annenkov et al. Reference Annenkov, Capriotti, Kraus and Sattler2023; Voevodsky Reference Voevodsky2013) have a sort of fibrant types as well as a sort of types. We extend $\Sigma_{DTT}$ by the symbols

and several type constructors. For readability, we think of $\mathsf{Fib}$ as a subtype of $\mathsf{Type}$ and often omit $\iota$ . A major difference between $\mathsf{Type}$ and $\mathsf{Fib}$ is that identity types $\mathsf{Id_{Type}}(A, a, b)$ in $\mathsf{Type}$ satisfy axiom K or equality reflection but identity types $\mathsf{Id_{Fib}}(A, a, b)$ in $\mathsf{Fib}$ do not. The induction principle for identity types in $\mathsf{Fib}$ only works for families of $\mathsf{Fib}$ :

Example 5.12. To encode propositional logic, we begin with the following signature.

The equation $\mathsf{mono}$ implies that $\mathsf{true}(P)$ has at most one element. One may extend this signature by adding logical connectives like $\top$ , $\bot$ , $\land$ , $\lor$ and $\supset$ . For example, $\land$ and $\lor$ are encoded as follows.

Example 5.13. To encode predicate logic, we extend the union of the signatures for basic dependent type theory and propositional logic by adding equality and quantifiers. For example, equality and $\forall$ are encoded as follows.

In this encoding, a term can depend on the validity of a proposition, allowing us to write a partial function. For example, a term of type $(x : \mathsf{el}(A)) \to \mathsf{true}(P x) \to \mathsf{el}(B)$ is a partial function from A to B defined on those $a : \mathsf{el}(A)$ satisfying P, where $A : \mathsf{Type}$ , $B : \mathsf{Type}$ and $P : \mathsf{el}(A) \to \mathsf{Prop}$ . One may add the following symbols so that $\bot$ becomes the initial object and $P \lor Q$ the pushout of P and Q under $P \land Q$ .

Example 5.14 Cubical type theory (Cohen et al. Reference Cohen, Coquand, Huber, Mörtberg and Uustalu2018) is an extension of dependent type theory with a formal interval and cofibrant predicates. So we extend the signature for basic dependent type theory with

$\mathbb{I}$ carries a de Morgan algebra structure $(0, 1, \sqcap, \sqcup, (-)')$ , and $\mathsf{Cof}$ has logical connectives $\top, \land, \bot, \lor$ and equalities and quantifiers of the form

Moreover, $\mathsf{eq}_{0}$ and $\mathsf{eq}_{1}$ satisfy equality reflection, elimination operators $\mathsf{elim}_{\bot}^{\mathsf{Type}}$ and $\mathsf{elim}_{\lor}^{\mathsf{Type}}$ are added as in Example 5.13, and $\mathsf{Cof}$ satisfies propositional extensionality:

The composition operation is encoded as follows.

Note that the type of $\mathsf{comp}$ is essentially the same as the type of composition structures in the axiomatic approach to the semantics of cubical type theory given by Orton and Pitts (Reference Orton and Pitts2018). The gluing operation is encoded as follows, assuming that $\mathsf{Type}$ has enough type constructors to define the type $\mathsf{Equiv}(A, B) : \mathsf{Type}$ of equivalences between types $A : \mathsf{Type}$ and $B : \mathsf{Type}$ .

5.3 Syntactic representable map categories

Definition 5.15. For a signature $\Sigma$ , we define a small category $\mathbb{R}(\Sigma)$ as follows.

  • The objects are the contexts over $\Sigma$ .

  • The morphisms $\Gamma \to \Delta$ are the equivalence classes of context morphisms $\Gamma \to \Delta$ .

  • The identity on $\Gamma = (x_{1} : A_{1}, \dots, x_{n} : A_{n})$ is represented by the context morphism $(x_{1}, \dots, x_{n})$ .

  • For morphisms $f : \Gamma_{1} \to \Gamma_{2}$ and $g : \Gamma_{2} \to \Gamma_{3}$ , the composition $g \circ f$ is represented by the substitution g[f].

A generating representable morphism in $\mathbb{R}(\Sigma)$ is a morphism isomorphic to the projection

$$ (\Gamma, x : A) \to \Gamma $$

with $\Sigma \mid \Gamma \vdash A : {*}$ . A representable morphism in $\mathbb{R}(\Sigma)$ is a composite of generating representable morphisms.

It is well-known that the syntactic category of a type theory with dependent product types and equality types is locally cartesian closed (Seely Reference Seely1984). The same argument shows that $\mathbb{R}(\Sigma)$ is a representable map category.

Proposition 5.16. Let $\Sigma$ be a signature.

  1. (1) $\mathbb{R}(\Sigma)$ is a representable map category where the representable maps are defined in def:syntactic-representable-map.

  2. (2) For any $\alpha \in |\Sigma|$ , the functor $\mathbb{R}(\Sigma|_{\alpha}) \to \mathbb{R}(\Sigma)$ induced by the weakening on signatures is a representable map functor.

We call $\mathbb{R}(\Sigma)$ the syntactic representable map category of $\Sigma$ . It is the representable map category “freely generated by $\Sigma$ ” formulated by the following universal property.

Theorem 5.17. Let $\mathcal{C}$ be a representable map category and $\Sigma$ a signature.

  1. (1) If $|\Sigma|$ is unbounded, then the functor $|\mathfrak{Rep}(\mathbb{R}(\Sigma), \mathcal{C})| \to \lim_{\alpha \in |\Sigma|}|\mathfrak{Rep}(\mathbb{R}(\Sigma|_{\alpha}, \mathcal{C}))|$ induced by the weakening functors $\mathbb{R}(\Sigma|_{\alpha}) \to \mathbb{R}(\Sigma)$ is an equivalence.

  2. (2) If $\Sigma = (\Sigma', \alpha : \Gamma \Rightarrow {\Box})$ , then for any representable map functor $F : \mathbb{R}(\Sigma') \to \mathcal{C}$ , the functor $|(\mathbb{R}(\Sigma') / \mathfrak{Rep})(\mathbb{R}(\Sigma), \mathcal{C})| \ni G \mapsto G \alpha \in |\mathcal{C}/F \Gamma|$ is an equivalence.

  3. (3) If $\Sigma = (\Sigma', \alpha : \Gamma \Rightarrow {*})$ , then for any representable map functor $F : \mathbb{R}(\Sigma') \to \mathcal{C}$ , the functor $|(\mathbb{R}(\Sigma') / \mathfrak{Rep})(\mathbb{R}(\Sigma), \mathcal{C})| \ni G \mapsto G \alpha \in |(\mathcal{C}/F \Gamma)_{\mathrm{r}}|$ is an equivalence.

  4. (4) If $\Sigma = (\Sigma', \alpha : \Gamma \Rightarrow A)$ with $\Sigma' \mid \Gamma \vdash A : {\Box}$ , then for any representable map functor $F : \mathbb{R}(\Sigma') \to \mathcal{C}$ , the functor $|(\mathbb{R}(\Sigma') / \mathfrak{Rep})(\mathbb{R}(\Sigma), \mathcal{C})| \ni G \mapsto G \alpha \in \mathcal{C}/F \Gamma(1, F A)$ is an equivalence.

Example 5.18. Consider the signature $\Sigma_{DTT} = (\mathsf{Type} : () \Rightarrow {\Box}, \mathsf{el} : (A : \mathsf{Type}) \Rightarrow {*})$ from Example 5.7. By Theorem 5.17, for a representable map category $\mathcal{C}$ , the groupoid $|\mathfrak{Rep}(\mathbb{R}(\Sigma_{DTT}), \mathcal{C})|$ is equivalent to the following:

  • the objects are the representable arrows $f : A \to B$ in $\mathcal{C}$ ;

  • the arrows are isomorphisms in $\mathcal{C}^{\to}$ .

Hence, $\mathbb{R}(\Sigma_{DTT})$ has the same universal property as $\mathbb{G}$ (Corollary 4.13), and thus we have an equivalence $\mathbb{R}(\Sigma_{DTT}) \simeq \mathbb{G}$ in the 2-category $\mathfrak{Rep}$ .

The idea of the proof of Theorem 5.17 is the same as in the interpretation of extensional Marin-Löf type theory in locally cartesian closed categories (Seely Reference Seely1984). The main difficulty is the coherence problem: categorical structures often satisfy equations up to isomorphism, but equations in type theory are strict. A solution to the coherence problem is the splitting technique of Hofmann (Reference Hofmann, Pacholski and Tiuryn1995) which replaces a categorical structure by another structure satisfying equations strictly. We adapt the splitting technique for representable map categories.

Sketch of the proof of Theorem 5.17. 1. If $\Sigma = ()$ , then $\mathbb{R}(\Sigma)$ contains only the empty context, which is the terminal object, and thus $\mathfrak{Rep}(\mathbb{R}(\Sigma), \mathcal{C})$ is contractible. If $\Sigma$ is nonempty and unbounded, then the set of objects of $\mathbb{R}(\Sigma)$ is the union of the sets of objects of $\mathbb{R}(\Sigma|_{\alpha})$ indexed over $\alpha \in |\Sigma|$ and, for objects $\Gamma, \Delta \in \mathbb{R}(\Sigma|_{\alpha})$ , the hom-set $\mathbb{R}(\Sigma)(\Gamma, \Delta)$ is the filtered colimit $\textrm{colim}_{\substack{\beta \in |\Sigma| \\ \alpha < \beta}}\mathbb{R}(\Sigma|_{\beta})(\Gamma, \Delta)$ . From this description one can see that the functor $|\mathfrak{Rep}(\mathbb{R}(\Sigma), \mathcal{C})| \to \lim_{\alpha \in |\Sigma|}|\mathfrak{Rep}(\mathbb{R}(\Sigma|_{\alpha}), \mathcal{C})|$ is in fact an isomorphism.

The others are proved using standard techniques of the semantics of dependent type theory. Consider Item 2 which claims that, given a representable map functor $F : \mathbb{R}(\Sigma') \to \mathcal{C}$ and an object $A \in \mathcal{C}/F \Gamma$ , one can extend F to a representable map functor $G : \mathbb{R}(\Sigma) \to \mathcal{C}$ such that $G \alpha \cong A$ and such an extension is unique up to unique isomorphism. To avoid coherence problems, we use Hofmann’s splitting technique (Hofmann Reference Hofmann, Pacholski and Tiuryn1995). Since $\mathcal{C}$ has pullbacks, we have the pseudo-functor $\mathcal{C}/{-} : \mathcal{C}^{\mathrm{op}} \to \mathfrak{Cat}$ . Hofmann’s splitting gives a 2-functor $U : \mathcal{C}^{\mathrm{op}} \to \mathfrak{Cat}$ and a pseudo-natural equivalence $ U \to (\mathcal{C}/{-})$ . We define a 2-functor $R : \mathcal{C}^{\mathrm{op}} \to \mathfrak{Cat}$ by the pullback

We interpret a context $\Sigma \mid \Gamma \vdash \mathsf{ctx}$ as an object $G \Gamma \in \mathcal{C}$ , a type $\Sigma \mid \Gamma \vdash B : {\Box}$ as an object $G B \in U(G \Gamma)$ , a representable type $\Sigma \mid \Gamma \vdash B : {*}$ as an object $G B \in R(G \Gamma)$ and a term $\Sigma \mid \Gamma \vdash b : B$ as a section of $G B \to G \Gamma$ . Hofmann (Reference Hofmann, Pacholski and Tiuryn1995) constructs sufficient structures on U to interpret equality types and dependent product types, when $\mathcal{C}$ is locally cartesian closed. The same construction works for a representable map category $\mathcal{C}$ to interpret dependent product types over representable types in U and R. To interpret a symbol from $\Sigma'$ , apply F and choose a corresponding element of U via the pseudo-natural equivalence $U \simeq (\mathcal{C}/{-})$ . To interpret $\alpha$ , choose an element of $U(F \Gamma)$ corresponding to $A \in \mathcal{C} / F \Gamma$ . This completes the interpretation of the logical framework in U. Applying the pseudo-natural equivalence $U \simeq (\mathcal{C}/{-})$ , we have a representable map functor $G : \mathbb{R}(\Sigma) \to \mathcal{C}$ . All the choices made in this construction are unique up to unique isomorphism, so G is unique up to unique isomorphism.

5.4 Models of syntactic representable map categories

Given a signature $\Sigma$ , we concretely describe the 2-category $\mathfrak{Mod}_{\mathbb{R}(\Sigma)}$ (Theorem 5.19).

Suppose $\Sigma$ is a signature of the form $\Sigma = (\Sigma', \alpha : \Gamma \Rightarrow {\Box})$ . We define a 2-category $(\mathbf{DFib} \downarrow \Gamma^{(-)})$ as follows:

  • the objects are the pairs $(\mathcal{S}, \alpha^{\mathcal{S}})$ consisting of $\mathcal{S} \in \mathfrak{Mod}_{\mathbb{R}(\Sigma')}$ and $\alpha^{\mathcal{S}} \in \mathbf{DFib}_{\mathcal{S}}/\Gamma^{\mathcal{S}}$ ;

  • the morphisms $(\mathcal{S}, \alpha^{\mathcal{S}}) \to (\mathcal{T}, \alpha^{\mathcal{T}})$ are the pairs $(F, F_{\alpha})$ consisting of a morphism $F : \mathcal{S} \to \mathcal{T}$ of models of $\mathbb{R}(\Sigma')$ and a map $F_{\alpha} : \alpha^{\mathcal{S}} \to \alpha^{\mathcal{T}}$ of discrete fibrations over $F : \mathcal{S} \to \mathcal{T}$ such that the diagram

    (2)
    commutes;
  • the 2-morphisms $(F, F_{\alpha}) \Rightarrow (G, G_{\alpha}) : (\mathcal{S}, \alpha^{\mathcal{S}}) \to (\mathcal{T}, \alpha^{\mathcal{T}})$ are the 2-morphisms $\sigma : F \Rightarrow G$ in $\mathfrak{Mod}_{\mathbb{R}(\Sigma')}$ such that there exists a (necessarily unique) natural transformation $\sigma_{\alpha} : F_{\alpha} \Rightarrow G_{\alpha}$ over $\sigma$ .

There is the obvious 2-functor $\mathfrak{Mod}_{\mathbb{R}(\Sigma)} \to (\mathbf{DFib}\downarrow \Gamma^{(-)})$ .

When $\Sigma = (\Sigma', \alpha : \Gamma \Rightarrow {*})$ , the 2-functor $\mathfrak{Mod}_{\mathbb{R}(\Sigma)} \to (\mathbf{DFib} \downarrow \Gamma^{(-)})$ factors through the locally full sub-2-category $(\mathbf{DFib} \downarrow \Gamma^{(-)})_{\mathrm{r}} \subset (\mathbf{DFib} \downarrow\Gamma^{(-)})$ consisting of those objects $(\mathcal{S}, \alpha^{\mathcal{S}})$ such that $\alpha^{\mathcal{S}} \to \Gamma^{\mathcal{S}}$ is a representable map of discrete fibrations over $\mathcal{S}$ and those morphisms $(F, F_{\alpha}) : (\mathcal{S}, \alpha^{\mathcal{S}}) \to (\mathcal{T},\alpha^{\mathcal{T}})$ such that Diagram 2 satisfies the Beck–Chevalley condition.

Suppose $\Sigma = (\Sigma', \alpha : \Gamma \Rightarrow A)$ with $\Sigma'\mid \Gamma \vdash A : {\Box}$ . We define a 2-category $\mathrm{Sect}(A^{(-)})$ as follows:

  • the objects are the pairs $(\mathcal{S}, \alpha^{\mathcal{S}})$ consisting of a model $\mathcal{S}$ of $\mathbb{R}(\Sigma')$ and a section $\alpha^{\mathcal{S}}$ of the map $A^{\mathcal{S}} \to \Gamma^{\mathcal{S}}$ of discrete fibrations over $\mathcal{S}$ ;

  • the morphisms $(\mathcal{S}, \alpha^{\mathcal{S}}) \to (\mathcal{T}, \alpha^{\mathcal{T}})$ are the morphisms $F : \mathcal{S} \to \mathcal{T}$ of models of $\mathbb{R}(\Sigma')$ such that the diagram

    commutes;
  • the 2-morphisms $F \Rightarrow G$ are the 2-morphisms of models of $\mathbb{R}(\Sigma')$ .

There is the obvious 2-functor $\mathfrak{Mod}_{\mathbb{R}(\Sigma')} \to\mathrm{Sect}(A^{(-)})$ .

Theorem 5.19 Let $\Sigma$ be a signature.

  1. (1) If $\Sigma = ()$ , then the 2-functor $\mathfrak{Mod}_{\mathbb{R}(\Sigma)} \to \mathfrak{Cat}_{1}$ is a bi-equivalence, where $\mathfrak{Cat}_{1}$ denotes the 2-category of small categories with terminal objects.

  2. (2) If $|\Sigma|$ is nonempty and unbounded, then the induced 2-functor $\mathfrak{Mod}_{\mathbb{R}(\Sigma)} \to \lim_{\alpha \in |\Sigma|}\mathfrak{Mod}_{\mathbb{R}(\Sigma|_{\alpha})}$ is a bi-equivalence.

  3. (3) If $\Sigma = (\Sigma', \alpha : \Gamma \Rightarrow {\Box})$ , then the 2-functor $\mathfrak{Mod}_{\mathbb{R}(\Sigma)} \to (\mathbf{DFib} \downarrow \Gamma^{(-)})$ is a bi-equivalence.

  4. (4) If $\Sigma = (\Sigma', \alpha : \Gamma \Rightarrow {*})$ , then the 2-functor $\mathfrak{Mod}_{\mathbb{R}(\Sigma)} \to (\mathbf{DFib} \downarrow \Gamma^{(-)})_{\mathrm{r}}$ is a bi-equivalence.

  5. (5) If $\Sigma = (\Sigma', \alpha : \Gamma \Rightarrow A)$ with $\Sigma' \mid \Gamma \vdash A : {\Box}$ , then the 2-functor $\mathfrak{Mod}_{\mathbb{R}(\Sigma)} \to \mathrm{Sect}(A^{(-)})$ is a bi-equivalence.

Sketch of the proof. We use the fact that (2-)morphisms of models of a type theory are also representable map functors (Section 4.3). Then we can apply Theorem 5.17 for building not only models of $\mathbb{R}(\Sigma)$ but also (2-)morphisms of models of $\mathbb{R}(\Sigma)$ .

Note that the 2-functors in the statement are locally faithful. It remains to show that those 2-functors are bi-essentially surjective on objects, locally essentially surjective on objects and locally full. We only demonstrate the statement 3. The others can be proved using the same idea.

To show that the 2-functor $\mathfrak{Mod}_{\mathbb{R}(\Sigma)} \to (\mathbf{DFib} \downarrow \Gamma^{(-)})$ is bi-essentially surjective on objects, let $\mathcal{S}$ be a model of $\mathbb{R}(\Sigma')$ and $p : A \to \Gamma^{\mathcal{S}}$ a map of small discrete fibrations over $\mathcal{S}$ . By Theorem 5.17, the representable map functor $(-)^{\mathcal{S}} : \mathbb{R}(\Sigma') \to \mathbf{DFib}_{\mathcal{S}}$ extends to a representable map functor $(-)^{\widetilde{\mathcal{S}}} : \mathbb{R}(\Sigma) \to \mathbf{DFib}_{\mathcal{S}}$ such that $\alpha^{\widetilde{\mathcal{S}}} \cong A$ . This defines a model $\widetilde{\mathcal{S}}$ of $\mathbb{R}(\Sigma)$ such that the restriction of $\widetilde{\mathcal{S}}$ to $\mathbb{R}(\Sigma')$ is isomorphic to $\mathcal{S}$ and $\alpha^{\widetilde{\mathcal{S}}} \cong A$ .

To show that the 2-functor $\mathfrak{Mod}_{\mathbb{R}(\Sigma)} \to (\mathbf{DFib} \downarrow \Gamma^{(-)})$ is locally essentially surjective on objects, let $\mathcal{S}, \mathcal{T}$ be models of $\mathbb{R}(\Sigma)$ , $F : \mathcal{S} \to \mathcal{T}$ a morphism of models of $\mathbb{R}(\Sigma')$ , and $G : \alpha^{\mathcal{S}} \to \alpha^{\mathcal{T}}$ a map of discrete fibrations such that the diagram

commutes. Then $F_{(-)}$ is a representable map functor $\mathbb{R}(\Sigma') \to (\mathbf{DFib}^{\to})_{F}$ by Proposition 4.20 and G is an object of $(\mathbf{DFib}^{\to})_{F}/F_{\Gamma}$ . By Theorem5.17, the representable map functor $F_{(-)} : \mathbb{R}(\Sigma') \to (\mathbf{DFib}^{\to})_{F}$ extends to a representable map functor $\widetilde{F}_{(-)} : \mathbb{R}(\Sigma) \to (\mathbf{DFib}^{\to})_{F}$ such that $\widetilde{F}_{\alpha} \cong G$ . From $\mathbf{dom} \widetilde{F}_{\alpha} \cong \alpha^{\mathcal{S}}$ and $\mathbf{cod} \widetilde{F}_{\alpha} \cong \alpha^{\mathcal{T}}$ , we have $\mathbf{dom} \widetilde{F}_{({-})} \cong ({-})^{\mathcal{S}}$ and $\mathbf{cod} \widetilde{F}_{({-})} \cong ({-})^{\mathcal{T}}$ again by Theorem 5.17. By Proposition 4.20 and Remark 4.21, $\widetilde{F}_{(-)}$ defines a morphism $\mathcal{S} \to \mathcal{T}$ of models of $\mathbb{R}(\Sigma)$ such that the restriction of $\widetilde{F}_{(-)}$ to $\mathbb{R}(\Sigma')$ is F and $\widetilde{F}_{\alpha} \cong G$ .

The local fullness is similarly proved using the representable map category $(\mathbf{DFib}^{\Theta})_{\sigma}$ instead of $(\mathbf{DFib}^{\to})_{F}$ and Proposition 4.22.

Example 5.20 Consider the signature $\Sigma_{DTT} = (\mathsf{Type} : () \Rightarrow {\Box}, \mathsf{el} : (A : \mathsf{Type}) \Rightarrow {*})$ from Example 5.7. By Theorem 5.19, the 2-category $\mathfrak{Mod}_{\mathbb{R}(\Sigma_{DTT})}$ is bi-equivalent to the 2-category defined as follows:

  • the objects are the triples $(\mathcal{S}, \mathsf{Type}^{\mathcal{S}}, \mathsf{el}^{\mathcal{S}})$ consisting of a small category $\mathcal{S}$ with a terminal object, a small discrete fibration $\mathsf{Type}^{\mathcal{S}}$ over $\mathcal{S}$ and a representable map $\mathsf{el}^{\mathcal{S}} \to \mathsf{Type}^{\mathcal{S}}$ of small discrete fibrations over $\mathcal{S}$ , that is, the categories with families or the natural models;

  • the morphisms $\mathcal{S} \to \mathcal{T}$ are the triples $(F, F_{\mathsf{Type}}, F_{\mathsf{el}})$ consisting of a functor $F : \mathcal{S} \to \mathcal{T}$ preserving terminal objects and maps $F_{\mathsf{Type}} : \mathsf{Type}^{\mathcal{S}} \to \mathsf{Type}^{\mathcal{T}}$ and $F_{\mathsf{el}} : \mathsf{el}^{\mathcal{S}} \to \mathsf{el}^{\mathcal{T}}$ of discrete fibrations over F such that the diagram

    commutes and satisfies the Beck–Chevalley condition, that is, the pseudo cwf-morphisms;
  • the 2-morphisms $F \Rightarrow G : \mathcal{S} \to \mathcal{T}$ are the natural transformations $\sigma : F \Rightarrow G$ between the underlying functors such that there exist (necessarily unique) natural transformations $\sigma_{\mathsf{Type}} : F_{\mathsf{Type}} \Rightarrow G_{\mathsf{Type}}$ and $\sigma_{\mathsf{el}} : F_{\mathsf{el}} \Rightarrow G_{\mathsf{el}}$ over $\sigma$ .

Our choice of 2-morphisms of categories with families is quite natural, but there is another choice: the indexed natural transformations between the associated indexed categories (Clairambault and Dybjer Reference Clairambault and Dybjer2014). A difference is that a collection of types is regarded as a set in our definition while it is regarded as a category in the other definition.

Example 5.21. We describe core components of a model $\mathcal{S}$ of cubical type theory (Example 5.14). In addition to the natural model structure $(\mathcal{S}, \mathsf{Type}^{\mathcal{S}}, \mathsf{el}^{\mathcal{S}})$ , it is equipped with a discrete fibration $\mathbb{I}^{\mathcal{S}}$ over $\mathcal{S}$ such that the map $\mathbb{I}^{\mathcal{S}} \to \mathcal{S}$ is representable and a representable map $\mathsf{true}^{\mathcal{S}} \to \mathsf{Cof}^{\mathcal{S}}$ of discrete fibrations over $\mathcal{S}$ that is also a monomorphism.

By Remark 3.10, $\mathbb{I}^{\mathcal{S}}$ is regarded as an object of the category $\mathcal{S}$ with which $\mathcal{S}$ has products. The cubical set model of cubical type theory (Cohen et al. Reference Cohen, Coquand, Huber, Mörtberg and Uustalu2018, Section 8) is turned into this structure. $\mathcal{S}$ is the category of cubical sets: $\mathsf{Type}^{\mathcal{S}}$ is the discrete fibration of fibrant families of cubical sets; $\mathsf{el}^{\mathcal{S}}$ is the discrete fibration of sections of fibrant families of cubical sets; $\mathbb{I}^{\mathcal{S}}$ is the formal interval; in this example, $\mathsf{Cof}^{\mathcal{S}}$ is also representable and constructed from what is called the face lattice; there is a map $\mathsf{Cof}^{\mathcal{S}} \to \Omega$ to the subobject classifier $\Omega$ in $\mathcal{S}$ , and the map $\mathsf{true}^{\mathcal{S}} \to \mathsf{Cof}^{\mathcal{S}}$ is the monomorphism classified by it.

6. Bi-initial Models

In this section and the next section, we develop the semantics of type theory with the definitions of a type theory and a model of a type theory introduced in Section 4. The first step is to construct a bi-initial model of a type theory.

6.1 Democratic models

Usually a bi-initial model of a type theory is a syntactic one and has a special property: every object is represented by a finite sequence of types. We introduce a class of models of a type theory satisfying this property, generalizing the notion of a democratic category with families (Clairambault and Dybjer Reference Clairambault and Dybjer2014).

Definition 6.1. Let $\mathcal{S}$ be a model of a type theory $\mathbb{T}$ . We inductively define contextual objects in $\mathcal{S}$ as follows:

  1. (1) the terminal object $1 \in \mathcal{S}$ is a contextual object;

  2. (2) if $I \in \mathcal{S}$ is a contextual object, $f : A \to B$ is a representable arrow in $\mathbb{T}$ and $b \in B^{\mathcal{S}}(I)$ is an element over I, then the context extension $\{b\}^{f} \in \mathcal{S}$ is a contextual object.

Note that the terminal object 1 and the context extension $\{b\}^{f}$ are determined only up to unique isomorphism. We include all the terminal objects and all the context extensions in the class of contextual objects so that the class of contextual objects is closed under isomorphisms. We say $\mathcal{S}$ is democratic if every object of $\mathcal{S}$ is contextual and denote by $\mathfrak{Mod}_{\mathbb{T}}^{\mathrm{dem}}$ the full sub-2-category of $\mathfrak{Mod}_{\mathbb{T}}$ consisting of the democratic models.

Proposition 6.2. Any morphism $F : \mathcal{S} \to \mathcal{T}$ of models of a type theory $\mathbb{T}$ carries contextual objects in $\mathcal{S}$ to contextual objects in $\mathcal{T}$ .

Proof. Immediate from the definition.

Democratic models have the following interesting property.

Proposition 6.3. Let $\mathbb{T}$ be a type theory, $\mathcal{S}$ a democratic model of $\mathbb{T}$ and $\mathcal{T}$ an arbitrary model of $\mathbb{T}$ . Let $F, G : \mathcal{S} \to \mathcal{T}$ be morphisms of models of $\mathbb{T}$ .

  1. (1) There is at most one 2-morphism $F \Rightarrow G$ .

  2. (2) Every 2-morphism $F \Rightarrow G$ is invertible.

Consequently, $\mathfrak{Mod}_{\mathbb{T}}(\mathcal{S}, \mathcal{T})$ is equivalent to a discrete category.

Proof. Let $\sigma : F \Rightarrow G$ be a 2-morphism. Each component $\sigma_{I} : F I \to G I$ is uniquely determined and invertible by induction on the contextual object I.

  • $\sigma_{1} : F 1 \to G 1$ must be the unique arrow into the terminal object G 1. Since F 1 is also the terminal object, $\sigma_{1}$ is invertible.

  • Let $I \in \mathcal{S}$ be an object, $f : A \to B$ a representable arrow in $\mathbb{T}$ and $b \in B^{\mathcal{S}}(I)$ an element. Since $G(\{b\}^{f}) \cong \{G_{B}b\}^{f}$ , the component $\sigma_{\{b\}^{f}} : F(\{b\}^{f}) \to G(\{b\}^{f})$ is uniquely determined by $\sigma_{I}$ and by the property that the diagram

    commutes and $G_{A}(\delta^{f}_{b}) \cdot \sigma_{\{b\}^{f}} = F_{A}(\delta^{f}_{b})$ . If $\sigma_{I}$ is invertible, then so is $\sigma_{\{b\}^{f}}$ : the inverse $\sigma_{\{b\}^{f}}^{-1} : G(\{b\}^{f}) \to F(\{b\}^{f})$ is the unique arrow such that $F(\pi^{f}_{b}) \circ \sigma_{\{b\}^{f}}^{-1} = \sigma_{I}^{-1} \circ G(\pi^{f}_{b})$ and $F_{A}(\delta^{f}_{b}) \cdot \sigma_{\{b\}^{f}}^{-1} = G_{A}(\delta^{f}_{b})$ .

An easy way to construct a democratic model is to throw away non-contextual objects from an arbitrary model.

Definition 6.4. Let $\mathcal{S}$ be a model of a type theory $\mathbb{T}$ . We define a model $\mathcal{S}^{\heartsuit}$ of $\mathbb{T}$ as follows.

  • The base category $\mathcal{S}^{\heartsuit}$ is the full subcategory of $\mathcal{S}$ consisting of the contextual objects.

  • For an object $A \in \mathbb{T}$ , we define $A^{\mathcal{S}^{\heartsuit}}$ to be the pullback

$\mathcal{S}^{\heartsuit}$ is indeed a model of $\mathbb{T}$ because $\mathcal{S}^{\heartsuit}$ is closed under context extensions. We call $\mathcal{S}^{\heartsuit}$ the heart of $\mathcal{S}$ .

Let $\mathcal{S}$ be a model of a type theory $\mathbb{T}$ . By definition $\mathcal{S}^{\heartsuit}$ is a democratic model of $\mathbb{T}$ and the obvious inclusion $\mathcal{S}^{\heartsuit} \to \mathcal{S}$ is a morphism of models of $\mathbb{T}$ . The heart $\mathcal{S}^{\heartsuit}$ is the largest democratic model contained in $\mathcal{S}$ in the following sense.

Proposition 6.5. Let $\mathcal{S}$ be a model of a type theory $\mathbb{T}$ . The inclusion $\mathcal{S}^{\heartsuit} \to \mathcal{S}$ induces an isomorphism of categories

$$ \mathfrak{Mod}_{\mathbb{T}}(\mathcal{T}, \mathcal{S}^{\heartsuit}) \cong \mathfrak{Mod}_{\mathbb{T}}(\mathcal{T}, \mathcal{S}) $$

for any democratic model $\mathcal{T}$ of $\mathbb{T}$ .

Proof. By Proposition 6.2, every morphism $\mathcal{T} \to \mathcal{S}$ from a democratic model $\mathcal{T}$ factors through $\mathcal{S}^{\heartsuit}$ .

6.2 The bi-initial model of a type theory

The bi-initial model of a type theory $\mathbb{T}$ is obtained from the Yoneda embedding $\mathbb{T} \to \mathbf{DFib}_{\mathbb{T}}$ .

Lemma 6.6. Let $\mathcal{S}$ be a small cartesian category.

  1. (1) The Yoneda embedding $\mathcal{S} \to \mathbf{DFib}_{\mathcal{S}}$ preserves finite limits.

  2. (2) For any arrow $u : I \to J$ in $\mathcal{S}$ , the map of discrete fibrations $u : \mathcal{S}/I \to \mathcal{S}/J$ is representable with right adjoint $u^{*} : \mathcal{S}/J \to \mathcal{S}/I$ .

  3. (3) The Yoneda embedding preserves existing pushforwards.

Proof. The first two claims are obvious. To prove the third, let $u : I \to J$ and $v : J \to K$ be arrows in $\mathcal{S}$ and suppose that the pushforward $v_{*}I \in \mathcal{S}/K$ exists. By definition, for any arrow $w : L \to K$ in $\mathcal{S}$ , we have a bijection $\mathcal{S}/K(L, v_{*}I) \cong \mathcal{S}/J(v^{*}L, I)$ . This means that we have a pullback

and thus $\mathcal{S}/v_{*}I$ is the pushforward of $u : \mathcal{S}/I \to \mathcal{S}/J$ along $v : \mathcal{S}/J \to \mathcal{S}/K$ by Proposition 3.21.

Definition 6.7 Let $\mathbb{T}$ be a type theory. The Yoneda embedding $\mathbb{T}/({-}) : \mathbb{T} \to \mathbf{DFib}_{\mathbb{T}}$ is a representable map functor by Lemma 6.6, so we have a model $(\mathbb{T}, \mathbb{T}/({-}))$ of $\mathbb{T}$ . We denote by $\mathcal{I}(\mathbb{T})$ the heart of $(\mathbb{T}, \mathbb{T}/({-}))$ and call it the bi-initial model of $\mathbb{T}$ due to Theorem 6.10 below.

We describe the model $\mathcal{I}(\mathbb{T})$ in more detail. For an object $I \in \mathbb{T}$ , a representable arrow $f : A \to B$ in $\mathbb{T}$ and an object $(b : I \to B) \in \mathbb{T}/B$ , the context extension $\{b\}^{f}$ in the model $(\mathbb{T}, \mathbb{T}/({-}))$ is the pullback in $\mathbb{T}$

Thus, the base category $\mathcal{I}(\mathbb{T})$ is the full subcategory of $\mathbb{T}$ consisting of those objects $A \in \mathbb{T}$ such that the unique arrow $A \to 1$ is representable. For an object $A \in \mathbb{T}$ , the discrete fibration $A^{\mathcal{I}(\mathbb{T})}$ is the comma category $\mathcal{I}(\mathbb{T})/A$ defined by the pullback

Example 6.8 Suppose that $\mathbb{T}$ contains a representable arrow $\partial : E \to U$ and that every representable arrow in $\mathbb{T}$ is a composite of pullbacks of $\partial$ . For example, the basic dependent type theory $\mathbb{G}$ and its slices $\mathbb{G}/A$ satisfy this assumption. Then the base category of $\mathcal{I}(\mathbb{T})$ is equivalent to the following:

  • the objects are the finite sequences $(A_{1}, \dots, A_{n})$ of arrows $A_{i} : |A_{i-1}| \to U$ where $|A_{0}| = 1$ and $|A_{i}| = A_{i}^{*}E$ for $i \ge 1$ ;

  • the arrows $(A_{1}, \dots, A_{n}) \to (B_{1}, \dots, B_{m})$ are the arrows $|A_{n}| \to |B_{m}|$ in $\mathbb{T}$ .

When we think of U as the object of types and E as the object of elements, an object in $\mathcal{I}(\mathbb{T})$ is a finite sequence of types, that is, a context. For an object $I \in \mathcal{I}(\mathbb{T})$ , elements of $U^{\mathcal{I}(\mathbb{T})}(I)$ and $E^{\mathcal{I}(\mathbb{T})}(I)$ are types and elements, respectively, indexed over the context I. Hence, the bi-initial model $\mathcal{I}(\mathbb{T})$ generalizes the usual syntactic models of dependent type theories.

Example 6.9. Let $\Sigma$ be a signature of the logical framework (Section 5) and take the syntactic representable map category $\mathbb{R}(\Sigma)$ (Section 5.3). The base category of $\mathcal{I}(\mathbb{R}(\Sigma))$ is the full subcategory of $\mathbb{R}(\Sigma)$ spanned by those contexts $(x_{1} : A_{1}, \dots, x_{n} : A_{n})$ such that $A_{1}, \dots, A_{n}$ are all representable types. When $\Sigma$ is $\Sigma_{DTT}$ (Example 5.7) or its extension by type constructors, all of $A_{i}$ ’s are of the form $\mathsf{el}(B)$ for $B : \mathsf{Type}$ . When $\Sigma$ is the signature for cubical type theory (Example 5.14), $A_{i}$ ’s are either $\mathsf{el}(B)$ for $B : \mathsf{Type}$ , $\mathbb{I}$ or $\mathsf{true}(P)$ for $P : \mathsf{Cof}$ .

Theorem 6.10. For any type theory $\mathbb{T}$ , the model $\mathcal{I}(\mathbb{T})$ is a bi-initial object of $\mathfrak{Mod}_{\mathbb{T}}$ . That is, the category $\mathfrak{Mod}_{\mathbb{T}}(\mathcal{I}(\mathbb{T}), \mathcal{S})$ is contractible for any model $\mathcal{S}$ of $\mathbb{T}$ .

Proof. We show that there exists a morphism $\mathcal{I}(\mathbb{T}) \to \mathcal{S}$ and that morphisms $\mathcal{I}(\mathbb{T}) \to \mathcal{S}$ are unique up to unique isomorphism.

We first show the existence of a morphism $\mathcal{I}(\mathbb{T}) \to \mathcal{S}$ . For every object $I \in \mathcal{I}(\mathbb{T})$ , the unique map $I^{\mathcal{S}} \to \mathcal{S}$ of discrete fibrations over $\mathcal{S}$ is representable. In particular, the discrete fibration $I^{\mathcal{S}} \in \mathbf{DFib}_{\mathcal{S}}$ is representable because the category $\mathcal{S}$ has a terminal object. Hence, the restriction of $({-})^{\mathcal{S}} : \mathbb{T} \to \mathbf{DFib}_{\mathcal{S}}$ to $\mathcal{I}(\mathbb{T})$ factors, up to natural isomorphism, as a functor $F : \mathcal{I}(\mathbb{T}) \to \mathcal{S}$ followed by the Yoneda embedding $\mathcal{S} \to \mathbf{DFib}_{\mathcal{S}}$ . For objects $A \in \mathbb{T}$ and $I \in \mathcal{I}(\mathbb{T})$ and an arrow $a : I \to A$ , we define $F_{A}(a) \in A^{\mathcal{S}}(FI)$ to be $\mathcal{S}/FI \cong I^{\mathcal{S}} \overset{a^{\mathcal{S}}}{\longrightarrow} A^{\mathcal{S}}$ , yielding a map $F_{A} : \mathcal{I}(\mathbb{T})/A \to A^{\mathcal{S}}$ of discrete fibrations over $F : \mathcal{I}(\mathbb{T}) \to \mathcal{S}$ .

Clearly, $F : \mathcal{I}(\mathbb{T}) \to \mathcal{S}$ preserves terminal objects and $A \mapsto F_{A}$ is natural. To see the Beck–Chevalley condition, let $f : A \to B$ be a representable arrow in $\mathbb{T}$ . We have to show that the diagram

satisfies the Beck–Chevalley condition. It suffices to show that the composite of squares

(3)

satisfies the Beck–Chevalley condition for all objects $(b : I \to B) \in \mathcal{I}(\mathbb{T})/B$ . By the definition of $F_{({-})}$ , Diagram 3 is equal to the following composite of squares.

(4)

To show that Diagram 4 satisfies the Beck–Chevalley condition for all $(b : I \to B) \in \mathcal{I}(\mathbb{T})/B$ , it suffices to check that the canonical natural transformation $(f^{*}b)^{\mathcal{S}}F(b^{*}f)^{*} \Rightarrow \delta^{f}b^{\mathcal{S}}F$ induced by Diagram 4 is invertible at $\mathrm{id}_{I} \in \mathcal{I}(\mathbb{T})/I$ for all $(b : I \to B) \in \mathcal{I}(\mathbb{T})/B$ . This is straightforward because the right-most square of Diagram 4 is a pullback in $\mathbf{DFib}_{\mathcal{S}}$ and thus satisfies the Beck–Chevalley condition by Corollary 3.15.

To show the uniqueness of morphisms $\mathcal{I}(\mathbb{T}) \to \mathcal{S}$ , let $G : \mathcal{I}(\mathbb{T}) \to \mathcal{S}$ be another morphism of models of $\mathbb{T}$ . By Proposition 6.3, it suffices to show that there exists a 2-morphism $F \Rightarrow G$ . Let $I \in \mathcal{I}(\mathbb{T})$ be an object and let $u : I \to 1$ denote the unique arrow to the terminal object. By the Beck–Chevalley condition for the square

we have the natural isomorphism $G_{I} u^{*} \cong \delta^{u} G : \mathcal{I}(\mathbb{T}) \to I^{\mathcal{S}}$ . Since $\delta^{u} G$ preserves terminal objects, $G_{I}(\mathrm{id}_{I}) \cong G_{I}(u^{*} 1)$ is the terminal object. Thus, by Proposition 3.5, we have $\mathcal{S}/GI \cong I^{\mathcal{S}}$ . For an arrow $a : I \to A$ in $\mathbb{T}$ with $I \in \mathcal{I}(\mathbb{T})$ , the diagram

commutes. This means that $G_{A}(a) \in A^{\mathcal{S}}(GI)$ is given by the composite $\mathcal{S}/GI \cong I^{\mathcal{S}} \overset{a^{\mathcal{S}}}{\longrightarrow} A^{\mathcal{S}}$ . Hence, G has the same definition as F, and thus $F \cong G$ .

7. Internal Languages

In this section, we establish a correspondence between theories and models for every type theory $\mathbb{T}$ . We begin with a definition of a theory over $\mathbb{T}$ or $\mathbb{T}$ -theory.

Definition 7.1. Let $\mathbb{T}$ be a type theory. A theory over $\mathbb{T}$ or $\mathbb{T}$ -theory is a cartesian functor $K : \mathbb{T} \to \mathbf{Set}$ . We denote by $\mathbf{Th}_{\mathbb{T}}$ the category of $\mathbb{T}$ -theories and their maps, that is, natural transformations.

For a $\mathbb{T}$ -theory K, we think of K(A) for an object $A \in \mathbb{T}$ as a set of closed derivations of judgment form A. While K respects finite limits, representable maps, and pushforward along them are disregarded. Indeed, for a representable map $A \to 1$ and an arbitrary object B in $\mathbb{T}$ , not all set-theoretic functions $K(A) \to K(B)$ should be closed derivations of the exponential $A \Rightarrow B$ .

Example 7.2. Consider the basic dependent type theory $\mathbb{G}$ (Section 4.1). The theory of locally presentable categories (Adámek and Rosický Reference Adámek and Rosický1994) shows that $\mathbf{Th}_{\mathbb{G}}$ is equivalent to the category of generalized algebraic theories and interpretations between them; see also (Uemura Reference Uemura2022, Remark 3.26). Concretely, for a $\mathbb{G}$ -theory $K : \mathbb{G} \to \mathbf{Set}$ , the corresponding generalized algebraic theory $\Sigma_{K}$ can be described as follows:

  • a closed type $({} \vdash A)$ in $\Sigma_{K}$ corresponds to an element of $K(U_{0})$ . Thus, $K(U_{0})$ is the set of closed types;

  • a closed term $({} \vdash a : A)$ in $\Sigma_{K}$ corresponds to an element of $K(E_{0})$ such that $\partial_{0} \cdot a = A$ . Thus, $K(E_{0})$ is the set of closed terms;

  • a type $(x_{0} : A_{0}, \dots, x_{n-1} : A_{n-1} \vdash A_{n})$ in $\Sigma_{K}$ corresponds to an element of $K(U_{n})$ such that $\mathrm{ft}_{i} \cdot A_{i} = A_{i-1}$ for $i = n, \dots, 1$ . Thus, $K(U_{n})$ is the set of types over a context of length n;

  • a term $(x_{0} : A_{0}, \dots, x_{n-1} : A_{n-1} \vdash a_{n} : A_{n})$ in $\Sigma_{K}$ corresponds to an element of $K(E_{n})$ such that $\partial_{n} \cdot a_{n} = A_{n}$ and $\mathrm{ft}_{i} \cdot A_{i} = A_{i-1}$ for $i = n, \dots, 1$ . Thus, $K(E_{n})$ is the set of terms over a context of length n.

From Theorem 4.12, one can see that every object $A \in \mathbb{G}$ is a finite limit of $U_{n}$ and $E_{n}$ , and thus the other sets K(A) are finite limits of $K(U_{n})$ and $K(E_{n})$ .

Example 7.3. Let $\Sigma$ be a signature of the logical framework (Section 5) and take the syntactic representable map category $\mathbb{R}(\Sigma)$ (Section 5.3). Every context $\Sigma \mid \Gamma \vdash \mathsf{ctx}$ induces the $\mathbb{R}(\Sigma)$ -theory $\mathbb{R}(\Sigma)(\Gamma, {-}) : \mathbb{R}(\Sigma) \to \mathbf{Set}$ . When $\Gamma = (x_{1} : A_{1}, \dots, x_{n} : A_{n})$ , we think of $\mathbb{R}(\Sigma)(\Gamma, {-})$ as the theory consisting of constants $c_{1} : A_{1}, c_{2} : A_{2}[c_{1}/x_{1}], \dots, c_{n} : A_{n}[c_{1}/x_{1}, \dots, c_{n-1}/x_{n-1}]$ . Indeed, $\mathbb{R}(\Sigma)(\Gamma, \Delta)$ is the set of derivations from $\Gamma$ to $\Delta$ , but they are equivalent to closed derivations of $\Delta$ where $x_{1}, \dots, x_{n}$ are regarded as constants. A $\mathbb{R}(\Sigma)$ -theory of the form $\mathbb{R}(\Sigma)(\Gamma, {-})$ is thus a finite $\mathbb{R}(\Sigma)$ -theory. The theory of locally presentable categories (Adámek and Rosický Reference Adámek and Rosický1994) shows that any $\mathbb{R}(\Sigma)$ -theory is written as a filtered colimit of finite $\mathbb{R}(\Sigma)$ -theories.

The internal language of a model of $\mathbb{T}$ is then easily defined.

Definition 7.4. Let $\mathbb{T}$ be a type theory and $\mathcal{S}$ a model of $\mathbb{T}$ . We define a $\mathbb{T}$ -theory $\mathrm{L}_{\mathbb{T}}\mathcal{S}$ to be $\mathbf{DFib}_{\mathcal{S}}(\mathcal{S}, ({-})^{\mathcal{S}})$ , where we regard $\mathcal{S}$ as a discrete fibration over $\mathcal{S}$ with the identity functor $\mathcal{S} \to \mathcal{S}$ . Note that $\mathrm{L}_{\mathbb{T}}\mathcal{S}(A) \cong A^{\mathcal{S}}(1)$ because $\mathcal{S}$ has the terminal object 1. We call $\mathrm{L}_{\mathbb{T}}\mathcal{S}$ the internal language of $\mathcal{S}$ .

Example 7.5. Let $\mathcal{S}$ be a model of the type theory $\mathbb{G}$ , that is, a category with families. We think of $U_{0}^{\mathcal{S}}$ as a discrete fibration of types and $E_{0}^{\mathcal{S}}$ as a discrete fibration of terms. Consider the set $\mathrm{L}_{\mathbb{G}}\mathcal{S}(U_{n}) \cong U_{n}^{\mathcal{S}}(1)$ . By Item 3 of Theorem 4.12, it is isomorphic to $(\mathrm{P}_{\partial_{0}}^{n}U_{0})^{\mathcal{S}}(1)$ . By Proposition 3.21 an element of $(\mathrm{P}_{\partial_{0}}^{n}U_{0})^{\mathcal{S}}(1)$ is a sequence $(a_{0}, \dots, a_{n})$ of elements $a_{0} \in U_{0}^{\mathcal{S}}(1), a_{1} \in U_{0}^{\mathcal{S}}(\{a_{0}\}^{\partial_{0}}), \dots, a_{n} \in U_{0}^{\mathcal{S}}(\{a_{n-1}\}^{\partial_{0}})$ . In other words, $\mathrm{L}_{\mathbb{G}}\mathcal{S}(U_{n})$ is the set of types in $\mathcal{S}$ over a context of length n. Similarly, $\mathrm{L}_{\mathbb{G}}\mathcal{S}(E_{n})$ is the set of terms in $\mathcal{S}$ over a context of length n.

Proposition 7.6. For a type theory $\mathbb{T}$ , the map $\mathcal{S} \mapsto \mathrm{L}_{\mathbb{T}}\mathcal{S}$ is part of a 2-functor $\mathrm{L}_{\mathbb{T}} : \mathfrak{Mod}_{\mathbb{T}} \to \mathbf{Th}_{\mathbb{T}}$ , where we regard $\mathbf{Th}_{\mathbb{T}}$ as a locally discrete 2-category.

Proof. For a morphism $F : \mathcal{S} \to \mathcal{T}$ of models of $\mathbb{T}$ , an object $A \in \mathbb{T}$ and a map $c : \mathcal{S} \to A^{\mathcal{S}}$ , we regard c as an element $c \in A^{\mathcal{S}}(1)$ and define $\mathrm{L}_{\mathbb{T}}F(c) : \mathcal{T} \to A^{\mathcal{T}}$ to be the map corresponding to the element $F_{A} c \in A^{\mathcal{T}}(F 1) \cong A^{\mathcal{T}}(1)$ . In other words, $\mathrm{L}_{\mathbb{T}}F(c) : \mathcal{T} \to A^{\mathcal{T}}$ is the unique map such that the diagram

commutes. For a 2-morphism $\sigma : F \Rightarrow G : \mathcal{S} \to \mathcal{T}$ of models of $\mathbb{T}$ , we have $\mathrm{L}_{\mathbb{T}}F = \mathrm{L}_{\mathbb{T}}G$ because $F_{A} c = G_{A} c \cdot \sigma_{1}$ for any element $c \in A^{\mathcal{S}}(1)$ .

The goal of this section is to show that the internal language 2-functor $\mathrm{L}_{\mathbb{T}} : \mathfrak{Mod}_{\mathbb{T}} \to \mathbf{Th}_{\mathbb{T}}$ has a left bi-adjoint $\mathbf{M}_{\mathbb{T}} : \mathbf{Th}_{\mathbb{T}} \to \mathfrak{Mod}_{\mathbb{T}}$ (Theorem 7.20) and induces a bi-equivalence $\mathfrak{Mod}_{\mathbb{T}}^{\mathrm{dem}} \simeq \mathbf{Th}_{\mathbb{T}}$ (Theorem 7.31).

The idea of the construction of the left bi-adjoint $\mathbf{M}_{\mathbb{T}}$ of $\mathrm{L}_{\mathbb{T}}$ is as follows. We consider the case of $\mathbb{T} = \mathbb{G}$ . From Example 7.2, a $\mathbb{T}$ -theory K consists of sets $K(U_{n})$ of types, sets $K(E_{n})$ of terms, and so on. We adjoin to $\mathbb{T}$ types of K as type constructors and terms of K as term constructors, yielding a new type theory ${\mathbb{T}}[K]$ together with an inclusion $\mathbb{T} \to {\mathbb{T}}[K]$ . We take the bi-initial model $\mathcal{I}({\mathbb{T}}[K])$ and then obtain a model $\mathbf{M}_{\mathbb{T}}K$ of $\mathbb{T}$ by restricting $({-})^{\mathcal{I}({\mathbb{T}}[K])} : {\mathbb{T}}[K] \to\mathbf{DFib}_{\mathcal{I}({\mathbb{T}}[K])}$ along $\mathbb{T} \to {\mathbb{T}}[K]$ .

In Section 7.1, we review filtered pseudo-colimits of categories and show that representable map categories are closed under filtered pseudo-colimits. The type theory ${\mathbb{T}}[K]$ is defined as a filtered pseudo-colimit in Section 7.2. In Section 7.3, we show that $\mathbf{M}_{\mathbb{T}}$ is left bi-adjoint to $\mathrm{L}_{\mathbb{T}}$ . In Section 7.4, we show that $\mathrm{L}_{\mathbb{T}}$ induces a bi-equivalence $\mathfrak{Mod}_{\mathbb{T}}^{\mathrm{dem}} \simeq \mathbf{Th}_{\mathbb{T}}$ .

7.1 Filtered pseudo-colimits of representable map categories

In this preliminary subsection, we show that the 2-category of representable map categories has filtered pseudo-colimits.

Definition 7.7. Let $\mathcal{C} : \mathcal{I} \to \mathfrak{Cat}$ be a pseudo-functor from a small category $\mathcal{I}$ . We define a small category ${plim}_{i \in \mathcal{I}}\mathcal{C}_{i}$ called the pseudo-limit of $\mathcal{C}$ as follows.

  • An object of ${plim}_{i \in \mathcal{I}}\mathcal{C}_{i}$ consists of the following data:

    1. - for each object $i \in \mathcal{I}$ , an object $A_{i} \in \mathcal{C}_{i}$ ;

    2. - for each arrow $u : i \to i'$ in $\mathcal{I}$ , an isomorphism $A_{u} : u \cdot A_{i} \cong A_{i'}$

      satisfying the following conditions:

    3. - for any object $i \in \mathcal{I}$ , the diagram

      commutes;
    4. - for any arrows $u : i \to i'$ and $v : i' \to i''$ in $\mathcal{I}$ , the diagram

      commutes.

  • An arrow $A \to B$ in ${plim}_{i \in \mathcal{I}}\mathcal{C}_{i}$ consists of an arrow $f_{i} : A_{i} \to B_{i}$ for each object $i \in \mathcal{I}$ such that, for any arrow $u : i \to i'$ in $\mathcal{I}$ , the diagram

    commutes.

Definition 7.8. Let $\mathcal{I}$ be a category. We say $\mathcal{I}$ is filtered if every finite diagram in $\mathcal{I}$ has a cocone. $\mathcal{I}$ is cofiltered if $\mathcal{I}^{\mathrm{op}}$ is filtered.

Definition 7.9. Let $\mathcal{C} : \mathcal{I} \to \mathfrak{Cat}$ be a pseudo-functor from a filtered small category $\mathcal{I}$ . We define a small category ${pcolim}_{i \in \mathcal{I}}\mathcal{C}_{i}$ as follows.

  • The objects of ${pcolim}_{i \in \mathcal{I}}\mathcal{C}_{i}$ are the pairs (i, A) of objects $i \in \mathcal{I}$ and $A \in \mathcal{C}_{i}$ .

  • For objects $(i_{1}, A_{1}), (i_{2}, A_{2}) \in {pcolim}_{i \in \mathcal{I}}\mathcal{C}_{i}$ we define

    $$ \mathop{{pcolim}}_{i \in \mathcal{I}}\mathcal{C}_{i}((i_{1}, A_{1}), (i_{2}, A_{2})) = \mathop{{colim}}_{\substack{i \in \mathcal{I} \\ u_{1} : i_{1} \to i \\ u_{2} : i_{2} \to i}}\mathcal{C}_{i}(u_{1} \cdot A_{1}, u_{2} \cdot A_{2}). $$

There are the obvious functors $\iota_{i} : \mathcal{C}_{i} \to {pcolim}_{i \in \mathcal{I}}\mathcal{C}_{i}$ for objects $i \in \mathcal{I}$ and natural isomorphisms $\iota_{u} : \iota_{i} \cong \iota_{i'} \circ \mathcal{C}_{u}$ for arrows $u : i \to i'$ in $\mathcal{I}$ , yielding an object $\iota \in {plim}_{i \in \mathcal{I}}\mathfrak{Cat}(\mathcal{C}_{i}, {pcolim}_{i \in \mathcal{I}}\mathcal{C}_{i})$ . For a category $\mathcal{D}$ , the canonical functor

$$ \iota^{*} : \mathfrak{Cat}(\mathop{{pcolim}}_{i \in \mathcal{I}}\mathcal{C}_{i}, \mathcal{D}) \to \mathop{{plim}}_{i \in \mathcal{I}}\mathfrak{Cat}(\mathcal{C}_{i}, \mathcal{D}) $$

is an isomorphism of categories. We call ${pcolim}_{i \in \mathcal{I}}\mathcal{C}_{i}$ the filtered pseudo-colimit of $\mathcal{C}$ .

An important property of filtered pseudo-colimits is that filtered pseudo-colimits in $\mathfrak{Cat}$ commute with finite bi-limits (Descotte et al. Reference Descotte, Dubuc and Szyld2018, Theorem 3.2). We only use the following special cases.

Lemma 7.10. Filtered pseudo-colimits commute with finite cotensors. More precisely, for a pseudo-functor $\mathcal{C} : \mathcal{I} \to \mathfrak{Cat}$ from a filtered small category $\mathcal{I}$ and a finite category $\mathcal{J}$ , the canonical functor

$$ \mathop{{pcolim}}_{i \in \mathcal{I}}\mathcal{C}_{i}^{\mathcal{J}} \to \left(\mathop{{pcolim}}_{i \in \mathcal{I}}\mathcal{C}_{i}\right)^{\mathcal{J}} $$

is an equivalence of categories.

Lemma 7.11. Filtered pseudo-colimits commute with slicing. More precisely, for a pseudo-functor $\mathcal{C} : \mathcal{I} \to \mathfrak{Cat}$ from a filtered small category $\mathcal{I}$ and objects $i_{0} \in \mathcal{I}$ and $A \in \mathcal{C}_{i_{0}}$ , the canonical functor

$$ \mathop{{pcolim}}_{(u : i_{0} \to i) \in i_{0} / \mathcal{I}}\left(\mathcal{C}_{i}/u \cdot A\right) \to \left(\mathop{{pcolim}}_{i \in \mathcal{I}}\mathcal{C}_{i}\right)/(i_{0}, A) $$

is an equivalence of categories.

Proof. By the bicategorical Yoneda lemma, the pair $(i_{0}, A)$ corresponds to a pseudo-natural transformation $A : \mathcal{I}(i_{0}, {-}) \to \mathcal{C}$ . Let $(\mathcal{C} \downarrow A)$ be the oplax bi-limit of the 1-cell $A : \mathcal{I}(i_{0}, {-}) \to \mathcal{C}$ in the 2-category of pseudo-functors $\mathcal{I} \to \mathfrak{Cat}$ , pseudo-natural transformations and modifications. $(\mathcal{C} \downarrow A)$ is calculated pointwise, so $(\mathcal{C} \downarrow A)_{i}$ is the category of pairs (u, B) consisting of an arrow $u : i_{0} \to i$ in $\mathcal{I}$ and an object $B \in \mathcal{C}/u \cdot A$ . One can check that the filtered pseudo-colimit of $(\mathcal{C} \downarrow A) : \mathcal{I} \to \mathfrak{Cat}$ is equivalent to $\textrm{pcolim}_{(u : i_{0} \to i) \in i_{0} / \mathcal{I}}(\mathcal{C}_{i}/u \cdot A)$ and that the filtered pseudo-colimit of $\mathcal{I}(i_{0}, {-}) : \mathcal{I} \to \mathfrak{Cat}$ is equivalent to the terminal category. Thus, it follows from the commutation of filtered pseudo-colimits and oplax bi-limits of a 1-cell that $\textrm{pcolim}_{(u : i_{0} \to i) \in i_{0} / \mathcal{I}}(\mathcal{C}_{i}/u \cdot A)$ is canonically equivalent to the oplax limit of the 1-cell $(i_{0}, A) : 1 \to \textrm{pcolim}_{i \in \mathcal{I}}\mathcal{C}_{i}$ in $\mathfrak{Cat}$ , that is, the slice category $\left(\textrm{pcolim}_{i \in \mathcal{I}}\mathcal{C}_{i}\right)/(i_{0}, A)$ .

Proposition 7.12. Let $\mathcal{C} : \mathcal{I} \to \mathfrak{Cat}$ be a pseudo-functor from a filtered small category $\mathcal{I}$ .

  1. (1) If all $\mathcal{C}_{i}$ are cartesian categories and all $\mathcal{C}_{u} : \mathcal{C}_{i} \to \mathcal{C}_{i'}$ are cartesian functors, then ${pcolim}_{i \in \mathcal{I}}\mathcal{C}_{i}$ is a cartesian category and the functors $\iota_{i} : \mathcal{C}_{i} \to {pcolim}_{i \in \mathcal{I}}\mathcal{C}_{i}$ are cartesian functors.

  2. (2) Suppose the hypotheses of 1 hold. Let $i_{0}$ be an object of $\mathcal{I}$ and $f : A \to B$ an arrow in $\mathcal{C}_{i_{0}}$ . Suppose that, for any arrow $u : i_{0} \to i$ , the pushforwards along $u \cdot f$ exist and that, for any arrows $u : i_{0} \to i$ and $v : i \to i'$ , the functor $\mathcal{C}_{v} : \mathcal{C}_{i} \to \mathcal{C}_{i'}$ carries pushforwards along $u \cdot f$ to those along $vu \cdot f$ . Then pushforwards along $\iota_{i_{0}}(f)$ exist and the functor $\iota_{i_{0}} : \mathcal{C}_{i_{0}} \to {pcolim}_{i \in \mathcal{I}}\mathcal{C}_{i}$ carries pushforwards along f to those along $\iota_{i_{0}}(f)$ .

Proof. Since limits in a category $\mathcal{C}$ are given by the right adjoint to the diagonal functor $\mathcal{C} \to \mathcal{C}^{\mathcal{J}}$ , the statement 1 is an immediate consequence of Lemma 7.10. For 2 consider the diagram

This diagram commutes up to canonical isomorphism by 1. The horizontal functors are equivalences by Lemma 7.11. Thus, $\iota_{i_{0}}(f)^{*}$ has a right adjoint because $\textrm{pcolim}_{u}(u \cdot f)^{*}$ has a right adjoint by assumption.

Let $\mathcal{C} : \mathcal{I} \to \mathfrak{Rep}$ be a pseudo-functor from a filtered small category $\mathcal{I}$ . We define an arrow in $\textrm{pcolim}_{i \in \mathcal{I}}\mathcal{C}_{i}$ to be representable if it is isomorphic to the image of a representable arrow in $\mathcal{C}_{i}$ by $\iota_{i}$ for some $i \in \mathcal{I}$ . Then, by Proposition 7.12, $\textrm{pcolim}_{i \in \mathcal{I}}\mathcal{C}_{i}$ forms a representable map category and the functors $\iota_{i} : \mathcal{C}_{i} \to \textrm{pcolim}_{i \in \mathcal{I}}\mathcal{C}_{i}$ are representable map functors. The following is immediate from the construction.

Proposition 7.13. Let $\mathcal{C} : \mathcal{I} \to \mathfrak{Rep}$ be a pseudo-functor from a filtered small category $\mathcal{I}$ and $\mathcal{D}$ a representable map category. Then the canonical functor

$$ \iota^{*} : \mathfrak{Rep}(\mathop{{pcolim}}_{i \in \mathcal{I}}\mathcal{C}_{i}, \mathcal{D}) \to \mathop{{plim}}_{i \in \mathcal{I}}\mathfrak{Rep}(\mathcal{C}_{i}, \mathcal{D}) $$

is an isomorphism of categories.

7.2 Type theory generated by a theory

Given a theory K over a type theory $\mathbb{T}$ , we obtain another type theory ${\mathbb{T}}[K]$ by adjoining to $\mathbb{T}$ the constants of K as inference rules with no premises. To make it precise, we will show that, for an object $A \in \mathbb{T}$ , the slice category $\mathbb{T}/A$ is the type theory obtained from $\mathbb{T}$ by freely adjoining a global section of A (Proposition 7.19). Then the type theory ${\mathbb{T}}[K]$ is defined to be a suitable filtered pseudo-colimit of slices $\mathbb{T}/A$ .

Lemma 7.14. Let $\mathcal{C}$ be a small cartesian category and $K : \mathcal{C} \to \mathbf{Set}$ a functor. Then K is cartesian if and only if its category of elements $\int_{\mathcal{C}}K$ is cofiltered.

Proof. The proof can be found, for instance, in Mac Lane andMoerdijk (Reference Mac Lane and Moerdijk1992, Section VII.6).

Definition 7.15. Let K be a theory over a type theory $\mathbb{T}$ . We define a type theory ${\mathbb{T}}[K]$ to be the filtered pseudo-colimit of the composite pseudo-functor

By definition, an object of ${\mathbb{T}}[K]$ is a triple (A, c, f) consisting of an object $A \in \mathbb{T}$ , an element $c \in K(A)$ and an object $f \in \mathbb{T}/A$ . We think of an object $A \in \mathbb{T}$ as an object of ${\mathbb{T}}[K]$ via the inclusion $A \mapsto (1, {*}, A)$ , where ${*}$ is the unique element of K(1).

Lemma 7.16. Let K be a theory over a type theory $\mathbb{T}$ . For an object $A \in \mathbb{T}$ , we have a natural bijection $K(A) \cong {\mathbb{T}}[K](1, A)$ .

Proof.

By Lemma 7.16 we identify an element $c \in K(A)$ with the corresponding arrow $c : 1 \to A$ in ${\mathbb{T}}[K]$ .

Proposition 7.17. Let K be a theory over a type theory $\mathbb{T}$ and $\mathcal{C}$ a locally small representable map category. For a representable map functor $F : \mathbb{T} \to \mathcal{C}$ , we have an equivalence of categories

$$ (\mathbb{T} / \mathfrak{Rep})({\mathbb{T}}[K], \mathcal{C}) \simeq \mathbf{Th}_{\mathbb{T}}(K, \mathcal{C}(1, F {-})) $$

that sends a representable map functor $G : {\mathbb{T}}[K] \to \mathcal{C}$ equipped with a natural isomorphism $\sigma_{A} : G A \cong F A$ for $A \in \mathbb{T}$ to the natural transformation $K(A) \ni c \mapsto \sigma_{A} \circ G c \in \mathcal{C}(1, F A)$ .

To prove Proposition 7.17, we show that the slice category $\mathbb{T}/A$ over an object $A \in \mathbb{T}$ is the representable map category obtained from $\mathbb{T}$ by freely adjoining an arrow $1 \to A$ . Let $\mathcal{C}$ be a representable map category and $A \in \mathcal{C}$ an object. We have a representable map functor $A^{*} : \mathcal{C} \to \mathcal{C}/A$ defined by $A^{*}B = A \times B$ and an arrow $\Delta_{A} : 1 \to A^{*}A$ in $\mathcal{C}/A$ represented by the diagonal arrow $A \to A \times A$ .

Lemma 7.18. Let $\mathcal{C}$ be a cartesian category and $A \in \mathcal{C}$ an object. For every object $f : B \to A$ of $\mathcal{C}/A$ , we have the following pullback in $\mathcal{C}/A$ .

Proof. The square

is a pullback in $\mathcal{C}$ .

Proposition 7.19. Let $\mathcal{C}$ be a representable map category and $A \in \mathcal{C}$ an object. For any representable map category $\mathcal{D}$ and representable map functor $F : \mathcal{C} \to \mathcal{D}$ , the functor

$$ (\mathcal{C} / \mathfrak{Rep})(\mathcal{C}/A, \mathcal{D}) \ni (G, \sigma) \mapsto \sigma_{A} \circ G \Delta_{A} \in \mathcal{D}(1, F A) $$

is an equivalence of categories.

Proof. Since $\mathcal{D}(1, F A)$ is a discrete category, it suffices to show that every fiber of the functor is contractible. Let $a : 1 \to F A$ be an arrow. By Lemma 7.18, a representable map functor $G : \mathcal{C}/A \to \mathcal{D}$ equipped with a natural isomorphism $\sigma : G A^{*} \cong F$ such that $\sigma_{A} \circ G \Delta_{A} = a$ must send an object $f : B \to A$ of $\mathcal{C}/A$ to the pullback

Hence such a pair $(G, \sigma)$ is unique up to unique isomorphism. Such a $(G, \sigma)$ exists because the composite is a representable map functor such that $a^{*} (F/A) A^{*} \cong F$ .

Proof of Proposition 7.17. We have equivalences of categories $(\mathbb{T} / \mathfrak{Rep})({\mathbb{T}}[K], \mathcal{C}) \simeq \textrm{plim}_{(A, c) \in \int_{\mathbb{T}}K}(\mathbb{T} / \mathfrak{Rep})(\mathbb{T}/A, \mathcal{C})$ and $\mathbf{Th}_{\mathbb{T}}(K, \mathcal{C}(1, F {-})) \simeq \lim_{(A, c) \in \int_{\mathbb{T}}K}\mathcal{C}(1, F A)$ . Then use Proposition 7.19.

7.3 The bi-adjunction of theories and models

In this subsection, we show the following theorem.

Theorem 7.20. For a type theory $\mathbb{T}$ , the 2-functor $\mathrm{L}_{\mathbb{T}} : \mathfrak{Mod}_{\mathbb{T}} \to \mathbf{Th}_{\mathbb{T}}$ has a left bi-adjoint.

Definition 7.21. Let K be a theory over a type theory $\mathbb{T}$ . We define a 2-category $(K \downarrow \mathrm{L}_{\mathbb{T}})$ as follows:

  • the objects are the pairs $(\mathcal{S}, m)$ consisting of a model $\mathcal{S}$ of $\mathbb{T}$ and a map $m : K \to \mathrm{L}_{\mathbb{T}}\mathcal{S}$ of $\mathbb{T}$ -theories;

  • the morphisms $(\mathcal{S}, m) \to (\mathcal{T}, n)$ are the morphisms $F : \mathcal{S} \to \mathcal{T}$ of models of $\mathbb{T}$ such that $\mathrm{L}_{\mathbb{T}}F \circ m = n$ ;

  • the 2-morphisms are those of $\mathfrak{Mod}_{\mathbb{T}}$ .

Lemma 7.22. For a type theory $\mathbb{T}$ , the 2-functor $\mathrm{L}_{\mathbb{T}}$ has a left bi-adjoint if and only if the 2-category $(K \downarrow \mathrm{L}_{\mathbb{T}})$ has a bi-initial object for every $\mathbb{T}$ -theory K.

Proof. Let K be a $\mathbb{T}$ -theory, $\mathcal{S}$ a model of $\mathbb{T}$ and $m : K \to \mathrm{L}_{\mathbb{T}}\mathcal{S}$ a map of $\mathbb{T}$ -theories. For a model $\mathcal{T}$ of $\mathbb{T}$ , consider the functor

Since $\mathbf{Th}_{\mathbb{T}}(K, \mathrm{L}_{\mathbb{T}}\mathcal{T})$ is a discrete category, this functor is an equivalence if and only if every fiber is contractible. But the fiber over a map $n : K \to \mathrm{L}_{\mathbb{T}}\mathcal{T}$ is just $(K \downarrow \mathrm{L}_{\mathbb{T}})((\mathcal{S}, m), (\mathcal{T}, n))$ . Thus, $(\mathcal{S}, m)$ is a bi-universal map from K to $\mathrm{L}_{\mathbb{T}}$ if and only if it is a bi-initial object of $(K \downarrow \mathrm{L}_{\mathbb{T}})$ .

We have a 2-functor $\mathfrak{Mod}_{{\mathbb{T}}[K]} \ni \mathcal{S} \mapsto (\mathcal{S}|_{\mathbb{T}},m_{\mathcal{S}}) \in (K \downarrow \mathrm{L}_{\mathbb{T}})$ where $\mathcal{S}|_{\mathbb{T}}$ is the model of $\mathbb{T}$ obtained from $\mathcal{S}$ by restricting $({-})^{\mathcal{S}} : {\mathbb{T}}[K] \to \mathbf{DFib}_{\mathcal{S}}$ to $\mathbb{T}$ and $m_{\mathcal{S}} : K \to \mathrm{L}_{\mathbb{T}}(\mathcal{S}|_{\mathbb{T}})$ sends an element $c \in K(A)$ to the map $c^{\mathcal{S}} : \mathcal{S} \to A^{\mathcal{S}}$ of discrete fibrations over $\mathcal{S}$ .

Lemma 7.23. For a theory K over a type theory $\mathbb{T}$ , the 2-functor $\mathfrak{Mod}_{{\mathbb{T}}[K]} \to (K \downarrow \mathrm{L}_{\mathbb{T}})$ is a bi-equivalence.

Proof. It is clear that the 2-functor is locally faithful. It remains to show that the 2-functor is bi-essentially surjective on objects, locally essentially surjective on objects and locally full.

To show that the 2-functor is bi-essentially surjective on objects, let $\mathcal{S}$ be a model of $\mathbb{T}$ and $m : K \to \mathrm{L}_{\mathbb{T}}\mathcal{S}$ a map of $\mathbb{T}$ -theories. By Proposition 7.17, the representable map functor $({-})^{\mathcal{S}} : \mathbb{T} \to \mathbf{DFib}_{\mathcal{S}}$ extends to a representable map functor $({-})^{\widetilde{\mathcal{S}}} : {\mathbb{T}}[K] \to \mathbf{DFib}_{\mathcal{S}}$ that sends $c : 1 \to A$ to $m(c) : \mathcal{S} \to A^{\mathcal{S}} \cong A^{\widetilde{\mathcal{S}}}$ for $c \in K(A)$ . Thus, $\widetilde{\mathcal{S}}$ is a model of ${\mathbb{T}}[K]$ such that $(\widetilde{\mathcal{S}}|_{\mathbb{T}}, m_{\widetilde{\mathcal{S}}}) \simeq (\mathcal{S}, m)$ .

To show that the 2-functor is locally essentially surjective on objects, let $\mathcal{S}$ and $\mathcal{T}$ be models of ${\mathbb{T}}[K]$ and $F : \mathcal{S}|_{\mathbb{T}} \to \mathcal{T}|_{\mathbb{T}}$ a morphism of models of $\mathbb{T}$ such that $\mathrm{L}_{\mathbb{T}}F \circ m_{\mathcal{S}} = m_{\mathcal{T}}$ . This equation means that, for any element $c \in K(A)$ , the diagram

(5)

commutes. Recall from Section 4.3 that $F_{({-})}$ can be regarded as a representable map functor $F_{({-})} : \mathbb{T} \to (\mathbf{DFib}^{\to})_{F}$ (Proposition 4.20). Then $K(A) \ni c \mapsto (c^{\mathcal{S}}, c^{\mathcal{T}}) \in (\mathbf{DFib}^{\to})(F, F_{A})$ defines a map $K \to (\mathbf{DFib}^{\to})_{F}(F, F_{({-})})$ of $\mathbb{T}$ -theories. By Proposition 7.17, the representable map functor $F_{({-})} : \mathbb{T} \to (\mathbf{DFib}^{\to})_{F}$ extends to a representable map functor $\widetilde{F}_{({-})} : {\mathbb{T}}[K] \to (\mathbf{DFib}^{\to})_{F}$ , giving a morphism $\widetilde{F} : \mathcal{S} \to \mathcal{T}$ of models of ${\mathbb{T}}[K]$ whose restriction to $\mathbb{T}$ is F.

The local fullness is similarly proved using Proposition 4.22 and $(\mathbf{DFib}^{\Theta})_{\sigma}$ instead of $(\mathbf{DFib}^{\to})_{F}$ .

Proof of Theorem 7.20. Let K be a $\mathbb{T}$ -theory. We have a bi-equivalence $\mathfrak{Mod}_{{\mathbb{T}}[K]} \simeq (K \downarrow \mathrm{L}_{\mathbb{T}})$ by Lemma 7.23. Hence, $(K \downarrow \mathrm{L}_{\mathbb{T}})$ has a bi-initial object by Theorem 6.10. By Lemma 7.22, the 2-functor $\mathrm{L}_{\mathbb{T}}$ has a left bi-adjoint.

We can extract an explicit construction of the left bi-adjoint of $\mathrm{L}_{\mathbb{T}}$ from the proof of Theorem 7.20. Let K be a theory over a type theory $\mathbb{T}$ . We will denote by $(\mathbf{M}_{\mathbb{T}}K, \eta_{K})$ the bi-initial object of $(K \downarrow \mathrm{L}_{\mathbb{T}})$ . The model $\mathbf{M}_{\mathbb{T}}K$ of $\mathbb{T}$ is obtained from the bi-initial model $\mathcal{I}({\mathbb{T}}[K])$ of ${\mathbb{T}}[K]$ by restricting $({-})^{\mathcal{I}({\mathbb{T}}[K])} : {\mathbb{T}}[K] \to\mathbf{DFib}_{\mathcal{I}({\mathbb{T}}[K])}$ to $\mathbb{T}$ . We call $\mathbf{M}_{\mathbb{T}}K$ the syntactic model of $\mathbb{T}$ generated by K. The map $\eta_{K} : K \to \mathrm{L}_{\mathbb{T}}(\mathbf{M}_{\mathbb{T}}K)$ sends an element $c \in K(A)$ over $A \in \mathbb{T}$ to the arrow $c : 1 \to A$ in ${\mathbb{T}}[K]$ , which is an element of $A^{\mathbf{M}_{\mathbb{T}}K}(1)$ .

Example 7.24. Let K be a theory over the basic dependent type theory $\mathbb{G}$ , that is, a generalized algebraic theory. $\mathbb{G}[K]$ satisfies the assumption of Example 6.8, because every representable arrow in $\mathbb{G}[K]$ is isomorphic to a representable arrow from some slice $\mathbb{G}/A$ . Hence, the objects of $\mathbf{M}_{\mathbb{G}}K$ are the finite sequences $(A_{1}, \dots, A_{n})$ of arrows $A_{i} : |A_{i-1}| \to U$ , which corresponds to an arrow $A : 1 \to \mathrm{P}_{\partial}^{n}1$ via the adjunction $\partial^{*} \dashv \partial_{*}$ . By lem:theory-and-global-section, the arrows $1 \to \mathrm{P}_{\partial_{0}}^{n}1$ in $\mathbb{G}[K]$ correspond to the elements of $K(\mathrm{P}_{\partial_{0}}^{n}1)$ . Since $K(\mathrm{P}_{\partial_{0}}^{n}1) \cong K(U_{n-1})$ by item:20 of thm:gat-exp and elements of $K(U_{n-1})$ are contexts of length n, the base category of $\mathbf{M}_{\mathbb{G}}K$ is the category of contexts in the generalized algebraic theory K.

7.4 The bi-equivalence of theories and models

In this section, we study the unit and counit of the bi-adjunction $\mathbf{M}_{\mathbb{T}} \dashv \mathrm{L}_{\mathbb{T}}$ in more detail. For a model $\mathcal{S}$ of a type theory $\mathbb{T}$ , we denote by $\varepsilon_{\mathcal{S}} : \mathbf{M}_{\mathbb{T}}(\mathrm{L}_{\mathbb{T}}\mathcal{S}) \to \mathcal{S}$ the counit of the bi-adjunction $\mathbf{M}_{\mathbb{T}} \dashv \mathrm{L}_{\mathbb{T}}$ , that is, one of those morphisms of models of $\mathbb{T}$ such that $\mathrm{L}_{\mathbb{T}}\varepsilon_{\mathcal{S}} \circ \eta_{\mathrm{L}_{\mathbb{T}}\mathcal{S}} =\mathrm{id}_{\mathrm{L}_{\mathbb{T}}\mathcal{S}}$ . We first show that the unit $\eta : \mathrm{id} \Rightarrow \mathrm{L}_{\mathbb{T}}\mathbf{M}_{\mathbb{T}}$ is an isomorphism (Proposition 7.25). This implies that $\mathbf{M}_{\mathbb{T}} : \mathbf{Th}_{\mathbb{T}} \to \mathfrak{Mod}_{\mathbb{T}}$ is locally an equivalence and thus induces a bi-equivalence between $\mathbf{Th}_{\mathbb{T}}$ and the bi-essential image of $\mathbf{M}_{\mathbb{T}}$ . We then determine the bi-essential image of $\mathbf{M}_{\mathbb{T}}$ by characterizing those models $\mathcal{S}$ such that the counit $\varepsilon_{\mathcal{S}} : \mathbf{M}_{\mathbb{T}}\mathrm{L}_{\mathbb{T}}\mathcal{S} \to \mathcal{S}$ is an equivalence. We show that the counit $\varepsilon_{\mathcal{S}}$ is an equivalence precisely when $\mathcal{S}$ is democratic (Corollary 7.30). Hence, the bi-adjunction $\mathbf{M}_{\mathbb{T}} \dashv \mathrm{L}_{\mathbb{T}}$ induces a bi-equivalence between $\mathbb{T}$ -theories and democratic models of $\mathbb{T}$ (Theorem 7.31).

Proposition 7.25. Let $\mathbb{T}$ be a type theory and K a $\mathbb{T}$ -theory. Then the map $\eta_{K} : K \to \mathrm{L}_{\mathbb{T}}(\mathbf{M}_{\mathbb{T}}K)$ is an isomorphism.

Proof. For an object $A \in \mathbb{T}$ , the map $\eta_{K}(A) : K(A) \to \mathrm{L}_{\mathbb{T}}(\mathbf{M}_{\mathbb{T}}K)(A)$ is the composite of isomorphisms

Thus, the unit of the bi-adjunction $\mathbf{M}_{\mathbb{T}} \dashv \mathrm{L}_{\mathbb{T}}$ is always an isomorphism. On the other hand, the counit is not an equivalence in general, but we can say that it is always an embedding in the following sense.

Proposition 7.26 Let $\mathcal{S}$ be a model of a type theory $\mathbb{T}$ .

  1. (1) The functor $\varepsilon_{\mathcal{S}} : \mathbf{M}_{\mathbb{T}}(\mathrm{L}_{\mathbb{T}}\mathcal{S}) \to \mathcal{S}$ is fully faithful.

  2. (2) For any object $A \in \mathbb{T}$ , the square

    is a pullback.

To prove Proposition 7.26, we need a little more work. Let K be a theory over a type theory $\mathbb{T}$ and $I \in \mathbf{M}_{\mathbb{T}}K$ and $A \in {\mathbb{T}}[K]$ objects. Recall that ${\mathbb{T}}[K]$ is the filtered pseudo-colimit $\textrm{pcolim}_{(B, c) \in \int_{\mathbb{T}}K}\mathbb{T}/B$ . Then, by Lemma 7.18, the objects $I, A \in {\mathbb{T}}[K]$ can be written as pullbacks

for some objects $B, C, D \in \mathbb{T}$ , arrows $f : C \to B$ and $g : D \to B$ and element $c \in K(B)$ . By the definition of representable arrows in ${\mathbb{T}}[K]$ , we may choose f to be representable. Let $h : E \to B$ be the local exponent $C \Rightarrow_{B} D$ in $\mathbb{T}/B$ , that is, $E = f_{*}f^{*}D$ . Let $\mathcal{S}$ be a model of $\mathbb{T}$ and $F : \mathbf{M}_{\mathbb{T}}K \to \mathcal{S}$ a morphism of models of $\mathbb{T}$ . We denote by $m : K \to \mathrm{L}_{\mathbb{T}}\mathcal{S}$ the corresponding map of $\mathbb{T}$ -theories defined by $m(c') = F_{A'}(c')$ for $c' \in K(A')$ .

Lemma 7.27. Under the assumptions above, the following properties hold.

  1. (1) Suppose $A \in \mathbf{M}_{\mathbb{T}}K$ . We may choose $g : D \to B$ to be representable. Then we have isomorphisms $\sigma : c^{*}K(E) \cong \mathbf{M}_{\mathbb{T}}K(I, A)$ and $\tau : m(c)^{*}(\mathrm{L}_{\mathbb{T}}\mathcal{S}(E)) \cong \mathcal{S}/F A$ such that the diagram

    commutes.
  2. (2) Suppose $A \in \mathbb{T}$ . We may choose $D = B \times A$ . Then we have isomorphisms $\sigma : c^{*}K(E) \cong A^{\mathbf{M}_{\mathbb{T}}K}(I)$ and $\tau : m(c)^{*}(\mathrm{L}_{\mathbb{T}}\mathcal{S}(E)) \cong A^{\mathcal{S}}$ such that the diagram

    commutes.

Proof. We have an isomorphism $\sigma : c^{*}K(E) \cong {\mathbb{T}}[K](I, A)$ by

Concretely $\sigma$ sends $d \in c^{*}K(E)$ to the dotted arrow below,

where $\mathrm{ev} : E \times_{B} C \cong (C \Rightarrow_{B} D) \times_{B} C \to D$ is the evaluation. Similarly, we have an isomorphism $\tau : m(c)^{*}(\mathrm{L}_{\mathbb{T}}\mathcal{S}(E)) \cong \mathbf{DFib}_{\mathcal{S}}(\mathcal{S}/FI, m(c)^{*}D^{\mathcal{S}})$ which sends $d' \in m(c)^{*}(\mathrm{L}_{\mathbb{T}}\mathcal{S}(E))$ to the dotted arrow below.

Suppose that $A \in \mathbf{M}_{\mathbb{T}}K$ . By definition ${\mathbb{T}}[K](I, A) \cong \mathbf{M}_{\mathbb{T}}K(I, A)$ , and thus we regard $\sigma$ as an isomorphism $c^{*}K(E) \cong \mathbf{M}_{\mathbb{T}}K(I, A)$ . Choose $g : D \to B$ to be representable. Then A is the context extension of $c \in B^{\mathbf{M}_{\mathbb{T}}K}(1)$ along $g : D \to B$ , and thus $m(c)^{*}D^{\mathcal{S}} \cong \mathcal{S}/FA$ because F preserves context extensions. Hence, $\mathbf{DFib}_{\mathcal{S}}(\mathcal{S}/FI, m(c)^{*}D^{\mathcal{S}}) \cong \mathbf{DFib}_{\mathcal{S}}(\mathcal{S}/FI, \mathcal{S}/FA) \cong \mathcal{S}(FI, FA)$ by Yoneda, and we regard $\tau$ as an isomorphism $m(c)^{*}(\mathrm{L}_{\mathbb{T}}\mathcal{S}(E)) \cong \mathcal{S}(FI, FA)$ . For any element $d \in c^{*}K(E)$ , both $F(\sigma(d))$ and $\tau(m(d))$ make the diagram

commute, and thus $F\sigma = \tau m$ .

Suppose that $A \in \mathbb{T}$ . By definition ${\mathbb{T}}[K](I, A) \cong A^{\mathbf{M}_{\mathbb{T}}K}(I)$ , and thus we regard $\sigma$ as an isomorphism $c^{*}K(E) \cong A^{\mathbf{M}_{\mathbb{T}}K}(I)$ . Choose D to be $B \times A$ . Then $m(c)^{*}D^{\mathcal{S}} \cong A^{\mathcal{S}}$ , and we regard $\tau$ as an isomorphism $m(c)^{*}(\mathrm{L}_{\mathbb{T}}\mathcal{S}(E)) \cong A^{\mathcal{S}}(FI)$ by Yoneda. This time $\sigma(d)$ and $\tau(d')$ are just composites

respectively, for $d \in c^{*}K(E)$ and $d' \in m(c)^{*}(\mathrm{L}_{\mathbb{T}}\mathcal{S}(E))$ . Therefore, $F_{A}\sigma = \tau m$ .

Proof of Proposition 7.26. Use Lemma 7.27 for $F = \varepsilon_{\mathcal{S}}$ . In this case, m is the identity.

By Proposition 7.26, $\varepsilon_{\mathcal{S}}$ is an equivalence in the 2-category $\mathfrak{Mod}_{\mathbb{T}}$ if and only if the underlying functor $\varepsilon_{\mathcal{S}} : \mathbf{M}_{\mathbb{T}}(\mathrm{L}_{\mathbb{T}}\mathcal{S}) \to \mathcal{S}$ is essentially surjective on objects, because the base change of a discrete fibration along an equivalence induces a fibred equivalence. The next goal is to determine the essential image of the functor $\varepsilon_{\mathcal{S}}$ .

Proposition 7.28. For any theory K over a type theory $\mathbb{T}$ , the model $\mathbf{M}_{\mathbb{T}}K$ of $\mathbb{T}$ is democratic.

Proof. We have already seen that every object $I \in \mathbf{M}_{\mathbb{T}}K$ is written as a pullback

for some representable arrow $f : B \to A$ in $\mathbb{T}$ and element $c \in K(A)$ . This means that I is the context extension of $c \in A^{\mathbf{M}_{\mathbb{T}}K}(1)$ with respect to f.

Proposition 7.29. Let $\mathcal{S}$ be a model of a type theory $\mathbb{T}$ . Then the essential image of the functor $\varepsilon_{\mathcal{S}} : \mathbf{M}_{\mathbb{T}}(\mathrm{L}_{\mathbb{T}}\mathcal{S}) \to \mathcal{S}$ is the class of contextual objects.

Proof. By Proposition 7.28, the essential image of the functor $\varepsilon_{\mathcal{S}} : \mathbf{M}_{\mathbb{T}}(\mathrm{L}_{\mathbb{T}}\mathcal{S}) \to \mathcal{S}$ consists of contextual objects. Proposition 7.26 implies that the essential image of $\varepsilon_{\mathcal{S}}$ is closed under context extensions. Hence, the essential image of $\varepsilon_{\mathcal{S}}$ is precisely the class of contextual objects.

Corollary 7.30. Let $\mathcal{S}$ be a model of a type theory $\mathbb{T}$ .

  1. (1) $\varepsilon_{\mathcal{S}} : \mathbf{M}_{\mathbb{T}}(\mathrm{L}_{\mathbb{T}}\mathcal{S}) \to \mathcal{S}$ induces an equivalence $\mathbf{M}_{\mathbb{T}}(\mathrm{L}_{\mathbb{T}}\mathcal{S}) \simeq \mathcal{S}^{\heartsuit}$ in $\mathfrak{Mod}_{\mathbb{T}}$ .

  2. (2) $\varepsilon_{\mathcal{S}}$ is an equivalence in $\mathfrak{Mod}_{\mathbb{T}}$ if and only if $\mathcal{S}$ is democratic.

In summary, we get a biequivalence of theories and democratic models.

Theorem 7.31. For a type theory $\mathbb{T}$ , the 2-functor $\mathrm{L}_{\mathbb{T}} : \mathfrak{Mod}_{\mathbb{T}} \to \mathbf{Th}_{\mathbb{T}}$ induces a biequivalence

$$ \mathfrak{Mod}^{\mathrm{dem}}_{\mathbb{T}} \simeq \mathbf{Th}_{\mathbb{T}}. $$

8. Conclusion and Future Directions

We proposed an abstract notion of a type theory and established a correspondence between theories and models for each type theory. This is the first step in a new development of categorical type theory.

We should first mention the development of the theory of $\infty$ -type theories (Nguyen and Uemura Reference Nguyen and Uemura2022). Since our definition of a type theory is purely categorical, it is straightforward to generalize it to a higher dimensional one, and we obtain analogous results of Sections 6 and 7. An advantage of this higher dimensional generalization is that one can handle (higher) categorical models of type theories in the style of (non-split) comprehension category (Jacobs Reference Jacobs1993) within the same framework. Our notion of a model of a type theory (Definition 4.5) is never a categorical model in the sense that the notion of identification of types is equality rather than isomorphism. Categorical models of a type theory should instead be understood as models of a suitable $\infty$ -type theory. $\infty$ -type theories are thus a more convenient framework for the semantics of type theory.

The main tools for studying type theories are the 2-category $\mathfrak{Rep}$ , the categories $\mathbf{Th}_{\mathbb{T}}$ , and the 2-categories $\mathfrak{Mod}_{\mathbb{T}}$ . The 2-category $\mathfrak{Rep}$ allows us to compare different kinds of type theory directly in the sense that a morphism $F : \mathbb{T} \to \mathbb{S}$ in $\mathfrak{Rep}$ is thought of as an interpretation of the type theory $\mathbb{T}$ in $\mathbb{S}$ . In particular, an equivalence in the 2-category $\mathfrak{Rep}$ is a natural notion of an equivalence of type theories. The universal properties of syntactic representable map categories (Theorem 5.17) help us to build various interpretations of type theories.

Sometimes we need weaker notions of equivalences of type theories. For example, one can ask if the interpretation of the Book HoTT (The Univalent Foundations Program 2013) in cubical type theory (Cohen et al. Reference Cohen, Coquand, Huber, Mörtberg and Uustalu2018) is an equivalence in any sense. This interpretation will never be an equivalence in the 2-category $\mathfrak{Rep}$ , but one would expect it to be conservative in a weak sense: every type in cubical type theory is homotopy equivalent to some type from the Book HoTT; every term in cubical type theory is path connected to some term from the Book HoTT. One approach to formulate this conjecture is to equip $\mathbf{Th}_{\mathbb{T}}$ with a (semi-)model structure, following Kapulkin and Lumsdaine (Reference Kapulkin and Lumsdaine2018), Isaev (Reference Isaev2017), and discuss if a functor between such (semi-)model categories is a Quillen equivalence (Isaev Reference Isaev2020). Another possibility is to work in the framework of $\infty$ -type theories. Suppose that type theories $\mathbb{T}_{1}$ and $\mathbb{T}_{2}$ are equipped with classes of arrows called weak equivalences. An interpretation $\mathbb{T}_{1} \to \mathbb{T}_{2}$ is conservative with respect to these weak equivalences if it induces an equivalences between the $\infty$ -type theories obtained from $\mathbb{T}_{1}$ and $\mathbb{T}_{2}$ by freely inverting weak equivalences.

Comparing $\mathbf{Th}_{\mathbb{T}} \simeq \mathfrak{Mod}_{\mathbb{T}}^{\mathrm{dem}}$ and $\mathfrak{Mod}_{\mathbb{T}}$ , the former is easier to understand and more convenient to work with since it is a full subcategory of $\mathbf{Set}^{\mathbb{T}}$ . However, $\mathbf{Th}_{\mathbb{T}}$ throws away all the information about representable arrows in $\mathbb{T}$ , so we can never reconstruct the type theory $\mathbb{T}$ from the category $\mathbf{Th}_{\mathbb{T}}$ . The 2-category $\mathfrak{Mod}_{\mathbb{T}}$ , on the other hand, seems to keep information about $\mathbb{T}$ , and we expect that the type theory $\mathbb{T}$ can be reconstructed from $\mathfrak{Mod}_{\mathbb{T}}$ . A precise formulation is as follows. First, we regard $\mathfrak{Mod}_{\mathbb{T}}$ as a 2-category over $\mathfrak{Cat}_{1}$ with the forgetful 2-functor $\mathfrak{Mod}_{\mathbb{T}} \to \mathfrak{Cat}_{1}$ that maps a model of $\mathbb{T}$ to its base category. Then a representable map functor $F : \mathbb{S} \to \mathbb{T}$ between type theories induces a 2-functor $F^{*} : \mathfrak{Mod}_{\mathbb{T}} \to \mathfrak{Mod}_{\mathbb{S}}$ over $\mathfrak{Cat}_{1}$ defined by $F^{*}(\mathcal{S}, ({-})^{\mathcal{S}}) = (\mathcal{S}, (F{-})^{\mathcal{S}})$ . Thus, $\mathbb{T} \mapsto \mathfrak{Mod}_{\mathbb{T}}$ is part of a 2-functor $\mathfrak{Mod}_{({-})} : \mathfrak{Rep}^{\mathrm{op}} \to 2\mathfrak{CAT}/\mathfrak{Cat}_{1}$ to the (huge) 2-category of (large) 2-categories over $\mathfrak{Cat}_{1}$ .

Question 8.1 Is $\mathfrak{Mod}_{({-})} : \mathfrak{Rep}^{\mathrm{op}} \to 2\mathfrak{CAT}/\mathfrak{Cat}_{1}$ monic (in a suitable higher categorical sense) and can we characterize its image?

In unpublished work of John Bourke and the author, it is shown that the 2-category $\mathfrak{Mod}_{\mathbb{T}}$ is locally presentable in a bicategorical sense (the same idea is used in the $\infty$ -categorical setting Nguyen and Uemura Reference Nguyen and Uemura2022 to show the presentability of $\mathfrak{Mod}_{\mathbb{T}}$ , but there only invertible 2-morphisms of models are considered). Analogously to the Gabriel–Ulmer duality (Gabriel and Ulmer Reference Gabriel and Ulmer1971), the type theory $\mathbb{T}$ is expected to be reconstructed using finitely bi-presentable objects in $\mathfrak{Mod}_{\mathbb{T}}$ .

Acknowledgement

The author is grateful to Benno van den Berg for helpful feedback and corrections on drafts of this paper. The author would also like to thank Daniel Gratzer, Thomas Streicher and John Bourke for useful questions, comments and discussions. The author also thanks the reviewers for comments and corrections. This work is part of the research programme “The Computational Content of Homotopy Type Theory” with project number 613.001.602, which is financed by the Netherlands Organisation for Scientific Research (NWO).

Footnotes

1 This fact is also observed independently by Fiore (Reference Fiore2012).

References

Adámek, J. and Rosický, J. (1994). Locally Presentable and Accessible Categories, London Mathematical Society Lecture Note Series, vol. 189, Cambridge, Cambridge University Press. doi:10.1017/CBO9780511600579.CrossRefGoogle Scholar
Altenkirch, T., Capriotti, P. and Kraus, N. (2016). Extending homotopy type theory with strict equality. In: Talbot, J.-M. and Regnier, L. (eds.) 25th EACSL Annual Conference on Computer Science Logic (CSL 2016), Leibniz International Proceedings in Informatics (LIPIcs), vol. 62, Dagstuhl, Germany, Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik, 21:1–21:17. doi: 10.4230/LIPIcs.CSL.2016.21.Google Scholar
Annenkov, D., Capriotti, P., Kraus, N. and Sattler, C. (2023). Two-Level Type Theory and Applications. arXiv:1705.03307v4.Google Scholar
Awodey, S. (2018). Natural models of homotopy type theory. Mathematical Structures in Computer Science 28 (2) 241286. doi: 10.1017/S0960129516000268.CrossRefGoogle Scholar
Bauer, A., Haselwarter, P. G. and Lumsdaine, P. L. (2020). A general definition of dependent type theories. arXiv:2009.05539v1.Google Scholar
Birkedal, L., Clouston, R., Mannaa, B., Ejlers Møgelberg, R., Pitts, A. M. and Spitters, B. (2020). Modal dependent type theory and dependent right adjoints. Mathematical Structures in Computer Science 30 (2) 118138. doi: 10.1017/S0960129519000197.CrossRefGoogle Scholar
Buckley, M. (2014). Fibred 2-categories and bicategories. Journal of Pure and Applied Algebra 218 (6) 10341074. doi: 10.1016/j.jpaa.2013.11.002.CrossRefGoogle Scholar
Capriotti, P. (2016). Models of Type Theory with Strict Equality. Phd thesis, University of Nottingham.Google Scholar
Cartmell, J. W. (1978). Generalised Algebraic Theories and Contextual Categories. Phd thesis, Oxford University.Google Scholar
Cisinski, D.-C. (2019). Higher Categories and Homotopical Algebra, Cambridge Studies in Advanced Mathematics, Cambridge University Press. doi: 10.1017/9781108588737.CrossRefGoogle Scholar
Clairambault, P. and Dybjer, P. (2014). The biequivalence of locally cartesian closed categories and Martin-Löf type theories. Mathematical Structures in Computer Science 24 (6) e240606. doi: 10.1017/S0960129513000881.CrossRefGoogle Scholar
Cohen, C., Coquand, T., Huber, S. and Mörtberg, A. (2018). Cubical type theory: A constructive interpretation of the univalence axiom. In: Uustalu, T. (ed.) 21st International Conference on Types for Proofs and Programs (TYPES 2015), Leibniz International Proceedings in Informatics (LIPIcs), vol. 69, Dagstuhl, Germany, Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik, 5:1–5:34. doi: 10.4230/LIPIcs.TYPES.2015.5.CrossRefGoogle Scholar
Descotte, M., Dubuc, E. and Szyld, M. (2018). A construction of certain weak colimits and an exactness property of the 2-category of categories. Theory and Applications of Categories 33 (8) 192215. http://www.tac.mta.ca/tac/volumes/33/8/33-08abs.html.Google Scholar
Dybjer, P. (1996). Internal type theory. In: Berardi, S. and Coppo, M. (eds.) Types for Proofs and Programs: International Workshop, TYPES’95 Torino, Italy, June 5–8, 1995 Selected Papers, Berlin, Heidelberg, Springer Berlin Heidelberg, 120134. doi: 10.1007/3-540-61780-9_66.CrossRefGoogle Scholar
Fiore, M. (2012). Discrete Generalised Polynomial Functors. Talk at ICALP 2012. http://www.cl.cam.ac.uk/mpf23/talks/ICALP2012.pdf.Google Scholar
Gabriel, P. and Ulmer, F. (1971). Lokal präsentierbare Kategorien , Lecture Notes in Mathematics, vol. 221, Berlin, Heidelberg, Springer-Verlag. doi: 10.1007/BFb0059396.Google Scholar
Gratzer, D., Kavvos, G. A., Nuyts, A. and Birkedal, L. (2021). Multimodal dependent type theory. Logical Methods in Computer Science 17 (3) 11:111:67. doi: 10.46298/lmcs-17(3:11)2021.Google Scholar
Harper, R., Honsell, F. and Plotkin, G. (1993). A framework for defining logics. Journal of the ACM 40 (1) 143184. doi: 10.1145/138027.138060.CrossRefGoogle Scholar
Hermida, C. (1999). Some properties of Fib as a fibred 2-category. Journal of Pure and Applied Algebra 134 (1) 83109. doi: 10.1016/S0022-4049(97)00129-1.CrossRefGoogle Scholar
Hofmann, M. (1995). On the interpretation of type theory in locally cartesian closed categories. In: Pacholski, L. and Tiuryn, J. (eds.) Computer Science Logic, Berlin, Heidelberg, Springer Berlin Heidelberg, 427441. doi: 10.1007/BFb0022273.CrossRefGoogle Scholar
Isaev, V. (2017). Model structures on categories of models of type theories. Mathematical Structures in Computer Science 28 (10) 16951722. doi: 10.1017/S0960129517000202.CrossRefGoogle Scholar
Isaev, V. (2020). Morita equivalences between algebraic dependent type theories. arXiv:1804.05045v2Google Scholar
Jacobs, B. (1993). Comprehension categories and the semantics of type dependency. Theoretical Computer Science 107 (2) 169207. doi: 10.1016/0304-3975(93)90169-T.CrossRefGoogle Scholar
Jacobs, B. (1999). Categorical Logic and Type Theory, 1st edition, Elsevier Science.Google Scholar
Kapulkin, K. and Lumsdaine, P. L. (2018). The homotopy theory of type theories. Advances in Mathematics 337 138. doi: 10.1016/j.aim.2018.08.003.CrossRefGoogle Scholar
Kapulkin, K. and Szumiło, K. (2019). Internal languages of finitely complete $(\infty,1)$ -categories. Selecta Mathematica (N.S.) 25 (2) Art. 33, 46. doi: 10.1007/s00029-019-0480-0.CrossRefGoogle Scholar
Kelly, G. M. and Street, R. (1974). Review of the elements of 2-categories. In: Kelly, G. M. (ed.) Category Seminar: Proceedings Sydney Category Theory Seminar 1972/1973, Berlin, Heidelberg, Springer Berlin Heidelberg, 75103. doi: 10.1007/BFb0063101.CrossRefGoogle Scholar
Lambek, J. and Scott, P. J. (1986). Introduction to Higher Order Categorical Logic , Cambridge Studies in Advanced Mathematics, vol. 7, Cambridge, Cambridge University Press.Google Scholar
Lawvere, F. W. (1963). Functorial Semantics of Algebraic Theories. Phd thesis, Columbia University. http://www.tac.mta.ca/tac/reprints/articles/5/tr5abs.html.Google Scholar
Licata, D. R., Orton, I., Pitts, A. M. and Spitters, B. (2018). Internal universes in models of homotopy type theory. In: Kirchner, H. (ed.) 3rd International Conference on Formal Structures for Computation and Deduction (FSCD 2018), Leibniz International Proceedings in Informatics (LIPIcs), vol. 108, Dagstuhl, Germany, Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik, 22:1–22:17. doi: 10.4230/LIPIcs.FSCD.2018.22.CrossRefGoogle Scholar
Licata, D. R., Riley, M. and Shulman, M. (2019). A Fibrational Framework for Substructural and Modal Dependent Type Theories. Talk at HoTTEST.Google Scholar
Licata, D. R., Shulman, M. and Riley, M. (2017). A fibrational framework for substructural and modal logics. In: Miller, D. (ed.) 2nd International Conference on Formal Structures for Computation and Deduction (FSCD 2017), Leibniz International Proceedings in Informatics (LIPIcs), vol. 84, Dagstuhl, Germany, Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik, 25:1–25:22. doi: 10.4230/LIPIcs.FSCD.2017.25.CrossRefGoogle Scholar
Lurie, J. (2009). Higher Topos Theory, Princeton, Princeton University Press.CrossRefGoogle Scholar
Mac Lane, S. and Moerdijk, I. (1992). Sheaves in Geometry and Logic, New York, NY, Springer New York. doi: 10.1007/978-1-4612-0927-0.Google Scholar
Martin-Löf, P. (1975). An intuitionistic theory of types: Predicative part. Studies in Logic and the Foundations of Mathematics 80 73118. doi: 10.1016/S0049-237X(08)71945-1.CrossRefGoogle Scholar
Newstead, C. (2018). Algebraic Models of Dependent Type Theory. Phd thesis, Carnegie Mellon University.Google Scholar
Nguyen, H. K. and Uemura, T. (2022). ∞-type theories. arXiv:2205.00798v1 Google Scholar
Niefield, S. B. (1982). Cartesianness: Topological spaces, uniform spaces, and affine schemes. Journal of Pure and Applied Algebra 23 (2) 147167. doi: 10.1016/0022-4049(82)90004-4.CrossRefGoogle Scholar
Nordström, B., Petersson, K. and Smith, J. M. (1990). Programming in Martin-Löf’s Type Theory: An Introduction, Oxford, Oxford University Press.Google Scholar
Orton, I. and Pitts, A. M. (2018). Axioms for modelling cubical type theory in a topos. Logical Methods in Computer Science 14 (4) 133. doi: 10.23638/LMCS-14(4:23)2018.Google Scholar
Pfenning, F. and Davies, R. (2001). A judgmental reconstruction of modal logic. Mathematical Structures in Computer Science 11 (4) 511540. doi: 10.1017/S0960129501003322.CrossRefGoogle Scholar
Seely, R. A. G. (1983). Hyperdoctrines, natural deduction and the Beck condition. Zeitschrift für mathematische Logik und Grundlagen der Mathematik 29 (10) 505542. doi: 10.1002/malq.19830291005.CrossRefGoogle Scholar
Seely, R. A. G. (1984). Locally cartesian closed categories and type theory. Mathematical Proceedings of the Cambridge Philosophical Society 95 (1) 3348. doi: 10.1017/S0305004100061284.CrossRefGoogle Scholar
Shulman, M. (2018). Brouwer’s fixed-point theorem in real-cohesive homotopy type theory. Mathematical Structures in Computer Science 28 (6) 856941. doi: 10.1017/S0960129517000147.CrossRefGoogle Scholar
The Stacks Project Authors (2019). Stacks Project. https://stacks.math.columbia.edu.Google Scholar
The Univalent Foundations Program (2013). Homotopy Type Theory: Univalent Foundations of Mathematics. Institute for Advanced Study. http://homotopytypetheory.org/book/.Google Scholar
Uemura, T. (2021). Abstract and Concrete Type Theories. PhD Thesis, University of Amsterdam.Google Scholar
Uemura, T. (2022). The universal exponentiable arrow. Journal of Pure and Applied Algebra 226 (7) 106991. doi: 10.1016/j.jpaa.2021.106991.CrossRefGoogle Scholar
Voevodsky, V. (2013). A simple type system with two identity types. https://www.math.ias.edu/vladimir/sites/math.ias.edu.vladimir/files/HTS.pdf.Google Scholar
Figure 0

Fig. 1. Legal judgments.