Types Are Internal Infinity-Groupoids Antoine Allioux, Eric Finster, Matthieu Sozeau
Total Page:16
File Type:pdf, Size:1020Kb
Types are internal infinity-groupoids Antoine Allioux, Eric Finster, Matthieu Sozeau To cite this version: Antoine Allioux, Eric Finster, Matthieu Sozeau. Types are internal infinity-groupoids. 2021. hal- 03133144 HAL Id: hal-03133144 https://hal.inria.fr/hal-03133144 Preprint submitted on 5 Feb 2021 HAL is a multi-disciplinary open access L’archive ouverte pluridisciplinaire HAL, est archive for the deposit and dissemination of sci- destinée au dépôt et à la diffusion de documents entific research documents, whether they are pub- scientifiques de niveau recherche, publiés ou non, lished or not. The documents may come from émanant des établissements d’enseignement et de teaching and research institutions in France or recherche français ou étrangers, des laboratoires abroad, or from public or private research centers. publics ou privés. Types are Internal 1-groupoids Antoine Allioux∗, Eric Finstery, Matthieu Sozeauz ∗Inria & University of Paris, France [email protected] yUniversity of Birmingham, United Kingdom ericfi[email protected] zInria, France [email protected] Abstract—By extending type theory with a universe of defini- attempts to import these ideas into plain homotopy type theory tionally associative and unital polynomial monads, we show how have, so far, failed. This appears to be a result of a kind of to arrive at a definition of opetopic type which is able to encode circularity: all of the known classical techniques at some point a number of fully coherent algebraic structures. In particular, our approach leads to a definition of 1-groupoid internal to rely on set-level algebraic structures themselves (presheaves, type theory and we prove that the type of such 1-groupoids is operads, or something similar) as a means of presenting or equivalent to the universe of types. That is, every type admits encoding higher structures. Internally to type theory, however, the structure of an 1-groupoid internally, and this structure is we do not have recourse to such techniques. Indeed, without unique. further hypotheses, we do not expect that even the most basic structures of the theory, type themselves, are presented by set- I. INTRODUCTION level structures. This leaves us in a strange position: absent Homotopy Type Theory has brought a new perspective to a theory of algebraic structures, we have nothing to use to intensional Martin-Lof¨ type theory: the higher identity types encode algebraic structures! of a type endow it with the structure of an 1-groupoid, and We suggest that a possible explanation for this phenomenon ideas from homotopy theory provide us with a means to predict is the following: contrary to our experience with set-level and understand the resulting tower of identifications. While mathematics, where an algebraic structure (i.e. a “structured this perspective has been enormously clarifying with respect set”) can itself be defined just in terms of sets: underlying to our understanding of the notion of proof-relevant equality, sets, functions, sets of relations and so on, when we pass to leading, as it has, to a new class of models as well as new the world of homotopy theoretic mathematics, the notion of computational principles, a number of difficulties remain in type and structured type are simply no longer independent order to complete the vision of type theory as a foundation of each other in the same way. Consequently, some primitive for a new, structural mathematics based on homotopy-theoretic notion of structured type must be defined at the same time as and higher categorical principles. the notion of type itself. The present work is a first attempt at Foremost among these difficulties is the following: how does rendering this admittedly somewhat vague idea precise. one describe a well behaved theory of algebraic structures We begin by imagining a type theory which, in addition on arbitrary types? The fundamental difficulty in setting up to defining a universe U of types, defines at the same time such a theory is that, in a proof relevant setting, nearly all a universe S of structures. Of course, we will need to be of the familiar algebraic structures (monoids, groups, rings, somewhat more precise about what exactly we mean by struc- and categories, to take a few) become infinitary in their ture. Category theory suggests that one way of representing a presentation. Indeed, the axioms of these theories, which take structure is by the monad on U which it defines, so we might the form of a finite list of mere properties when the underlying think of S as a universe of monads. In practice, however, it types are sets, constitute additional structure when they are no will be useful to restrict to a particularly well behaved class of longer assumed to be so. Consequently, in order to arrive at a monads, having reasonable closure properties, and for which well-behaved theory, the axioms themselves must be subject we have a good understanding of their higher dimensional to additional axioms, frequently referred to generically as counterparts. We submit that a reasonable candidate for such a “coherence conditions”. In short, in a proof relevant setting, it well-behaved collection is that class of polynomial monads [1]. no longer suffices to describe the equations of an algebraic We feel that this is an appropriate class of structures for structure at the “first level” of equality. Rather, we must a number of reasons. A first reason is that this class of specify how the structure behaves throughout the entire tower monads arises quite naturally in type theory already: indeed, of identity types, and this is an infinite amount of data. How a large literature exists on the interpretation of inductive do we organize and manipulate this data? and coinductive types as initial algebras and terminal coal- Similar problems have arisen in the mathematics of homo- gebras for polynomial monads, and we consider our work as topy theory and higher category theory, and many solutions deepening and extending this connection. Furthermore, this and techniques are known. Somewhat bafflingly, however, all class of algebraic structures enjoys some pleasant properties which make them particularly amenable to “weakening”. For homotopical interpretation of type theory asserts that types example, the very general approach to weakening algebraic should “be” 1-groupoids, it seems natural to compare these structures developed by Baez and Dolan in [2] can be smoothly two objects. Our main result is the following: adapted to the polynomial case. While the cited work employs Theorem 1. There is an equivalence the language of symmetric operads, connections with the theory of polynomial functors were already described in [3], U ' 1-Grp and moreover, recent work [4] has shown that in type theory, In other words, every type admits the structure of an 1- we should expect symmetric operads to in fact be subsumed groupoid in our sense, and that structure is unique. This by the theory of polynomial monads. theorem, therefore, can be regarded as a (constructive) in- The central intuition of Baez and Dolan’s approach, is ternalization of the intuition provided by the various meta- that each polynomial monad M determines its own higher theoretic results to this effect [6], [7]. dimensional collection of shapes (the M-opetopes) generated directly from the syntactic structure of its terms. They go A. Preliminaries on to introduce the notion of an M-opetopic type which The basis of our metatheory is the type theory implemented is, roughly, a collection of well formed decorations of these in Agda [8] which is an extension of the predicative part of shapes, and the notion of weak M-algebra is then defined as an Martin-Lof¨ type theory [9]. Among the particular types that M-opetopic type satisfying certain closure properties. In this Agda implements, we shall use inductive types, records and sense, their approach differs from, say, approaches based on coinductive records. simplices, cubes or spheres in that the geometry is not fixed As such, we adopt a style similar to Agda code, writing ahead of time, but adapted to the particular structure under (x : A) ! B x for the dependent product (although we oc- consideration. Q casionally also employ the (x:A) B x notation if it improves With these considerations in mind, our plan in the present readability). We also make use of the implicit counterpart of work is to put the idea of a type theory with primitive the dependent products, written fx : Ag ! B x. This allows structures to the test. What might it look like, and what might us to hide arguments which can be inferred from the context it be able to prove? In order to answer these questions, we and hence clarify our notation. Non-dependant functions are 1 will build a prototype of the theory in the proof assistant denoted A ! B, as usual. Functions enjoy the usual η Agda, and exploit the recent addition of rewrite rules [5], conversion rule. which permit us to extend definitional equality by new well- We shall make extensive use of coinductive record types, 2 typed reductions. Concretely, we will introduce a universe M, as well as copatterns for producing elements of these types. whose elements we think of as codes for polynomial monads We write > for the empty record with a constructor tt : >. and describe the structures they decode to. Because we think P We write (x:A) B x for the dependent sum as a record with of the objects of the universe M as primitives of our theory, constructor ; and projections fst and snd . Pairs which are on the same level as types, we allow ourselves the freedom to not dependant are denoted A × B. prescribe their computational behavior: in particular, we will We write ? for the empty type, using absurd patterns where equip them with definitional associativity and unit laws.