
Three extensional models of type theory Benno van den Berg ∗ October 12, 2007 1 Introduction Martin-L¨of’s type theory1 exists in two forms, differing in the formalisation of the identity types. In [15] Per Martin-L¨offormulated his type theory with the extensional rules for the identity types, identifying judgmental and propo- sitional equality. This rendered type-checking and well-formedness of formulas undecidable. For this reason (among others2), he latter formulated intensional rules for the identity type that do preserve the decidability of type-checking and well-formedness of formulas. For this reason, the intensional version is adopted by most implementations. While the type theory with intensional identity fares better as a program- ming language, it has drawbacks from the point of formalising constructive mathematics. In the first place, intensional type theory does not identify exten- sionally equal functions, while in mathematics one traditionally adopts a thor- oughly extensional point of view. Secondly, the type theory lacks the ability to build quotients, i.e., one cannot redefine the notion of equality on a certain type. As building quotients is also common practice in the life of the mathematician, this presents another problem for formalising constructive mathematics. In the words of Martin Hofmann, intensional type theory lacks extensional constructs. To overcome this problem, Hofmann introduced the notion of setoid [9]. In a manner reminiscent of the distinction made by Bishop between presets and sets, he considers besides the “pure types”, the types that come equipped with an intrinsic notion of equality given by the equality rules, also setoids which are types together with new notion of equality given by a definable equivalence rela- ∗Technische Universit¨atDarmstadt, Fachbereich Mathematik, Schlossgartenstr. 7, 64289 Darmstadt, Germany. [email protected]. 1 In this paper we think of type theory as being formulated with Π, Σ, ×, +, 0, 1, N,W and equality rules, but without universes. This theory is usually called MLW. 2For example, extensional type theory refutes Church’s Thesis. This is a rather surprising, perhaps even undesirable, feature of a system that was meant to serve as a foundation for constructive mathematics. 1 tion.3 As shown by Hofmann, in this way one can overcome both problems: the setoids model extensionality of functions, and allow one to build good quotients. Despite the name, also extensional type theory lacks some extensional con- structs. It identifies extensionally equal functions, but it does not always allow one to build quotients. But also this problem can be overcome by considering setoids, but this time over extensional type theory. From a categorical point of view this can be understood as follows. The fact that the setoids allow one to build “good” quotients means precisely that the category of setoids forms a category that has quotients of equivalence relations that are effective. In other words, the category is exact. In fact, the idea of building setoids is similar to taking the exact completion (as Hofmann points out himself). The exact completion is the universal way (in the appropriate, that means: 2-categorical, sense) of making a cartesian category exact. So in both the intensional and extensional case the category of setoids is not just a category that allows one to model (dependent) product and sum types and inductive types (i.e., is a ΠW -category in the terminology of this paper), but is also exact. So in effect it is a ΠW -pretopos as we will call it, following [17]. This paper compares the free ΠW -pretopos with the two categories of se- toids. It sounds reasonable to think that these categories have to be very close. For also the free ΠW -pretopos is basically a “syntactic” object: just as the free group or ring, it is built from terms from the appropriate language, identifying those terms that are provably equal in the theory. And this is what makes the main result of the paper so surprising: Theorem 1.1 The free ΠW -pretopos, the setoids over intensional type theory and the setoids over extensional type theory are pairwise non-equivalent cate- gories. We will prove this result by comparing the amount of choice that is available in each of these categories. In categorical language, we will compare the projectives in these categories, both the internal and external ones. Identifying the projectives in the two categories of setoids is comparatively easy using the theory of exact completions. Therefore the larger portion of the paper is concerned with studying the projectives in the free ΠW -pretopos. Here the starting point is a result by Carboni who showed (in [4]), by combining glueing with exact completion, that the finite types are (externally) projective in the free locally cartesian closed pretopos.4 We extend this result by showing that this holds for the free ΠW -pretopos as well, the novelty being that the 3Actually, Hofmann works with partial equivalence relations. I am told this is immaterial. [I have to think about this.] 4By the finite types, we mean the objects in the finite type hierarchy over the natural numbers, like N, N × N, NN, etcetera. 2 argument works in the presence of inductive types (in the form of W-types) as well. The contents of this paper as therefore as follows: in Section 2 we will briefly recapitulate the theory of W-types in a categorical context as it appeared in the work of Moerdijk and Palmgren [17]. For these W-types we derive two stability properties: in Section 3 we will show that W-types are stable under glueing,5 making use of the theory of “dependent polynomial functors” developed by Gambino and Hyland [7].6 In Section 4 we introduce the notion of exact com- pletion, discuss its salient properties and prove stability of W-types under exact completion. The latter result was essentially contained in the author’s paper [1], but – unfortunately – not explicitly pointed out there. In Section 5 we prove that in the free ΠW -pretopos all finite types are externally projective, while they are not all internally projective (the latter follows from a folklore fact in the metamathematics of intuitionism). This is used to compare the free ΠW - pretopos with the two categories of setoids, where the situation is shown to be different. It also follows from this comparison that the two categories of setoids are distinct. Finally, we have added an appendix that recalls a few categorical definitions. Acknowledgments: the results reported in this paper were obtained when the author was a PhD student in Utrecht visiting Sweden, and have also ap- peared as a part of his PhD thesis [2]. He would like to thank his supervisor Ieke Moerdijk for valuable assistance, and his hosts in G¨oteborg and Uppsala, Thierry Coquand, Peter Dybjer and Erik Palmgren, as well as Per Martin-L¨of, for generously spending their time discussing type theory. The author would also like to thank Thomas Streicher for helping him out on an essential point, and he gratefully acknowledges the receipt of a travel grant from NWO which allowed him to visit Sweden. 2 W-types Convention: Throughout the paper E will denote a ΠN-category: a locally cartesian closed category with disjoint sums and a natural numbers object. Since the work of Seely [19] we know that Martin-L¨oftype theory can be interpreted in a ΠN-category E (later problems related to substitution were found, for which there exist several solutions, see [8, 11]). The interpretation of the dependent types relies on the fact that for any map f: Y / X in such a category E the pullback functor f ∗: C/X / C/Y 5For glueing along the global sections functor to Sets, this was already proved in [17]. We expect the general result to be useful in the context of Algebraic Set Theory as well (see [3]). 6This is related to the type-theoretic account of general trees due to Petersson and Synek [18]. 3 has both adjoints. The left adjoint Σf is given by composition and interprets the dependent sums, while the right adjoint Πf which derives from the lccc structure of E interprets the dependent products. In [17] this interpretation was extended by Moerdijk and Palmgren to cover the W-types as well. Because their interpretation might be less familiar, and W-types play such a prominent rˆole in this paper, we will discuss them in this section. In type theory, W-types are thought of as inductively generated sets. One can either think of them as free term algebras over a signature, or sets of well- founded trees with a labelling of a particular kind. (It should be pointed out that there are sets which deserve to be called inductively generated, but are not of this form. We refer to [6] for a broader framework for inductive definitions in type theory.) Categorically, a W-type is an instance of an initial algebra. We recall the general definition. Definition 2.1 An algebra for an endofunctor T : E / E consists of an object X in E together with a structure map x: TX / X. These T -algebras form a category, with morphisms from (X, x: TX / X) to (Y, y: TY / Y ) given by arrows p: X / Y in E such that the square T p TX / TY x y / X p Y commutes. Whenever it exists, the initial object in this category will be called the initial T -algebra. W-types are initial algebras for polynomial functors. Definition 2.2 For any map f: Y / X in E, the polynomial functor Pf asso- ciated to f is defined as the composite ∗ Y Πf ΣX E / E/Y / E/X / E.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages19 Page
-
File Size-