Axioms for Modelling Cubical Type Theory in a Topos

12/13/2017 ∙ by Ian Orton, et al. ∙ University of Cambridge 0

The homotopical approach to intensional type theory views proofs of equality as paths. We explore what is required of an object I in a topos to give such a path-based model of type theory in which paths are just functions with domain I. Cohen, Coquand, Huber and Mörtberg give such a model using a particular category of presheaves. We investigate the extent to which their model construction can be expressed in the internal type theory of any topos and identify a collection of quite weak axioms for this purpose. This clarifies the definition and properties of the notion of uniform Kan filling that lies at the heart of their constructive interpretation of Voevodsky's univalence axiom. (This paper is a revised and expanded version of a paper of the same name that appeared in the proceedings of the 25th EACSL Annual Conference on Computer Science Logic, CSL 2016.)

READ FULL TEXT VIEW PDF
POST COMMENT

Comments

There are no comments yet.

Authors

page 1

page 2

page 3

page 4

This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

1 Introduction

Cubical type theory [CCHM18] provides a constructive justification of Voevodsky’s univalence axiom, an axiom that has important consequences for the formalisation of mathematics within Martin-Löf type theory [Uni13]. Working informally in constructive set theory, Cohen et al [CCHM18] give a model of their type theory using the category of set-valued contravariant functors on a small category that is the Lawvere theory for de Morgan algebra [BD75, Chapter XI]; see [Spi15]. The representable functor on the generic de Morgan algebra in is used as an interval object in , with proofs of equality modelled by the corresponding notion of path, that is, by morphisms with domain . Cohen et al call the objects of cubical sets. They have a richer structure compared with previous, synonymous notions [BCH14, Hub15]. For one thing they allow path types to be modelled simply by exponentials , rather than by name abstractions [Pit13, Chapter 4]. More importantly, the de Morgan algebra operations endow the interval with structure that considerably simplifies the definition and properties of the constructive notion of Kan filling that lies at the heart of [CCHM18]. In particular, the filling operation is obtained from a simple special case that composes a filling at one end of the interval to a filling at the other end. Coquand [Coq15] has suggested that this distinctive composition operation can be understood in terms of the properties of partial elements and their extension to total elements, within the internal higher-order logic of toposes [LS86]. In this paper we show that that is indeed the case and usefully so. In particular, the uniformity condition on composition operations [CCHM18, Definition 13], which allows one to avoid the non-constructive aspects of the classical notion of Kan filling [BC15], becomes automatic when the operations are formulated internally. Our approach has the usual benefit of axiomatics – helping to clarify exactly which properties of a topos are sufficient to carry out each of the various constructions used to model cubical type theory [CCHM18], clearing the way for simplifications, generalisations and new examples.

To accomplish this, we find it helpful to work not in the higher-order predicate logic of toposes, but in an extensional type theory equipped with an impredicative universe of propositions

, standing for the subobject classifier of the topos 

[Mai05]. Working in such a language, our axiomatisation concerns two structures that a topos may possess: an object that is endowed with some elementary characteristics of the unit interval; and a subobject of propositions whose elements we call cofibrant propositions and which determine the subobjects that are relevant for a Kan-like notion of filling. (In the case of [CCHM18], classifies subobjects generated by unions of faces of hypercubes.) Working internally with cofibrant propositions rather than externally with a class of cofibrant monomorphisms leads to an appealingly simple notion of fibration (Section 5), with that of Cohen et al as an instance when the topos is . These fibrations are type-families equipped with extra structure (composition operations) which are supposed to model intensional Martin-Löf type theory, when organised as a Category with Families (CwF) [Dyb96], say. In order that they do so, we make a series of postulates about the interval and cofibrant subobjects that are true of the presheaf model in [CCHM18]. An overview of these postulates is given in Section 3, followed in subsequent sections by constructions in the CwF of fibrations that show it to be a model of Martin-Löf type theory with , , data types (we just consider the natural numbers and disjoint unions) and intensional identity types. In section 6 we give an internal treatment of glueing, needed for constructions relating to univalence [Uni13]. Our approach to glueing is a bit different from that in [CCHM18] and enables us to isolate a strictness property of cofibrant propositions (axiom in Figure 1) independently of glueing, as well as separating out the use of the fact that cofibrant predicates are closed under universal quantification over the interval (axiom in Figure 1). In section 7 we give a result about univalence that is provable from our axioms. However, for reasons discussed at the end of that section, one cannot give an internal account of the univalent universe construction from [CCHM18]. (This problem is circumvented in [LOPS18] by extending the internal type theory with a suitable modality.)

