1 Introduction

In one of the seminal papers on topos theory [10], the links between algebraic topology and mathematical logic are described as being still embryonic. The situation has changed dramatically since then, thanks to the discovery of a deep connection between Quillen’s homotopical algebra [39] and Martin-Löf type theory [34], which has given rise to Homotopy Type Theory [50] and Voevodsky’s Univalent Foundations programme [52]. At the core of this connection is the relationship between the orthogonality property of weak factorisation systems (wfs’s for short) and the axioms for identity types [7, 18].

Presheaf categories play a fundamental role in this context because of the abundance of wfs’s and Quillen model structures on them [14]. For applications in both type theory [15] and homotopical algebra [40], however, it is sometimes useful to work with refinements of wfs’s known as algebraic weak factorisation systems (awfs’s for short) [23, 24], where maps satisfying an orthogonality property are replaced by maps equipped with algebraic structure, providing diagonal fillers for lifting problems and satisfying suitable uniformity conditions. The theory of awfs’s is analogous to that of wfs’s and is supported by a myriad of examples [11, 12], including the notions of a uniform Kan fibration studied in Homotopy Type Theory [2, 22, 42, 46, 47, 51]. Yet, working with awfs’s diagrammatically can be very complex, since the algebraic structure on a map is in general not unique, and thus needs to be carried around explicitly. Because of this, the construction of some important objects (such as that of fibration structures on a given map) using only diagrams can be a daunting task.

An alternative approach is provided by what may be called the internal type theory of a presheaf category, which is a highly expressive extensional dependent type theory [33, 38, 43], capable of handling complex categorical structure and amenable to computer-assisted formalisation of proofs using Coq [8] or Agda [35]. This idea, suggested by Thierry Coquand [16], has been successfully applied to Homotopy Type Theory in [36], where part of the theory of uniform fibrations was developed type-theoretically and implemented in Agda. As we will see here, this approach makes it feasible to write down, say, the object of fibration structures on a map and reason about it formally. At present, however, in order to link these two approaches one needs to unfold the interpretation of the internal type theory into the presheaf category [27], which can be a difficult and laborious process due to the subtleties introduced by dependent types.

Our first main contribution is to introduce and develop a new tool to relate the category-theoretic and the type-theoretic methods for describing structures in presheaf categories: namely, we extend the Kripke-Joyal forcing of the higher-order logic of a presheaf category \({\mathcal {E}}\)—a powerful, long-established, technique of categorical logic [32, 37]—to a precisely stated internal type theory of \({\mathcal {E}}\). In particular, we show how Kripke-Joyal forcing for this type theory allows us to test the validity of type-theoretic judgements in \({\mathcal {E}}\) (Theorem 4.8), unfold explicitly what forcing amounts to for various forms of type, such as dependent products (Proposition 4.16), which are very important for our applications, and relate it precisely to the ordinary forcing of higher-order logic (Theorem 4.19). This technique then also permits intricate type-theoretic constructions of bespoke classifiers which, via forcing, represent familiar and important fibrations of structures (as studied in [45, 48]), a possibility that promises many further applications.

The second main contribution of the paper is to the study of the awfs’s considered in Homotopy Type Theory, using a combination of the new Kripke-Joyal forcing for the internal type theory and the usual internal reasoning therein. We thereby reconcile the category-theoretic and type-theoretic descriptions of awfs’s considered in [2, 9, 22, 42, 46, 47] and give simple proofs of several properties of cofibrations and uniform (trivial) fibrations. In particular, we use Kripke-Joyal forcing to provide a type-theoretic characterisation of cofibrations (Proposition 5.6) and a new proof that the pointed endofunctor of cofibrant partial elements admits the structure of a monad (Theorem 6.7).

One of our key results (Theorem 7.5) shows how the uniformity condition that is part of the definition of a uniform (trivial) fibration arises naturally from the forcing conditions for dependent products. We also use Kripke-Joyal forcing to provide a new, simpler, proof that the uniform fibration structures on a map are exactly the algebra structures for a pointed endofunctor (Theorem 7.7). With these results in place, we then give an account of the basic properties of uniform fibrations, combining category-theoretic and type-theoretic reasoning. In particular, we describe type-theoretically the object of uniform fibration structures on a map (Corollary 8.7) and use it to construct a universal uniform fibration (Theorem 8.9). We also describe the homotopical semantics of identity types as path types (Theorem 9.4). To the best of our knowledge, all of these results are original and fill an awkward gap in the research in the area, by relating precisely the category-theoretic and the type-theoretic approaches to uniform fibrations.

We hope that these applications demonstrate the utility of Kripke-Joyal forcing for researchers in mathematical logic, category theory and algebraic topology. We should also mention that, while our applications are to the theory of awfs’s and Homotopy Type Theory, our Kripke-Joyal forcing for type theory is applicable to many other kinds of algebraic structures that may occur on presheaves, a topic that we leave for future research.

In order to briefly explain our approach in more detail, let us recall that the standard Kripke-Joyal forcing provides a way to test the validity of a formula of the internal logic of a presheaf category \({\mathcal {E}}= [{\mathbb {C}}^{\smash {\textrm{op}}}, \mathop {\textbf{Set}}]\). Given a formula \(\sigma :X \rightarrow \Omega \), i.e. a map into the subobject classifier of \({\mathcal {E}}\), and a generalised element \(x :\textsf{y}c \rightarrow X\) (where \(\textsf{y}c\) is the Yoneda embedding applied to \(c \in \mathbb {C}\)), we say that c forces \(\sigma (x)\) if there exists a (necessarily unique) map as indicated by the dotted arrow in the diagram

where \(\{ x :X \mid \sigma (x)\} \rightarrowtail X\) is the subobject of X obtained by pullback of the subobject classifier \(\textsf{true}:1 \rightarrow \Omega \) along \(\sigma \). In order to introduce our Kripke-Joyal forcing, we follow [3] and set up the internal type theory of \({\mathcal {E}}\) by regarding types as maps into the Hofmann-Streicher universe \(U\) in \({\mathcal {E}}\) associated to an inaccessible cardinal \(\kappa \) in \(\mathop {\textbf{Set}}\) [28], an approach which deals correctly with coherence issues [26, 38]. Then, given a type \(\alpha :X \rightarrow U\) and a generalised element \(x :\textsf{y}c \rightarrow X\), we define our Kripke-Joyal forcing by saying that c forces \(a \mathord {\, : \,}\alpha (x)\) if we have a (no longer unique) map as indicated by the dotted arrow in the diagram

where \(X.\alpha \rightarrow X\) is the display map obtained by pullback of the small map classifier \(\pi ~:~E~\rightarrow ~U\), in the sense of [30], along \(\alpha \). As is the case for Kripke-Joyal forcing of logical formulas, unfolding this condition recursively according to the form of the type \(\alpha \) provides a quasi-mechanical method to determine necessary and sufficient conditions for the validity of type-theoretic judgements in \({\mathcal {E}}\), something which may be difficult to obtain by other means.

Our definition of the Kripke-Joyal forcing involves generalised elements of a presheaf with domain a representable of the form \(x :\textsf{y}c \rightarrow X\), where \(c \in \mathbb {C}\), rather than \(u :Y \rightarrow X\), where Y is another presheaf. Our choice is motivated by examples of simplicial sets and cubical sets, where generalised elements with domain a representable have a clear topological meaning (as n-simplices and as n-cubes of X, respectively). It should also be pointed out that any quantification over the generalised elements from representables ranges over a set, rather than over a class. Also, our notion of a uniform fibration arises direcly from considering generalised elements with a representable domain. We leave the interesting question of exploring a Kripke-Joyal forcing for arbitrary generalised elements to future work.

Our approach to the internal type theory of \({\mathcal {E}}\) also allows us to obtain some new results regarding the relationship between propositions and types in a presheaf category. In particular, we show how the image factorisation of the small map classifier provides a convenient way of expressing the operation of propositional truncation in the type theory (Proposition 2.4). We use this to provide a precise account of the relationship between provability of formulas and inhabitation of associated types (Propositions 2.5 and 2.7), which is of independent interest. Finally, we note that our Kripke-Joyal forcing semantics for type theory is complete with respect to the standard notion of deduction for Martin-Löf type theory (Remark 4.26), in the same way that conventional Kripke semantics is complete for (intuitionistic) first-order logic, something that fails for Kripke-Joyal forcing for higher-order logic.

Outline of the paper. The paper is divided into two parts. The first part, which includes Sects. 123 and 4, sets up the general framework, definition and fundamental results on Kripke-Joyal forcing for the presheaf type theory. The second part, which includes Sections  5678 and 9, applies Kripke-Joyal forcing to the study of cofibrations, partial elements, uniform trivial fibrations, uniform fibrations and path types, respectively. We end the paper in Sect. 10 with some directions for future work.

Notation For a category \(\mathcal {C}\) and \(X, Y \in \mathcal {C}\), we write \(\mathcal {C}(X,Y)\) for the class of maps from X to Y. For maps \(f :X \rightarrow Y\) and \(g :Y \rightarrow Z\), we write \(g \circ f\) or simply gf for their composite. For \(X \in \mathcal {C}\), we write \({{\,\textrm{id}\,}}_X :X \rightarrow X\) for the identity map at X. We write 0 and 1 for the initial and terminal object, \(X \times Y\) for product, \(X + Y\) for coproduct, and more generally \(X \times _Z Y\) for pullback and \(X +_Z Y\) for pushout. Given categories \(\mathcal {C}\) and \(\mathcal {D}\) and functors \(F :\mathcal {C}\rightarrow \mathcal {D}\) and \(G :\mathcal {D}\rightarrow \mathcal {C}\), we write \(F \dashv G\) to mean that F is left adjoint to G. In this case, there is a family of natural bijections \(\mathcal {C}(X, GA) \cong \mathcal {D}(FX, A)\), for \(X \in \mathcal {C}\) and \(A \in \mathcal {D}\). The transpose of a map f (in either direction) is written \(f^\sharp \). As usual, unit and counit of the adjunction are denoted \(\eta :{{\,\textrm{id}\,}}_{\mathcal {C}} \rightarrow GF\) and \(\varepsilon :FG \rightarrow {{\,\textrm{id}\,}}_{\mathcal {D}}\). For a category \({\mathcal {E}}\) and \(X \in {\mathcal {E}}\), we write \({\mathcal {E}}/_{X}\) for the slice category of objects over X.

Throughout the paper, we shall work assuming a fixed inaccessible cardinal \(\kappa \).Footnote 1 We say that a set is \(\kappa \)-small if it has cardinality less than \(\kappa \). We say that a category is locally small (or locally \(\kappa \)-small) if its hom-classes are sets (or \(\kappa \)-small sets, respectively). Similarly, we say that a category is small (or \(\kappa \)-small) if its class of objects is a set and it is locally small (or its class of objects is \(\kappa \)-small and it is locally \(\kappa \)-small, respectively). We write \(\mathop {\textbf{Set}}\) for the category of sets and functions, \({\mathop {\textbf{Set}}}^\bullet \) for the category of pointed sets and point-preserving functions, \({\mathop {\textbf{Set}}}_{\kappa }\) for the category of sets of rank \(< \kappa \) and functions (which is equivalent to the category of \(\kappa \)-small sets and functions, but has the advantage of being small) and \({\mathop {\textbf{Set}}}^\bullet _{\kappa }\) for the category of pointed sets of rank \(< \kappa \).

2 Presheaf categories

Preliminaries For a small category \(\mathbb {C}\), we write \(\textrm{Psh}(\mathbb {C})\) for the category of presheaves over \(\mathbb {C}\) and \(\textsf{y}:\mathbb {C}\rightarrow \textrm{Psh}(\mathbb {C})\) for the Yoneda embedding. Sometimes we identify objects and maps in \(\mathbb {C}\) with the representable presheaves and natural transformations between them. Furthermore, for a presheaf X, we often identify elements \(x \in X(c)\) with maps \(x :\textsf{y}c \rightarrow X\), as permitted by the Yoneda lemma. For \(f :d \rightarrow c\) in \(\mathbb {C}\), we write x.f for the element of X(d) obtained by applying \(X(f) :X(c) \rightarrow X(d)\) to \(x \in X(c)\), which corresponds to the composite map \(x.f :\textsf{y}d \rightarrow \textsf{y}c \rightarrow X\) under the identification above. For \(X \in \textrm{Psh}(\mathbb {C})\), we write \(\int \! X\) for its category of elements. Recall the equivalence of categories

$$\begin{aligned} \textstyle \textrm{Psh}(\mathbb {C})/_{X} \simeq \textrm{Psh}(\int \! X) . \end{aligned}$$
(1.1)

If \(X = \textsf{y}c\), then \(\int \! X = \mathbb {C}/_{c}\) and we have an equivalence of categories

$$\begin{aligned} \textrm{Psh}(\mathbb {C})/_{\textsf{y}c} \simeq \textrm{Psh}(\mathbb {C}/_{c}) . \end{aligned}$$
(1.2)

Let us now fix a small category \(\mathbb {C}\) and define \({\mathcal {E}}=_{\textrm{def}}\textrm{Psh}(\mathbb {C})\). We now review some of the basic structure of \({\mathcal {E}}\) in order to fix notation. Foremost, \({\mathcal {E}}\) is locally cartesian closed, i.e. it has a terminal object 1 and all of its slice categories \({\mathcal {E}}/_{X}\) are cartesian closed. Thus for every \(f :Y \rightarrow X\) the pullback functor \({f}^* :{\mathcal {E}}/_{X} \rightarrow {\mathcal {E}}/_{Y}\) has both a left and a right adjoint, written \(\Sigma _{f} :{\mathcal {E}}/_{Y} \rightarrow {\mathcal {E}}/_{X}\) and \(\Pi _{f} :{\mathcal {E}}/_{Y} \rightarrow {\mathcal {E}}/_{X}\), respectively. The action of \(\Sigma _{f}\) is given simply by composition with \(f :Y \rightarrow X\).

Small maps We introduce the notion of a small map in \({\mathcal {E}}\), which is determined by the Grothendieck universe of \(\kappa \)-small sets in the ambient set theory.

Definition 1.1

  1. (i)

    We say that a map \(p :A \rightarrow X\) in \({\mathcal {E}}\) is a small map if all of its fibers \(p^{-1}_c\{x\} \subseteq A(c)\), for \(c \in \mathbb {C}\) and \(x \in X(c)\), are \(\kappa \)-small sets. Note that this is equivalent to the condition that, for every \(x :\textsf{y}c \rightarrow X\), the set of all lifts \(a :\textsf{y}c \rightarrow A\) across \(p :A \rightarrow X\) is \(\kappa \)-small.

  2. (ii)

    An object \(A \in {\mathcal {E}}\) is small if \(A \rightarrow 1\) is a small map. In this case, all of the values of A are \(\kappa \)-small sets.

We write \(\mathcal {S}\) for the class of small maps in \({\mathcal {E}}\). For \(X \in {\mathcal {E}}\), we write \(\mathcal {S}/_{X}\) for the full subcategory of \({\mathcal {E}}/_{X}\) spanned by small maps. The category \({\mathcal {E}}\) admits a classifier for small maps (cf. [4, Proposition 82]), given by the Hofmann-Streicher universe \(U\in {\mathcal {E}}\) [28], which is defined by letting, for \(c \in \mathbb {C}\),

$$\begin{aligned} U(c) =_{\textrm{def}}\textrm{Obj} \big [ {(\mathbb {C}/_{c})}^{\smash {\textrm{op}}} \,, {\mathop {\textbf{Set}}}_\kappa \big ] \,. \end{aligned}$$
(1.3)

This is set-sized by our choice of \({\mathop {\textbf{Set}}}_\kappa \) in the Introduction. Explicitly, an element \(\alpha ~\in ~U(c)\) is a presheaf on the slice category \(\mathbb {C}/_{c}\) whose values are sets of rank \(\prec \kappa \). Note that we consider \(U(c)\) as a set. The action on U of an arrow \(d\rightarrow c\) in \(\mathbb {C}\) is by precomposition with the composition functor \(\mathbb {C}/_d \rightarrow \mathbb {C}/_c\). Similarly, define \(E\in {\mathcal {E}}\) for \(c \in \mathbb {C}\) by letting,

$$\begin{aligned} E(c) =_{\textrm{def}}\textrm{Obj} \big [ {(\mathbb {C}/_{c})}^{\smash {\textrm{op}}} \,, {\mathop {\textbf{Set}}}^\bullet _\kappa \big ] \,. \end{aligned}$$

Thus, an element \(\alpha \in E(c)\) is a contravariant functor on the slice category \(\mathbb {C}/_{c}\) whose values are pointed sets of rank \(\prec \kappa \). The forgetful functor \({\mathop {\textbf{Set}}}^\bullet _\kappa \rightarrow {\mathop {\textbf{Set}}}_\kappa \) induces a natural transformation

$$\begin{aligned} \pi :E\rightarrow U\end{aligned}$$
(1.4)

by composition. We call \(\pi \) the small map classifier. This terminology is justified by the fact that \(\pi \) is small and, for every small map \(p :A \rightarrow X\), there exists a pullback diagram

(1.5)

Indeed, for a small map \(p :A \rightarrow X\), a canonical map \(\alpha \) can be defined as follows. For \(c~\in ~\mathbb {C}\) and \(x \in X(c)\), we require an element \(\alpha _{x}\in U(c)\), which is a presheaf \(\alpha _{x}~:~{{\mathbb {C}}/_{c}}^{\smash {\textrm{op}}}~\rightarrow ~\mathop {\textbf{Set}}_\kappa \). This is defined for \(f :d \rightarrow c\) by,

$$\begin{aligned} \alpha _{x}(f) = \{ a \in A(d) \ | \ p_d(a) = x.f \} , \end{aligned}$$
(1.6)

which is the set of all a making the following commute,

Note that the values of \(\alpha _{x}\) are small, as \(p :A \rightarrow X\) is a small map.Footnote 2 We call this map \(\alpha ~:~X \rightarrow ~U\) the classifying map of \(p :A \rightarrow X\) and say that p is classified by \(\alpha \).

We introduce some notation for canonical pullbacks of \(\pi :E\rightarrow U\). First, for \(\alpha :\textsf{y}c \rightarrow U\), there is a canonical pullback square

(1.7)

given by taking \(\textsf{y}c.\alpha \) at \(d\in \mathbb {C}\) to be \((\textsf{y}c.\alpha )(d)\ =_{\textrm{def}}\ \coprod _{f \in \mathbb {C}(d,c)}\alpha (f)\). Note that this is the object of \({\mathcal {E}}/_{\textsf{y}c} \simeq \textrm{Psh}(\mathbb {C}/_{c})\) associated to \(\alpha :{{\mathbb {C}}/_{c}}^{\smash {\textrm{op}}} \rightarrow \mathop {\textbf{Set}}_\kappa \) under (1.2). The rest of the pullback in (1.7) is then evident.

This assignment then determines a choice of pullback for each \(\alpha :X \rightarrow U\),

(1.8)

We call \(X.\alpha \) the comprehension of \(\alpha \) with respect to \(U\) and the display map associated to \(\alpha \). Since \(\pi \) is a small map, so is \(X.\alpha \rightarrow X\). In this way, every small map is isomorphic to a display map. Explicitly, for every small map \(p :A \rightarrow X\), there is a diagram

(1.9)

where \(\alpha \) is the classifying map of p. In this situation, we say that the small map p is displayed. We summarise the notation for these equivalent notions:

In the following, all three points of view will be exploited.

Remark 1.2

Let X be an object of \({\mathcal {E}}= \textrm{Psh}(\mathbb {C})\) and consider the slice topos \({\mathcal {E}}/_{X}\). Up to the equivalence of categories (1.1), this is the presheaf topos \(\textrm{Psh}(\int \! X)\), with a notion of small map as in Definition 1.1, and an associated small map classifier \(\pi _X :E_X \rightarrow U_X\). One can show that this map is obtained by composition (and whiskering) of the presheaves E and U (and the natural transformation \(\pi :E\rightarrow U\)) with the forgetful functor \({(\int \! X)}^{\smash {\textrm{op}}} \rightarrow {\mathbb {C}}^{\smash {\textrm{op}}}\). In particular, \(E_X (c,x) = E(c)\) and \(U_X (c,x) = U(c)\), for c in \(\mathbb {C}\) and \(x \in X(c)\). In \({\mathcal {E}}/_{X}\), the small map classifier \(\pi _X :E_X \rightarrow U_X\) corresponds under (1.1) to the base change \(X^*\pi \) of the small map classifier \(\pi \) in \({\mathcal {E}}\),

(1.10)

Thus in particular,

$$\begin{aligned} \textstyle \textrm{Psh}(\mathbb {C})(X,U)\ \cong \ \textrm{Psh}(\mathbb {C})/_{X}(1, X^*U)\ \cong \ \textrm{Psh}(\int \! X) (1, U_X) \,. \end{aligned}$$
(1.11)

We will sometimes notationally identify a type \(\alpha :X \rightarrow U\) in \(\textrm{Psh}(\mathbb {C})\) with the associated closed type \(\alpha :1 \rightarrow U_X\) in \(\textrm{Psh}(\int \! X) \) under this isomorphism.

Dependent sums and products of small maps Small maps are closed under a variety of operations. In particular, the pullback of a small map along any map \(f:Y\rightarrow X\) is again a small map. Furthermore, if \(p :A \rightarrow X\) is a small map, then the left and right adjoints to pullback along p restrict to small maps, in the sense that there are serially-commuting diagrams as follows.

figure a

The action of these adjoints is reflected into operations on classifying maps, as we now explain.

Consider first the pullback along any map \(f :Y \rightarrow X\). Given \(\alpha :X \rightarrow U\) with its small display map the pullback is classified by the composite \(\alpha f:Y \rightarrow U\), by the two pullbacks lemma,

(1.13)

In this way, the pullback operation on small maps \(f^*:\mathcal {S}/_{X}\rightarrow \mathcal {S}/_{Y}\) is induced, up to isomorphism, by precomposition of the associated classifying maps, \(f^*p_\alpha \cong p_{\alpha f}\). We have the following characterisation of the sections of the small display map \( Y.\alpha f \rightarrow Y\), which will be used to validate the substitution rule in Notation 3.4.

Proposition 1.3

