Internalizing the External, or The Joys of Codiscreteness
Posted by Mike Shulman
This post is essentially a summary of a long discussion between Urs and myself about axiomatizing cohesive -toposes in homotopy type theory. But it should be accessible and interesting even if you don’t care about cohesive -toposes. I think it yields interesting general conclusions about internalization, type theory, higher modal logic, and the importance of codiscreteness.
Note that practically everything I’m going to say below has been formalized in Coq, and it can be found here.
Suppose we have a forgetful functor , and we want to speak about properties of this functor without “leaving the world of ”. (The example I particularly have in mind is when or and is the direct image functor of the global-sections geometric morphism for a topos or -topos.) A clear prerequisite for this is that we can somehow recover from data in or on , and an obvious way to do this is to assume that has either a monadic right adjoint or a comonadic left adjoint. For various reasons, including simplicity, let’s restrict to the case when these adjoints are fully faithful (so they equip with “discrete objects” or “codiscrete objects” in the sense used in my last post). Then it’s easy to describe and purely in terms of data on : we simply specify a reflective or coreflective subcategory.
However, now suppose we want to describe this in the internal logic of . Roughly speaking, the internal logic is a way of speaking about objects as if they were sets or spaces with “elements”, together with a way to “interpret” or “compile” such language into statements about in the usual language of category theory that uses generalized elements. For instance, an assertion in the internal language such as “for any and , there exists a unique such that …” compiles to the usual definition of a cartesian product: “for any and , there exists a unique such that … “.
In the internal logic of , therefore, the objects of act like sets (if is a 1-topos) or -groupoids (if is an -topos). The internal logic of a 1-topos is sometimes called its Mitchell-Benabou language, while the internal logic of an -topos is (conjecturally) homotopy type theory. From now on, I’ll use the language of the latter; so for instance “type” should be read as referring to an object of . (I’ll also slip into the implicit ∞-category theory convention, just because it would be way too cumbersome otherwise.)
Now how do we describe a reflective or coreflective subcategory internally? In the obvious approach, we just say what it means to belong to the subcategory, plus have an operation on the types which serves as the reflector/coreflector, together with a unit/counit satisfying a suitable universal property. In the reflective case, this means we have something like the following axioms.
- . This says that for any type , we have a proposition (expressing the assertion that is in our putative reflective subcategory).
- . This says that for any , we have another type (its reflection into the subcategory).
- . This says that for any , the type is in the subcategory.
- . This says that for any , we have a map .
- . This says that for any types and , where is in the subcategory, precomposing with yields an equivalence between and .
However, assuming that our type theory has dependent types, an operation on types specified in the internal logic in this way actually gives us more than merely an operation on objects of (which is what we had in mind). This is because any operation we have in type theory can automatically be applied in any context. Hence, not only can we say that for every type , we have a type , we can also say that for any dependent type we have another dependent type Since dependent types over represent objects in the slice category , a type-theoretic operation actually gives us an operation on every slice category of . This should make sense in terms of the vague description of the internal logic I gave above, once you realize that if a “generalized element of at stage ” means a morphism , then a “generalized object of the category at stage ” can only mean an object of the slice category .
Moreover, this operation on slice categories commutes with pullback, since the pullback of along and the -image of the pullback of along are both represented by the same dependent type: . If we additionally add axioms which appear to say that this operation a reflection or coreflection (as I did above for a reflection), then we are actually describing a reflective or coreflective subcategory of every slice category, for which the (co)reflector commutes with pullback – a (co)reflective subfibration of the codomain fibration.
So how can we eliminate this extra data and get back to talking about a reflective or coreflective subcategory of itself? In the coreflective case, we’re pretty sunk (I’ll get back to that case later), but in the reflective case, there is a close relationship between reflective subcategories and reflective subfibrations.
Every reflective subcategory (subject to certain adjoint-functor-theorem-y conditions) gives rise to a factorization system , in which is the class of maps inverted by the reflector , and the reflective subcategory is identified with . The factorization systems which arise from reflective subcategories in this way are precisely those for which satisfies two-out-of-three (in which case, of course, the reflective subcategory is the localization at ); these are called reflective factorization systems.
Every factorization system gives rise to a pullback-stable system of reflective subcategories of slice categories: the subcategory of is , with the -factorization being the reflection. A pullback-stable system of reflective subcategories arises from a factorization system in this way precisely when , the class of morphisms which are objects of , is closed under composition. The reflectors also commute with pullback (giving a reflective subfibration) precisely when the factorization system itself is pullback-stable.
A reflective factorization system is stable precisely when its corresponding reflective subcategory has a left-exact reflector.
A couple of good references to learn about this stuff are given at the bottom of this page. Thus, we have a diagram of inclusions: Recall that the naive internal axioms, which look as though they are describing a reflective subcategory, actually describe a reflective subfibration. Thus, we can augment them to actually describe a lex-reflective subcategory by imposing further axioms ensuring that is closed under composition and that satisfies two-out-of-three.
It turns out that internally, the class consists of the morphisms which represent dependent types for which . One can prove from this that will be closed under composition just when, internally, the types for which are closed under dependent sums:
Similarly, can be characterized internally as the morphisms which represent dependent types for which each is contractible. One can prove from this that satisfies two-out-of-three just when, internally, for any map where and are contractible, so is the of all homotopy fibers of .
This last condition is a special case of saying that preserves pullbacks, and from it one can prove internally that preserves all pullbacks – that is, the reflector is lex. In fact, though, even without these latter two conditions, there is a certain amount of lex-ness even to the notion of reflective subfibration. For since the reflector commutes with pullback, so do their right adjoints: the inclusions of the fiberwise subcategories and dependent products. This implies in particular that is an exponential ideal, and hence must preserve finite products.
The closure of the subcategory under dependent sums is a somewhat more mysterious condition. However, it admits a very pleasing reformulation. Notice that one consequence of the axiom asserting the universal property of is that we can factor through it:
- . This says that if is in the subcategory and , then we have another map .
- . This says that for and as above, and any , we have .
This looks a lot like the “elimination rule” of an inductively defined type, a common notion in type theory. In general, when a type is inductively defined by certain constructors, it means that we have various ways to construct elements of (perhaps taking as input other elements of ), and moreover if we have any other type together with similar ways to construct elements of , there is a specified map from to preserving the constructors. For instance, the natural numbers are inductively defined by two constructors and .
Here, we seem to be sort-of saying that is inductively defined by , together with a certain vague “sharpness”. In particular, it has an eliminator saying that if has a similar constructor together with the same sort of “sharpness” (that is, ), then we have a specified map preserving the constructor (evidently “preserving sharpness” is a vacuous condition, which makes sense since our subcategory is full).
However, in dependent type theory, inductive types generally also come with dependent eliminators, in which the target type is allowed to depend on the inductive type . For instance, for the natural numbers this eliminator says that given a dependent type together with an element and for every an operation , we have a specified section such that and . One value of the dependent eliminators is that they allow us to prove uniqueness (up to equality, i.e. paths in homotopy theory) of the morphisms specified by the non-dependent eliminator, by using the dependent eliminator into an equality/path type.
A natural dependent eliminator for would be the following. Suppose is a type dependent on , suppose we have a section over , and suppose that . Then we have a specified section , such that for all .
Here’s the lovely fact: a reflective subfibration has a dependent eliminator if and only if the objects are closed under dependent sums, i.e. it is a factorization system. If we have closure under sums, then we can use the non-dependent eliminator to define a map and nudge it so it becomes a section of ; while conversely we can define an inverse to using the dependent eliminator. Moreover, if we assume that the subcategory is closed under equality/path types, then the dependent eliminator implies not just the non-dependent eliminator (which is obvious) but also its universal property (by eliminating into an equality type).
This gives a very type-theoretic style of thinking about , which is also very convenient for proving things about sharped objects. We can write convenient tactics in Coq which automatically apply the dependent eliminator and its computation rules to reduce everything to statements about unsharped objects. In a sense, it’s saying that we have a higher-categorical sort of modality: one which acts on objects as well as on propositions. This shouldn’t be too surprising; we know that lex-reflective subcategories of a 1-topos are equivalent to Lawvere-Tierney topologies, which are a traditional sort of modality which acts on propositions. In homotopy type theory, we need to use higher modalities which act on objects because not every sub--topos is a topological localization.
I hope that the foregoing has convinced you that codiscrete objects admit a very nice and convenient axiomatization in the internal logic. Unfortunately, discrete objects don’t admit nearly so nice a description, because the internal logic doesn’t let us dualize the slice categories into co-slices when we want to dualize reflectiveness into coreflectiveness. I don’t know of any general way to construct a coreflective subfibration.
However, if we have codiscrete objects, then they give us a solution for dealing with the discrete objects! Namely, we already have the category sitting inside as the codiscrete objects, with the functor represented by the reflector . Thus, we can talk “in ” “about ” and still remain inside , if we do all of our talking inside the codiscrete objects.
The main player in this approach is . Here is the (or, rather, a) type of types, which represents an object classifier in category theory. You can think of it as like a Grothendieck universe of sorts; but remember that we want it to satisfy the univalence axiom. Thus, is the object of underlying – which we can think of as the “external space of objects of ” – included back into as a codiscrete object. The functoriality of (and the fact that it preserves products) means that any operation on types, which is described in type theory by a function on , gives rise to a corresponding “externalized” function on . For instance, the internal-hom, which takes two types A
and B
and gives the function-type A -> B
, is represented by a function , and hence gives us a function .
Something is still missing, though. The function is an externalization of the internal-hom operation, which takes two objects of and gives us a third object of . However, what we really want (in order to talk about “externally”) is the external hom, which takes two objects of and gives us an object of ! Thus we need an operation which “escapes” from the external world, in a sense, and which should be a version of itself (since the external-hom is applied to the internal-hom).
Magically, we have just such an operation. Recall that the object classifier comes with a universal map , of which every (small) map is a pullback in an essentially unique way. The functor applied to this gives us a map , which therefore has a classifying map . It’s an easy exercise in pasting pullback squares, using the fact that preserves pullbacks, to show that the composite
is equivalent to itself. Thus, escape
really is “a version of sharp”, and it lets us define the external hom by composing the “externalized internal-hom” with escape
.
This works amazingly well. In particular, it allows us to express the coreflector for the discrete objects in terms of an operation , state its universal property, and prove useful things about it. It’s more cumbersome than working purely internally, of course, but as we get more practice we’ll write more helpful tactics and it will get easier. It’s just as easy to additionally assert that the discrete objects are also reflective, with reflector that preserves finite products, thereby obtaining the original desired axiomatization of cohesive -toposes. The axiomatization that I’m now satisfied with can be found here.
Let me finish by saying a bit about what we can do if we don’t have codiscrete objects. Remember from last time that there is a universal way to add codiscrete objects, by constructing the scone on a (lex) functor . Thus, if we want to talk about such a functor using internal logic, we can first construct its scone, which contains as a lex-reflective subcategory of codiscrete objects.
Moreover, the scone also contains as a lex-reflective subcategory, and these two subcategories are complementary open and closed subtoposes. (An open subtopos is determined by a subterminal object , and its reflector is ; the reflector of the complementary closed subtopos takes to the pushout of the two projections of .) Finally, any topos equipped with a complementary pair of open and closed subtoposes can be obtained as the scone of a functor from the one to the other. Thus, if we axiomatize two lex-reflective subcategories as above and stipulate that they are complementary open and closed subtoposes, we will have an internal logic with which to talk about arbitrary lex functors between toposes. And if we furthermore require that the codiscrete objects (those in the closed subtopos) come with matching discrete ones, this corresponds to asking that have a lex left adjoint; thus we have an internal language with which to talk about arbitrary geometric morphisms.
Re: Internalizing the External, or The Joys of Codiscreteness
Thanks, Mike, this is most enjoyable!
One question about Cohesive.v:
I understand that the code there characterizes a reflective subcategory “of discrete objects” on top of (and via) the coreflective subcategory “of codiscrete objects”. But it does not yet make these two subcategories be equivalent such as to characterize cohesion proper, or does it?
I would think that there needs to be one more axiom saying that “” is an equivalence.
Do you see what I mean? Am I missing some subtlety that makes this automatic now?