In Section 8 we indicate why the model in [CCHM18] satisfies our axioms and more generally which other presheaf toposes satisfy them. There is some freedom in choosing the subobject of cofibrant propositions; and the connection algebra structure we assume for the interval (axioms and in Figure 1) is weaker than being a de Morgan algebra, since we can avoid the use of a de Morgan involution operation. In Section 9 we conclude by considering other related work.

Agda formalisation

The definitions and constructions we carry out in the internal type theory of toposes are sufficiently involved to warrant machine-assisted formalisation. Our tool of choice is Agda [Agd]. We persuaded it to provide an impredicative universe of mere propositions [Uni13, Section 3.3] using a method due to Escardo [Esc15]. This gives an intensional, proof-relevant version of the subobject classifier and of the type theory described in Section 2. To this we add postulates corresponding to the axioms in Figure 1. We also made modest use of the facility for user-defined rewriting in recent versions of Agda [CA16], in order to make the connection algebra axioms and definitional, rather than just propositional equalities, thereby eliminating a few proofs in favour of computation. Using Agda required us to construct and pass around proof terms that are left implicit in the paper version; we found this to be quite bearable and also invaluable for getting the details right. Our development can be found at https://doi.org/10.17863/CAM.21675.

2 Internal Type Theory of a Topos

We rely on the categorical semantics of dependent type theory in terms of categories with families (CwF) [Dyb96]. For each topos (with subobject classifier ) one can find a CwF with the same objects, such that the category of families at each object is equivalent to the slice category . This can be done in a number of different ways; for example [Pit00, Example 6.14], or the more recent references [KL16, Section 1.3][LW15] and [Awo16], which cater for categories more general than a topos (and for contextual/comprehension categories rather than CwFs in the first two cases). Using the objects, families and elements of this CwF as a signature, we get an internal type theory along the lines of those discussed in [Mai05], canonically interpreted in the CwF in the standard fashion [Hof97]. We make definitions and postulates in this internal language for using a concrete syntax inspired by Agda [Agd]. Dependent function types are written as ; their canonical terms are function abstractions, written as . Dependent product types are written as ; their canonical terms are pairs, written as . In the text we use this language informally, similar to the way that Homotopy Type Theory is presented in [Uni13]. For example, the typing contexts of the judgements in the formal version, such as , become part of the running text in phrases like “given , and , then…”

In the internal type theory the subobject classifier of the topos becomes an impredicative universe of propositions, with logical connectives (), quantifiers () and equality () satisfying function and proposition extensionality properties. The universal property of the subobject classifier gives rise to comprehension subtypes: given , then is a type whose terms are those for which is provable, with the proof being treated irrelevantly.111Our Agda development is proof relevant, so that terms of comprehension types contain a proof of membership as a component. Taking to be terminal, for each we have a type whose inhabitation corresponds to provability of :

(1)

We will make extensive use of these types in connection with the partial elements of a type; see Section 5.1.

Instead of quantifying externally over the objects, families and elements of the CwF associated with , we will assume comes with an internal full subtopos . In the internal language we use as a Russell-style universe (that is, if , then itself denotes a type) containing and closed under forming products, exponentials and comprehension subtypes.

3 The axioms

In this section we present the axioms that we require to hold in the internal type theory of a topos . We provide an overview of each axiom, giving some intuition as to its purpose and we explain where it is used in the construction of a model of cubical type theory. This allows us to see that certain axioms are only required for modelling specific parts of cubical type theory, for example definitional identity types (Section 5.3). These axioms can therefore be dropped when, for example, looking for models of cubical type theory with only propositional identity types (Section 4). For ease of reference the axioms are collected together in Figure 1, written in the language described in Section 2.

Notation (Infix and implicit arguments).

In the figure and elsewhere we adopt a couple of useful notational conventions from Agda [Agd]. First, function arguments that are written with infix notation are indicated by the placeholder notation “”; for example applied to is written . Secondly, we use the convention that braces {} indicate implicit arguments; for example, the application of in Figure 1 to , , and is written , or if cannot be deduced from the context.

The interval is connected

has distinct end-points

and a connection algebra structure


Cofibrant propositions (where )
include end-point-equality

and are closed under binary disjunction

dependent conjunction

and universal quantification over


