A nuclear adjunction between Poly and Dir
There are at least two interesting kinds of maps between bundles: “forward-forward” maps and “forward-backward” maps. That is, both kinds go forward on the base, but the first kind also goes forward on the fibers, whereas the second kind goes backwards on the fibers. In a paper with David Jaz Myers, we showed (for bundles of sets) that the first category is equivalent to , the category of Dirichlet polynomials, which are sums of representables ; the second category is equivalent to , the category of ordinary (Descartes) polymomials, which are sums of representables .
Recently I realized that for any set , there’s an adjunction . Moreover, when has at least two elements, this adjunction is nuclear, i.e. it’s both monadic and comonadic. In particular, this means that you can model inside of as the coalgebras for a certain comonad on , and you can similarly model inside of as the algebras for a monad on . I’m not sure if this has any practical applications, but it’s at least theoretically interesting. And when , I’ll show how the coalgebras model “sets with elements marked for deletion”.
1 Introduction
I’ve been thinking about polynomial functors for a few years now, and at the beginning of that time I was also thinking about Dirichlet polynomials. The category has objects as on the left, and the category has objects as on the right: I wrote a couple of short notes with David Jaz Myers about these things, e.g. that the category of Dirichlet polynomials forms a topos. Indeed, it is equivalent to the topos of functions . That is, both and have interpretations as categories of bundles in , but with different sorts of maps: maps are forwards on base and forwards on fibers, whereas maps are forwards on base and backwards on fibers. I’ll explain this more in the next section.
Anyway, I haven’t thought much about for a while, but a few days ago I found a bunch of adjunctions one for every . Moreover, when has at least two elements, this adjunction is a nuclear adjunction, i.e. it’s both monadic and comonadic. That means that is equivalent to the category of algebras for the induced monad on and that is equivalent to the category of coalgebras for the induced comonad on .
I’ll try to keep this blog post pretty short. First I’ll describe and in terms of bundles. Then I’ll give the two functors and and say why they’re adjoint. Then I’ll say why the adjunction is both monadic and comonadic (i.e. nuclear). Finally, I’ll show what happens when , and how the coalgebras for the comonad on correspond to “sets with elements marked for deletion”.
2 and in terms of bundles
A bundle of sets is just a function ; here is called the total space and is called the base space. For each , denote the fiber by . So we could denote this bundle by Here’s a picture of the bundle where the base has four elements and the four fibers are , , , and : 1
Note that for any function , we can take the pullback of and in so doing get another bundle, denoted , sitting over :
What’s the appropriate kind of map between bundles? The most obvious choice to a category theorist would be a commutative square: This is equivalent to a map from to the pullback bundle : (where the right-most square is a pullback). These go forwards on the base, i.e. we have , and forwards on the fibers: for each , there is an induced function . Another kind of map is forwards on the base and backwards on the fibers: (where again the right-most square is a pullback). The backwards part is a map from the pullback bundle back to , i.e. a function .
It turns out that we can represent a bundle as both a Dirichlet functor and as a polynomial functor . Namely corresponds to the following objects in and : The maps (natural transformations) between Dirichlet functors can be identified with the forwards-forwards bundle maps (1), and the maps (natural transformations) between polynomial functors can be identified with the forwards-backwards bundle maps (2).
3 Adjunctions between and
In this section we provide an adjunction between and for each . But we begin with something more basic: an adjunction between and for each . Clearly, mapping into constitutes a functor given by . This is part of an adjunction For example, when , each of these functors is the power-set. Anyway, the idea is that we’re going to apply this adjunction to the fibers of bundles.
So let’s describe the functor . On objects it is given by In other words, the bundle is sent to a bundle with the same base, but where the fiber has been replaced with the fiber . A Dirichlet (forwards-forwards) map of bundles as in (1) includes a function and a function for each ; the latter induces a function and hence a polynomial (forwards-backwards) map of bundles, as in (2).
The functor is quite similar. On objects it is given by In other words, the bundle is again sent to a bundle with the same base, but where the fiber has been replaced with the fiber . A polynomial (forwards-backwards) map of bundles as in (2) includes a function and a function for each ; the latter induces a function and hence a Dirichlet (forwards-forwards) map of bundles, as in (1).
To see that these functors are adjoint, consider the bundle as an object of represented by and the bundle as an object of represented by . We calculate:
Just as a minor point, I want to also note that both and preserve coproducts; this is unsurprising for , but I don’t think I’d seen a right adjoint that preserves coproducts before.
4 Why they are monadic and comonadic
Let’s again look at the adjunction The corresponding monad on is called the -continuation monad. Whenever has at least two elements, I’ve heard—and will herein rely on the belief—that the category of algebras for the continuations monad is equivalent to .
That is, suppose you had a set and a function that satisfies the algebra axioms. For example, if then this function lets you turn elements of the double power set of into elements of , and the monad algebra axioms say that you’re doing it in a reasonable way. But how in the heck could you ever get such an and such a function? How can you get from a subset of subsets of to an element of ? Well one source of such ’s is for some . Indeed, it’s easy to (and we are about to) find a map of the form An element of the domain is a function . Given one of those we’re supposed to find a function , so let’s give ourselves an element and try to find an element of . This is not so bad. We just take the function given by , apply to it, and thereby find an element of , as desired. In other words, we have a function , and our desired map (4) is .
Well it turns out that any such set , equipped with the map we just provided, can be shown to satisfy the algebra laws. Moreover they’re the only such things! This is a Stone-type duality when : the category of complete atomic boolean algebras is equivalent to . 2 And supposedly, the same thing holds for with more than 2 elements.
Now let’s consider the monad on and the comonad on induced by the adjunction (3). They both send the bundle to the bundle .
An algebra for the monad on consists of a bundle , a function , which by the unit law must be the identity, and a function for each , which by the algebra laws makes each into a -algebra. This means that is in the image of the functor , for each , and hence that is in the image of the functor . In other words, the adjunction (3) is monadic. To see that this adjunction is comonadic is completely analogous.
So the upshot is that is equivalent to the category of algebras for the monad on , and that is equivalent to the category of coalgebras for the comonad on . This is what it means for to be a nuclear adjunction.
5 What happens when the base is empty
The above story is the main subject of this post. I just want to end with a little light fun. So far we’ve focused on the case where . We’ll leave the case to the reader. In this section we’ll discuss the case where is empty. We’ll see something interesting: the coalgebras for the comonad on are intuitively “sets with elements marked for deletion". I’ll explain what that means.
First, note that when the functors and are given by An algebra for the monad on is just a bundle where every fiber has either 0 or 1 element, in other words, it can be identified with a subset . A map of algebras consists of a function such that .
It’s more interesting to look at the category of coalgebras for the corresponding comonad on . The objects can again be identified with subsets . 3 A map of coalgebras consists of a function such that if then .
Think of the coalgebra (subset) as a set where elements of are “marked for deletion”. In programming, Evan Patterson has told me that when deleting elements from a set, it generally messes up all the indexing if you actually remove them, so it’s convenient to just mark these elements as deleted. What should a map between sets with deleted elements be? Well it should be a map between the sets, with the requirement that an active element (one not marked for deletion) cannot be sent to a deleted element. Or using the contrapositive, if an element is sent to a deleted element, it must itself be deleted. This is exactly the sort of map we get between affine polynomials , i.e. of -coalgebras.
There is an induced equivalence of categories between the -algebras and the -coalgebras. It sends a subset to its complement . That is, a function that sends active elements to active elements (i.e. a map of -algebras) can be identified with a function that sends deleted elements backwards to deleted elements (i.e. a map of -coalgebras).
6 Conclusion
The monadic adjunction strengthens the connection between polynomial functors and Dirichlet functors. It says that each can model the other, namely as the (co-)algebras for a certain (co-)monad. It seems relatively important theoretically, but I’m not really sure what else to do with it, especially applications-wise. Maybe the (co-)Kleisli category is interesting for some reason? Anyway, I’ll leave this here in the hopes that someone can help me see some use for it or some further questions to ask!
Footnotes
I denote by the -element set , so that represents the empty set, etc. But rather than write , , etc., I’ve written , , etc., for typographical reasons.↩︎
Thanks to Alexander Gietelink Oldenziel for reminding me that this has a name (Stone-type duality) when .↩︎
In standard polynomial form, bundles for which each fiber is either empty or singleton, i.e. subsets , can be identified with affine polynomials , where . The same bundle could be seen as the subset or , since each defines the other as its complement, and .↩︎