Let \(f:Y\rightarrow X\) and \(\alpha :X\rightarrow U\). Then the following data are in bijective correspondence:

  1. (i)

    sections \(a:Y \rightarrow Y.\alpha f\) over Y,

  2. (ii)

    lifts \(a' :Y \rightarrow X.\alpha \) of f across \(p_\alpha \). \(\square \)

Now consider the left adjoint. Given \(\alpha :X \rightarrow U\) and \(\beta :X.\alpha \rightarrow U\), let \(p :X.\alpha \rightarrow X\) and \(q :X.\alpha .\beta \rightarrow X.\alpha \) be the associated display maps. Since p and q are small, we obtain a small map \(\Sigma _{p}(q)\) in \(\mathcal {S}/_{X}\) by application of the functor \(\Sigma _p\) in (1.12). This is given simply by composition, so that \(\Sigma _{p}(q) =_{\textrm{def}}q \circ p\). Let \(\Sigma _\alpha (\beta ) :X \rightarrow U\) be the classifying map of \(\Sigma _{p}(q) :X.\alpha .\beta \rightarrow X\), giving rise to the following pullback diagram, in which the map labelled \(\textsf{pair}_{\alpha , \beta }\) is the canonical one:

(1.14)

Note that there is an isomorphism \(X.\alpha .\beta \cong X.\Sigma _{\alpha }(\beta )\) over X. We therefore obtain maps \(\textsf{p}_1\) and \(\textsf{p}_2\) fitting into the diagrams

figure b

From this description we obtain Proposition 1.4 below, which characterises the sections of the display map \(X.\Sigma _\alpha (\beta )~\rightarrow ~X\). It is essentially contained already in [43], and will be used to show the validity of the rules for dependent sum types in Proposition 3.9.

Proposition 1.4

Let \(\alpha :X\rightarrow U\) and \(\beta :X.\alpha \rightarrow U\). Then the following data are in bijective correspondence:

  1. (i)

    pairs of sections \(a :X \rightarrow X.\alpha \) and \(b :X \rightarrow X.\beta (a)\), both over X,

  2. (ii)

    sections \(c :X \rightarrow X.\Sigma _\alpha (\beta )\) over X. \(\square \)

Remark

As shown in [3], the operation mapping \(\alpha \) and \(\beta \) to \(\Sigma _\alpha (\beta )\) can be internalised in \({\mathcal {E}}\), by making use of the polynomial functor \(P :{\mathcal {E}}\rightarrow {\mathcal {E}}\) associated to the map \(\pi :E\rightarrow U\), in the sense of [20], i.e. the composite

(1.16)

Indeed, there is a pullback diagram

and for every \(\alpha \) and \(\beta \) as above, we have a pasting

where \((\alpha , \beta ) :X \rightarrow P(U)\) is determined by the universal property of \(P(U)\), and Q can be seen as the object of pairs of sections (ab) as in Proposition 1.4. Comparing this pasting with (1.14), not only \(X.\Sigma _{\alpha }(\beta )\) is isomorphic to \(X.\Sigma (\alpha , \beta )\) over X, but also the composite map \(\Sigma (\alpha , \beta ) :X \rightarrow U\) above is isomorphic to the map classifying map \(\Sigma _\alpha (\beta ) :X \rightarrow U\), in the sense to be made precise when we discuss the internal category of types in Sect. 2.

We now consider the right adjoint. With \(p :X.\alpha \rightarrow X\) and \(q :X.\alpha .\beta \rightarrow X.\alpha \) as before, let \(\Pi _\alpha (\beta )\) be the classifying map of the small map \(\Pi _{p}(q)\), giving rise to a pullback diagram of the form

(1.17)

The map on the left hand side is isomorphic to \(\Pi _{p}(q)\) in \({\mathcal {E}}/_{X}\) and hence inherits its universal property. In particular, the counit of the adjunction induces a map \(\varepsilon :X.\alpha .\Pi _\alpha (\beta ) \rightarrow X.\alpha .\beta \) in \({\mathcal {E}}/_{X.\alpha }\) which gives rise to a commutative diagram

(1.18)

The resulting characterisation of the sections of the display map \(X.\Pi _\alpha (\beta ) \rightarrow X\) is also essentially contained already in [43], and will be used to show the validity of the rules for dependent product types in Proposition 3.11.

Proposition 1.5

Let \(\alpha :X\rightarrow U\) and \(\beta :X.\alpha \rightarrow U\). Then the following data are in bijective correspondence:

  1. (i)

    sections \(b :X.\alpha \rightarrow X.\alpha .\beta \) over \(X.\alpha \),

  2. (ii)

    sections \({b}^\sharp :X \rightarrow X.\Pi _\alpha (\beta )\) over X.

The bijection is defined by \(\varepsilon \circ ~p^*b^\sharp =~b\), using pullback along p and composition with the counit \(\varepsilon \). \(\square \)

Remark

As was the case for the left adjoint, there is a pullback diagram

which gives rise for every \(\alpha \) and \(\beta \) to the pasting diagram

(1.19)

This is related to the one in (1.17) in a way that is analogous to the one discussed for the left adjoint.

The subobject classifier We conclude this review section by introducing some notation and recalling some basic facts about the subobject classifier of \({\mathcal {E}}\), written \(\Omega \). This presheaf is defined by letting, for \(c \in \mathbb {C}\),

$$\begin{aligned} \Omega (c) =_{\textrm{def}}\textrm{Obj} \big [ { (\mathbb {C}/_{c})}^{\smash {\textrm{op}}} \,, \textbf{2} \big ] , \end{aligned}$$
(1.20)

where \(\textbf{2}\) is the poset \(\{0\le 1\}\). The map \(\textsf{true}:1 \rightarrow \Omega \) is defined by letting its component at c be the constant functor with value 1. This classifies subobjects in the sense that for every subobject \(S \rightarrowtail X\), there exists a unique \(\sigma :X \rightarrow \Omega \) such that

(1.21)

is a pullback diagram. In this case, we call \(\sigma \) the characteristic map of S and say that S is classified by \(\sigma \). We introduce some notation for the pullbacks of \(\textsf{true}:1 \rightarrow \Omega \). Given \(\sigma :X \rightarrow \Omega \), we write

(1.22)

for the subobject which is the pullback of \(\textsf{true}\) along \(\sigma \).

For \(X \in {\mathcal {E}}\), we write \(\textrm{Sub}(X)\) for the poset of subobjects of X. This poset has a Heyting algebra structure, which is reflected into operations on morphisms from X to \(\Omega \), for which we shall use standard logical notation. For example, if \(S, T \in \textrm{Sub}(X)\) are classified by \(\sigma \) and \(\tau \), respectively, so that \(S = \{ x \mathord {\, : \,}X \ | \ \sigma (x) \}\) and \( T =\{ x \mathord {\, : \,}X \ | \ \tau (x) \}\), then we write \(\sigma \Rightarrow \tau \) for the characteristic map of the Heyting implication \(S \Rightarrow T\) in \(\textrm{Sub}(X)\). Thus the subobject \(\{ x \mathord {\, : \,}X \ | \ (\sigma \Rightarrow \tau )(x) \}\) has the universal property of the Heyting implication \(S~\Rightarrow ~T\).

For our purposes, quantification along small maps will play an important role, so we introduce some notation for it. Fix \(\alpha :X \rightarrow U\) and let \(p :X.\alpha \rightarrow X\) be the associated small display map. Pullback along p restricts to a function \({p}^* :\textrm{Sub}(X) \rightarrow \textrm{Sub}(X.\alpha )\), which is a Heyting algebra morphism with both left and right adjoints, written \(\exists _p\) and \(\forall _p\), respectively. If \(S \in \textrm{Sub}(X.\alpha )\) is classified by \(\sigma :X.\alpha \rightarrow \Omega \), so that \(S = \{ (x,a) \mathord {\, : \,}X.\alpha \ | \ \sigma (x,a) \}\), then we write \(\exists _\alpha (\sigma ) :X \rightarrow \Omega \) for the characteristic map of \(\exists _p(S) \in \textrm{Sub}(X)\), so that

$$\begin{aligned} \exists _p(S) = \exists _p\{ (x,a) \mathord {\, : \,}X.\alpha \ | \ \sigma (x,a) \} = \{ x \mathord {\, : \,}X \ | \ (\exists _\alpha \sigma ) (x) \} . \end{aligned}$$

Since \(\exists _p\) is calculated by taking the image factorisation of the composite of \(S \rightarrowtail X.\alpha \) and \(p :X.\alpha \rightarrow X\), we obtain a diagram

(1.23)

whose right hand side is a pullback. The universal quantification \(\forall _p(S) \in \textrm{Sub}(X)\) is similarly classified by a map written \(\forall _\alpha (\sigma ) :X \rightarrow \Omega \), giving

$$\begin{aligned} \forall _p(S) = \forall _p\{ (x,a) \mathord {\, : \,}X.\alpha \ | \ \sigma (x,a) \} = \{ x \mathord {\, : \,}X \ | \ (\forall _\alpha \sigma )(x) \} . \end{aligned}$$

3 Small maps and subobjects

Subobjects as small maps There is an evident analogy between the small map classifier \(\pi :E\rightarrow U\) and the subobject classifier \(\textsf{true}:1 \rightarrow \Omega \). For one thing, recall that the universe \(U\) was defined in (1.3) by mapping into the category \(\mathop {\textbf{Set}}_{\kappa }\) of small sets, while the subobject classifer \(\Omega \) was defined in (1.20) by mapping into the category \(\textbf{2}\) of truth values. Note also the similarity between the classifying map of a small map in (1.5) and the characteristic map of a subobject in (1.21), as well as between the comprehension of a map \(\alpha :X \rightarrow U\) with respect to \(U\) in (1.8) and the comprehension of a map \(\sigma :X \rightarrow \Omega \) with respect to \(\Omega \) in (1.22). Our aim in this section is to make the relation between \(U\) and \(\Omega \) more precise. Anticipating the use to which they will be put in the sequel, we may regard \(U\) as an object of types and \(\Omega \) as an object of propositions. Observe first that there is an inclusion functor of truth values into sets, \(\textbf{2} \hookrightarrow {\mathop {\textbf{Set}}}_{\kappa }\), where, to be specific, we take the ordinals \(0= \emptyset \), \(1 = \{0\}\), \(2 = \{0, 1\}\), the latter ordered by inclusion when regarded as the category \(\textbf{2}\). By the definitions of \(U\) and \(\Omega \) in (1.3) and (1.20), respectively, this functor induces by composition a natural transformation

$$\begin{aligned} \{-\} :\Omega \rightarrow U, \end{aligned}$$
(2.1)

which we call the inclusion of propositions into types.

Proposition 2.1

The inclusion map \(\{-\} :\Omega \rightarrow U\) is a monomorphism in \({\mathcal {E}}\), and fits into a pullback diagram of the form

Proof

The inclusion functor \(\textbf{2} \hookrightarrow {\mathop {\textbf{Set}}}_{\kappa }\) is injective on objects, and so composing with it is pointwise monic. Similarly, the pullback is induced via composition by the evident pullback of categories and functors

Corollary 2.2

Let \(\sigma :X \rightarrow \Omega \). Then \(X.\{\sigma \} = \{ x :X \mid \sigma (x)\}\), i.e. the comprehension of \(\sigma \) with respect to \(\Omega \) is equal, as a subobject of X, to the comprehension of its inclusion \(\{\sigma \}\) with respect to \(U\).

Proof

The display map \(p_{\{\sigma \}}:X.\{\sigma \} \rightarrow X\) fits into the diagram

Since the outer rectangle is a pullback by definition and the right hand square is a pullback by Proposition 2.1, the left hand square is also a pullback. Thus the mono \(p_{\{\sigma \}}:X.\{\sigma \} \rightarrow X\) represents the subobject \(\{ x :X \mid \sigma (x)\}\) classified by \(\sigma :X \rightarrow \Omega \).

Remark 2.3

Propositional comprehension of a subobject \(S\rightarrowtail X\) from a map \(\sigma :X\rightarrow \Omega \) is determined only up to equivalence of the representing monomorphisms \(s :S \rightarrowtail X\), whereas for a type \(\alpha :X\rightarrow U\), we have made a canonical choice \(p_\alpha :X.\alpha \rightarrow X\), which however is only one among many isomorphic small maps \(p :A \rightarrow X\) classified by \(\alpha \). Corollary 2.2 says that we can use these canonical small maps as canonical representatives of subobjects when convenient. See Sect. 2 for a warning about this use.

Propositional truncation Consider the universal small map \(\pi :E\rightarrow U\) and its image factorisation \(E\twoheadrightarrow \textsf{im}(\pi ) \rightarrowtail U\) and let \(\textsf{supp}:U\rightarrow \Omega \) be the characteristic map of the subobject \(\textsf{im}(\pi ) \rightarrowtail {U}\), fitting into the pullback diagram

Note that \(\textsf{supp}\) is induced by composition with the functor \({\mathop {\textbf{Set}}}_{\kappa } \rightarrow \textbf{2}\) mapping every non-empty set to 1 and the empty set to 0. For \(\alpha :X \rightarrow U\), we write \(\textsf{supp}(\alpha ) :X \rightarrow \Omega \) and call it the support of \(\alpha \). Pasting the factorisation on the left and the pullback diagram of Proposition 2.1 on the right, we obtain

(2.2)

We define the truncation operation \(\textsf{tr}:U\rightarrow U\) to be the composite of \(\textsf{supp}:U\rightarrow \Omega \) and \(\{-\}:\Omega \rightarrowtail U\). For \(\alpha :X \rightarrow U\), we write \(\textsf{tr}(\alpha ) :X \rightarrow U\) for the composite of \(\alpha \) and \(\textsf{tr}\), so that

$$\begin{aligned} \textsf{tr}(\alpha ) =_{\textrm{def}}\{ \textsf{supp}(\alpha ) \} . \end{aligned}$$
(2.3)

This operation of propositional truncation behaves like the bracket types of [5], as stated in the following proposition

Proposition 2.4

Let \(p :A \rightarrow X\) be a small map with classifying map \(\alpha :X \rightarrow U\). Then \(\textsf{tr}(\alpha ) :X \rightarrow ~U\) is a classifying map for the image factorisation of p, in the sense that there is a pullback diagram

Moreover, the composite \(\textsf{supp}\circ \{-\} :\Omega \rightarrow \Omega \) is the identity map.

Proof

Consider the image factorisation on the left face below, which is a pullback of the right face, since image factorisations are stable under pullback:

(2.4)

Adjoining diagram (2.2) on the right, we obtain

which shows that the three-fold composite across the front face below is also a pullback. Thus

$$\begin{aligned} \textsf{im}(p) \cong X.\{\textsf{supp}(\alpha )\} = X.\textsf{tr}(\alpha ) . \end{aligned}$$

Finally, the left hand square in

is a pullback, as can be seen by putting \(\{-\}\) for \(\alpha \) in (2.4) and using \(\textsf{im}(\Omega .\{-\}) = \textsf{im}(\textsf{true}) = \textsf{true}\), since \(\textsf{true}:1\rightarrow \Omega \) is monic. The right hand square is a pullback by definition. Thus the outer rectangle is a pullback, and so the composite \(\textsf{supp}\circ \{-\}\) must be the identity, since it is the characteristic map of \(\textsf{true}:1 \rightarrowtail \Omega \).

Propositions and types Subobjects and small maps can be combined, but some care is required in working with their characteristic maps and classifying maps, respectively. For example, fix \(\alpha :X \rightarrow U\) and let \(p :X.\alpha \rightarrow X\) be the associated display map. Then consider \(\sigma :X.\alpha \rightarrow \Omega \) and let \(S = \{ (x,a) \mathord {\, : \,}X.\alpha \mid \sigma (x,a)\}\) be the associated subobject,

(2.5)

By Corollary 2.2, \(S = X.\alpha .\{\sigma \}\) as subobjects, and so the composite \(S \rightarrow X\) is classified as a small map by \(\Sigma _{\alpha }\{\sigma \} :X\rightarrow U\). Thus \(S \rightarrow X\) is isomorphic over X to the associated display map,

Now consider the image factorisation \(S \twoheadrightarrow \exists _p(S) \rightarrowtail X\) and the characteristic map \({\exists _\alpha (\sigma )} :X\rightarrow \Omega \) of the subobject \(\exists _p(S) \rightarrowtail X\), as in (1.23). Composing with the inclusion \(\{-\}:\Omega \rightarrowtail U\), we can compare the map \(\{\exists _\alpha (\sigma )\} :X\rightarrow U\) to the propositional truncation \(\textsf{tr}(\Sigma _{\alpha }\{\sigma \}) :X\rightarrow U\), which also classifies the image \(\exists _p(S)\rightarrowtail X\) (as a small map), by Proposition 2.4. Indeed, since \(\textsf{tr}= \{-\}\circ \textsf{supp}\), and \(\{-\}\) is monic, it suffices to compare the maps \(\exists _\alpha (\sigma ) :X\rightarrow \Omega \) and \(\textsf{supp}(\Sigma _{\alpha }\{\sigma \}) :X\rightarrow \Omega \). Since these are characteristic maps into \(\Omega \), they are equal if and only if the associated subobjects of X are the same, which is true since both are \(\textsf{im}(S)\rightarrowtail X\). Thus we have \(\{\exists _\alpha (\sigma )\} = \textsf{tr}(\Sigma _{\alpha }\{\sigma \})\) as maps from X to \(U\).

Now consider the universal quantification, and compare \(\{\forall _\alpha (\sigma )\} \) with \( \Pi _{\alpha }\{\sigma \}\). Again we have the subobject \(S \rightarrowtail X.\alpha \) of (2.5) with its characteristic map \(\sigma :X.\alpha \rightarrow \Omega \), as well as its classifying map as a small map \(\{\sigma \} :X.\alpha \rightarrow U\). Applying \(\Pi _p\) along \(X.\alpha \rightarrow X\) gives a small map \(q:X.\Pi _{\alpha }\{\sigma \} \rightarrow X\) classified by \(\Pi _{\alpha }\{\sigma \} :X\rightarrow U\). Since \(\Pi _p\) preserves monomorphisms, \(q:X.\Pi _{\alpha }\{\sigma \} \rightarrow X\) is monic and so determines a subobject of X, which by definition is \(\forall _p(S) \rightarrowtail X\). The characteristic map of this subobject is then \(\forall _{\alpha }(\sigma ) :X\rightarrow \Omega \). Finally, composing again with the inclusion \(\{-\}:\Omega \rightarrowtail U\) we can compare the maps

$$\begin{aligned} \{\forall _\alpha (\sigma )\} :X\rightarrow U, \qquad \Pi _{\alpha }\{\sigma \} :X\rightarrow U. \end{aligned}$$
(2.6)

But now there is no reason why these maps should be equal. What we can say is that their supports agree, because they are the characteristic maps of the same subobject of X, and therefore

$$\begin{aligned} \forall _\alpha (\sigma ) = \textsf{supp}\{\forall _\alpha (\sigma )\} = \textsf{supp}(\Pi _{\alpha }\{\sigma \}). \end{aligned}$$

Bearing this lesson in mind, we have the following relationship between the operations on propositions \(\sigma :X\rightarrow \Omega \) and on types \(\alpha :X\rightarrow U\), stated in terms of equations between maps into \(\Omega \). This is one variant of the usual propositions-as-types translation (see 2.7 below for another).

Proposition 2.5

The following equalities hold for maps into \(\Omega \), where \(\sigma \,, \tau :X \rightarrow \Omega \).

  1. (i)

    \(\textsf{true}= \textsf{supp}(\textsf{1}) \),

  2. (ii)

    \(\textsf{false}= \textsf{supp}(\textsf{0})\),

  3. (iii)

    \(\sigma \wedge \tau = \textsf{supp}(\{\sigma \} \times \{\tau \})\),

  4. (iv)

    \(\sigma \vee \tau = \textsf{supp}(\{\sigma \} + \{\tau \} )\),

  5. (v)

    \(\sigma \Rightarrow \tau = \textsf{supp}(\{\sigma \} \rightarrow \{\tau \})\).

For \(\alpha :X \rightarrow U\) and \(\sigma :X.\alpha \rightarrow \Omega \),

  1. (vi)

    \({\forall _\alpha (\sigma ) } = \textsf{supp}(\Pi _\alpha \{ \sigma \} )\),

  2. (vii)

    \({ \exists _\alpha (\sigma ) } = \textsf{supp}(\Sigma _\alpha \{\sigma \} ) \).

Remark 2.6

The equations of Proposition 2.5 can be expressed as diagrams in \({\mathcal {E}}\) by representing the operations on subobjects and on small maps internally as maps involving \(\Omega \) and \(U\) (as shown in [3]). We illustrate this only for the quantifiers. Let \(P :{\mathcal {E}}\rightarrow {\mathcal {E}}\) be the polynomial functor associated to the map \(\pi :E\rightarrow U\), as defined in (1.16). Dependent sums and existential quantifiers then give rise to maps \(\Sigma :P(U) \rightarrow U\) and \(\exists :P(\Omega ) \rightarrow \Omega \), respectively. The following square

then commutes, since the equation (vii) holds for all \(\alpha :X \rightarrow U\) and . The direct analogue for the universal quantifier also holds, of course, by (vi); but consider instead the following diagram, corresponding to the two maps in (2.6):

(2.7)

Since the maps in this diagram land in \(U\), rather than \(\Omega \), we cannot use the universal property of \(\Omega \) to conclude that it commutes. Nonetheless, it can be shown to commute “up to isomorphism”, which we make precise next.

The internal category of types We have emphasized the analogy between the small map classifier \(U\) and the subobject classifier \(\Omega \). There are, of course, also some important differences; in particular, the universal property of \(\Omega \) is stronger than that of \(U\), in that a subobject \(S \rightarrowtail X\) has a unique characteristic map from X to \(\Omega \), while for a small map \(p :A \rightarrow X\), a classifying map from X to \(U\) will usually not be unique. As was shown in (1.6), however, there is a canonical choice of the classifying map of a given small map; moreover, this map is in fact unique up to isomorphism, in a sense that we now make precise.

As was noted in (Sect. 1), for each \(X \in {\mathcal {E}}\), the poset of subobjects \(\textrm{Sub}(X)\) has a stable Heyting algebra structure, which is mirrored by operations on morphisms from X to \(\Omega \). Since the isomorphism \(\textrm{Sub}(X)\ \cong \ {\mathcal {E}}(X, \Omega )\) is natural in X, by the Yoneda lemma there are associated operations on \(\Omega \) making it an internal Heyting algebra in \({\mathcal {E}}\). In particular, \(\Omega \) is an internal poset, with an ordering relation \(\{ (x, y) \mathord {\, : \,}\Omega \times \Omega \ | \ x \le y \} \rightarrowtail \Omega \times \Omega \), satisfying the condition that for subobjects \(S, T \rightarrowtail X\) with characteristic maps \(\sigma , \tau :X \rightarrow \Omega \), one has \(S\le T\) if and only if there is a (necessarily unique) lift as indicated in the following diagram.

In much the same way, there is an internal category structure on the object \(U\),

$$\begin{aligned} U_1\rightarrow U\times U, \end{aligned}$$

such that for any small maps \(A \rightarrow X\) and \(B \rightarrow X\), with classifying maps \(\alpha , \beta :X \rightarrow U\), the maps \(f :A\rightarrow B\) in the slice category over X correspond (uniquely!) to lifts \(\vartheta \) of \((\alpha , \beta ) :X \rightarrow U\times U\), as indicated in the following diagram.

Moreover, since by (1.9) the assignment of \(p_\alpha :X.\alpha \rightarrow X\) to \(\alpha :X\rightarrow U\) is essentially surjective onto the objects in the category \(\mathcal {S}/_{X}\) of small maps, we therefore have an equivalence of categories,

$$\begin{aligned} \mathcal {S}/_{X}\ \simeq \ \underline{{\mathcal {E}}}(X, \mathbb {U}), \end{aligned}$$
(2.8)

where \(\mathbb {U}= (U, U_1)\) may be called the internal category of types, and the category \(\underline{{\mathcal {E}}}(X, \mathbb {U})\) consists of objects \({\mathcal {E}}(X, U)\) and morphisms \({\mathcal {E}}(X, U_1)\). This can be done internally in any locally cartesian closed category using only the dependent product structure, via the so-called internal full subcategory construction. In our context, it is possible to give an alternative construction, which we limit ourselves to sketching since we shall make no essential use of (2.8).

First recall the definition (1.3) of the set \(U(c)\), for \(c \in \mathbb {C}\), and consider the corresponding set of morphisms,

$$\begin{aligned} U_1(c) =_{\textrm{def}}\textrm{Mor} \big [ {(\mathbb {C}/_{c})}^{\smash {\textrm{op}}} \,, {\mathop {\textbf{Set}}}_\kappa \big ] \,. \end{aligned}$$
(2.9)

Explicitly, an element \(\vartheta \in U_1(c)\) is a natural transformation \(\vartheta :\alpha \rightarrow \beta \) of presheaves \(\alpha ,\beta \in U(c)\) on the slice category \(\mathbb {C}/_{c}\) whose values are small sets. The domain and codomain maps are just those of the functor category \(\big [ {(\mathbb {C}/_{c})}^{\smash {\textrm{op}}} \,, {\mathop {\textbf{Set}}}_\kappa \big ]\), as are the identities and composition. Naturality with respect to \(d\rightarrow c\) in \(\mathbb {C}\) is given by “whiskering” (i.e. precomposition) with the composition functor \(\mathbb {C}/d \rightarrow \mathbb {C}/c\).

Now let \(c \in \mathbb {C}\) and assume \(\alpha ,\beta :\textsf{y}c \rightarrow U\), with associated display maps \(p_\alpha :\textsf{y}c.\alpha \rightarrow \textsf{y}c\) and \(p_\beta :\textsf{y}c.\beta \rightarrow \textsf{y}c\). A map \(h :p_\alpha \rightarrow p_\beta \) in \(\mathcal {S}/_{\textsf{y}c}\) is a morphism in

$$\begin{aligned} \big ({{\mathop {\textbf{Set}}}_\kappa }^{{\mathbb {C}}^{\smash {\textrm{op}}}}\big ){/\textsf{y}c}\ \simeq \ {{\mathop {\textbf{Set}}}_\kappa }^{{(\mathbb {C}{/c})}^{\smash {\textrm{op}}}}, \end{aligned}$$
(2.10)

and therefore corresponds to a unique element \(\vartheta \) of \(U_1(c)\) by (2.9). One then checks that the equivalence of categories (2.10) indeed relates \(\alpha :\textsf{y}c \rightarrow U\) to the display map \(p_\alpha :\textsf{y}c.\alpha \rightarrow \textsf{y}c\) in a functorial way (see (1.7)).

Finally, two maps \(\alpha ,\beta :X \rightarrow U\) are said to be isomorphic if they are so as objects in the category \(\underline{{\mathcal {E}}}(X, \mathbb {U})\) of types over X (2.8). In particular, it is in this sense that the diagram (2.7) commutes up to isomorphism. Indeed, using this notion, we can give a more precise statement than Proposition 2.5 of the relationship between propositions \(\sigma :X\rightarrow \Omega \) and types \(\alpha :X\rightarrow U\).

Proposition 2.7

The following equalities and isomorphisms hold for maps into \(U\).

  1. (i)

    \(\{\textsf{true}\} \cong \textsf{1} \),

  2. (ii)

    \(\{\textsf{false}\} \cong \textsf{0} \),

  3. (iii)

    \(\{\sigma \wedge \tau \} \cong \{\sigma \} \times \{\tau \}\),

  4. (iv)

    \(\{\sigma \vee \tau \} = \textsf{tr}\big ( \{\sigma \} + \{\tau \} \big )\),

  5. (v)

    \(\{\sigma \Rightarrow \tau \} \cong \{\sigma \} \rightarrow \{\tau \}\).

For \(\alpha :X \rightarrow U\) and \(\sigma :X.\alpha \rightarrow \Omega \),

  1. (vi)

    \(\{ \forall _\alpha (\sigma ) \} \cong \Pi _\alpha \{ \sigma \} \),

  2. (vii)

    \(\{ \exists _\alpha (\sigma ) \} = \textsf{tr}(\Sigma _\alpha \{\sigma \} )\).

Proof

We have an adjunction \(\textsf{supp}\dashv \{-\}\), so that for all \(\sigma :X\rightarrow \Omega \) and \(\alpha :X\rightarrow U\), there is a natural isomorphism \(\Omega ^X ( \textsf{supp}(\alpha ), \sigma )\ \cong \ \mathbb {U}^X (\alpha , \{\sigma \})\). Now use the fact that \(\textsf{supp}(\{\sigma \}) = \sigma \) and \(\{\textsf{supp}(\alpha )\} = \textsf{tr}(\alpha )\). For the two equalities, use Proposition 2.5.

4 The type theory of a presheaf category

The category with families The aim of this section is to introduce precisely a dependent type theory associated to the presheaf category \({\mathcal {E}}\). In order to do so, we begin by saying how \({\mathcal {E}}\) determines a category with families via the universe \(\pi :E\rightarrow U\) (as in [3]). We then consider what forms of type are supported by this category with families. We will not specify all the deduction rules that are valid in \({\mathcal {E}}\), but rather focus on those that will be most important for our applications, namely those concerning dependent sums, dependent products and the subobject classifier.

In Sects. 5 and 8, we will extend this type theory with additional forms of type, corresponding to additional structure that may be assumed on \({\mathcal {E}}\). We begin by introducing some terminology.

Definition 3.1

(The category with families \(\mathcal {T}_{{\mathcal {E}}}\))

  • A context is an object of \({\mathcal {E}}\). We use letters \(\Gamma , \Delta , \ldots \) to denote contexts.

  • For a context \(\Gamma \), a type in context \(\Gamma \) is a morphism \(\alpha :\Gamma \rightarrow U\) in \({\mathcal {E}}\). In this case, we write \(\Gamma \vdash \alpha :U\).

  • Given two types \(\alpha _1\) and \(\alpha _2\) in context \(\Gamma \), we say that \(\alpha _1\) and \(\alpha _2\) are judgementally equal if they are equal as morphisms from \(\Gamma \) to U. In this case, we write \(\Gamma \vdash \alpha _1 = \alpha _2 :U\).

  • For a context \(\Gamma \) and a type \(\alpha \) in context \(\Gamma \), an element of \(\alpha \) in context \(\Gamma \) is a map \(a :\Gamma \rightarrow E\) such that

    (3.1)

    commutes. In this case, we write \(\Gamma \vdash a :\alpha \).

  • For two terms \(a_1\) and \(a_2\) of type \(\alpha \) in context \(\Gamma \), we say that \(a_1\) and \(a_2\) are judgementally equal elements of \(\alpha \) if they are equal as morphisms from \(\Gamma \) to E. We then write \(\Gamma \vdash a_1 = a_2 :\alpha \).

For a context \(\Gamma \) and a type \(\alpha \) in context \(\Gamma \), we have a new context \(\Gamma .\alpha \), obtained by the pullback in (1.8). This is the operation of context extension. We sometimes refer to a map a with codomain \(E\) simply as an element, leaving implicit that it is an element of the type \(\pi \circ a\).

Remark 3.2

Thus elements of a type \(\alpha \) in context \(\Gamma \) are in bijective correspondence with sections of its display map \(\Gamma .\alpha \rightarrow \Gamma \). Indeed, an element a of \(\alpha \) in context \(\Gamma \), as defined above, determines the diagram

The empty context is the terminal object 1 of \({\mathcal {E}}\). A type in the empty context, which is just a map \(\alpha :1 \rightarrow U\) is called a closed type. In this case, we simply write \(\vdash \alpha :U\). As a special case of (1.8), for a closed type \(\alpha \), we obtain

Such closed types correspond up to isomorphism to small presheaves \(A:{\mathbb {C}}^{\smash {\textrm{op}}} \rightarrow \mathop {\textbf{Set}}_\kappa \).

Definition 3.3

Let \(\Gamma \) and \(\Delta \) be contexts. A context morphism from \(\Delta \) to \(\Gamma \) is a map \(t :\Delta \rightarrow \Gamma \) in \({\mathcal {E}}\).

Context morphisms, which may be regarded as (tuples of) terms, act on types and elements via the operation of substitution, which we now define.

Notation 3.4

(Substitution) Fix a context morphism \(t :\Delta \rightarrow \Gamma \). For a type \(\alpha \) in context \(\Gamma \), we define a type \(\alpha (t)\) in context \(\Delta \), obtained by substitution of t in \(\alpha \), by letting

$$\begin{aligned} \alpha (t) =_{\textrm{def}}\alpha \circ t . \end{aligned}$$
(3.2)

We then have the following diagram of the associated context extensions, in which the left square is also a pullback.

If a is term of type \(\alpha \) in context \(\Gamma \), we define the substitution of t in a to be the element a(t) of type \(\alpha (t)\) in context \(\Delta \) defined by letting \(a(t) =_{\textrm{def}}a \circ t\). Note that a(t) is indeed an element of \(\alpha (t)\) since

commutes if the right hand square does. Note that substitution satisfies the expected laws \(\alpha (t)(s) = \alpha (ts)\), etc.

We introduce some auxiliary notation for substitutions of a context morphism of the form \(({{\,\textrm{id}\,}}_\Gamma , a) :\Gamma \rightarrow \Gamma .\alpha \) as in Remark 3.2. In this case, given a type \(\beta \) in context \(\Gamma .\alpha \), we write the substitution of \(({{\,\textrm{id}\,}}_\Gamma , a)\) in \(\beta \) as \(\beta (a)\), rather than the more precise \(\beta ({{\,\textrm{id}\,}}_\Gamma , a)\). Similarly, if b is a term of type \(\beta \) in context \(\Gamma .\alpha \), we write b(a) instead of \(b({{\,\textrm{id}\,}}_\Gamma , a)\). The interpretation of these terms and types is displayed in the diagram

This notation allows us to derive the substitution rule

Notation 3.5

(Weakening) When we perform a substitution along a map of the form for some \(\beta :\Gamma \rightarrow U\), we obtain the diagram

This corresponds to the rule of weakening, which we write as

Note that we write rather than the more familiar \(\beta \) in the conclusion, as this will help us keep track of the context in which we are working. Analogously, we have weakening for elements of types, which we write as

Notation 3.6

Observe that in the context extension diagram (1.8), viz.

(3.3)

the top arrow \(q_\alpha :\Gamma .\alpha \rightarrow E\) gives a canonical element in the weakened context \(\Gamma .\alpha \). This corresponds to the syntactic rule of introducing a variable, usually expressed in dependent type theories by a judgement of the form \(\Gamma , x:\alpha \vdash x :\alpha \).

We recall a fundamental fact from [3].

Theorem 3.7

Contexts, context morphisms, types, elements, and the context extension operation, as defined above, form a category with families, denoted \(\mathcal {T}_{{\mathcal {E}}}\). \(\square \)

Remark 3.8

By Remark 1.2, the slice category \({\mathcal {E}}/_{X} \cong \textrm{Psh}(\int \! X)\) also has a universal small map \(\pi _X :E_X \rightarrow U_X\), and so we can apply the foregoing construction to obtain a category with families \(\mathcal {T}_{{\mathcal {E}}/_{\!X}}\). Using (1.11), and similar reasoning, one sees that the contexts, types, elements, etc., of \(\mathcal {T}_{{\mathcal {E}}/_{\!X}}\) correspond to those of \(\mathcal {T}_{{\mathcal {E}}}\) in which the context has the form \(X.(-)\), as in e.g. \(X.\Gamma \vdash a:\alpha \). We shall not distinguish between these isomorphic type theories.

Dependent sum and dependent product types The category-theoretic structure of \({\mathcal {E}}\) and the closure properties of the class \({\mathcal {E}}\) of small maps discussed in Sect. 1 correspond to well-known type-theoretic constructions. In particular, the type theory of \({\mathcal {E}}\) has empty type \(\textsf{0} \), a unit type \(\textsf{1} \), sum types \(\alpha + \beta \), dependent sum types \(\Sigma _\alpha (\beta )\), dependent product types \(\Pi _\alpha (\beta )\), a type of propositions \(\Omega \) and subset types  \(\{ x \mathord {\, : \,}\alpha \mid \sigma \}\). With these product types \(\alpha \times \beta \) and function types \(\alpha \rightarrow \beta \) can be defined, as explained in Notation 3.12 below. It also has a type of natural numbers \(\textsf{N}\), as well as many other inductively defined types. We shall not list the rules for all these types, limiting ourselves to those that will be most relevant and illustrative, namely dependent sums, dependent products and propositions.

Proposition 3.9 and Proposition 3.11 and their proofs, for which we refer to  [3], make use of the convention introduced in Notation 3.4. Even if we speak of ‘rules’ in their statements, it should be pointed out that these are claims about semantic objects, not generating rules of a dependent type theory.

Proposition 3.9

(Rules for dependent sum types) The following rules are valid in \({\mathcal {E}}\).

  • Formation: if \(\Gamma \vdash \alpha \mathord {\, : \,}U\) and \(\Gamma .\alpha \vdash \beta \mathord {\, : \,}U\), then \(\Gamma \vdash \Sigma _\alpha (\beta ) \mathord {\, : \,}U\).

  • Introduction: if \(\Gamma \vdash a \mathord {\, : \,}\alpha \) and \(\Gamma \vdash b \mathord {\, : \,}\beta (a)\) then \(\Gamma \vdash \textsf{pair}(a,b) \mathord {\, : \,}\Sigma _\alpha (\beta )\).

  • Elimination: if \(\Gamma \vdash t :\Sigma _\alpha (\beta )\) then \(\Gamma \vdash \textsf{p}_1(t) :\alpha \) and \(\Gamma \vdash \textsf{p}_2(t) :\beta (\textsf{p}_1(t))\).

  • Computation: if \(\Gamma \vdash a \mathord {\, : \,}\alpha \) and \(\Gamma \vdash b \mathord {\, : \,}\beta (a)\) then \(\Gamma \vdash \textsf{p}_1(\textsf{pair}(a,b)) = a \mathord {\, : \,}\alpha \) and \(\Gamma \vdash \textsf{p}_2(\textsf{pair}(a,b)) = b \mathord {\, : \,}\beta (a)\).

  • Expansion: if \(\Gamma \vdash t :\Sigma _\alpha (\beta )\) then \(\Gamma \vdash t = \textsf{pair}( \textsf{p}_1(t), \textsf{p}_2(t)) :\Sigma _\alpha (\beta )\). \(\square \)

Notation 3.10

In the statement of the next proposition and below we make use not only of the convention introduced in Notation 3.4, but also write \(\lambda (b)\) instead of \(\lambda ( ({{\,\textrm{id}\,}}_\Gamma , b^\sharp ) )\) for simplicity.

Proposition 3.11

(Rules for dependent product types) The following rules are valid in \({\mathcal {E}}\).

  • Formation: if \(\Gamma \vdash \alpha \mathord {\, : \,}U\) and \(\Gamma .\alpha \vdash \beta \mathord {\, : \,}U\) then \(\Gamma \vdash \Pi _\alpha \beta \mathord {\, : \,}U\).

  • Introduction: if \(\Gamma .\alpha \vdash b :\beta \) then \(\Gamma \vdash \lambda (b) :\Pi _\alpha (\beta )\).

  • Elimination: if \(\Gamma \vdash t \mathord {\, : \,}\Pi _\alpha (\beta )\) and \(\Gamma \vdash a \mathord {\, : \,}\alpha \) then \(\Gamma \vdash \textsf{app}(t,a) :\beta (a)\).

  • Computation: if \(\Gamma .\alpha \vdash b :\beta \) and \(\Gamma \vdash a \mathord {\, : \,}\alpha \) then \(\Gamma \vdash \textsf{app}\big ( \lambda (b), a \big ) = b(a) :\beta (a)\).

  • Expansion: if \(\Gamma \vdash t \mathord {\, : \,}\Pi _\alpha (\beta )\) then \(\Gamma \vdash \lambda ( \textsf{app}(t(p_\alpha ), q_\alpha ) = t :\Pi _\alpha (\beta )\). \(\square \)

Notation 3.12

(Product and function types) The rules for dependent sum and dependent product types of Propositions 3.9 and 3.11, in combination with the weakening operation of Notation 3.5, allow us to define product and function types and derive deduction rules for them. For \(\alpha :\Gamma \rightarrow U\) and \(\beta :\Gamma \rightarrow U\), we define the product type \(\alpha \times \beta :\Gamma \rightarrow U\) and the function type \(\alpha \rightarrow \beta :\Gamma \rightarrow U\) by letting

where we used the notation for weakening introduced in (3.5). We can then derive the deduction rules

for product types, and the rules

for function types, where we made use of the simplification introduced in Notation 3.10.

Notation 3.13

(Constant functions) In order to be able to manipulate constant functions conveniently, we introduce a further abuse of notation on top of the one discussed in Notation 3.10. If \(\Gamma \vdash b :\beta \), we write \(\Gamma \vdash \lambda (b) :\alpha \rightarrow \beta \) instead of , thereby omitting mention of the weakening in this particular case. This convention will be used frequently in Sect. 5.

Remark 3.14

The rules for dependent sum and dependent product types stated in Proposition 3.9 and Proposition 3.11 imply also many familiar properties of these types. In particular, if \(\Gamma \vdash \alpha :U\) and \(\Gamma .\alpha \vdash \beta :U\) and \(\Gamma .\alpha .\beta \vdash \rho :U\), we can prove that there are isomorphisms of types,

(3.4)
(3.5)

Also, if \(\Gamma \vdash \alpha :U\) and \(\Gamma .\alpha \vdash \beta :U\), then there is an isomorphism,

(3.6)

The soundness of the rules in \({\mathcal {E}}\), Proposition 3.9 and Proposition 3.11, then implies that there are corresponding isomorphisms in the category of types over \(\Gamma \),

$$\begin{aligned} \mathcal {S}/_{\Gamma }\ \simeq \ \underline{{\mathcal {E}}}(\Gamma , \mathbb {U}), \end{aligned}$$

introduced in (2.8) of section 2. In particular, it follows that the internal category of types \(\mathbb {U}\) is locally cartesian closed, much as the subobject classifier \(\Omega \) is an internal Heyting algebra.

The type of propositions We conclude this section by fixing some notation for the closed type associated to the subobject classifier of \({\mathcal {E}}\), which we shall also write \(\Omega \). The elements of this type, to be regarded as propositions, will be written using the standard logical notation,

$$\begin{aligned} \textsf{true}, \quad \textsf{false}, \quad a =_\alpha b , \quad \sigma \wedge \tau , \quad \sigma \vee \tau , \quad \sigma \Rightarrow \tau , \quad (\forall x :\alpha ) \tau (x) , \quad (\exists x :\alpha ) \tau (x) . \end{aligned}$$

Note that the proposition \(a =_\alpha b\) is a well-formed element of type \(\Omega \) in context \(\Gamma \) when a and b are well-formed elements of type \(\alpha \) in context \(\Gamma \). We refer to this as propositional equality; it is to be distinguished from judgemental equality \(a = b :\alpha \), relating two elements of type \(\alpha \) (and from \(p = q :\Omega \), relating two elements of type \(\Omega \)). In spite of this, we will sometimes drop the subscript from propositional equality, when this does not create confusion (see also Remark 3.16 below).

Definition 3.15

We say that a proposition \(\sigma \) in context \(\Gamma \) is valid if \(\sigma :\Gamma \rightarrow \Omega \) factors through \(\textsf{true}:1 \rightarrow \Omega \). In that case, we write \(\Gamma \vdash \sigma \). Similarly, we say that \(\Gamma , \varphi _1, \ldots , \varphi _n\) implies \(\varphi \), if the subobject \(\{ \Gamma \mid \varphi _1 \wedge \ldots \wedge \varphi _n\}\) factors through \(\{ \Gamma \mid \varphi \}\). In this case, we write \(\Gamma , \varphi _1, \ldots , \varphi _n \vdash \varphi \).

Note that \(\sigma \) is valid exactly when the associated subobject \(\{ \Gamma \mid \sigma \} \rightarrowtail \Gamma \) admits a section, and hence is isomorphic to \(\Gamma \).

Remark 3.16

Propositional equality \(a=_\alpha b :\Omega \) serves the purpose of the equality types \(\textsf{Eq}_{\alpha }(a,b)\) sometimes used in a system of type theory without a type of propositions. Here judgemental and propositional equality are equivalent, in the sense that the inference rules

are also valid. This is sometimes expressed by saying that the type theory of \({\mathcal {E}}\) is extensional, in contrast with formulations of Martin-Löf type theories that are intensional.

5 Kripke-Joyal forcing

Definition and basic properties The aim of this section is to give the definition of the Kripke-Joyal semantics for the type theory \(\mathcal {T}_{{\mathcal {E}}}\) of the category \({\mathcal {E}}\) of presheaves, introduced in Sect. 3, and establish some of its key properties. In particular, we unfold the general definition for each of the main type forming operations, so as to facilitate the work of subsequent sections.

Definition 4.1

Let \(\alpha :X \rightarrow U\) and \(x :\textsf{y}{c} \rightarrow X\).

  1. (i)

    For \(a :\textsf{y}{c} \rightarrow E\), we say that c forces \(a :\alpha (x)\), written

    $$\begin{aligned} c \Vdash a :\alpha (x), \end{aligned}$$

    if the following diagram commutes:

  2. (ii)

    For \(a, b :\textsf{y}{c} \rightarrow E\) such that \(c \Vdash a :\alpha (x)\) and \(c \Vdash b :\alpha (x)\), we say that c forces \(a = b :\alpha (x)\), written

    $$\begin{aligned} c \Vdash a = b :\alpha (x), \end{aligned}$$

    if a and b are equal maps in \({\mathcal {E}}\).

Remark 4.2

We provide some equivalent ways of regarding the forcing condition.

  1. (i)

    A map \(a :\textsf{y}{c} \rightarrow E\) such that \(c \Vdash a :\alpha (x)\) is the same thing as an element of \(\alpha (x)\) in context \(\textsf{y}{c}\). Indeed, we can rewrite the diagram in Definition 4.1 as

    Consulting (3.1), we see that \(c \Vdash a :\alpha (x)\) is therefore simply another notation for \(\textsf{y}{c} \vdash a :\alpha (x)\). Even if it is just an abbreviation, the forcing notation provides an alternate tool for working with the type theory of \({\mathcal {E}}\), when unfolded for the various type formers, as we shall see later.

  2. (ii)

    A map \(a :\textsf{y}{c} \rightarrow E\) such that \(c \Vdash a :\alpha (x)\) is the same thing as a dotted map making the following diagram commute:

    As we will see in Theorem 4.19, our definition subsumes the Kripke-Joyal forcing for propositions, which defines \(c \Vdash \sigma (x)\) to mean that there is a (now necessarily unique) map in

    One of the key differences between forcing for types and forcing for propositions is that in the forcing condition for types we need to record the map a, as it is not unique in general.

  3. (iii)

    A map \(a :\textsf{y}{c} \rightarrow E\) such that \(c \Vdash a :\alpha (x)\) also corresponds uniquely to a section of the display map of \({\alpha (x)}:\textsf{y}{c} \rightarrow U\),

The following statements gather some immediate consequences of Definition 4.1.

Lemma 4.3

Let \(\alpha , \beta :X \rightarrow U\). Then \(\alpha = \beta \) if and only if \(c \Vdash \alpha (x) = \beta (x)\) for every \(c\in \mathbb {C}\) and \(x :\textsf{y}c \rightarrow X\). \(\square \)

For the next lemma, recall that the monotonicity of conventional Kripke semantics states that if \(k \Vdash p\) and \(j>k\) then \(j\Vdash p\). Something similar holds in our setting as well.

Lemma 4.4

(Monotonicity) Let \(\alpha :X \rightarrow U\), \(x :\textsf{y}{c} \rightarrow X\) and \(a :\textsf{y}{c} \rightarrow E\). If \(c \Vdash a \mathord {\, : \,}\alpha (x) \) then \(d \Vdash a(f) \mathord {\, : \,}\alpha (x f) \) for every \(f :d \rightarrow c\).

Proof

Just precompose the diagram Definition 4.1 with \(f :d \rightarrow c\).

A converse to monotonicity might be stated as follows. Suppose that for every \(f :d \rightarrow c\), we have \(a_f :\textsf{y}{d} \rightarrow E\) with \(d \Vdash a_f \mathord {\, : \,}\alpha (x f)\), and moreover the uniformity condition \(e \Vdash a_f( g) = a_{fg} \mathord {\, : \,}\alpha (x fg)\) holds for all \(g :e \rightarrow d\). Then there is \(a :\textsf{y}{c} \rightarrow E\) with \(c \Vdash a \mathord {\, : \,}\alpha (x)\), and moreover \(d \Vdash a(f) = a_f \mathord {\, : \,}\alpha (x f)\) for all \(f :d \rightarrow c\). By the Yoneda lemma, this is trivial, however, because for a we can just take \(a_{{{\,\textrm{id}\,}}_{c}}\). What is not so trivial is the analogous statement for a judgement of the form \(X\vdash a :\alpha \) when X is not representable. Since the presheaf X is a colimit of representables, the validity of such judgements in the internal type theory \(\mathcal {T}_{\mathcal {E}}\) can be related to forcing semantics as follows.

Proposition 4.5

Let \(X \vdash \alpha :U\). Suppose that for each \({x :\textsf{y}{c} \rightarrow X}\) there is a given element \(a_x:\textsf{y}{c} \rightarrow E\) such that

$$\begin{aligned} c \Vdash a_x \mathord {\, : \,}\alpha (x), \end{aligned}$$
(4.1)

and moreover, the following uniformity condition holds for all \(f :d \rightarrow c\),

$$\begin{aligned} d \Vdash a_x( f) = a_{x f} \mathord {\, : \,}\alpha (x f). \end{aligned}$$

Then there is a unique element \(a :X\rightarrow E\) such that

$$\begin{aligned} X\vdash a :\alpha \end{aligned}$$
(4.2)

and, for all \({x :\textsf{y}{c} \rightarrow X}\),

$$\begin{aligned} c \Vdash a( x) = a_{x } \mathord {\, : \,}\alpha (x ). \end{aligned}$$

Proof

Given any \(X \vdash a :\alpha \) we can set \(a_x =_{\textrm{def}}ax\) for each \({x :\textsf{y}{c} \rightarrow X}\), and we then have \(c \Vdash a_x \mathord {\, : \,}\alpha (x)\) by precomposing (3.1) with \({x :\textsf{y}{c} \rightarrow X}\). The uniformity condition \(d \Vdash a_x( f) = a_{x f} \mathord {\, : \,}\alpha (x f)\) holds because \(a_x( f) = (ax)f = a(x f) = a_{x f}\).

To see that any uniform family of elements \((a_x:\textsf{y}{c} \rightarrow E)_{x :\textsf{y}{c} \rightarrow X}\) arises in this way from a unique \(X \vdash a :\alpha \), note that, for each c, the family \((a_x:\textsf{y}{c} \rightarrow E)_{x :\textsf{y}{c} \rightarrow X}\) determines a function \(\textbf{a}_c:X(c) \rightarrow E(c)\), while the uniformity condition means that the various functions \(\textbf{a}_c\) are natural in c, so we indeed have a natural transformation \(a :X \rightarrow E\). Recall that \(X \vdash a :\alpha \) means that this \(a :X \rightarrow E\) makes the diagram (3.1) commute. This follows from the individual conditions (4.1).

We can summarise Proposition 4.5 as follows.

Corollary 4.6

Let \(\alpha :X\rightarrow U\). Then the following data are in bijective correspondence:

  1. (i)

    elements \(a :X \rightarrow E\) such that \(X\vdash a:\alpha \),

  2. (ii)

    uniform families of elements \(a_x :\textsf{y}{c} \rightarrow E\) such that \(c \Vdash a_x :\alpha (x)\).

Specifically, the bijection is defined by letting \(a_x =_{\textrm{def}}a(x):\alpha (x)\). \(\square \)

Proposition 4.7

Let \(\alpha :1 \rightarrow U\) be a closed type. Then the following data are in bijective correspondence:

  1. (i)

    elements \(a :1 \rightarrow E\) such that \(\vdash a :\alpha \),

  2. (ii)

    uniform families of elements \((a_c)_{c\in \mathbb {C}}\), where \(c \Vdash a_c \mathord {\, : \,}\alpha \), i.e. such that \(d \Vdash {a_c}( f) = a_{d} \mathord {\, : \,}\alpha \), for all \(f :d \rightarrow c\).

Proof

Immediate from Corollary 4.6.

When the equivalent conditions of Proposition 4.7 hold, we may write \({\mathcal {E}}\Vdash a :\alpha \) and say that \({\mathcal {E}}\) forces \(a :\alpha \) (or even just that \({\mathcal {E}}\) forces \(\alpha \)). In these terms Corollary 4.6 implies the following soundness and completeness theorem for the \(\vdash \) relation of the internal type theory \(\mathcal {T}_{{\mathcal {E}}}\) with respect to the Kripke-Joyal forcing relation \(\Vdash \) (but also see Remark 4.26).

Theorem 4.8

(Soundness and completeness of forcing) Let \(\alpha :1 \rightarrow U\) be a closed type and \(a :1 \rightarrow E\). Then \(\mathcal {T}_{{\mathcal {E}}}\vdash a :\alpha \) if and only if \({\mathcal {E}}\Vdash a:\alpha \). \(\square \)

Forcing in slice categories Since any slice category of a presheaf topos is also a presheaf topos, as \(\textrm{Psh}(\mathbb {C})/_{X} \cong \textrm{Psh}(\int \!X)\), Definition 4.1 also determines a notion of forcing there (for the type theory \(\mathcal {T}_{{\mathcal {E}}/_{\!X}}\), see Remark 3.8), which is related to forcing in \({\mathcal {E}}\) by the following, c.f. also Remark 1.2.

Lemma 4.9

Let \(\alpha :X \rightarrow U\) and \(x :\textsf{y}c \rightarrow X\). Then the following data are in bijective correspondence:

  1. (i)

    maps \(a :\textsf{y}c \rightarrow E\) such that \(c \Vdash a \mathord {\, : \,}\alpha (x)\) in \(\textrm{Psh}(\mathbb {C})\),

  2. (ii)

    maps \(a :\textsf{y}(c,x) \rightarrow E_X\) such that \((c, x) \Vdash a \mathord {\, : \,}\alpha \) in \(\textrm{Psh}(\int \!X)\).

Proof

Under the identification of (1.11) (and observing Remark 3.8), the forcing condition \((c, x) \Vdash a \mathord {\, : \,}\alpha \) states that the diagram on the left below commutes in \(\textrm{Psh}(\int \!X)\), where \(\pi _X\) is the small map classifier of \(\textrm{Psh}(\int \!X)\), as in Remark 1.2. But by the specification of \(\pi _X\), this is equivalent to the commutativity in \(\textrm{Psh}(\mathbb {C})\) of the diagram on the right, which is what the condition \(c \Vdash a \mathord {\, : \,}\alpha (x)\) means.

figure c

Remark 4.10

Let \(\alpha :X\rightarrow U\) and reconsider the bijection of Corollary 4.6 between

  1. (i)

    elements \(X\vdash a:\alpha \),

  2. (ii)

    uniform families of elements \(c \Vdash a_x :\alpha (x)\), for all \(x :\textsf{y}{c} \rightarrow X \).

In light of Lemma 4.9, when we move to the slice category \({\mathcal {E}}/_X\) where \(\alpha :X\rightarrow U\) becomes a closed type, the bijection is then between:

  1. (i)

    elements \(\vdash a:\alpha \),

  2. (ii)

    uniform families of elements \((c,x)\Vdash a_{(c,x)} :\alpha \), for all \((c,x) \in \int {X}\).

The latter statement is Proposition 4.7.

In conclusion, forcing a type in context \(X\vdash a :\alpha \) in \(\mathcal {T}_{\mathcal {E}}\) is equivalent to forcing the corresponding closed type \(\vdash a :\alpha \) in \(\mathcal {T}_{{\mathcal {E}}/_{X}}\). Indeed, there is a bijection between the witnessing elements a. We can summarise this as follows.

Proposition 4.11

Let \(\alpha :X\rightarrow U\) be a type. Then the following data are in bijective correspondence:

  1. (i)

    elements \(a :X \rightarrow E\) such that \({\mathcal {E}}/_X \Vdash a:\alpha \),

  2. (ii)

    uniform families of elements \((a_x)_{(c,x) \in \int X}\), where \(c\Vdash a_x:\alpha (x)\). \(\square \)

Forcing for types We now unfold the definition of forcing with respect to each of the main type-forming operations of \(\mathcal {T}_{{\mathcal {E}}}\). We make use thereby of the term constructors \(\textsf{pair}\), \(\textsf{app}\), etc., of \(\mathcal {T}_{{\mathcal {E}}}\) that were introduced in Sect. 3.

Proposition 4.12

(Forcing for empty and unit type) Let \(c \in \mathbb {C}\).

  1. (i)

    \(c \not \Vdash a :\textsf{0} \) for all \(a :\textsf{y}{c} \rightarrow E\).

  2. (ii)

    \(c \Vdash a :\textsf{1} \) for a unique \(a=* :\textsf{y}{c} \rightarrow E\).

Proof

For item (i), if \(c \Vdash a :\textsf{0} \), then by item (iii) of Remark 4.2 we would have a section of the display map \(\textsf{y}{c}.\textsf{0} \rightarrow \textsf{y}{c}\), but \(\textsf{y}{c}.\textsf{0} = \{\textsf{y}{c}\ |\ \bot \} \rightarrowtail \textsf{y}{c}\) is the initial object of \({\mathcal {E}}\), so this is impossible, since \(\textsf{y}{c}\) always has at least the element \({{\,\textrm{id}\,}}:\textsf{y}{c}\rightarrow \textsf{y}{c}\).

For item (ii), \(c \Vdash a :\textsf{1} \) for every section a of the display map \(\textsf{y}{c}.\textsf{1} \rightarrow \textsf{y}{c}\), but \(\textsf{y}{c}.\textsf{1} = \{\textsf{y}{c}\ |\ \top \} \rightarrowtail \textsf{y}{c}\) is the total subobject, so there is always exactly one such section.

Proposition 4.13

(Forcing for sum types) Let \(\alpha , \beta \mathord {\, : \,}X \rightarrow U\). For every \(x :\textsf{y}{c} \rightarrow X\), the following conditions hold.

  1. (i)

    If \( c \Vdash a:\alpha (x) \) then \( c \Vdash \textsf{inl}(a) :\alpha (x) + \beta (x)\), and if \( c \Vdash b:\beta (x) \) then \( c \Vdash \textsf{inr}(b) :\alpha (x) + \beta (x)\).

  2. (ii)

    If \(c \Vdash t :\alpha (x) + \beta (x) \) then either \( c \Vdash t = \textsf{inl}(a):\alpha (x) \mathsf {+} \beta (x) \) for \( c \Vdash a:\alpha (x) \) or \( c \Vdash t = \textsf{inr}(b):\alpha (x) \mathsf {+} \beta (x) \) for \( c \Vdash b:\beta (x) \).

Proof

The sum \(\alpha + \beta :X \rightarrow U\) classifies the canonical map from the coproduct

$$\begin{aligned}{}[p_\alpha , p_\beta ] :X.\alpha + X.\beta \rightarrow X. \end{aligned}$$

Now if \( c \Vdash a:\alpha (x) \) then we have a lift \(a :\textsf{y}{c} \rightarrow X.\alpha \) of \(x :\textsf{y}{c} \rightarrow X\) across the display map \(p_\alpha :X.\alpha \rightarrow X\). Composing with the coproduct inclusion \( \textsf{inl} :X.\alpha \rightarrow X.\alpha + X.\beta \) we obtain \( c \Vdash \textsf{inl}(a) :\alpha (x) + \beta (x)\). If instead \( c \Vdash b:\beta (x) \) then in the same way we obtain \( c \Vdash \textsf{inr}(b) :\alpha (x) + \beta (x)\). Thus (i).

For (ii), if \(c \Vdash t :\alpha (x) + \beta (x) \), then there is a lift \(t :\textsf{y}{c} \rightarrow X.\alpha + X.\beta \) of \(x :\textsf{y}{c} \rightarrow X\) across \([p_\alpha , p_\beta ]\). Since the representable \(\textsf{y}{c}\) is indecomposable, the map t must factor through one of the coproduct inclusions. Thus we either have \( c \Vdash t = \textsf{inl}(a):\alpha (x) + \beta (x)\) where \( c \Vdash a:\alpha (x) \) or we have \( c \Vdash t = \textsf{inr}(b):\alpha (x) + \beta (x) \) where \( c \Vdash b:\beta (x) \), as required.

Proposition 4.14

(Forcing for dependent sum types) Let \(\alpha :X \rightarrow U\) and \(\beta :X.\alpha \rightarrow U\). For every \(x :\textsf{y}{c} \rightarrow X\), the following conditions hold.

  1. (i)

    If \(c \Vdash a :\alpha (x)\) and \(c \Vdash b :\beta (a)\), then \(c \Vdash \textsf{pair}( a, b) :(\Sigma _\alpha \beta )(x)\).

  2. (ii)

    If \( c \Vdash t \mathord {\, : \,}(\Sigma _\alpha \beta )(x)\), then \(c \Vdash \textsf{p}_1(t) :\alpha (x)\) and \(c \Vdash \textsf{p}_2(t) :\beta (\textsf{p}_1(t))\).

Proof

The statements (i) and (ii) follow from Proposition 3.9 (introduction and elimination) and item (i) of Remark 4.2.

Corollary 4.15

(Forcing for product types) For \(\alpha , \beta :X \rightarrow U\), the following hold.

  1. (i)

    If \(c \Vdash a :\alpha (x)\) and \(c \Vdash b :\beta (x)\), then \(c \Vdash \textsf{pair}(a, b) :(\alpha \times \beta ) (x)\).

  2. (ii)

    If \( c \Vdash t \mathord {\, : \,}(\alpha \times \beta )(x)\), then \(c \Vdash \textsf{p}_1(t) :\alpha (x)\) and \(c \Vdash \textsf{p}_2(t) :\beta (x)\).

Proof

Special case of Proposition 4.14 since product types are defined as dependent sum types (see Notation 3.12).

The next proposition unfolds the forcing condition for elements of the dependent product type. We see another appearance of the uniformity condition, which will play a role in our study of uniform fibrations in Sect. 7. As the proof shows, this condition arises from the non-pointwise character of dependent products in presheaves, much like the consideration of “future possible worlds” in the familiar Kripke semantics of implication \(p \Rightarrow q\).

Proposition 4.16

(Forcing for dependent product types) Let \(\alpha :X \rightarrow U\) and \(\beta :X.\alpha \rightarrow U\). Then for every \(x :\textsf{y}{c} \rightarrow X\) we have the following.

  1. (i)

    Suppose for every \(f :d \rightarrow c\) and every \(d \Vdash a \mathord {\, : \,}\alpha (x f )\) we are given \({d \Vdash b_{(f,a)} \mathord {\, : \,}\beta (x f, a)}\), satisfying the following uniformity condition for all \(g :e \rightarrow d\),

    $$\begin{aligned} e \Vdash b_{(f,a)} (g) = b_{(fg,ag)} :\beta (x fg, ag). \end{aligned}$$

    Then there is a map \(b :\textsf{y}{c}.\alpha \rightarrow E\) for which

    $$\begin{aligned} c \Vdash \lambda b \mathord {\, : \,}( \Pi _\alpha \beta ) (x) , \end{aligned}$$

    and for all \(f :d \rightarrow c\) and \(d \Vdash a \mathord {\, : \,}\alpha (x f )\) we have

    $$\begin{aligned} {d \Vdash \textsf{app}( (\lambda b) (f), a ) = b_{(f,a)} \mathord {\, : \,}\beta (x f, a)} . \end{aligned}$$
  2. (ii)

    Suppose that \(c \Vdash t :(\Pi _{\alpha } \beta )(x)\). Then for every \(f :d \rightarrow c\) and every \(d \Vdash a :\alpha (x f)\), we have

    $$\begin{aligned} d \Vdash \textsf{app}( t (f), a) :\beta (x f, a), \end{aligned}$$

    and moreover the following uniformity condition holds for every \(g :e \rightarrow d\),

    $$\begin{aligned} e \Vdash \textsf{app}( t (f), a) (g) = \textsf{app}( t (f g), a (g) ) :\beta (x fg, a). \end{aligned}$$

Proof

We work in the slice category \({\mathcal {E}}/{\textsf{y}{c}.\alpha }\) where the representables are pairs of the form (fa) with \(f :d \rightarrow c\) and \(d \Vdash a :\alpha (x f)\). Applying Proposition 4.11 to the condition in (i) we obtain \({\mathcal {E}}/{\textsf{y}{c}.\alpha } \Vdash b:\beta (x)\), which by Theorem 4.8 implies \(\mathcal {T}_{{\mathcal {E}}/{\textsf{y}{c}.\alpha }} \vdash b :\beta (x)\). Thus in \(\mathcal {T}\) we have \(\textsf{y}{c}.\alpha \vdash b :\beta (x)\) for some \(b :\textsf{y}{c}.\alpha \rightarrow E\). By Proposition 3.11, therefore, \(\textsf{y}{c} \vdash \lambda b :\Pi _\alpha (\beta )(x)\), and hence \(c \Vdash \lambda b :\Pi _\alpha (\beta )(x)\) by Remark 4.2(i). Then for all \(f :d \rightarrow c\) and \(d \Vdash a \mathord {\, : \,}\alpha (x f )\) we indeed have

$$\begin{aligned} \textsf{app}( (\lambda b) (f), a ) = b(f,a) = b_{(f,a)} \mathord {\, : \,}\beta (x f, a) \end{aligned}$$

by the computation rule of Proposition 3.11 and Corollary 4.6. Thus (i), as required.

For (ii), take \(c \Vdash t :(\Pi _{\alpha } \beta )(x)\) and \(f :d \rightarrow c\) so that \(d \Vdash t(f) :(\Pi _{\alpha } \beta )(xf)\) by Corollary 4.4. We then have \(\textsf{y}{d} \vdash t(f) :(\Pi _{\alpha } \beta )(xf)\), again by (i) of Remark 4.2. And similarly for \(d \Vdash a :\alpha (x f)\), we have \(\textsf{y}{d} \vdash a :\alpha (x f)\). Applying the elimination rule from Proposition 3.11 then gives \(\textsf{y}{d} \vdash \textsf{app}( t (f), a) :\beta (x f, a)\), whence \(d \Vdash \textsf{app}( t (f), a) :\beta (x f, a)\). The uniformity with respect to \(g :e \rightarrow d\) follows from the corresponding statement in the type theory, which is proved as usual from the Computation, Expansion, and Substitution rules.

Corollary 4.17

(Forcing for function types) Let \(\alpha :X \rightarrow U\) and \(\beta :X \rightarrow U\). Then for every \(x :\textsf{y}{c} \rightarrow X\) we have the following.

  1. (i)

    Suppose for every \(f :d \rightarrow c\) and every \(d \Vdash a \mathord {\, : \,}\alpha (x f )\) we are given \(d \Vdash b_{(f,a)} \mathord {\, : \,}\beta (x f)\), satisfying the following uniformity condition for all \(g :e \rightarrow d\),

    $$\begin{aligned} e \Vdash b_{(f,a)} (g) = b_{(fg,a(g))} :\beta (x fg). \end{aligned}$$

    Then there is a map \(b :\textsf{y}{c}.\alpha \rightarrow E\) for which

    $$\begin{aligned} c \Vdash \lambda (b) \mathord {\, : \,}(\alpha \rightarrow \beta )(x) , \end{aligned}$$

    and for all \(f :d \rightarrow c\) and \(d \Vdash a \mathord {\, : \,}\alpha (x f )\) we have

    $$\begin{aligned} {d \Vdash \textsf{app}( (\lambda b) (f), a ) = b_{(f,a)} \mathord {\, : \,}\beta (x f)} . \end{aligned}$$
  2. (ii)

    Suppose that \(c \Vdash t :(\alpha \rightarrow \beta )(x)\). Then for every \(f :d \rightarrow c\), and every \(d \Vdash a :\alpha (x f)\), we have

    $$\begin{aligned} d \Vdash \textsf{app}( t (f), a) :\beta (x f), \end{aligned}$$

    and moreover the following uniformity condition holds for every \(g :e \rightarrow d\),

    $$\begin{aligned} \textsf{app}( t (f), a) (g) = \textsf{app}( t (fg), a( g)):\beta (x fg). \end{aligned}$$

Proof

This is the special case of Proposition 4.16 since function types are defined as dependent product types (see Notation 3.12).

The foregoing forcing statements included detailed information about which specific terms are forced, on the basis of those assumed as given. While this information is sometimes useful, it can also be convenient to use the following simplified forcing conditions which elide this information (to the extent possible). Except where otherwise indicated, the individual forcing statements of the form \(c \Vdash t :\alpha \) then assert that there merely exists a term t such that \(c \Vdash t :\alpha \).

Corollary 4.18

(Forcing conditions) Let the types \(\alpha \), \(\beta \), etc., be as in the corresponding propositions above. Then for every \(x :\textsf{y}{c} \rightarrow X\) we have the following equivalences.

  1. (i)

    \(c \Vdash a :\textsf{0} \) if and only if \(a\ne a\).

  2. (ii)

    \(c \Vdash a :\textsf{1} \) if and only if \(a= *\).

  3. (iii)

    \(c \Vdash t :(\alpha + \beta )(x)\) if and only if \(c \Vdash a:\alpha (x)\) or \(c \Vdash b:\beta (x)\),

  4. (iv)

    \(c \Vdash t :(\alpha \times \beta )(x)\) if and only if \(c \Vdash a :\alpha (x)\) and \(c \Vdash b :\beta (x)\).

  5. (v)

    \(c \Vdash t :(\Sigma _\alpha \beta )(x)\) if and only if \(c \Vdash a :\alpha (x)\) and \(c \Vdash b :\beta (a)\).

  6. (vi)

    \(c \Vdash t :({\alpha } \rightarrow {\beta })(x)\) if and only if \(d \Vdash b_{(f,a)} \mathord {\, : \,}\beta (x f)\) for all \(f :d \rightarrow c\) and \(d \Vdash a \mathord {\, : \,}\alpha (x f )\), and \(e \Vdash b_{(f,a)} (g) = b_{(fg,ag)} :\beta (x fg)\) for all \(g :e \rightarrow d\).

  7. (vii)

    \(c \Vdash t :(\Pi _{\alpha } \beta )(x)\) if and only if \(d \Vdash b_{(f,a)} \mathord {\, : \,}\beta (x f, a)\) for all \(f :d \rightarrow c\) and \(d \Vdash a \mathord {\, : \,}\alpha (x f )\), and \(e \Vdash b_{(f,a)} (g) = b_{(fg,ag)} :\beta (x fg, ag)\) for all \(g :e \rightarrow d\). \(\square \)

Kripke-Joyal forcing for propositions We conclude this section by specialising our Kripke-Joyal forcing for type theory to propositions in \({\mathcal {E}}\) and relating it to the standard Kripke-Joyal forcing for first-order logic. For this, we make use of the relation between the small map classifier \(U\) and the subobject classifier \(\Omega \) described in Sect. 2. Recall that the standard Kripke-Joyal semantics is given by the specification, for \(\sigma :X \rightarrow \Omega \) and \(x :\textsf{y}{c} \rightarrow X\), that \(c\Vdash \sigma (x)\) if there is a (necessarily unique) dotted map fitting in the diagram

(4.3)

The following shows that our Kripke-Joyal semantics for type theory coincides with the standard one when restricted to propositions.

Theorem 4.19

Let \(\sigma :X \rightarrow \Omega \) and \(x :\textsf{y}{c} \rightarrow X\). Then the following conditions are equivalent.

  1. (i)

    \(c \Vdash \sigma (x)\).

  2. (ii)

    There exists a (necessarily unique) \(s :\textsf{y}{c} \rightarrow E\) such that \(c \Vdash s :\{\sigma (x)\}\).

Proof

Immediate from the definitions, observing that we have the

Notation 4.20

In light of Theorem 4.19, we shall often write \(c \Vdash \sigma (x) \) to mean that there exists an s such that \(c \Vdash s :\{\sigma (x)\} \).

By Theorem 4.19, we obtain forcing conditions for all types \(\sigma :\Gamma \rightarrow U\) that factor through the monomorphism \(\{-\}:\Omega \rightarrow U\) of (2.1). For such types, the uniformity conditions required for function types and \(\Pi \)-types become vacuous and indeed give back the standard Kripke-Joyal conditions. We illustrate this in a few cases.

Proposition 4.21

(Forcing for propositional equality) Let \(\alpha :X \rightarrow U\) and suppose that \(X \vdash a :\alpha \) and \(X \vdash b :\alpha \). Then for any \(x :\textsf{y}{c} \rightarrow X\), the following conditions are equivalent.

  1. (i)

    \( c \Vdash a(x) = b(x) \).

  2. (ii)

    a(x) and b(x) are equal as maps \(\textsf{y}{c} \rightarrow E\).

Proof

For each \(x :\textsf{y}{c} \rightarrow X\), the element \(a:\alpha \) determines a map (xa(x)) as follows (and similarly for \(b:\alpha \)).

Now consider the following diagram, in which both squares are pullbacks.

By definition, we have \( c \Vdash a(x) = b(x)\) if and only if there is a dotted map as indicated. But this holds if and only if \((x,a(x)) = (x,b(x))\), which in turn is equivalent to \(a(x) = b(x)\) as maps \(\textsf{y}{c} \rightarrow E\).

For disjunction, even though \(\{\sigma \vee \tau \}\) is not the same as \(\{\sigma \}+ \{\tau \}\), we still have the following equivalence due to special properties of presheaf categories.

Proposition 4.22

(Forcing for disjunction) Let \(\sigma , \tau \mathord {\, : \,}X \rightarrow \Omega \). For \(x :\textsf{y}{c} \rightarrow X\), the following conditions are equivalent.

  1. (i)

    \(c \Vdash \sigma (x) \vee \tau (x) \).

  2. (ii)

    \( c \Vdash \sigma (x) \) or \( c \Vdash \tau (x) \).

Proof

As stated in Proposition 2.5, the disjunction \(\sigma \vee \tau :X \rightarrow \Omega \) classifies the subobject \(\{\sigma \} \cup \{\tau \} \rightarrowtail X\), which is the image of the canonical map \(\{\sigma \} + \{\tau \} \rightarrow X\). So if \(c \Vdash \sigma (x) \vee \tau (x) \), then there is a map \(v :\textsf{y}{c} \rightarrow \{\sigma \} \cup \{\tau \}\) lifting x. Since the representable \(\textsf{y}{c}\) is projective, there is then a further lift \(u :\textsf{y}{c} \rightarrow \{\sigma \} + \{\tau \}\), and so \(c \Vdash u :\{\sigma (x)\} + \{\tau (x)\}\). Applying Proposition 4.13 we obtain either \(c \Vdash a :\{\sigma (x)\} \) or \(c \Vdash b :\{\tau (x)\} \), whence either \( c \Vdash \sigma (x) \) or \( c \Vdash \tau (x) \). The converse is even more direct, using the factorisations

A similar fact also holds for existential quantifiers.

Proposition 4.23

Let \(\alpha :X \rightarrow U\) and \(\sigma :X.\alpha \rightarrow \Omega \). For \(x :\textsf{y}{c} \rightarrow X\), the following conditions are equivalent.

  1. (i)

    \( c \Vdash (\exists _\alpha \sigma ) (x) \).

  2. (ii)

    There exists \(a :\textsf{y}{c} \rightarrow E\) such that \(c \Vdash a \mathord {\, : \,}\alpha (x) \), and \(c \Vdash \sigma (x, a) \).

Proof

First assume that \(c \Vdash (\exists _\alpha \sigma )(x)\), which means that we have a lift

Since \(\textsf{y}{c}\) is projective, there is then a further lift as indicated in the diagram below, which also recalls the construction of \(\{ X \mid \exists _\alpha \sigma \}\).

Let \(a =_{\textrm{def}}q_\alpha \circ p_\sigma \circ v\), so that \(c \Vdash a \mathord {\, : \,}\alpha (x) \), and \(c \Vdash \sigma (x, a) \), by construction. The converse is direct, using the above diagram.

The general characterisation of forcing for subset types follows the same pattern. The proof is left to the reader.

Proposition 4.24

(Forcing for subset types) Let \(\alpha :X \rightarrow U\) and \(\sigma :X.\alpha \rightarrow \Omega \). For \(x :\textsf{y}{c} \rightarrow X\), the following conditions are equivalent.

  1. (i)

    There exists s such that \(c \Vdash s \mathord {\, : \,} \{ y \mathord {\, : \,}\alpha (x) \mid \sigma (x,y) \} \)

  2. (ii)

    There exists a such that \(c \Vdash a \mathord {\, : \,}\alpha (x)\) and \(c \Vdash \sigma (x, a)\). \(\square \)

Proposition 4.25

(Forcing for propositional truncation) Let \(\alpha :X \rightarrow U\). For \(x :\textsf{y}{c} \rightarrow X\), the following conditions are equivalent.

  1. (i)

    \(c\Vdash \textsf{supp}(\alpha )(x)\).

  2. (ii)

    There exists a such that \(c\Vdash a :\alpha (x)\).

Proof

Recall from Proposition 2.4 that the propositional truncation \(\textsf{supp}(\alpha ) :X \rightarrow \Omega \) is the pullback along \(\alpha \) of the image factorisation of \(\pi :E\rightarrow U\),

By definition, \(c\Vdash \textsf{supp}(\alpha )(x)\) if and only if there is a factorisation of \(x :\textsf{y}{c} \rightarrow X\) through the subobject \(X.\{\textsf{supp}(\alpha )\}\rightarrowtail X\). But since the representable \(\textsf{y}{c}\) is projective, this is the case if and only if there is a further lift \(u:\textsf{y}{c} \rightarrow X.\alpha \) as indicated. Composing to get \(a= q_\alpha \circ u\) gives \(c\Vdash a :\alpha (x)\). The converse is immediate.

Remark 4.26

Our Kripke-Joyal forcing semantics can be specialised to the system of dependent type theory without a type \(\Omega \) of propositions, but with the type formers

$$\begin{aligned} \quad 1 , \quad \alpha \times \beta , \quad \alpha \rightarrow \beta , \quad \Sigma _{x:\alpha }\beta (x) , \quad \Pi _{x :\alpha } \beta (x) , \quad a =_\alpha b , \end{aligned}$$
(4.4)

by treating propositional equality \(a =_\alpha b\) equivalently as an (extensional) equality type \(\textsf{Eq}_{\alpha }(a,b)\), as mentioned in Remark 3.16. This can then be seen as a proof-relevant version of the standard Kripke semantics for intuitionistic first-order logic [49]. The standard deduction relation \(\vdash _\textsf{IFOL}\) for that system can be shown to be sound and complete with respect to standard Kripke semantics, in the sense that for any closed formula \(\sigma \), one has \( \vdash _\textsf{IFOL} \sigma \) if and only if \(K\Vdash \sigma \) for all Kripke frames K, which are essentially interpretations of the signature of \(\sigma \) into categories of the form \(\textsf{Set}^K\) for arbitrary posets K.

Similarly, one can infer from the results in [6] that the system of type theory specified by (4.4), with the customary inference rules, as stated e.g. in ibid., is deductively complete with respect to our Kripke-Joyal forcing semantics, in the following sense. Given a closed type \(\alpha \) (over a basic signature of closed and dependent types and terms), one can construct a closed term \(\vdash a :\alpha \) if and only if, for every interpretation of the signature of \(\alpha \) into a category of the form \(\textsf{Set}^P\) for an arbitrary poset P, one has \(\textsf{Set}^P \Vdash a :\alpha \) in the sense of Proposition 4.7. Briefly, extensional dependent type theory is complete with respect to Kripke-Joyal forcing semantics, something that is not true for the system of higher-order logic, with a type of propositions. We leave to the reader the pleasant task of simplifying the forcing conditions given in this section for the special case where the index category \(\mathbb {C}\) is a poset.

6 Cofibrations

Basic definitions This section starts the second part of the paper, in which we use our forcing semantics to describe models of homotopy type theory. In order to do so, we assume certain auxiliary structures on our fixed presheaf category, as in [15], which give rise to (algebraic) weak factorisation systems [7, 18, 53]. As we shall see, forcing allows us to relate precisely category-theoretic concepts, as defined in [15, 21, 22], with their type-theoretic counterparts, as defined in [36]. Below, we shall take the categorical point of view as our starting point. In Definition 5.1, we write \({\mathcal {E}}^{\rightarrow }_{\textrm{cart}}\) for the category of arrows and pullback squares in \({\mathcal {E}}\).

Definition 5.1

A class of cofibrations in \({\mathcal {E}}= \textrm{Psh}(\mathbb {C})\) is a class of maps \(\textsf{Cof}\) that satisfies the following conditions:

  1. (C1)

    The elements of \(\textsf{Cof}\) are monomorphisms.

  2. (C2)

    The unique map \(0 \rightarrow 1\) is in \(\textsf{Cof}\).

  3. (C3)

    The identity \({{\,\textrm{id}\,}}_1 :1 \rightarrow 1\) is in \(\textsf{Cof}\).

  4. (C4)

    Cofibrations are stable under pullback along all maps.

  5. (C5)

    Cofibrations are closed under composition.

  6. (C6)

    The full subcategory of \({\mathcal {E}}^{\rightarrow }_{\textrm{cart}}\) spanned by \(\textsf{Cof}\) has a terminal object.

Let us now assume that \(\textsf{Cof}\) is a class of cofibrations in \({\mathcal {E}}\). We say that an object \(X \in {\mathcal {E}}\) is cofibrant if the unique map \(!_X :0 \rightarrow X\) is a cofibration.

Remark 5.2

We note without proof a few elementary consequences of these axioms.

  1. (i)

    In light of (C4), axioms (C2) and (C3) imply that, for every \(X \in {\mathcal {E}}\), the unique map \(!_X :0 \rightarrow X\) and the identity \({{\,\textrm{id}\,}}_X :X \rightarrow X\) are cofibrations. Thus, every object is cofibrant. See [19, 25] for a context where this is not the case.

  2. (ii)

    The terminal cofibration posited in (C6) will be denoted \(\textsf{t}:1 \rightarrowtail \Phi \), note that its domain can be shown to be 1. In the pullback square

    (5.1)

    the lower horizontal characteristic map can be shown to be monic. The map \(\textsf{t}:1 \rightarrowtail \Phi \) classifies cofibrations, in the sense that a monomorphism \(S \rightarrowtail X\) is in \(\textsf{Cof}\) if and only if its characteristic map \(\sigma :X \rightarrow \Omega \) factors through \( \Phi \rightarrowtail \Omega \), and thus if and only if it is a pullback of \(\textsf{t}\) along a (necessarily unique) classifying map.

  3. (iii)

    The full subcategory of \({\mathcal {E}}^{\rightarrow }_{\textrm{cart}}\) spanned by \(\textsf{Cof}\) has all colimits, and these are preserved by the inclusion into \({\mathcal {E}}^{\rightarrow }\). In particular, cofibrations are closed under coproducts \(A + B \rightarrowtail X + Y\), descent along epimorphisms, and joins \(S \vee T \rightarrowtail X\).

  4. (iv)

    The cofibrations with representable codomain \(S \rightarrowtail \textsf{y}c\) are called generating cofibrations. Note that these form a small set. Every cofibration is a colimit in \({\mathcal {E}}^{\rightarrow }_{\textrm{cart}}\) of generating cofibrations in a canonical way (determined by the category of elements of its codomain). As shown in [22, Theorem 9.1] using Garner’s small object argument [23], the subcategory of generating cofibrations determines an algebraic weak factorisation system \((\textsf{Cof}, \textsf{TrivFib})\), with right class the uniform trivial fibrations to be considered in Sect. 7.

Since \(\Phi \) is a subobject of \(\Omega \), it admits a characteristic map \({{\,\mathrm{\textsf{cof}}\,}}:\Omega \rightarrow \Omega \),

In the internal type theory, we thus have

$$\begin{aligned} \Phi = \{ \varphi :\Omega \mid {{\,\mathrm{\textsf{cof}}\,}}{\varphi } \} . \end{aligned}$$
(5.2)

We will call a proposition \(\varphi :X \rightarrow \Omega \) cofibrant if it factors through \(\Phi \rightarrowtail \Omega \), for which we also write \(\varphi :X \rightarrow \Phi \).

Let \(\varphi :X \rightarrow \Phi \) be a cofibrant proposition. The comprehension of \(\varphi \) with respect to \(\Phi \) is defined as the pullback of \(\textsf{t}\) along \(\varphi \). Thus the cofibrant comprehension agrees with the usual (subobject) comprehension,

Thus in particular, every generating cofibration is of the form \(\{\textsf{y}c\,|\,\varphi \} \rightarrowtail \textsf{y}c\) for a unique \(\varphi :\textsf{y}c \rightarrow \Phi \).

The next series of propositions shows some of the consequences of our axioms for cofibrations in the internal type theory of \({\mathcal {E}}\), thus relating them to those in [36, Figure 1]. In particular, Fig. 5.8 below is [36, Lemma 5.4 (i)], but we give a forcing proof.

Lemma 5.3

Let \(\varphi :X \rightarrow \Omega \) be a proposition. For every \(x :\textsf{y}c \rightarrow X\), the following conditions are equivalent.

  1. (i)

    \(c \Vdash {{\,\mathrm{\textsf{cof}}\,}}\varphi (x)\).

  2. (ii)

    \(\varphi (x) :\textsf{y}c \rightarrow \Omega \) factors through \(\Phi \rightarrowtail \Omega \).

Proof

Consider the diagram

Lemma 5.4

Let \(\varphi :X \rightarrow \Omega \). Then \({\mathcal {E}}\Vdash \varphi \Rightarrow {{\,\mathrm{\textsf{cof}}\,}}\varphi \).

Proof

We show that \(c \Vdash \varphi (x) \Rightarrow {{\,\mathrm{\textsf{cof}}\,}}\varphi (x)\) for every \(x :\textsf{y}c \rightarrow X\). So let \(f :d \rightarrow c\) and assume \(d \Vdash \varphi (x f ) \). Then there is a dotted map in

We then obtain the diagram

which shows \(d \Vdash {{\,\mathrm{\textsf{cof}}\,}}\varphi (xf )\), as required.

Corollary 5.5

Let \( \varphi :X \rightarrow \Omega \).

  1. (i)

    The map \(\{\varphi \} \rightarrowtail \{{{\,\mathrm{\textsf{cof}}\,}}\varphi \} \) is a cofibration.

  2. (ii)

    \({{\,\mathrm{\textsf{cof}}\,}}\varphi =_\Omega \textsf{true}\) if and only if \(\{\varphi \} \rightarrowtail X\) is a cofibration if and only if \( \{{{\,\mathrm{\textsf{cof}}\,}}\varphi \} \rightarrowtail X \) is an isomorphism. \(\square \)

Proposition 5.6

(Forcing characterisation of cofibrations) Let \( m :S \rightarrowtail X \) be a monomorphism. Then the following conditions are equivalent.

  1. (i)

    The map m is a cofibration.

  2. (ii)

    \({\mathcal {E}}\Vdash (\forall x :X) {{\,\mathrm{\textsf{cof}}\,}}\!\big ( (\exists s :S)( m(s) = x) \big ) \).

Proof

We first show that, for \(\varphi :X \rightarrow \Omega \), \({\mathcal {E}}\Vdash (\forall x :X) {{\,\mathrm{\textsf{cof}}\,}}\varphi (x)\) if and only if \(\varphi \) is cofibrant. Indeed, \({\mathcal {E}}\Vdash (\forall x :X) {{\,\mathrm{\textsf{cof}}\,}}\varphi (x)\) if and only if \(d \Vdash {{\,\mathrm{\textsf{cof}}\,}}\varphi (x f)\) for all \(x :\textsf{y}c \rightarrow X\) and \(f :d \rightarrow c\). This holds if and only if there is a dotted map in

By the Yoneda lemma, this means there is a factorisation of \(\varphi :X \rightarrow \Omega \) through \(\Phi \),

To prove the required claim, it suffices to define \(\varphi :X \rightarrow \Omega \) to be the characteristic map of \( m :S \rightarrowtail X \), i.e. \(\varphi (x) =_{\textrm{def}}(\exists s :S) (m(s) = x)\).

Dominance We show that Axiom (C5) corresponds to the basic law of a dominance, introduced in [41].

Lemma 5.7

Suppose \(\varphi :X \rightarrow \Omega \) and \(\psi :X \rightarrow \Omega \), and consider the pullback squares

The following conditions are equivalent.

  1. (i)

    \(\{\varphi \wedge \psi \} \rightarrowtail \{\varphi \}\) is a cofibration.

  2. (ii)

    \( {\mathcal {E}}\Vdash \varphi \Rightarrow {{\,\mathrm{\textsf{cof}}\,}}\psi \).

Proof

Assume first that \(\{\varphi \wedge \psi \} \rightarrowtail \{\varphi \}\) is a cofibration. Let \(c \in \mathbb {C}\) and \(x :\textsf{y}c \rightarrow X\). We want to show \( c \Vdash \varphi (x) \Rightarrow {{\,\mathrm{\textsf{cof}}\,}}\psi (x) \), so let \(f :d \rightarrow c\) and assume that \(d \Vdash \varphi (xf)\), i.e. that we have a factorisation

and we claim that \(d \Vdash {{\,\mathrm{\textsf{cof}}\,}}\psi (xf)\). That holds if and only if \(\psi (x f) :\textsf{y}d \rightarrow \Omega \) factors through \(\Phi \) or, equivalently, just if \(\{ \psi (xf) \} \rightarrowtail \textsf{y}d\) is a cofibration. But \(\{ \psi (xf) \} \rightarrowtail \textsf{y}d\) is also the pullback of \(\{\varphi \wedge \psi \} \rightarrowtail \{\varphi \}\) along the dotted arrow above. The claim follows by the closure of cofibrations under pullback, Axiom (C4).

Conversely, as we just saw, \({\mathcal {E}}\Vdash \varphi \Rightarrow {{\,\mathrm{\textsf{cof}}\,}}\psi \) if and only if the pullback of \(\{\varphi \wedge \psi \} \rightarrowtail \{\varphi \}\) along any map \(\textsf{y}c \rightarrow \{ \varphi \}\) is a cofibration. But this implies that \(\{\varphi \wedge \psi \} \rightarrowtail \{\varphi \}\) itself is a cofibration.

Proposition 5.8

Assuming only axioms (C1–4) and (C6), axiom (C5) can be expressed equivalently as follows.

  1. (i)

    Cofibrations are closed under composition.

  2. (ii)

    \({\mathcal {E}}\Vdash ( \forall \varphi , \psi :\Omega ) {{\,\mathrm{\textsf{cof}}\,}}\varphi \Rightarrow \big ((\varphi \Rightarrow {{\,\mathrm{\textsf{cof}}\,}}\psi ) \Rightarrow {{\,\mathrm{\textsf{cof}}\,}}(\varphi \wedge \psi )\big )\).

Proof

Suppose that item (i) holds. We need to show that for every \(c \in \mathbb {C}\), we have \(c \Vdash ( \forall \varphi , \psi :\Omega ) {{\,\mathrm{\textsf{cof}}\,}}\varphi \Rightarrow \big ((\varphi \Rightarrow {{\,\mathrm{\textsf{cof}}\,}}\psi ) \Rightarrow {{\,\mathrm{\textsf{cof}}\,}}(\varphi \wedge \psi )\big )\). Thus take any \(x: d\rightarrow c\) and \(\varphi , \psi : \textsf{y}{d} \rightarrow \Omega \) and any \(y:e\rightarrow d\) such that \(e \Vdash {{\,\mathrm{\textsf{cof}}\,}}\varphi (xy) \), and let furthermore \(z:f\rightarrow e\) with \(f \Vdash \varphi (xyz) \Rightarrow {{\,\mathrm{\textsf{cof}}\,}}(\psi (xyz)) \). Then \(\{\varphi (xy)\}\rightarrowtail \textsf{y}e\) is a cofibration and therefore so is \(\{\varphi (xyz)\}\rightarrowtail \textsf{y}f\) and, by Lemma 5.7, \(\{\varphi (xyz) \wedge \psi (xyz)\} \rightarrowtail \{\varphi (xyz)\}\) is a cofibration as well. By the assumption, the composite \(\{\varphi (xyz) \wedge \psi (xyz)\} \rightarrowtail \textsf{y}f\) is then a cofibration, and hence \(f \Vdash {{\,\mathrm{\textsf{cof}}\,}}(\varphi (xyz) \wedge \psi (xyz))\), as required.

To see that (ii) implies (i), note first that arbitrary cofibrations compose just if the same is true of cofibrations of the form \(\{\varphi \} \rightarrowtail \textsf{y}c\) and \(\{\varphi \wedge \psi \} \rightarrowtail \{\varphi \}\), where \(\varphi , \psi :\textsf{y}c \rightarrow \Omega \). (Indeed, given arbitrary cofibrations \(\{\varphi \} \rightarrowtail X\) and \(\{\vartheta \} \rightarrowtail \{\varphi \}\), the composite is a cofibration just if its pullback along every \(\textsf{y}c \rightarrow X\) is one; then take \(\{\psi \} \rightarrowtail \textsf{y}c\) to be the composite \(\{\vartheta \} \rightarrowtail \{\varphi \} \rightarrowtail \textsf{y}c\).) So let \(\{\varphi \} \rightarrowtail \textsf{y}c\) and \(\{\varphi \wedge \psi \} \rightarrowtail \{\varphi \}\) be cofibrations, and assume item (ii), so that for all \(d \rightarrow c \) and all \(\varphi , \psi : d \rightarrow \Omega \), we have

$$\begin{aligned} d \Vdash {{\,\mathrm{\textsf{cof}}\,}}\varphi \Rightarrow ((\varphi \Rightarrow {{\,\mathrm{\textsf{cof}}\,}}\psi ) \Rightarrow {{\,\mathrm{\textsf{cof}}\,}}(\varphi \wedge \psi )) . \end{aligned}$$

Thus, in particular, if \(c \Vdash {{\,\mathrm{\textsf{cof}}\,}}\varphi \) and \(c \Vdash \varphi \Rightarrow {{\,\mathrm{\textsf{cof}}\,}}\psi \) then \(c \Vdash {{\,\mathrm{\textsf{cof}}\,}}(\varphi \wedge \psi )\). But the first premise holds since \(\{\varphi \} \rightarrowtail \textsf{y}c\) is assumed to be a cofibration, and the second premise holds by Lemma 5.7, since \(\{\varphi \wedge \psi \} \rightarrowtail \{\varphi \}\) is also assumed to be a cofibration. Thus we have \(c \Vdash {{\,\mathrm{\textsf{cof}}\,}}(\varphi \wedge \psi )\), and so \(\{\varphi \wedge \psi \} \rightarrowtail \textsf{y}c\) is a cofibration, as required.

Remark 5.9

Let \(\varphi :X \rightarrow \Phi \) and \(\psi :\{\varphi \} \rightarrow \Phi \), and consider the pullback squares

figure d

We write \(\Sigma _{\varphi } \psi :X \rightarrow \Phi \) for the classifer of the composite cofibration \(\{\varphi \,|\, \psi \} \rightarrowtail \{\varphi \} \rightarrowtail X\). Thus, \(\{\varphi \,|\, \psi \} = \{\Sigma _{\varphi } \psi \}\) as subobjects of X.

7 Partial elements

Uniform trivial fibrations will be defined in Sect. 7 as maps equipped with a lifting structure against cofibrations. In the type theory of \({\mathcal {E}}\), this is expressed in terms of the notion of a cofibrant partial element of a type [36, Section 5.1]. In preparation for the material on uniform fibrations, we discuss cofibrant partial elements, leading up to position 6.5, which provides the equivalence between the categorical and type-theoretical definitions. As before, we start with a diagrammatic definition. We consider a fixed class of cofibrations as in Definition 5.1.

Definition 6.1

Let \(p :A \rightarrow X\) be a map in \({\mathcal {E}}\).

  1. (i)

    A (cofibrant) partial element of \(p :A \rightarrow X\) is a pair (mu), where \(m :S \rightarrowtail X\) is a cofibration and \(u :S \rightarrow A\) makes the following diagram commute:

    (6.1)

    We call S the extent of the partial element (mu).

  2. (ii)

    A partial element (mu) of \(A \rightarrow X\) is extensible if there exists \(a :X \rightarrow A\) such that the following diagram commutes:

Regarding A as an object in \({\mathcal {E}}/_{\!X}\), we wish to define the object \(P_X(A) \in {\mathcal {E}}/_{\!X}\) of all such partial elements of A, or as we shall say, the classifier for partial elements. Consider the case \(X=1\). A partial element can then be described equivalently as a pair \((\varphi , u)\) where \(\varphi :1\rightarrow \Phi \), and \(u :\{\varphi \}\rightarrow A\). We can therefore define the object \(P(A)\) as follows. Let \(P:{\mathcal {E}}\rightarrow {\mathcal {E}}\) be the polynomial endofunctor associated to the map \(\textsf{t}:1 \rightarrow \Phi \), namely the composite

(6.2)

The global elements \(t :1\rightarrow P(A)\) are pairs \(t=(\varphi , v)\) with \(\varphi \mathord {\, : \,}1\rightarrow \Phi \) and \(v :1\rightarrow A^{\{\varphi \}} \). This data determines a unique span

(6.3)

with \(\lambda u = v\), which is exactly a partial element of A in the sense of Definition 6.1. For example, since \({{\,\mathrm{\textsf{cof}}\,}}(\textsf{t}) = \textsf{true}\) by axiom (C3), for any \(a :1\rightarrow A\) there is the totally defined partial element \((\textsf{t}, a ):1\rightarrow P(A)\). Similarly, since \({{\,\mathrm{\textsf{cof}}\,}}(\textsf{f})= \textsf{true}\) by axiom (C2), we have the totally undefined partial element \((\textsf{f}, 0_A) :1\rightarrow P(A)\).

Finally, if \(p:A\rightarrow X\), then let \(P_X(A)\rightarrow X\) be the result of applying the corresponding endofunctor \(P_X :{\mathcal {E}}/_{\!X} \rightarrow {\mathcal {E}}/_{\!X}\), where in place of \(\textsf{t}:1 \rightarrow \Phi \) we use the cofibration classifier for \({\mathcal {E}}/_{\!X}\), namely \(X^*\textsf{t}:X^*1 \rightarrow X^*\Phi \), as in [22, Section 9]. We then recover the description in [36, Definition 5.1] using the internal type theory of \({\mathcal {E}}\), as follows. If \(p :A\rightarrow X\) is classified by \(\alpha :X\rightarrow U\), then \(P_X(A) \rightarrow X\) is classified by the type

(6.4)

in the sense that \(P_X(A) \cong X.P(\alpha )\) over X. Hereafter, we will use the type-theoretic description (6.4) interchangeably with the relative point of view, keeping in mind that the function type \(\alpha ^{\{\varphi \}}\) refers to the relative exponential over X. Sections \(t :X\rightarrow X.P(\alpha )\) over X then correspond in exactly the same way to diagrams

(6.5)

i.e. partial elements of , with \(t = (\varphi , \lambda u)\) for \(\varphi :X\rightarrow \Phi \) and \(u :\{\varphi \} \rightarrow X.\alpha \) over X.

The functor \(P:{\mathcal {E}}\rightarrow {\mathcal {E}}\) defined in (6.2), as well as its relative versions \(P_X :{\mathcal {E}}/_{\!X} \rightarrow {\mathcal {E}}/_{\!X}\), has a canonical pointing \(\eta :{{\,\textrm{id}\,}}_{{\mathcal {E}}} \rightarrow P\), given by the composite

where the second map uses the unit of the adjunction \({\textsf{t}}^* \dashv \Pi _\textsf{t}\), and the third map uses that the unit of the adjunction \(\Sigma _\textsf{t}\dashv {\textsf{t}}^*\) is an isomorphism \({{\,\textrm{id}\,}}_{{\mathcal {E}}} \cong {\textsf{t}}^* \circ \Sigma _\textsf{t}\) since \(\textsf{t}\) is monic. Observe that \(\eta _A :A \rightarrow P(A)\) can be defined in the type theory of \({\mathcal {E}}\) as the function taking \(a :A\) to the totally defined partial element \((\textsf{t}, a ) :T(A)\). Proposition 6.4 below gives the sense in which \(P(A)\) classifies cofibrant partial elements of A. For this, we require a lemma.

Lemma 6.2

For every \(A \in {\mathcal {E}}\), the commutative diagram

is a pullback. Thus \(\eta _A :A \rightarrow P(A)\) is a cofibration.

Proof

As already noted, since \(\textsf{t}\) is monic the unit of \(\Sigma _\textsf{t}\dashv {\textsf{t}}^*\) is an isomorphism \({{\,\textrm{id}\,}}_{{\mathcal {E}}} \cong {\textsf{t}}^* \circ \Sigma _\textsf{t}\). It follows by a standard argument that the counit of \({\textsf{t}}^* \dashv \Pi _\textsf{t}\) is also an isomorphism \({\textsf{t}}^* \circ \Pi _\textsf{t}\cong {{\,\textrm{id}\,}}_{{\mathcal {E}}}\). Since \(T(A) = \Pi _\textsf{t}(A)\), we therefore have \(\textsf{t}^*(TA) \cong A\).

Corollary 6.3

The natural transformation \(\eta :{{\,\textrm{id}\,}}_{{\mathcal {E}}} \rightarrow P\) is cartesian.

Proof

Let \(f :A \rightarrow B\) be a morphism in \({\mathcal {E}}\) and consider the naturality diagram

where \(\textsf{t}:1 \rightarrow \Phi \) coincides with \(\eta _1 :1 \rightarrow P(1)\). The bottom square and the outer rectangle are cartesian by the previous lemma, so the top square is also cartesian.

The next proposition gives the universal property of \(\eta _A :A \rightarrow P(A)\).

Proposition 6.4

For every \(A \in {\mathcal {E}}\), the map \(\eta _A :A\rightarrowtail P(A) \) classifies cofibrant partial maps to A in the following sense: for any \(T \in {\mathcal {E}}\) and cofibration \(m :S \rightarrowtail T\) and map \(u :S \rightarrow A\) as indicated below, the span (mu) can be uniquely completed to a pullback square as follows.

(6.6)

Proof

The cofibration \(m :S \rightarrowtail T\) has a unique classifying map \(\varphi :T \rightarrow \Phi \). Using Lemma 6.2, we can complete (6.6) to form the solid part of the following diagram, in which the outer (distorted) rectangle is a pullback.

(6.7)

Recalling that \({\pi _1}:P(A)\rightarrow \Phi \) is \(\Pi _\textsf{t}(A)\), we have the indicated dotted map as \(u^\sharp :T \rightarrow P(A)\) over \(\Phi \), the adjoint transpose of \(u :T \cong {\textsf{t}}^*(T) \rightarrow A\) under the adjunction \(\textsf{t}^* \dashv \Pi _{\textsf{t}}\). The left hand square then commutes, and is a pullback, because \(\textsf{t}^*(u^\sharp ) = u\).

Letting \(T=1\) in the foregoing shows that \(P(A)\) classifies partial elements of A in \({\mathcal {E}}\), and doing the same for \(p :A\rightarrow X\) in the slice category \({\mathcal {E}}/_{\!X}\) shows that \(P_X(A)\) classifies partial elements in the sense of Definition 6.1. In light of Proposition 6.4, we call \(\eta _A \mathord {\, : \,}A \rightarrow P(A)\) the cofibrant partial map classifier of A (cf. [4, Proposition 10]), generalising the usual partial map classifier from topos theory [29, Proposition A.2.4.7], which occurs when \({{\,\mathrm{\textsf{cof}}\,}}= \textsf{true}\circ {!_\Omega }\) and so \(\Phi = \Omega \).

We now unfold explicitly the forcing conditions for \(P(A)\), which are determined by those for dependent sums and dependent products.

Proposition 6.5

(Forcing for partial elements) Let \(\alpha :X \rightarrow U\). Then for any \(x :\textsf{y}{c} \rightarrow X\) the following conditions are equivalent.

  1. (i)

    There is a cofibration \(m :\{\varphi \} \rightarrowtail \textsf{y}c\) and a map \(u :\{\varphi \} \rightarrow E\) such that the following diagram commutes:

  2. (ii)

    \(c \Vdash \varphi \mathord {\, : \,}\Phi \) and there is a map \(u :\{\varphi \} \rightarrow E\) for which \(c \Vdash \lambda u \mathord {\, : \,}\{\varphi \}\rightarrow \alpha (x)\).

  3. (iii)

    There is a map \(t :\textsf{y}c \rightarrow E\) such that \( c \Vdash t \mathord {\, : \,}P( \alpha )(x) \).

Proof

For the equivalence between item (i) and item (ii), a map \(u :\{\varphi \} \rightarrow E\) determines a unique map \((xm,u) :\{\varphi \} \rightarrow X.\alpha \) making the diagram in item (i) commute if and only if the judgement \(\textsf{y}{c},\{\varphi \}\vdash u :\alpha (xm)\) holds. But the latter is equivalent to \(c\Vdash \lambda u :\{\varphi \}\rightarrow \alpha (x)\).

For the equivalence between item (ii) and item (iii), recall the definition of \(P(\alpha )\) from from (6.4). So by Proposition 4.14, \( c \Vdash t \mathord {\, : \,}P(\alpha )(x) \) if and only if \(t = (\varphi ,v)\) with \(c \Vdash \varphi \mathord {\, : \,}\Phi \) and \(c \Vdash v \mathord {\, : \,}(\{\varphi \}\rightarrow \alpha )(x) \). We might as well assume without loss of generality that \(v = \lambda u\) for suitable \(u :\{\varphi \} \rightarrow E\), as required.

Remark 6.6

The forcing conditions in Proposition 6.5 may be unfolded even further using Corollary 4.17. Indeed, if \(t = (\varphi ,v)\) then \(c \Vdash \varphi \mathord {\, : \,}\Phi \) and \(c \Vdash v \mathord {\, : \,}(\{\varphi \}\rightarrow \alpha )(x) \) if and only if for all \(f :d \rightarrow c \) and \(d \Vdash p \mathord {\, : \,}\{\varphi ( f)\} \) we have \(d \Vdash \textsf{app}(v(f), p) \mathord {\, : \,}\alpha (x f)\), and for all \(g :e \rightarrow d\), we have \( e\Vdash \textsf{app}(v(f), p) (g) = \textsf{app}(v({f g}), p(g)):\alpha (xfg) \). In particular, for \(v = \lambda {u}\), the computation rule for function types reduces the above to

$$\begin{aligned} d \Vdash p \mathord {\, : \,}\{\varphi (f)\} \,, \qquad d \Vdash u(f)p \mathord {\, : \,}\alpha (x f) \end{aligned}$$

for all \(f:d \rightarrow c\) and, furthermore, the following uniformity condition holds

$$\begin{aligned} e \Vdash (u(f)p) ( g) = u({f g})p(g) :\alpha (xfg) \end{aligned}$$

for all \(g :e \rightarrow d\).

The next result also admits both diagrammatic and internal type-theoretic proofs (cf. [4, Proposition 12]). The proof via forcing given here serves mainly to illustrate the method.

Theorem 6.7

Let \(\alpha :1 \rightarrow U\). Then there is a map \(\mu _\alpha :P^2(\alpha ) \rightarrow P(\alpha ) \), natural in \(\alpha \), making the pointed endofunctor \((P, \eta )\) into a monad on \({\mathcal {E}}\). Moreover, the monad \((P, \eta , \mu )\) extends to the slice categories \({\mathcal {E}}/_{X}\) making it an \({\mathcal {E}}\)-indexed monad.

Proof

We will force an element \(\mu _\alpha \) of the closed function type \(P^2(\alpha ) \rightarrow P(\alpha )\). Thus we need to show:

  1. (1)

    for all \(c\in \mathbb {C}\), there is given \(\mu _\alpha c\) such that \(c \Vdash \mu _\alpha c \mathord {\, : \,}P^2(\alpha ) \rightarrow P(\alpha )\),

  2. (2)

    for all \(f :d \rightarrow c\),

    $$\begin{aligned} d \Vdash {\mu _\alpha c}\circ f\, =\, \mu _\alpha d \mathord {\, : \,}P^2(\alpha ) \rightarrow P(\alpha ). \end{aligned}$$
    (6.8)

By Corollary 4.17, the forcing condition (1) for \( \mu _\alpha c\) of function type \( P^2(\alpha ) \rightarrow P(\alpha )\) at c requires that for every \(f :d \rightarrow c\) and for all a such that \(d \Vdash a \mathord {\, : \,}P^2(\alpha )(f)\), there is given \(\mu _\alpha c_{(f,a)}\) such that \(d \Vdash \mu _\alpha c_{(f,a)}\mathord {\, : \,}P(\alpha )(f)\), and moreover \(\mu _\alpha c_{(f,a)}\circ g = \mu _\alpha c_{(fg,ag)}\) for every \(g :e \rightarrow d\).

Since the types are closed, the indicated substitution of f is trivial, and so the requirements (1) and (2) simplify to the following (with some relettering):

(1’):

for all \(f :d \rightarrow c\), and for all a such that \(d \Vdash a \mathord {\, : \,}P^2(\alpha )\), there is given \(\mu _\alpha c_{(f,a)}\) such that \(d \Vdash \mu _\alpha c_{(f,a)}\mathord {\, : \,}P(\alpha )\), and

(2’):

for all \(g:e \rightarrow d\), we have \(\mu _\alpha c_{(f,a)}\circ g = \mu _\alpha c_{(fg,ag)}\), and

(3):

for all a such that \(e \Vdash a \mathord {\, : \,}P^2(\alpha )\), we have

$$\begin{aligned} e\Vdash \mu _\alpha c_{(fg,a)}\, =\, \mu _\alpha d_{(g,a)} \mathord {\, : \,}P(\alpha ). \end{aligned}$$

Note that this also gives the uniformity in c required in (2).

Thus let \(f :d \rightarrow c\), and suppose that \(d \Vdash a \mathord {\, : \,}P^2\alpha \). By Proposition 6.5, for the type of partial elements , we have \(a = (\varphi ,\lambda u)\) with:

  1. (a)

    \(d \Vdash \varphi \mathord {\, : \,}\Phi \) and \(d \Vdash \lambda u \mathord {\, : \,}\{\varphi \}\rightarrow P\alpha \), the latter meaning that:

  2. (a1)

    for all \(g:e \rightarrow d\) and all \(e \Vdash p \mathord {\, : \,}\{\varphi g\}\), we have \(e \Vdash u(g)p \mathord {\, : \,}P\alpha \), and

  3. (a2)

    for all \(h :e' \rightarrow e\), we have \((u(g)p)h = u(g h) p(h)\).

Unfolding the clause \(e \Vdash u(g)p \mathord {\, : \,}P\alpha \) in (a1) yields \(u(g)p = (\psi , \lambda v)\) with:

  1. (b)

    \(e \Vdash \psi \mathord {\, : \,}\Phi \) and \(e \Vdash \lambda v \mathord {\, : \,}\{\psi \} \rightarrow \alpha \), the latter meaning that:

  2. (b1)

    for all \(h:e' \rightarrow e\) and all \(e' \Vdash q \mathord {\, : \,}\{\psi h\}\), we have \(e' \Vdash v(h) q \mathord {\, : \,}\alpha \), and

  3. (b2)

    for all \(i :e'' \rightarrow e'\), we have \((v(h)q)i = v(hi)q(i)\).

To satisfy (1’), we need to construct an element \(\mu _\alpha c_{(f,a)} = (\vartheta , \lambda w) \mathord {\, : \,}P\alpha \) (based at \(\textsf{y}{d}\)) such that, among other things,

$$\begin{aligned} d \Vdash \vartheta \mathord {\, : \,}\Phi \quad \text {and}\quad d \Vdash \lambda w \mathord {\, : \,}\{\vartheta \}\rightarrow \alpha . \end{aligned}$$

From (a) above, we have a span,

(6.9)

To see this, take any \(p :\textsf{y}{e} \rightarrow \{\varphi \}\) and compose with \(\{\varphi \} \rightarrowtail \textsf{y}{d}\) to get a map \(g:e \rightarrow d\) with \(e \Vdash p \mathord {\, : \,}\{\varphi g\}\). By (a1) we then get \( u(g)p :\textsf{y}{e} \rightarrow P\alpha \). Since the assignment \(p \mapsto u(g)p\) is natural in e by (a2), by Yoneda there is indeed a map \(u :\{\varphi \} \rightarrow P\alpha \), as claimed.

Now let \(u = (\psi , \lambda v)\), where \(\psi :\{\varphi \} \rightarrow \Phi \), and there is another span

(6.10)

as can be deduced from (b) in the same way that \((\varphi , \lambda u)\) followed from (a).

Let \(\vartheta :\textsf{y}{d}\rightarrow \Phi \) classify the composite \(\{\psi \} \rightarrowtail \{\varphi \} \rightarrowtail \textsf{y}{d}\), which is a cofibration since each factor is one. We can then take \(w = v\) to get the desired pair \((\vartheta , \lambda w)\) with \(d\Vdash (\vartheta , \lambda w)\mathord {\, : \,}P(\alpha )\). Thus with \(\mu _\alpha c_{(f,a)} = (\vartheta , \lambda w)\) we have (1’). The uniformity conditions (2’) and (3) then follow from the uniformity conditions in (a) and (b).

Thus we have shown (6.8), and so there is a closed term \(\mu _\alpha :P^2\alpha \rightarrow P\alpha \). That \(\mu _\alpha \) is natural in \(\alpha \) can be seen to follow from the universal property of \((P, \eta )\) given in Proposition 6.4. The monad laws for \((P, \eta ,\mu )\) can be seen to follow from the unit and associativity laws for composition of (general maps and) cofibrations. Finally, the entire monad \((P, \eta , \mu )\) is indexed over \({\mathcal {E}}\), because all of the type-theoretic constructions involved are stable under pullback, as is forcing, by Proposition 4.11.

8 Uniform trivial fibrations

We again assume a fixed class \(\textsf{Cof}\) of cofibrations in \({\mathcal {E}}\), as in Definition 5.1. The subcategory of \({\mathcal {E}}^{\rightarrow }\) consisting of cofibrations and cartesian squares between them determines an algebraic weak factorisation system  \((\textsf{Cof}, \textsf{TrivFib})\) on \({\mathcal {E}}\) [22, Theorem 9.1]. The maps in the right class \(\textsf{TrivFib}\) are the uniform trivial fibrations which appear in the semantics of Homotopy Type Theory (see [15, Section 5.1], [4], and [21]). In this section, we show how these structured maps can be described equivalently in the internal type theory of \({\mathcal {E}}\). In particular, we see how the uniformity condition arises naturally from Kripke-Joyal forcing.

Definition 7.1

Let \(p :A \rightarrow X\) be a map in \({\mathcal {E}}\). A uniform trivial fibration structure on p consists of a function j that assigns a diagonal filler j(muv) to every commutative diagram of solid arrows of the form

where m is a cofibration, subject to the following uniformity condition: for every \(t :T' \rightarrow T\), giving rise to the following diagram with a pullback square on the left,

(7.1)

we have \(j({t}^*(m), us, vt) = j(m, u, v) \circ t\).

The next result recalls from [22, Theorem 9.1] that a trivial fibration structure is determined by its values for the generating cofibrations, i.e. those with representable codomains, since a general diagonal filling problem can be expressed as a colimit of filling problems for generating cofibrations.

Lemma 7.2

Let \(p :A \rightarrow X\) be a map in \({\mathcal {E}}\). Then p admits a uniform trivial fibration structure if and only if there is a function j that assigns a diagonal filler \(a = j(m, u, x)\) to every commutative diagram of solid arrows

(7.2)

where m is a generating cofibration, subject to the uniformity condition indicated in the following diagram:

\(\square \)

We now wish to express the diagonal filling property in the internal type theory. So let \(p :A \rightarrow X\) be a small map, \(m :S \rightarrowtail \textsf{y}{c}\) be a cofibration and consider their classifying maps \(\alpha :X \rightarrow U\) and \(\varphi :\textsf{y}{c} \rightarrow \Phi \), respectively. The outer diagram in (7.2) can then be expressed equivalently in the form,

(7.3)

for a suitable \(u :\{\varphi \} \rightarrow E\) with \(\textsf{y}{c}.\{\varphi \}\vdash u :\alpha (xi)\). Recall thereby that \(i:\{\varphi \}\rightarrowtail \textsf{y}{c}\) abbreviates the comprehension,

(7.4)

The commutative square (7.3) represents a partial element \((\varphi , \lambda {u})\) of \(\alpha \) at \(x :\textsf{y}{c}\rightarrow X\), in the sense of Definition 6.1, where \(c\Vdash \varphi :\Phi \) and \(c\Vdash \lambda {u} :\{\varphi \}\rightarrow \alpha (x)\). We show that also the existence of a diagonal filler for (7.3) can be written as a forcing condition. First recall that for any \(x :\textsf{y}{c} \rightarrow X\) and \(a:\textsf{y}{c} \rightarrow E\), the condition \(c \Vdash a \mathord {\, : \,}\alpha (x)\) means that there is a (necessarily unique) lift of the form,

(7.5)

Then for maps \(\varphi :\textsf{y}{c} \rightarrow \Phi \) and \(u :\{\varphi \} \rightarrow E\) as in (7.3) above, we construct the type

$$\begin{aligned} (u=^{\varphi }\!a) :\textsf{y}{c} \overset{}{\longrightarrow }U\end{aligned}$$

as follows. The maps \(\varphi \) and \(\alpha \) give rise to types over \(\textsf{y}{c}\) as indicated below.

(7.6)

The pullback of these two display maps may be regarded as weakenings of each context by the other; we choose the one indicated in the following diagram:

(7.7)

Maps \((xi,u) :\{\varphi \} \rightarrow X.\alpha \) and \((x,a) :\textsf{y}{c}\rightarrow X.\alpha \) as in (7.3) and (7.5) then determine two sections of the indicated display map \(p_{\alpha (xi)}\). Expressing the same thing in the type theory of \({\mathcal {E}}\), we have \(\textsf{y}{c}.\{\varphi \} \vdash u :\alpha (xi)\) and \(\textsf{y}{c}.\{\varphi \} \vdash a(i) :\alpha (xi)\). Note that the weakened term and type \(\textsf{y}{c}.\{\varphi \} \vdash a(i) :\alpha (xi)\) do not depend on \(\{\varphi \}\). Over \(\textsf{y}{c}\) we can then define the type

(7.8)

As defined \((u =^{\varphi }\!a) :\textsf{y}c \rightarrow U\), i.e. we have a type. However, \((u =^{\varphi }\!a)\) can be viewed as a proposition since it factors through \(\Omega \), which expresses the condition that “u is the restriction of a to \(\{\varphi \}\)” or, equivalently, “u extends along \(\{\varphi \}\rightarrowtail \textsf{y}{c}\) to a”, as in [36, Definition 5.1]. Because of this, we shall sometimes merely focus on existence of elements of \((u =^{\varphi }\!a)\) rather than on their particular form. Diagonal filling of (7.3) can now be expressed in terms of forcing as in Lemma 7.3 below, where we make use of Notation 3.12.

Lemma 7.3

Let \(\alpha :X \rightarrow U\), \(x :\textsf{y}{c} \rightarrow X\), \(\varphi :\textsf{y}{c} \rightarrow \Phi \) and \(u :\{\varphi \} \rightarrow E\) so that the diagram of solid arrows

commutes, where \(u' =(x i, u)\). Then there is a bijection between:

  1. (i)

    diagonal fillers \(a' :\textsf{y}c \rightarrow X.\alpha \) as indicated with the dotted arrow in the diagram,

  2. (ii)

    maps \(a :\textsf{y}{c} \rightarrow E\) such that

    $$\begin{aligned} c \Vdash a :\alpha (x) , \quad c \Vdash u=^{\varphi }\!a . \end{aligned}$$

Proof

We have already observed that maps \(a :\textsf{y}{c} \rightarrow E\) such that \(c \Vdash a :\alpha (x)\) correspond uniquely to maps \(a' :\textsf{y}{c} \rightarrow X.\alpha \) making the bottom triangle in the diagram commute. It therefore suffices to show that, for such a and \(a'\), \(c \Vdash u =^{\varphi }\! a\) if and only if the top triangle also commutes. Unfolding the definition of \(u =^{\varphi }\!a\), assume that

Although the type is a proposition and therefore requires no explicit forcing term, let us assume one in order to apply the rule of forcing for dependent products (Proposition 4.16) literally. Thus suppose we have

Then by Proposition 4.16, for every \(f :d \rightarrow c\) and every \(d \Vdash e :\{\varphi (f)\}\), we have

$$\begin{aligned} d \Vdash \textsf{app}( t (f), e) :( u =_{\alpha (xi)} a(i) ) (f, e), \end{aligned}$$
(7.9)

where we applied part (ii) of Proposition 4.16.Footnote 3 The substitution in the type in (7.9) can be calculated as follows:

$$\begin{aligned} \big ( u =_{\alpha (xi)} a(i) \big ) (f, e) \ =\ \big ( u(f, e) =_{\alpha (xi(f, e))} a(i(f, e)) \big ). \end{aligned}$$

Thus, equivalently, for every \(f :d \rightarrow c\) and every lift \((f,e) :\textsf{y}{d}\rightarrow \{\varphi \}\), we have

$$\begin{aligned} d \Vdash u(f,e) =_{\alpha (xi(f,e))} a(i(f,e)), \end{aligned}$$
(7.10)

as indicated in the following diagram:

(7.11)

But \(a(i(f,e)) = a(f)\) and \(\alpha (xi(f,e)) = \alpha (xf)\), so from (7.10) we have

$$\begin{aligned} d \Vdash u(f,e) =_{\alpha (xf)} a(f) . \end{aligned}$$

Thus

$$\begin{aligned} u' (f,e) = (xi,u) (f,e) = ( xi(f,e),u(f,e) ) = (xf, u(f,e) )\nonumber \\ = (xf, af) = (x, a)f = a'f = a' i (f,e). \end{aligned}$$
(7.12)

Since this holds for all (fe), we have \(u' = a'i\), as required, by Lemma 4.3.

Note that the uniformity condition for forcing the dependent product is trivial because we are forcing a proposition.

Remark 7.4

Observe that by function extensionality [50, Axiom 2.9.3] the type \((u=^{\varphi }\!a)\) defined in (7.8) is equivalent to the type \(\lambda u = \lambda a\), where the equality is on the function type \(\alpha (x)^{\{\varphi \}} = (\{\varphi \}\rightarrow \alpha (x))\) over \(\textsf{y}{c}\) (making use of item (i)). The term \(\lambda {a}\) here (see Notation 3.13) therefore represents the restriction to \(\{\varphi \}\) of the constant a-valued function and we have \((u=^{\varphi }\!a)\ =\ (\lambda u = \lambda a)\).

We can now construct a classifier \(\textsf{TFib}(\alpha )\) for trivial fibration structures on \(\alpha \) (cf. [4, Section 6]).

(7.13)

Note that under the propositions as types reading, this type expresses that every partial element of \(\alpha \) extends to a total one. Indeed, using the partial elements endofunctor P from (6.2), we can write this in the form

(7.14)

The notion of a uniform trivial fibration structure now arises inexorably from forcing of the type \(\textsf{TFib}(\alpha )\) of trivial fibration structures on \(\alpha \).

Theorem 7.5

Let \(\alpha :X \rightarrow U\). The following conditions are equivalent.

  1. (i)

    There is a term t such that \(X \vdash t \mathord {\, : \,}\textsf{TFib}(\alpha )\).

  2. (ii)

    For each \(x:\textsf{y}{c}\rightarrow X\) we have \( c \Vdash t_x \mathord {\, : \,}\textsf{TFib}(\alpha )(x)\), uniformly in x.

  3. (iii)

    There is a uniform trivial fibration structure on .

Proof

Observe that (i) and (ii) are equivalent by Proposition 4.5.

Now suppose (ii). For each \(x :\textsf{y}{c} \rightarrow X\), we have \( c \Vdash t_x \mathord {\, : \,}\textsf{TFib}(\alpha )(x) \), uniformly in x. By definition (7.14) this means

Unwinding the forcing conditions using Proposition 4.16 and Proposition 4.14, we see that for every \(f :d \rightarrow c\) and every

(7.15)

we have \(t_{xf} (\varphi , v) = \big ( t_{x f} (\varphi , v)_1, t_{x f} (\varphi , v)_2 \big )\) with

$$\begin{aligned} d&\Vdash t_{x f} (\varphi , v)_1 :\alpha (x f) \end{aligned}$$
(7.16)
$$\begin{aligned} d&\Vdash t_{x f} (\varphi , v)_2 :v = \lambda ( t_{x f} (\varphi , v)_1 ) . \end{aligned}$$
(7.17)

Without loss of generality, we may assume that \(v= \lambda u\), so that by (7.4) the second condition becomes

$$\begin{aligned} d \Vdash t_{x f} (\varphi , \lambda u)_2 :u =^{\varphi }\! t_{x f} (\varphi , \lambda u)_1. \end{aligned}$$
(7.18)

Moreover, for any \(g :e \rightarrow d\), we have

$$\begin{aligned} (t_{x f}(\varphi , \lambda u) )g = t_{x fg} (\varphi g, \lambda u g). \end{aligned}$$
(7.19)

Unfolding the condition (7.15) using Proposition 6.5 yields a commutative diagram

(7.20)

and the uniformity condition yields, for any \(g :e \rightarrow d\), a further pullback diagram on the left,

(7.21)

Now we can apply Lemma 7.3 to (7.16) and (7.18) to conclude that \(t_{x f}(\varphi ,\lambda u)_1 \) is a diagonal filler in

while \(t_{x fg} (\varphi g, \lambda u g)_1\) is similarly a diagonal filler for the outer rectangle in (7.21).

In this way, forcing \(\textsf{TFib}(\alpha )\) produces diagonal fillers

$$\begin{aligned} j(\varphi , xf, u)\ =_{\textrm{def}}\ t_{x f}(\varphi ,u)_1 \end{aligned}$$
(7.22)

against all generating cofibrations \(\{\varphi \} \rightarrowtail \textsf{y}{d}\). Finally, the uniformity of these fillers \(j(\varphi , xf, u)\) with respect to all \(g :e \rightarrow d\) is provided by the uniformity condition (7.19).

The inference from (iii) to (ii) is essentially the same argument backwards.

Corollary 7.6

Let \(\alpha :X \rightarrow U\). The display map \(p_\alpha :X.\alpha \rightarrow X\) is a uniform trivial fibration if and only if \({\mathcal {E}}\Vdash t:\textsf{TFib}(\alpha )\) for some t. Indeed, t itself may be regarded as a trivial fibration structure on \(p_\alpha \) in virtue of the specification in (7.22). \(\square \)

Uniform trivial fibrations as algebras For \(X \in {\mathcal {E}}\), we defined the pointed endofunctor \(P_X :{\mathcal {E}}/_{X} \rightarrow {\mathcal {E}}/_{X}\) on the slice topos \({\mathcal {E}}/_{X}\) in (6.2). An algebra for \(P_X\) consists of an object \(p :A \rightarrow X\) of \({\mathcal {E}}/_{X}\) and a retraction of \(\eta _A :A \rightarrow P_X(A)\) over X, i.e. a map \(s :P_X(A) \rightarrow A \) over X such that

commutes. Such an algebra is the same thing as a uniform fibration structure on \(p :A \rightarrow X\) ( [22, Theorem 9.8]). We give a new simple proof of this fact using forcing, which in particular avoids any reference to Garner’s small object argument [23] and left Kan extensions (cf. [4, Proposition 14]).

For this, let us first consider the object \(P\text {-}\textsf{alg}(A)\) of algebra structures on p by taking the following pullback in \({\mathcal {E}}/_{X}\), where we write A for \(p :A \rightarrow X\) as an object in \({\mathcal {E}}/_{X}\) and \(P\) for \(P_X\):

(7.23)

If \(p :A \rightarrow X\) is classified by \(\alpha :X \rightarrow U\), then \(P\text {-}\textsf{alg}(A) \rightarrow X\) is classified by the map \(P\text {-}\textsf{alg}(\alpha ) :X \rightarrow U\) defined by setting

(7.24)

We can then strengthen Theorem 7.5 to the following isomorphism.

Theorem 7.7

Let \(\alpha :X \rightarrow U\). Then there is an isomorphism \(P\text {-}\textsf{alg}(\alpha ) \cong \textsf{TFib}(\alpha )\).

Proof

Recall the description of \(\textsf{TFib}(\alpha )\) in (7.14). Applying to it the type-theoretic axiom of choice (3.5) yields a natural isomorphism

(7.25)

We claim that, up to natural isomorphism, the right hand side is the object \(P\text {-}\textsf{alg}(\alpha )\) of algebra structures on \(\alpha \) from (7.24). It suffices to show that (in the context extended by \(s :\alpha ^{P\alpha }\)) there is a natural isomorphism

(7.26)

Moreover, since both sides are now propositions, it suffices to show that they are logically equivalent, which we will do by forcing.

Thus take any \(x :\textsf{y}{c} \rightarrow X\) and any \(s :\textsf{y}{c} \rightarrow E\) with \(c\Vdash s :({{P\alpha }\rightarrow \alpha })(x)\) and suppose that

(7.27)

Then for all \(f :d \rightarrow c\) and all \((\varphi , v)\) such that

$$\begin{aligned} d \Vdash (\varphi , v) \mathord {\, : \,}P\alpha (xf) , \end{aligned}$$
(7.28)

we have

$$\begin{aligned} d \Vdash v =\lambda \, \textsf{app}(s(f), (\varphi , v)) . \end{aligned}$$
(7.29)

To see what this means, consider the diagram on the left in (7.30) below:

figure e

The solid part is the pullback in \({\mathcal {E}}/\textsf{y}{c}\) arising from (7.28) and the forcing rules for \(P\alpha (x)\) in Proposition 6.5, with \(\lambda u = v\), and we have written \(\textsf{y}{d}\) for the map \(\textsf{y}{f}:\textsf{y}{d}\rightarrow \textsf{y}{c}\) and \(\alpha (x)\) for the projection \(p_{\alpha (x)} :\textsf{y}{c}.\alpha (x)\rightarrow \textsf{y}{c}\) and similarly for \(P\alpha (x)\).

By Remark 7.4, the condition (7.29) thus becomes

$$\begin{aligned} \textstyle d \Vdash u =^{\varphi } \textsf{app}(s(f),(\varphi , \lambda u)). \end{aligned}$$

By Lemma 7.3, the map \(j = \textsf{app}(s(f),(\varphi , \lambda u))\) therefore fits on the diagonal in the lefthand diagram of (7.30) and makes the top triangle commute.

Take \(\sigma _f\) with \(\lambda \sigma _f = s(f)\), so that

$$\begin{aligned} j = \textsf{app}(s(f),(\varphi , \lambda u)) = \textsf{app}(\lambda \sigma _f, (\varphi , \lambda u)) = \sigma _f (\varphi , \lambda u). \end{aligned}$$

Then we claim that \(\sigma _f \,\eta = {{\,\textrm{id}\,}}\), which will give the required righthand side of (7.26).

To prove the claim, recall that (7.29) holds for all \(f :d\rightarrow c\) and all \((\varphi , \lambda u)\) with

$$\begin{aligned} d \Vdash (\varphi , \lambda u) \mathord {\, : \,}P\alpha (xf) . \end{aligned}$$

Since for any \(c \Vdash a \mathord {\, : \,}\alpha (x)\), we can take \(c \Vdash (\textsf{t}, \lambda a) \mathord {\, : \,}P\alpha (x)\) to get \(d \Vdash (\textsf{t}, \lambda a(f)) \mathord {\, : \,}P\alpha (xf)\), we will then have \(a(f) = \sigma _f \,(\textsf{t}, a(f))\). Indeed, in this case we have \(i = {{\,\textrm{id}\,}}:\{\textsf{t}\}\rightarrowtail \textsf{y}{d}\) and so \(u = a(f)\) as on the right in (7.30) above, so the (partial) commutativity of the diagram on the left specialises on the right to give \(a(f) = \sigma _f\,(\textsf{t}, a(f)) \).

Since this holds for all \(f :d\rightarrow c\) and is uniform with respect to all \(g:e \rightarrow d\), and since \((\textsf{t}, a_f) = \eta (a_f)\), we conclude that

Conversely, \({{\,\textrm{id}\,}}=s \circ \eta \) implies \(u = s \circ \eta \circ u\), and since \(\eta \circ u = (\varphi , \lambda u) \circ i\), it follows that \(u = s\circ (\varphi ,u) \circ i\), and thus \(u =^\varphi \textsf{app}(s, (\varphi , u))\).

Corollary 7.8

(Pullback stability of \(\textsf{TFib}\)) Let \(\alpha :X \rightarrow U\). Then the object \(\textsf{TFib}(\alpha )\) over X is stable under pullback along any map \(t :Y \rightarrow X\), in the sense that the right hand square below is a pullback whenever the left hand one is:

figure f

In other words, \({t}^* \textsf{TFib}(\alpha ) \cong \textsf{TFib}(\alpha (t))\).

Proof

Note that we have simplified the notation \(X.\textsf{TFib}(\alpha ) \rightarrow X\) to \(\textsf{TFib}(\alpha ) \rightarrow X\). The description in (7.23) involves only \(P\)-algebras, exponentials, and pullbacks, all of which are stable under all pullbacks (as is \(P\) itself).

It also follows from Theorem 7.7 that, for every small \(A\in {\mathcal {E}}\), the unique map \(P{A} \rightarrow 1\) is a uniform trivial fibration, as it can be equipped with the \((P, \eta )\)-algebra structure \(\mu _A :P{P{A}} \rightarrow P{A}\). Thus, we have the following result.

Corollary 7.9

Every small map can be factored as a cofibration followed by a uniform trivial fibration.

Proof

Consider \(p :A \rightarrow X\) as an object of the slice category \({\mathcal {E}}/_{{X}}\) and apply the functor \(P_X :{\mathcal {E}}/_{X} \rightarrow {\mathcal {E}}/_{X}\) to form the object \(P_X (p) :{\text {dom}}({P_X (p)}) \rightarrow X\) in \({\mathcal {E}}/_{X}\). The map \(\eta _p :p \rightarrow P_X(p)\) is a cofibration in \({\mathcal {E}}/_{X}\), hence in \({\mathcal {E}}\), while \(P_X (p)\) is a uniform trivial fibration, as was just observed.

We conclude the section by constructing a universal uniform trivial fibration, using the method of [4, Proposition 85]. For \(\alpha :X \rightarrow U\), applying Corollary 7.8 to the pullback in (1.8) we obtain a pullback diagram as the outside square below, where \({{\,\textrm{id}\,}}:U\rightarrow U\) of course classifies \(\pi :E\rightarrow U\).

(7.31)

Trivial fibration structures on \(\alpha \), i.e. sections of \(\textsf{TFib}(\alpha )\), then correspond uniquely to factorisations \(\bar{\alpha }\), as indicated.

Theorem 7.10

(Universal trivial fibration) There exists a universal small uniform trivial fibration \({\textsf{TFib}_\bullet }\rightarrow \textsf{TFib}\), in the sense that every small uniform trivial fibration \(p :A \rightarrow X\) is a pullback of \({\textsf{TFib}_\bullet }\rightarrow \textsf{TFib}\) along a canonically determined classifying map \(\bar{\alpha } :X \rightarrow \textsf{TFib}\).

(7.32)

Proof

Define \(\textsf{TFib}= \textsf{TFib}({{\,\textrm{id}\,}})\) and \({\textsf{TFib}_\bullet }\rightarrow \textsf{TFib}\) by the pullback indicated on the right below.

As was just shown (7.31), a trivial fibration structure on \(A \rightarrow X\) corresponds to a factorisation \(\bar{\alpha }\) of \(\alpha \), thus making a pullback square as indicated on the left above. In particular, taking \(X = \textsf{TFib}\) and \(\alpha \) the projection \(\textsf{TFib}\rightarrow U\) and \(\bar{\alpha } = {{\,\textrm{id}\,}}\), we see that \({\textsf{TFib}_\bullet }\rightarrow \textsf{TFib}\) is itself a trivial fibration, and thus it is a universal one.

Remark 7.11

Using variables, the identity map \({{\,\textrm{id}\,}}:U\rightarrow U\) is the interpretation of the judgement \(\alpha :U\vdash \alpha :U\), from which we also have \(\alpha :U\vdash \textsf{TFib}(\alpha ):U\). Thus for the type \(\textsf{TFib}= U.\textsf{TFib}({{\,\textrm{id}\,}})\) we have and then .

9 Uniform fibrations

The definition of a uniform fibration was originally introduced in the setting of categories of cubical sets in [9, 15] to provide a constructive model of the Univalence Axiom. The notion was analysed in terms of algebraic weak factorisation systems in [46] and generalised to the setting of presheaf categories equipped with a class of cofibrations and a suitable interval object in [4, 22]. The definition of [15, Section 8.2] was rephrased in the internal type theory of such a category in [36, Definition 5.6]. Here, we relate precisely the category-theoretic and the type-theoretic formulations of the notion of uniform fibration in the latter setting. In particular, we show how this notion arises naturally from our Kripke-Joyal forcing for the internal type theory of a presheaf category \({\mathcal {E}}= \textrm{Psh}(\mathbb {C})\) of cubical sets with connections. We expect that a similar treatment could be given for other cases, such as [1, 4].

We assume a class of cofibrations as in Definition 5.1, classified by \(\Phi \rightarrowtail \Omega \).

Definition 8.1

An interval with connections is an object \(\textrm{I}\) in \({\mathcal {E}}\) equipped with endpoints \(\delta ^k :1 \rightarrow \textrm{I}\) and connections \(c_k :\textrm{I}\times \textrm{I}\rightarrow \textrm{I}\), for \(k=0,1\), satisfying the following axioms.

  1. (i)

    The maps \(\delta ^k :1 \rightarrow \textrm{I}\) are cofibrations, for \(k=0,1\).

  2. (ii)

    The pullback of \(\delta ^0\) and \(\delta ^1\) is the initial object 0,

  3. (iii)

    The diagrams

    figure g

    commute, for \(k = 0,1\).

We recall the definition of a uniform fibration from [22, Section 7]. This involves the pushout-product construction, described in [40, Construction 11.1.7] under the name of Leibniz construction. We define a naive trivial cofibration to be the pushout-product map \(m \otimes \delta ^k\) in

where \(m :S \rightarrowtail T\) is an arbitrary cofibration and \(\delta ^k :1\rightarrowtail \textrm{I}\), for \(k=0,1\) is an endpoint. Note that \(m \otimes \delta ^k\) is indeed a cofibration by Remark 5.2. Naive trivial cofibrations are stable under pullback along arbitrary maps \(t :T' \rightarrow T\), in the sense that one then has a pullback square

(8.1)

where \(m' :S' \rightarrowtail T'\) is the pullback of m along t.

Definition 8.2

Let \(p :A \rightarrow X\) be a small map. A uniform fibration structure on p consists of a function j that assigns a dotted filler \(j(m,u,v) :T \times \textrm{I}\rightarrow A\) to every diagram of solid arrows

where m is a cofibration, and \(k=0,1\), subject to the following uniformity condition: for any map \(t :T' \rightarrow T\) and induced pullback square on the left,

(8.2)

we have

$$\begin{aligned} j(m', u (t\times i)', v (t\times i)) = j(m, u, v) \circ (t\times \textrm{I}), \end{aligned}$$

where \((t\times \textrm{I})'\) is the evident pullback of \((t\times \textrm{I})\).

As a functor on the arrow category \({\mathcal {E}}^\rightarrow \), the pushout-product \((-)\otimes \delta ^k\) has a right adjoint \(\delta ^k \Rightarrow (-)\), the pullback-hom, taking \(p :A \rightarrow X\) to the map \(\delta ^k \Rightarrow p\) indicated in the following diagram.

(8.3)

By adjointness, these operations can be seen to satisfy

$$\begin{aligned} (m \otimes \delta ^k ) \pitchfork p \quad \text {if and only if} \quad m \pitchfork (\delta ^k \Rightarrow f) , \end{aligned}$$
(8.4)

where the notation \(u \pitchfork v\) means, as usual, that u has the left lifting property with respect to v. Indeed, more is true: by adjointness there is a natural bijection between the diagonal fillers witnessing the statement \((m \otimes \delta ^k ) \pitchfork p\) and those establishing \(m \pitchfork (\delta ^k \Rightarrow f)\).

The condition in (8.2) for \(p :A \rightarrow X\) to be a uniform fibration can therefore be reformulated as the requirement that, for all cofibrations \(m :S \rightarrowtail T\), we have \(m \pitchfork (\delta ^k \Rightarrow p)\) uniformly in m. But this of course just says that \(\delta ^k \Rightarrow p\) is a uniform trivial fibration in the sense of Definition 7.1. We record this for later use (cf. [22, Proposition 7.4]).

Proposition 8.3

A small map \(p :A \rightarrow X\) is a uniform fibration if and only if the map \(\delta ^k \Rightarrow p :A^\textrm{I}\rightarrow X^\textrm{I}\times _X A\) is a uniform trivial fibration, for \(k=0,1\). \(\square \)

Remark 8.4

As was the case for uniform trivial fibrations ((Lemma 7.2), a uniform fibration structure is determined by its values on the generating trivial cofibrations, defined as those of the form \(m \otimes \delta ^k \) where \(m :S\rightarrowtail \textsf{y}{c}\) is a cofibration with a representable codomain. We leave it to the reader to reformulate Definition 8.2 of a uniform fibration structure on a map \(p :A \rightarrow X\) in these terms.

Our aim now is to show how Definition 8.2 can be formulated in the internal type theory of \({\mathcal {E}}\) and how it is thereby related to forcing. In light of Proposition 8.3 we would like to use Theorem 7.5 to show that there is an element of \(\textsf{TFib}(\delta ^k \Rightarrow {f})\) over X, but for this to make sense \(\delta ^k \Rightarrow {f}\) would need to be given as a display map. Thus let \(\alpha :X \rightarrow U\) classify \(A\rightarrow X\). Consider the case \(k = 0\) and let \(\mathsf {ev_0} :X^\textrm{I}\rightarrow X\) be the evaluation at the point \(\delta ^0 :1\rightarrow \textrm{I}\) (i.e. \(\mathsf {ev_0} = X^{\delta ^0}\)), so that the pullback in (8.3) above becomes

(8.5)

In what follows, we adopt the indexed-family style of writing a display map \(X.\alpha \rightarrow ~X\) as for easier comparison with [36]. For any \(x:\textsf{y}{c} \rightarrow X^\textrm{I}\) and section \((x,a) :\textsf{y}{c} \rightarrow \alpha (x_0)\), for \(k = 0, 1\), we define \(F_k(x,a) :\textsf{y}{c} \rightarrow U\) as

(8.6)

Proposition 8.5

Let \(\alpha :X \rightarrow U\). Then the following conditions are equivalent.

  1. (i)

    The projection admits a uniform fibration structure.

  2. (ii)

    There is a term of type

    where \(\textsf{TFib}\) is as defined in (7.13).

Moreover, there is a bijection between such structures and such terms.

Proof

Writing \(x_0 = \mathsf {ev_0}(x)\), for (8.5) we then have,

Using the isomorphism

the map \(p^\textrm{I}:A^\textrm{I}\rightarrow X^\textrm{I}\) may be rewritten as a display map over \(X^\textrm{I}\) in the form

Up to isomorphism, our previous diagram (8.3) then becomes

Thus for any \(x :\textsf{y}{c} \rightarrow X^\textrm{I}\) the map \((\delta ^0 \Rightarrow p)(x)\) over \(\textsf{y}{c}\) is the \(0^{th}\) projection of the type family ,

as indicated in the following diagram:

(8.7)

Thus, for \(x:\textsf{y}{c} \rightarrow X^\textrm{I}\) and section \((x,a) :\textsf{y}{c} \rightarrow \alpha (x_0)\), the type \(F_0(x,a) :\textsf{y}{c} \rightarrow U\) defined in (8.6) can be regarded as the fiber of \(\pi _0\) at (xa). The display map

is then isomorphic to \({\delta ^0 \Rightarrow {p}}\) over . Similarly, for \((x,a) :\textsf{y}{c} \rightarrow \alpha (x_1)\), let \(F_1(x,a) :\textsf{y}{c} \rightarrow U\) be the analogous type consisting of fibers of rather than \(\pi _0\). The type in item (ii) then classifies uniform fibration structures on by Theorem 7.5.

Recall from [36, Definition 5.6] the following definition of the type of 0-directed filling structures \(\textsf{Fill}_0(\alpha ) :U\) on an \(\textrm{I}\)-indexed family of types \(\alpha :\textrm{I}\rightarrow U\).

(8.8)

where

is the canonical isomorphism, and the type \((v=\lambda s)\) is as in (7.4). There is an analogous condition \(\textsf{Fill}_1(\alpha )\) in which 1 replaces 0 everywhere, describing 1-directed filling from the other end of the interval \(\textrm{I}\). Note that for \(\alpha :\textrm{I}\rightarrow U\), the types \(\textsf{Fill}_0(\alpha )\) and \(\textsf{Fill}_1(\alpha )\) are closed.

Now for any object X and family of types \(\alpha :X\rightarrow U\), we have the family \(x :X^\textrm{I}\vdash \alpha \circ x :\textrm{I}\rightarrow U\) obtained by “restricting \(\alpha \) along paths in X”, i.e. composing \(\alpha \) and \(\textsf{eval}:X^\textrm{I}\times \textrm{I}\rightarrow X\). Thus we have the closed type

(8.9)

We show below that \(\textsf{Fib} (\alpha )\) is isomorphic to the type in item (ii) of Proposition 8.5 and therefore also classifies uniform fibration structures on .

Proposition 8.6

For any object X and any \(\alpha :X \rightarrow U\), there is an isomorphism,

Proof

It clearly suffices to show

$$\begin{aligned} \textstyle \textsf{Fill}_0( \alpha \circ x )\ \cong \ \prod _{a \mathord {\, : \,}\alpha (x_0)} \textsf{TFib}\, F_0(x,a) , \end{aligned}$$

in context \(x :X^\textrm{I}\), and similarly for \(\textsf{Fill}_1\). Using (8.6), the type on the right becomes

(8.10)

Inserting the definition of \(\textsf{TFib}\) from (7.13) results in the type

(8.11)

which simplifies to

(8.12)

Comparing with (8.8), we see that this is indeed \(\textsf{Fill}_0( \alpha \circ x)\). The case of \(\textsf{Fill}_1\) is entirely analogous.

It follows that the type \(\textsf{Fib} (\alpha )\) from (8.9) also classifies uniform fibration structures on the type family \(\alpha :X\rightarrow U\).

Corollary 8.7

Let \(\alpha :X \rightarrow U\). Then the following conditions are equivalent.

  1. (i)

    The projection map is a uniform fibration.

  2. (ii)

    There is a term \(t \mathord {\, : \,}\textsf{Fib} (\alpha )\).

Moreover, there is a bijection between uniform fibration structures as in Definition 8.2 and terms \(t \mathord {\, : \,}\textsf{Fib} (\alpha )\).

The construction of a universal uniform fibration given below (following [4, 17, 31]) requires the interval \(\textrm{I}\) to be tiny, meaning that the “path space” functor \(X^\textrm{I}\) has a right adjoint \(X_\textrm{I}\) called the \(\textrm{I}^{th}\)-root. This is the case, for instance, when \({\mathcal {E}}= \textrm{Psh}(\mathbb {C})\) is the category of cubical sets with \(\mathbb {C}\) the Dedekind cube category [13] and \(\textrm{I}= \textsf{y}{[1]}\) the 1-cube, which then also satisfies the conditions in Definition 8.1.

In order to use the approach of Theorem 7.10 to construct a universal fibration, we need the analogue of Corollary 7.8 for \(\textsf{Fib} (\alpha )\), i.e. stability under pullback. Unlike \(\textsf{TFib}(\alpha )\), however, the object \(\textsf{Fib} (\alpha )\) is not indexed over X, but instead has the form

(8.13)

where \(\textsf{Fill}(\alpha \circ x) =_{\textrm{def}}\textsf{Fill}_0( \alpha \circ x) \times \textsf{Fill}_1( \alpha \circ x)\). Now \(\textsf{Fill}(\alpha \circ x)\) is also not indexed over X, but rather over \(X^\textrm{I}\). However, we can use it to construct a pullback stable family \(\textsf{Fib} ^*(\alpha )\) over X as follows (cf. [17, 31]). Applying the root functor to \(\textsf{Fill}(\alpha \circ x)\), regarded as a display map over \(X^\textrm{I}\), and pulling back along the unit of the adjunction,

(8.14)

we obtain a family \(\textsf{Fib} ^*(\alpha )\) on X that parametrises fibration structures on \(\alpha \), in the sense made precise in Proposition 8.8 below. It may be noted that this construction of \(\textsf{Fib} ^*(\alpha )\) is categorical, rather than in the type theory of \({\mathcal {E}}\) from Sect. 3. In fact, such an internal construction is impossible, as is shown in [31], where a type theoretic definition of \(\textsf{Fib} ^*(\alpha )\) is obtained by extending the internal type theory of \({\mathcal {E}}\) by a modal operator describing the comonad \(\Delta \dashv \Gamma :\mathcal {E} \rightarrow \textbf{Set}\).

Proposition 8.8

Let \(\alpha :X \rightarrow U\).

  1. (i)

    There is a natural bijection between sections of \(\textsf{Fib} ^*(\alpha )\) over X and global sections \(1\rightarrow \textsf{Fib} (\alpha )\).

  2. (ii)

    The object \(\textsf{Fib} ^*(\alpha )\) over X is stable under pullback along any map \(t :Y \rightarrow X\), in the sense that the right hand square below is a pullback whenever the left hand one is.

    figure h

Proof

For (i), by the specification (8.13), points \(1\rightarrow \textsf{Fib} (\alpha )\) correspond bijectively to sections of \(\textsf{Fill}(\alpha \circ x)\) over \(X^\textrm{I}\). Let \(\textsf{fill}(\alpha ) :X^\textrm{I}\rightarrow U\) classify \(\textsf{Fill}(\alpha \circ x) \rightarrow X^\textrm{I}\). We then have the correspondence indicated below between maps \(j_1,j_2,j_3,j_4\),

figure i

where \(\textsf{fill}(\alpha )^\sharp \) is the adjoint transpose of \(\textsf{fill}(\alpha )\), and both squares are pullbacks.

It thus suffices to show that the following is also a pullback.

To see this, factor the transpose \(\textsf{fill}(\alpha )^\sharp \) as \(\textsf{fill}(\alpha )_\textrm{I}\circ \eta \), as indicated below, noting that the root preserves pullbacks.

The square on the left is a pullback by the definition (8.14) of \(\textsf{Fib} ^*(\alpha )\).

For (ii), it now suffices to show that for every \(t :Y \rightarrow X\),

$$\begin{aligned} \textsf{fill}(\alpha )^\sharp \circ t = \textsf{fill}({\alpha (t))}^\sharp . \end{aligned}$$
(8.15)

Since \(\textsf{fill}(\alpha )^\sharp \circ t = (\textsf{fill}(\alpha ) \circ t^\textrm{I})^\sharp \) by the naturality of transposition, it suffices to show

$$\begin{aligned} \textsf{fill}(\alpha ) \circ t^\textrm{I}= \textsf{fill}(\alpha (t)) . \end{aligned}$$
(8.16)

Now, by definition, \(\textsf{fill}(\alpha ) :X^\textrm{I}\rightarrow U\) classifies \(\textsf{Fill}(\alpha \circ x) = \textsf{Fill}_0( \alpha \circ x) \times \textsf{Fill}_1( \alpha \circ x)\) (over \(X^\textrm{I}\)), so we just need to show that \(\textsf{Fill}_0(\alpha \circ x) \rightarrow X^\textrm{I}\) is stable under pullback along \(t^\textrm{I}:Y^\textrm{I}\rightarrow X^\textrm{I}\) (the case \(\textsf{Fill}_1( \alpha \circ x)\) is analogous). As shown in the proof of Proposition 8.6, over \(X^\textrm{I}\) we have

$$\begin{aligned} \textstyle \textsf{Fill}_0( \alpha \circ x )\ \cong \ \prod _{a \mathord {\, : \,}\alpha (x_0)} \textsf{TFib}\, F_0(x,a). \end{aligned}$$

Moreover, by the definition (8.6) the display map for \(F_0(x,a)\), namely

is isomorphic to the pullback-hom \({\delta ^0 \Rightarrow {p_\alpha }}\) over the isomorphism

Applying the functor \({\delta ^0 \Rightarrow {(-)}}\) to the pullback square on the left below results in the upper one on the right:

figure j

So we are done by the stability of \(\textsf{TFib}\) (Corollary 7.8) and the Beck-Chevalley condition for \(\Pi \), using the lower pullback on the right.

Theorem 8.9

(Universal fibration) There is a universal small uniform fibration, \(\textsf{Fib}_\bullet \rightarrow \textsf{Fib} \), in the sense that every small fibration \(A \rightarrow X\) is a pullback of \(\textsf{Fib}_\bullet \rightarrow \textsf{Fib} \) along a canonically determined classifying map \(X \rightarrow \textsf{Fib} \).

(8.17)

Proof

Define \(\textsf{Fib} = \textsf{Fib} ^*({{\,\textrm{id}\,}})\) and \(\textsf{Fib}_\bullet \rightarrow \textsf{Fib} \) by the pullback indicated below.

The rest of the proof is the same as for Theorem 7.10.

Remark 8.10

As in Remark 7.11, in terms of variables we have . Thus a uniform fibration is a small family \(\alpha :U\) equipped with a fibration structure \(f:\textsf{Fib} ^*(\alpha )\), and the universal one is indexed by the type of all such pairs \((\alpha ,f)\).

10 Path types

The fundamental insight of Homotopy Type Theory [7, 18] is that identity terms \(p:{{\,\textrm{Id}\,}}_A(a, b)\) in (intensional) Martin-Löf type theory [34] behave like continuous paths \(p :[0,1] \rightarrow A\) in a space A, and the identity type \({{\,\textrm{Id}\,}}_A\) itself then acts like a path space \(A^{[0,1]}\). Moreover, the rules of the type theory then permit a formal derivation of the homotopy lifting property for type families \(X\vdash A \ \textsf{type} \), thus forcing them to be regarded as fibrations \(A\twoheadrightarrow X\).

To make this insight precise, for any object \(A\in {\mathcal {E}}\), define the path object \(A^\textrm{I}\) to be the exponential by the interval \(\textrm{I}\) (Definition 8.1). The path object is indexed over \(A\times A\) by the pair of endpoint evaluations \(\epsilon = ( \epsilon _0, \epsilon _1 ) :A^\textrm{I}\overset{}{\longrightarrow }A\times A\), where \(\epsilon _k = A^{\delta _k}\) for \(k = 0,1\). Together with the constant path map \({{\,\mathrm{\rho }\,}}= A^{!} :A \rightarrow A^\textrm{I}\), where \(! :A \rightarrow 1\), these maps make the following diagram commute.

(9.1)

More generally, for \(p :A \rightarrow X\) any (small) map, with classifying map \(\alpha :X \rightarrow U\), the path object of \(p \cong p_{\alpha }\) in \({\mathcal {E}}/_X\) is the exponential of \(p_{\alpha }\) by \(\textrm{I}_X = (\pi _1:X\times \textrm{I}\rightarrow X)\), which can be constructed in \({\mathcal {E}}\) as the following pullback along \({{\,\mathrm{\rho }\,}}_X :X\rightarrow X^\textrm{I}\).

Let \(\alpha ^\textrm{I}:X\rightarrow U\) classify \(p_{\alpha ^\textrm{I}} :X.\alpha ^\textrm{I} \rightarrow X\), so that in the type theory of \({\mathcal {E}}\) we have the path type \(X\vdash \alpha ^\textrm{I}:U\). Terms \(X\vdash u:\alpha ^\textrm{I}\) are called paths in \(\alpha \). There are of course maps over X analogous to those in (9.1), of the form:

Given any \(x :\textsf{y}{c} \rightarrow X\) and elements \(c \Vdash a,b :\alpha (x)\) (corresponding to sections of \(\textsf{y}{c}.\alpha (x)\rightarrow \textsf{y}{c}\)), a path \(c \Vdash u:\alpha (x)^\textrm{I}(a,b)\) thus represents a homotopy \(a\sim b\) (over \(\textsf{y}{c}\)).

Regarding paths \(a\sim b\) as “identifications” as in Homotopy Type Theory, the path type \(\alpha ^\textrm{I}\) acts as an identity type for \(\alpha \). Under the propositions-as-types view, we should then expect a type family \(X.\alpha \vdash \beta :U\) to respect identifications \(a\sim b\) in \(\alpha \), by the principle of “indistinguishability of identicals”: if \(a\sim b\) and \(\beta (a)\), then \(\beta (b)\), regarding \(\beta :X.\alpha \rightarrow U\) as a (type-valued) “propositional function" on \(\alpha \). Indeed, we have the following:

Lemma 9.1

For any \(X\in {\mathcal {E}}\) and small map \(A \rightarrow X\), let \(B \rightarrow A\) be a small uniform fibration. For the associated families of types \(\alpha :X \rightarrow U\) and \(\beta :X.\alpha \rightarrow U\), and for any \(x :\textsf{y}{c} \rightarrow X\), suppose we have terms \(c\Vdash a, b:\alpha (x)\) and a path between them \(c\Vdash u :\alpha (x)^\textrm{I}(a,b)\). Then for each e with \(c\Vdash e :\beta (x,a)\) there is an associated \(u*e\) with \(c\Vdash u*e:\beta (x,b)\).

Proof

Consider the following diagram, in which \(\lambda {u'} = u\).

The solid upper square commutes because \(u'({{\,\textrm{id}\,}}\times \delta _0) = (x,a) = p_\beta (x,a,e):\textsf{y}{c} \rightarrow X.\alpha \), and by assumption \(c\Vdash e :\beta (x,a)\). As the reader can check, for the map on the left we have \(\textsf{y}{c}\times \delta _0 = 0_{\textsf{y}{c}} \otimes \delta _0\) with the cofibration \(0_{\textsf{y}{c}}:0\rightarrowtail \textsf{y}{c}\), and thus it is a (generating) trivial cofibration in the sense of Remark 8.4. By assumption, we have a uniform fibration structure \(f :\textsf{Fib} (\beta )\) over \(X.\alpha \), so by Corollary 8.7 we obtain a diagonal filler \(j = f(0_{\textsf{y}{c}},\, (x,a,e),\, u')\) as indicated. We can then take \(u*e =_{\textrm{def}}\pi _2\, j(\textsf{y}{c}\times \delta _1)\), so that \(c\Vdash u*e :\beta (\pi _1\, j(\textsf{y}{c}\times \delta _1))\). But

$$\begin{aligned} \beta (\pi _1\, j(\textsf{y}{c}\times \delta _1)) = \beta (p_\beta \, j(\textsf{y}{c}\times \delta _1)) = \beta (u'(\textsf{y}{c}\times \delta _1))= \beta (x,b). \end{aligned}$$

\(\square \)

The term \(u*e\) is called the transport of e along u. It is in virtue of this transport operation that fibrations are used as the type families in Homotopy Type Theory, as we shall see in Theorem 9.4. Of course, we then also need the path type \(\alpha ^\textrm{I}\) itself to be a fibration over \(\alpha \times \alpha \). Fortunately, we have the following result.

Lemma 9.2

Let \(X\in {\mathcal {E}}\) and \(\alpha :X \rightarrow U\). Given a uniform fibration structure \(f:\textsf{Fib} (\alpha )\) over X, we can construct a uniform fibration structure \(f':\textsf{Fib} (\alpha ^\textrm{I})\) over \(X.\alpha .\alpha \cong X.\alpha \times _X X.\alpha \).

Proof

Consider a diagonal filling problem for the display map \(p_{\alpha ^\partial } :X.\alpha ^\textrm{I}\rightarrow X.\alpha .\alpha \) with respect to a generating trivial cofibration \(m \otimes \delta _k\) with cofibration \(m :S \rightarrowtail \textsf{y}{c}\) (see Remark 8.4):

(9.2)

In terms of the adjoint functors \(\otimes \) and \(\Rightarrow \), we have \(p_{\alpha ^\partial } = (\partial \Rightarrow p_{\alpha })\), where \(\partial = [\delta _0, \delta _1] :1+1\rightarrowtail \textrm{I}\), as the reader can check. So by the adjoint relation (8.4), the above diagonal filling problem can be reformulated equivalently as follows, where \(D = {\text {dom}}((m \otimes \delta _k)\otimes \partial )\).

Since \((m \otimes \delta _k)\otimes \partial \cong (\partial \otimes m) \otimes \delta _k\), and \(\partial \) is a cofibration, and cofbrations are closed under \(\otimes \), the map on the left is a trivial cofibration. Thus from the assumed fibration structure \(f:\textsf{Fib} (\alpha )\) we obtain a diagonal filler \(j = f(\partial \otimes m, u',v')\) as indicated. Transposing \(j :(\textsf{y}{c} \times \textrm{I}) \times \textrm{I}\rightarrow X.\alpha \) to \(j' :\textsf{y}{c} \times \textrm{I}\rightarrow X.\alpha ^\textrm{I}\) provides a diagonal filler for (9.2), which we may take as the corresponding value of \(f':\textsf{Fib} (\alpha ^\textrm{I})\),

$$\begin{aligned} f'(m,u,v) =_{\textrm{def}}f(\partial \otimes m, u', v')' \end{aligned}$$

(up to the iso \((m \otimes \delta _k)\otimes \partial \cong (\partial \otimes m) \otimes \delta _k\)). Uniformity of \(f'\) then follows from that of f and the naturality of adjoint transposition.

Recalling Definition 8.1, a consequence of the connection \(c_0 :\textrm{I}\times \textrm{I}\rightarrow \textrm{I}\) is the contractibility of (the fibers of) the \(0^{th}\)-endpoint map \(\epsilon _0 :X.\alpha ^\textrm{I}\overset{}{\longrightarrow }X.\alpha \) (and similarly for \(c_1\) and \(\epsilon _1\)).

Lemma 9.3

Let \(\alpha :X\rightarrow U\) with elements \(c \Vdash a,b :\alpha (x)\). For any path \(u :a\sim b\) in \(\alpha (x)\), there is a path \(\varepsilon _u :{{\,\mathrm{\rho }\,}}_a \sim u\) in the path type \(\alpha (x)^\textrm{I}\). Formally, from \(c \Vdash u:\alpha (x)^\textrm{I}(a,b)\), we can construct \(c \Vdash \varepsilon _u :(\alpha (x)^\textrm{I})^\textrm{I}({{\,\mathrm{\rho }\,}}_a,u)\).

Proof

Over X, we of course have an iso \( X.(\alpha (x)^\textrm{I})^\textrm{I}\cong X.\alpha (x)^{\textrm{I}\times \textrm{I}}\), and so we can use the connection \(c_0 :\textrm{I}\times \textrm{I}\rightarrow \textrm{I}\) to obtain a map over X of the form

$$\begin{aligned} \varepsilon :X.\alpha (x)^\textrm{I}\overset{}{\longrightarrow }X.\alpha (x)^{\textrm{I}\times \textrm{I}} \cong X.(\alpha (x)^\textrm{I})^\textrm{I}. \end{aligned}$$

It follows from the connection diagrams in Definition 8.1(iii) that \(\varepsilon _u\) satifies the required forcing condition.

Lemma 9.3 can be understood informally as follows: the fiber at \(a :\alpha \) of the endpoint map \(\epsilon _0 :X.\alpha ^\textrm{I}\overset{}{\longrightarrow }X.\alpha \) may be regarded as a “homotopy singleton”,

The lemma says that, up to homotopy, the only element in \(\textsf{ho}{\{a\}}\) is the constant path \({{\,\mathrm{\rho }\,}}_{a} :a\sim ~a\).

Using the previous three lemmas we can show that Martin-Löf’s rules [34] for identity types \({{\,\textrm{Id}\,}}_\alpha \) are satisfied by the path types \(\alpha ^\textrm{I}\), provided that we interpret types as (uniform) fibrations (cf. [7]). In the following, we take \(A\rightarrow 1\) rather than the general case \(A\rightarrow X\) merely for notational convenience, and use displayed variables for a more familiar presentation. The judgement \(\Gamma \vdash A \ \textsf{type} \) will be interpreted to mean \( \Gamma \vdash A:\textsf{Fib} \), where is the base of the universal (small, uniform) fibration (Remark 8.10), and so we can write \( A:\textsf{Fib} \) as a pair \(A = (\alpha , f)\) with \(\alpha :U\) and \(f :\textsf{Fib} ^*(\alpha )\).

Theorem 9.4

Suppose the presheaf topos \({\mathcal {E}}\) has a tiny interval \(\textrm{I}\) with connections. Then in any context \(\Gamma \), for any \(A = (\alpha , f) :\textsf{Fib} \) with \(\alpha :U\) and \(f:\textsf{Fib} ^*(\alpha )\), let \(A^\textrm{I}= (\alpha ^\textrm{I}, f') :\textsf{Fib} \) for \(\alpha ^\textrm{I}:U\) and \(f':\textsf{Fib} ^*(\alpha ^\textrm{I})\). The following standard formation, introduction, and elimination rules for identity types then hold in the internal type theory of \({\mathcal {E}}\).

If, moreover, the constant path map \({{\,\mathrm{\rho }\,}}:A\rightarrow A^\textrm{I}\) is a cofibration, then the following computation rule also holds.

$$\begin{aligned} x \mathord {\, : \,}A \, \vdash \, \textsf{j}_b(x,x,{{\,\mathrm{\rho }\,}}(x)) = b(x) :B(x, x, {{\,\mathrm{\rho }\,}}(x) ) \end{aligned}$$
(9.3)

Proof

We follow the approach in [3, Section 2.4]. Reasoning first in an arbitrary context, which we leave implicit, let \(A = (\alpha , f) :\textsf{Fib} \) with \(\alpha :U\) and \(f:\textsf{Fib} ^*(\alpha )\). Then by Lemma 9.2 we have \(f' :\textsf{Fib} ^*(\alpha ^\textrm{I})\), whence \(A^\textrm{I}= (\alpha ^\textrm{I}, f') :\textsf{Fib} \). Thus we have the formation rule. The introduction rule follows from (9.1). The underlying types in those rules are displayed in the following two diagrams.

figure k

The premises of the elimination rule are then interpreted as the solid part of the following, letting \(B = (\beta , g):\textsf{Fib} \).

figure l

The conclusion of elimination asserts the existence of the indicated diagonal arrow j making the lower triangle commute, while the computation rule states that the upper one does. To build such a map j it suffices to show that for any c and \(x :\textsf{y}{c} \rightarrow 1.\alpha .\alpha .\alpha ^{\textrm{I}}\), there is an element \(j_{x} :\textsf{y}{c} \rightarrow E\) such that

$$\begin{aligned} c \Vdash j_{x} :\beta (x), \end{aligned}$$

uniformly in c. Since x can be rewritten as \((a,a',u):\textsf{y}{c} \rightarrow 1.\alpha .\alpha .\alpha ^{\textrm{I}}\), we have \(c\Vdash u:\alpha ^{\textrm{I}}(a,a')\). By Lemma 9.3 we then obtain \(c \Vdash \varepsilon _u :(\alpha (x)^\textrm{I})^\textrm{I}({{\,\mathrm{\rho }\,}}{(a)},u)\). Substituting a in the second premise of the elimination rule yields \(c\Vdash b(a) :\beta (a,a,{{\,\mathrm{\rho }\,}}(a))\). Transporting the latter along \(\varepsilon _u\) by Lemma 9.1 then provides \(c\Vdash \varepsilon _u * b(a) :\beta (a,a',u)\). Now set

$$\begin{aligned} j_{(a,a',u)} =_{\textrm{def}}\ \varepsilon _u * b(a). \end{aligned}$$

Uniformity in c follows from the same for each of the terms in the construction of \(j_{(a,a',u)}\). Indeed, given \(f :d\rightarrow c\), we have

$$\begin{aligned} d \Vdash j_{(a,a',u)}(f) = (\varepsilon _u * b(a))(f) = \varepsilon _{uf} * b(af) = j_{(af,a'f,uf)} :\beta (af,a'f,uf).\nonumber \\ \end{aligned}$$
(9.6)

Finally, if \({{\,\mathrm{\rho }\,}}:A\rightarrow A^\textrm{I}\) is a cofibration then, looking at (9.5), the map j can be (uniformly) replaced by a homotopic one \(j \sim j'\) that also makes the upper triangle commute, by a standard argument using the fibration on the right (as in e.g. [4, Lemma 56]). The new map \(j'\) then validates both the elimination and computation rules.

Note that the required coherence conditions for \(A^\textrm{I}\) and j with respect to all context maps \(Y \rightarrow X\) are ensured by the same device used for \(\Pi \) in (1.19); namely, we apply the above construction once in a universal case constructed from small map classifier \(E\rightarrow U\), and then obtain all of the instances in a uniform way by composition. See [3, Section 2.4] for details.

Remark 9.5

The condition that the constant path map \({{\,\mathrm{\rho }\,}}:A\rightarrow A^\textrm{I}\) is a cofibration holds, for instance, when all monos are taken as cofibrations, as in a Cisinski model structure. When this fails, as it may for presheaves not valued in sets, one can still recover the computation rule (9.3) by factoring \({{\,\mathrm{\rho }\,}}:A\rightarrow A^\textrm{I}\) into a cofibration followed by a (uniform) trivial fibration (Corollary 7.9), as shown in [47].

11 Conclusions

We conclude the paper by outlining some directions for future work. First, while here we considered \(\mathop {\textbf{Set}}\)-valued presheaves, where \(\mathop {\textbf{Set}}\) is the category of sets associated to ZFC extended with an inaccessible cardinal, it is also interesting to consider presheaf categories valued in other kinds of categories or categories of internal presheaves in some topos. Such a project may also connect with the idea of developing the material here in a constructive metatheory, as suggested to us by Thierry Coquand and Michael Rathjen. Secondly, one could try to extend our results to categories of sheaves. One preliminary issue for this is to find an adequate counterpart of the Hofmann-Streicher universe and of the classifier of small maps. One may also try to develop the material here without using a universe, adopting the approach of [44] to replace quantification over the universe. Finally, one may wish to consider extending the Kripke-Joyal forcing introduced here to other forms of type theory, such as the modal type theory studied in [31].