Strictness axiom: any cofibrant-partial type
that is isomorphic to a total type everywhere that is defined,
can be extended to a total type that is isomorphic to :

Figure 1: The axioms

The homotopical approach to type theory [Uni13] views elements of identity types as paths between the two elements being equated. We take this literally, using paths in the topos that are morphisms out of a distinguished object , called the interval. Recall from Section 2 that we assume the given topos comes with a Russell-style universe . We assume that the interval is an element of . We also assume that is equipped with morphisms and satisfying axioms in Figure 1. The other axioms () concern cofibrant propositions, which are used in Section 5 to define fibrations, the (indexed families of) types in the model of cubical type theory.

Axiom  expresses that the interval is internally connected, in the sense that any decidable subset of its elements is either empty or the whole of . This implies that if a path in an inductive datatype has a certain constructor form at one point of the path, it has the same form at any other point. This is used at the end of Section 5.2 to show that the natural number object in the topos is fibrant (that is, denotes a type) and that fibrations are closed under binary coproducts. It also gets used in proving properties of the glueing construct in Section 6. Together with axiom , connectedness of implies that there is no path from to in and hence that the path-based model of Martin-Löf type theory determined by the axioms is logically non-degenerate.

Axioms and endow with a form of connection algebra structure [BM99]. They capture some very simple properties of the minimum and maximum operations on the unit interval of real numbers that suffice to ensure contractibility of singleton types (Section 4) and, in combination with , and , to define path lifting from composition for fibrations (see Section 5.2). In the model of [CCHM18] the connection algebra structure is given by the lattice structure of the interval, taking to be binary meet, to be binary join and using the fact that and are respectively least and greatest elements.

[De Morgan involution] In the model of [CCHM18] is not just a lattice, but also has an involution operation (so that ) making the de Morgan dual of , in the sense that . Although this involution structure is convenient, it is not really necessary for the constructions that follow. Instead we just give a -version and a -version of certain concepts; for example, “composing from to ” as well as “composing from to ” in Section 5.2.

Axioms allow us to show that fibrations provide a model of - and -types; and furthermore to show that the path types determined by the interval object (Section 4) satisfy the rules for identity types propositionally [CD13, van16]. Axiom  is used to get from these propositional identity types to the proper, definitional identity types of Martin-Löf type theory, via a version of Swan’s construction [Swa16]; see Section 5.3.

In Section 7 we consider univalence [Uni13, Section 2.10] – the correspondence between type-valued paths in a universe and functions that are equivalences modulo path-based equality. To do so, we first give in Section 6 a non-strict, “up-to-isomorphism” version of the glueing construct of Cohen et al in the internal type theory of the topos. Axiom  is used in the definition of this weak form of glueing to ensure that the induced fibration structure extends the fibration structure on the family that we are “glueing”. Axiom  allows us to regain the strict form of glueing used by Cohen et al [CCHM18]. Its validity in presheaf models depends on a construction in the external meta-theory that cannot be replicated internally; see Theorem 8.2 for details.

4 Path Types

Given , we call elements of type paths in . The path type associated with is where

(2)

Can these types be used to model the rules for Martin-Löf identity types? We can certainly interpret the identity introduction rule (reflexivity), since degenerate paths given by constant functions

(3)

satisfy . However, we need further assumptions to interpret the identity elimination rule, otherwise known as path induction [Uni13, Section 1.12.1]. Coquand has given an alternative (propositionally equivalent) formulation of identity elimination in terms of substitution functions and contractibility of singleton types ; see [BCH14, Figure 2]. The connection algebra structure gives the latter, since using and we have

(4)

However, to get suitably behaved substitution functions we have to consider families of types endowed with some extra structure; and that structure has to lift through the type-forming operations (products, functions, identity types, etc). This is what the definitions in the next section achieve.

5 Cohen-Coquand-Huber-Mörtberg (CCHM) Fibrations

In this section we show how to generalise the notion of fibration introduced in [CCHM18, Definition 13] from the particular presheaf model considered there to any topos with an interval object as in the previous sections. To do so we use the notion of cofibrant proposition from Figure 1 to internalise the composition and filling operations described in [CCHM18].

5.1 Cofibrant propositions

Kan filling and other cofibrancy conditions on collections of subspaces have to do with extending maps defined on a subspace to maps defined on the whole space. Here we take “subspaces of spaces” to mean subobjects of objects in toposes. Since subobjects are classified by morphisms to , it is possible to consider collections of subobjects that are specified generically by certain propositions. More specifically, given a property of propositions, , we get a corresponding collection of propositions

