Presentations and Representations in Foundations
Posted by Mike Shulman
I’ve had several requests to write more introductory posts on type theory like the last one. Today I’m going to give it a go by adapting my notes from a talk I just gave here at IAS. So rather than trying to continue directly from the last post, today we’ll take a different tack. Namely, suppose we were designing a new foundational system from scratch. This system will probably be about some kind of “basic objects”, and it’ll probably also include some ways to construct such objects (often using other given objects as data). The question is, how do we describe or characterize these constructions?
To help get an idea what our options might be, let’s think about the structures we see arising in set-based mathematics. As an example, I’ll consider one familiar sort of structure: groups.
One way to describe or construct a group is what I’ll call the explicit approach: we say precisely what its elements are and what the group structure is. This might take the form of a multiplication table. But more generally, I’ll call a description “explicit” if it is as explicit as its inputs. For instance, the product of two groups can be defined to have elements ordered pairs with and , and multiplication defined by ; this is fully explicit in terms of the structure of and .
A characteristic of an explicit description is that the different “parts” of the structure can be defined more or less separately (subject to the rules governing the structure). For instance, if happens to act on in a specified way, then the set of ordered pairs can be given a different group structure , yielding the semidirect product .
A different way to describe or construct a group is with a presentation, consisting of some “generating” elements and equations. An explicit description can be converted into a presentation in a fairly trivial way, but the converse is not always true: the word problem for groups is not solvable in general. This may seem to make presentations less useful than explicit descriptions, but in fact lots of interesting and important structures are known best (or only) by presentations.
So, in building our foundational system, we might consider using either explicit descriptions or presentations as ways to construct objects. For instance, I think it’s reasonable to say that material set theories (like ZFC) mostly take the explicit approach. Material-sets are determined by their elements, and most of the axioms of material set theory tell us how to construct particular sets by specifying their elements (in terms of other sets we already have).
On the other hand, both of these approaches are very reductionist, depending on the fact that our objects (such as groups) are structured sets. Thus, neither is very promising if we’re looking for a foundational system whose basic objects are not sets. So what else might we consider?
Category theory suggests another fundamental way to describe objects: with universal properties. More precisely, we can characterize something by exhibiting it as a representing object for a functor. Since functors can be covariant or contravariant, we obtain two dual sorts of characterizations: “left” universal propreties and “right” universal properties. For instance, the cartesian product of groups can be characterized as a (right) representing object for the functor , while the tensor product of abelian groups can be characterized as a (left) representing object for the functor .
There are close connections between (1) right universal properties and explicit descriptions, and (2) left universal properties and presentations. The latter is familiar to a category theorist: the group presented by generators and relations is the coequalizer of the pair , where denotes the free group functor; this is precisely a left universal property. (Note, though, that this is not to say that this universal property is the same as the intuitive meaning of a “presentation” in the sense of “all the elements are obtained by applying the operations to subject to relations ”.) Morever, many or most left universal properties can be expressed as presentations: for instance, this is the case for the tensor product.
On the other hand, in most “categories of structures”, we can extract an explicit description fairly easily from a right universal property—because of the presence of certain special objects with left universal properties. For instance, in the case of groups we have the free group on one generator, , such that is the underlying set of . It follows immediately that if is defined using the (right) universal property of a product, then its underlying set must be the cartesian product of those of and ; and so on. Many explicit descriptions can be expressed as right universal properties, but sometimes this is tricky; for instance, what is the universal property of the semidirect product? (There are answers; I’m just saying they are less obvious, and in other cases they may be even harder.)
So, returning to our foundational system, we might alternatively consider expressing constructions in terms of universal properties. This is pretty clearly the choice made by structural set theories such as ETCS. In fact, the axioms of ETCS are usually expressed exactly in terms of universal properties in the category of sets.
If we’re hoping to free ourselves from sets, this approach is more promising, but it still has a drawback: universal properties are usually expressed in terms of (natural) bijections of hom-sets. ETCS deals with this by shifting the statement of universal properties into the ambient first-order logic. That is, instead of characterizing the product of sets by a natural bijection , we have instead axioms which say that “for every and , there exists a unique such that …”. While this does avoid circularity, it more or less forces the notions like “uniqueness” used in these universal properties to be those of the ambient first-order logic. Thus, if this logic is of the traditional sort, this means that there is still a “set-like” structure hanging around somewhere.
Fortunately, we can make one further improvement that helps resolve this problem. It’s well-known that in a closed category (perhaps monoidal, or cartesian, or whatever is appropriate), universal properties can usually be “internalized”. For instance, the exponential object in a cartesian closed category is characterized by natural isomorphisms
but this automatically implies that we also have isomorphisms of exponential objects
This latter property seems more amenable to being expressed in a foundational system without needing any ambient set-like structure. It’s a long way from there to actually finding such a foundational system, but fortunately the work’s already been done for us. Of course, as always, I’m talking about type theory.
In type theory, the basic objects are types and their elements. Traditionally, one thinks of types as being like sets, and that’s sometimes a very helpful guide when reasoning in type theory. However, the essential point today is that types don’t have to be like sets.
In order to explain how type theory expresses definitions by universal properties “internally”, I need to say something about how it handles variables. In set-theoretic foundations, if I have a variable and an expression involving , I can substitute any value for and the expression will then denote a resulting value. For instance, the expression denotes when I substitute for . Thus, an expression containing a free variable implicitly describes a “function” of sorts, from input values to output values.
This is also true in type theory, but because types might be more structured than sets are, an expression containing a free variable does not merely describe a function (between sets), but a morphism (between types). One way to think of this is that the “elements” of a type act more like generalized elements in category theory. Another way to think of it is that we should be able to “substitute” for a variable not just the “values” in its domain in the naive sense (e.g. the elements of the underlying set of a group), but also whatever structure there may be relating those values, to ensure that the “morphism” defined by any expression preserves that structure.
The practical upshot of this is that we can express rules for constructing types in terms of their “elements”, and then these rules will automatically characterize those types by a full universal property with respect to all “morphisms”. For instance, one of the rules for cartesian product types says that “if we have elements and , then we can form an element .” Since these elements and may involve free variables, this implies automatically that any pair of morphisms into and also yield a morphism into .
This should be contrasted with the treatment in material set theory, where is defined explicitly in terms of its elements , and in order to prove its universal property in the category of sets we have to say something like “given and , for any we have elements and , hence we can form the pair , and we define to send to .” The latter argument depends on knowing that sets “have no structure”; if we wanted to do the same thing in the category of groups, we would have to add an additional part verifying that is a group homomorphism. In type theory, all the extra structure that types might have is handled automatically by the interpretation of variables.
Nearly every rule for constructing types in type theory can be regarded as expressing a universal property. The division into “left” and “right” universal properties is referred to by type theorists as the division into “positive types” and “negative types”, and called generically “polarity”. In type-theoretic language, we say:
A negative type is characterized by giving the basic ways to use an element of it. For instance, the ways to use an element of are to extract its first or second component. The way to use an element of the function type is to apply it to an element of and obtain an element of .
Given these, it follows that the way to construct an element of such a type is to specify what happens when we use our putative element in all possible ways. For instance, the way to construct an element of is to specify its two components. And the way to construct an element of is to give a way to make an element of under the assumption of an element of , i.e. to give an expression of type containing a (new) free variable of type .
A positive type is characterized by giving the basic ways to construct parts of it. For instance, the ways to construct parts of the coproduct are to inject an element of , or to inject an element of . And the ways to construct a natural number are either to take , or to take the successor of some other natural number (this an example of a “properly recursive” inductive type, for which some of the ways to construct new elements involve having other elements of the same type).
Given these, it follows that the way to use an element of such a type is to specify what is to be done in all possible cases, depending on the ways that such an element might have been constructed. For instance, the way to use an element of is to divide into two cases, according to whether that element came from or from . And the way to use a natural number is to do a proof by induction, or a definition by recursion: we divide into two cases according to whether we have or a successor, and in the latter case we can assume we’ve already dealt with the predecessor natural number.
Recalling that “elements” of a type include the information of all “generalized elements”, I think it’s not too hard to see how the rule for constructing elements of, say, , express its universal property. Morphisms — that is, expressions of type containing a variable of type — are the same as morphisms — that is, expressions of type containing a variable of type in addition to the variable of type . (Hopefully it’s not too hard to believe that a variable of type is roughly the same as a variable of type and another variable of type . There’s a subtle issue here involving things called contexts, but I don’t want to get into it.) Moreover, because expressions with free variables are also how we construct elements of function types, we have immediately the internalized isomorphism . The other examples are similar.
There’s an important difference between positive and negative types, however, coming from the asymmetry that “(generalized) elements” are “maps in” rather than “maps out”. To describe a positive type, we give the basic “ways to construct elements”, but nothing requires that these be the only elements of the resulting type. For instance, if types are groups, then the coproduct type will be the free product of and , and this contains many more elements than those coming directly from or from . This is despite the fact that the coproduct type is a positive type whose “basic elements” are those coming from or from , and moreover that in order to use an element of it suffices to deal with the two cases when it comes from and when it comes from . In the types-are-groups world, there are more elements of than these, but because all constructions must respect group structure, anything we do with a variable of type is uniquely determined by what happens to the images of and .
(In case you’re wondering, yes, there is a type theory whose types are groups. The category of groups is regular, which is more than sufficient for it to have an internal type theory. This type theory doesn’t have as much structure as the ones we usually use as foundations for mathematics — for instance, there are no function types, since is not cartesian closed — but it’s a perfectly good type theory. Even more interesting is the category of abelian groups, whose internal type theory is a form of linear logic.)
I stress this point because there seems to be a common feeling among type theorists that “there should be nothing in an inductive (positive) type except what you put into it”. Probably this belief arises from thinking of types as like sets, where there are no “operations” in sight to make new stuff out of the generating stuff that you put in. But if types aren’t like sets, then all bets are off. Indeed, the great thing about type theory, as I’ve been saying, is that it frees us to consider theories whose basic objects aren’t set-like.
Now let’s bring in the homotopy theory. Suppose that we are higher category theorists, and we’d like a “natively higher-categorical” foundation for mathematics. To keep things easy, let’s look for a foundation whose basic objects are -groupoids — more precisely, for a type theory whose types behave like -groupoids. Surprisingly enough, it turns out that there’s not a whole lot of work to do: up to a point, plain old ordinary type theories can easily be interpreted as being about -groupoids rather than (say) sets.
The essential thing to note is that when we do this, the “morphisms” are automatically functors between our -groupoids, just as in the generic case discussed above. In particular, any expression with a free variable denotes a functorial operation. This is in harmony with what we would expect from a natively category-theoretic foundation of mathematics: everything you can do or say is automatically invariant (or, more precisely, “equivariant” or “covariant”) under equivalence.
One important new thing that we can add to this homotopy type theory is a new kind of positive type. The positive types in ordinary type theory are ones that make sense in any category, and are generally inspired by the category of sets (or other set-like categories). Since sets have only elements and nothing else, to give a presentation of a set is nothing but to give some elements and some equations between them.
However, -groupoids have all sorts of higher structure, so a “presentation” of an -groupoid can have “generators” of arbitrary dimension: not just points, but equivalences (or paths) between them, and higher equivalences between those, and so on. Moreover, when talking about weak -groupoids, as we generally do, we can omit the “relations” entirely, since quotienting (weakly) by a relation at level is the same as adding a generator of level . Thus, in homotopy type theory we should have positive types that correspond to presentations of this sort.
These are called higher inductive types and I think they are the most exciting thing in the world. (-: For instance, they give us a way to import all the “spaces” considered in classical homotopy theory into homotopy type theory, incarnated as type-theoretic presentations of their fundamental -groupoids. The higher inductive type generated by a single point and a single path from that point to itself represents (the fundamental -groupoid of) the circle, . We similarly have -dimensional spheres, tori, manifolds, CW complexes, etc. Moreover, fundamental homotopical constructions like truncation, suspension, localization, and stabilization can all be defined as higher inductive types. So we really do have a foundational system in which the “basic objects” are -groupoids — or homotopy types — and in which all the constructions that we want to do with them are available and characterized in a convenient way.
Let me end by introducing the famous identity type from this perspective. The classical sort of “inductive type” allows us to define not only single types, but dependent types, i.e. families of types indexed by some other type. For instance, for any type , there is a family of types indexed by the natural numbers, such that is the type of lists of elements of of length , i.e. , with factors. This family can be presented by (1) a single generator generator of , called the “empty list”, and (2) for each and each , a generator of , called the “cons” of and . This is a perfectly good (properly recursive) presentation, a.k.a. a positive type, which makes sense whether we regard types as sets or as -groupoids.
Identity types are another example of this sort of “inductively defined family”. Namely, given a fixed type and an element , the identity type is a family of types indexed by itself, which is presented by a single generator of , called . Now if types are like sets, then there are never any “operations” to think about, so there is nothing in a presented type except what we put into it: thus is empty unless and are the same and otherwise it contains only . But in other cases, of course, there is no reason to expect this to be true.
In particular, if types are -groupoids, then a dependent type over is a functor from to the -groupoid of -groupoids (the universe type). This is the only thing it could possibly be; remember I said that in homotopy type theory, everything is functorial. That means that the identity type is the functor which is freely generated by one element in . What is that? By the Yoneda lemma, it’s exactly the hom-functor . In topological language, this is the space of paths in starting at .
Thus, there is not really anything mysterious about of identity types, nor should it be surprising that — if we regard types as -groupoids — there is “more in the identity type” than we put into it, any more than it should be surprising that the free product of groups contains more elements than those coming directly from the two factor groups. Of course, it’s very important in working with the formal system of homotopy type theory that we have this “internalized” way to talk about the hom-functors, and so identity types naturally play a special role. But when you come down to it, they are just another sort of inductive (positive) type: a presentation of something with a left universal property.
Re: Presentations and Representations in Foundations
nice – you’ve made it clear how type theory and CT are two sides of the same coin: intro and elim rules (positive or negative) are essentially the same as universal properties (left or right). the point is that the constructions are determined by how they map into and out of other objects, rather than “what they are made of”.
now we just need to get the type theorists on board with the idea that a type is not just the collection of its closed terms.