(5)

Consider the class of monomorphisms whose classifying morphism

factors through . We call such monomorphisms cofibrations. Kan-like filling properties have to do with when a morphism can be extended along a cofibration . Instead, working in the internal language of , we will consider when partial elements whose domains of definition are in can be extended to totally defined elements. Recall that in intuitionistic logic, partial elements of a type are often represented by sub-singletons, that is, by functions satisfying

However, it will be more convenient to work with an extensionally equivalent representation as dependent pairs and , as in the next definition. The proposition is the extent of the partial element; in terms of sub-singletons it is equal to .

[Cofibrant partial elements, ] We assume we are given a subobject satisfying axioms in Figure 1. We call elements of type cofibrant propositions. Given a type , we define the type of cofibrant partial elements of to be

(6)

An extension of such a partial element is an element together with a proof of the following relation:

(7)

Note that by taking in axiom we have (that is, ) and ; and combining the latter with axiom we deduce also that holds. So and are always cofibrations, where is the initial object. Since holds, for every there is a total cofibrant partial element with the unique element that extends . Since holds, every object has an empty cofibrant partial element given by such that every is an extension of . (For any , denotes the unique function given by initiality of .)

It is helpful to think of variables of type as names of dimensions in space, so that working in a context corresponds to working in dimensions. Assume that we are working in a context with ; this therefore corresponds to working in three dimensions. We think of an element as a cube in the space , as shown below. Let . From we have . We think of as specifying certain faces and edges of a cube, in this case the bottom face (), the left face () and the front-right edge (), as in the right-hand picture below. Then a cofibrant partial element can be thought of as a partial cube, only defined on the region specified by .

[Join of compatible partial elements] Say that two partial elements and are compatible if they agree wherever they are both defined:

(8)

In that case we can form their join , such that

To see why, consider the following pushout square in the topos:

The outer square commutes because holds and then is the unique induced morphism out of the pushout. Note that axiom in Figure 1 implies that the collection of cofibrant partial elements is closed under taking binary joins of compatible partial elements.

The following lemma gives an alternative characterization of axioms  and . Since we noted above that holds, part (i) of the lemma tells us that cofibrations form a dominance in the sense of synthetic domain theory [Ros86]; we only use this property of in order to construct definitional identity types from propositional identity types (see Section 5.3).

  • Axiom is equivalent to requiring the class of cofibrations to be closed under composition.

  • Axiom is equivalent to requiring the class of cofibrations to be closed under exponentiation by .

Proof.

For part (i), first suppose that holds and that and are cofibrations. So both and hold and we wish to prove . Note that for and

So for and , we have and . Therefore by we get , which is equal to since . So we do indeed have .

Conversely, suppose cofibrations are closed under composition and that satisfy and . That holds is equivalent to the monomorphism being a cofibration; and since

from we get and hence the monomorphism is a cofibration. Composing these monomorphisms, we have that is a cofibration, that is, holds.

For part (ii), first suppose that holds and that is a cofibration. We have to show that is also a cofibration. Given we have

(since is a monomorphism)
(by unique choice in the topos)

so that is equal to ; and the latter is equal to by function extensionality in the topos. Since is a cofibration, for each we have . Hence by axiom  we also have , that is, , as required for to be a cofibration.

Conversely, suppose cofibrations are closed under and that satisfies . The latter implies that is a cofibration. Hence so is the monomorphism . Since is in the image of this monomorphism iff holds, we have , as required for axiom . ∎

5.2 Composition and filling structures

Axioms in Figure 1 give the simple properties of cofibrant propositions we use to define an internal notion of fibration generalising Definition 13 of [CCHM18] and to show that it is closed under forming -, - and -types, as well as basic datatypes.

Given an interval-indexed family of types , we think of elements of the dependent function type as dependently typed paths. We call elements of type cofibrant-partial paths. Given , we can evaluate it at a point of the interval to get a cofibrant partial element :

(9)

An operation for filling from in takes any and any with and extends to a dependently typed path with . This is a form of uniform Homotopy Extension and Lifting Property (HELP) [May99, Chapter 10, Section 3] stated internally in terms of cofibrant propositions rather than externally in terms of cofibrations. A feature of our internal approach compared with Cohen et al is that their uniformity condition on composition/filling operations [CCHM18, Definition 13], which allows one to avoid the non-constructive aspects of the classical notion of Kan filling [BC15], becomes automatic when the operations are formulated in terms of the internal collection of cofibrant propositions.

For some intuition as to why such an operation is referred to as filling, consider the following example. For simplicity, assume that is a constant family . Recall that we think of variables of type as dimensions in space; so that, given an element in an ambient context , we think of as a square in the space . We are interested in extending this two dimensional square to a three dimensional cube as indicated below.

However, let us imagine that we already know how to extend on certain faces and edges of the cube, for example, on the faces/edges specified by . This means that we have a cofibrant partial path which agrees with where they are both defined, that is . Note that is a partial path rather than partial element because, on the faces/edges where it is defined, it must be defined at all points along the new dimension by which we are extending , i.e. cannot depend on this new dimension. A filling for this data is a cube which agrees with the faces/edges that we started with. That is, it extends and agrees with at the base of the cube: and .

Since we are not assuming any structure on the interval for reversing paths (see Remark 1), we also need to consider the symmetric notion of filling from . Let

(10)

Note that because of axiom , this is isomorphic to the object of Booleans, and hence there is a function

(11)

satisfying and . In what follows, instead of using path reversal we parameterise definitions with and use (11) to interchange and .

[Filling structures]

Given , the type of filling structures for an -indexed families of types , is defined by:

(12)

A notable feature of [CCHM18] compared with preceding work [BCH14] is that such filling structure can be constructed from a simpler composition structure that just produces an extension at one end of a cofibrant-partial path from an extension at the other end. We will deduce this using axioms from the following, which is the main notion of this paper.

[CCHM fibrations] A CCHM fibration over a type is a family equipped with a fibration structure , where is defined by

(13)

Here is the type of composition structures for -indexed families:

(14)

Unwinding the definition, if then satisfies that for each cofibrant partial path over a path , if extends the partial element , i.e. , then extends , i.e. ; and similarly for .

[The CwF of CCHM fibrations] Let be the type of CCHM fibrations over an object , defined by

(15)

CCHM fibrations are closed under re-indexing: given and , we get a function defined by . Therefore we get a function given by

(16)

which is functorial: and . It follows that has the structure of a Category with Families by taking families to be CCHM fibrations over each and elements of such a family to be dependent functions in .

[Fibrant objects] We say is a fibrant object if we have a fibration structure for the constant family over the terminal object . Note that if is a fibration, then for each the type is fibrant, with the fibration structure given by reindexing by the map . However the converse is not true: having a family of fibration structures, that is, an element of , is weaker than having a fibration structure for . To see why, consider the family, defined by

(17)

For each the fibre is a fibrant object, with a fibration structure, , given by . However, it is not possible to construct a . For if it were, then we could define ; combined with , this would lead to contradiction.

If , then and so every filling structure gives rise to a composition structure. Conversely, the composition structure of a CCHM fibration gives rise to filling structure:

[Filling structure from composition structure] Given , , , and , there is a filling structure that agrees with at , that is:

(18)

Furthermore, is stable under re-indexing in the sense that for all and

(19)
Proof.

The construction of filling from composition follows [CCHM18, Section 4.4], but just using the connection algebra structure on (axioms and ), rather than a de Morgan algebra structure. Suppose , , , , , , , with , and . Then using Definition 5.1 we can define

(20)

where

and where is given by and . Finally, property (19) is immediate from definitions (16) and (20). ∎

Compared with [BCH14], the fact that filling can be defined from composition considerably simplifies the process of lifting fibration structure through the usual type-forming constructs, as the following two theorems demonstrate. Their proofs are internalisations of those in [CCHM18, Section 4.5], except that we avoid the use Cohen et al make of de Morgan involution.

[Fibrant -types] There is a function

(21)

where . The function is stable under re-indexing, in the sense that for all

(22)

Hence the category with families given by CCHM fibrations supports the interpretation of -types [Hof97, Definition 3.18].

Proof.

The construction of makes use of the filling operation from Lemma 5.2. Given , , , , , , , , and with , define

(23)

where

Thus ; and since

hold, it follows that

Hence . Finally, property (22) follows from (19) and (23). ∎

[Fibrant -types] There is a function

(24)

where . This function is stable under re-indexing (cf. 22) and hence the category with families given by CCHM fibrations supports the interpretation of -types [Hof97, Definition 3.15].

Proof.

Given , , , , , , , , , with and , using Lemma 5.2 we define