A nuclear adjunction between Poly and Dir

polynomial functors
category theory
Author
Published

2023-07-21

Abstract

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 Dir\mathbf{Dir}, the category of Dirichlet polynomials, which are sums b:B(Eb)y\sum_{b:B}(E_b)^\mathcal{y} of representables SetopSet\mathbf{Set}^\textnormal{op}\to\mathbf{Set}; the second category is equivalent to Poly\mathbf{Poly}, the category of ordinary (Descartes) polymomials, which are sums b:ByEb\sum_{b:B}\mathcal{y}^{E_b} of representables SetSet\mathbf{Set}\to\mathbf{Set}.

Recently I realized that for any set XX, there’s an adjunction LX ⁣:DirPoly ⁣:RXL_X\colon\mathbf{Dir}\rightleftarrows\mathbf{Poly}\colon R_X. Moreover, when X2|X|\geq 2 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 Dir\mathbf{Dir} inside of Poly\mathbf{Poly} as the coalgebras for a certain comonad on Poly\mathbf{Poly}, and you can similarly model Poly\mathbf{Poly} inside of Dir\mathbf{Dir} as the algebras for a monad on Dir\mathbf{Dir}. I’m not sure if this has any practical applications, but it’s at least theoretically interesting. And when X=0X=0, 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 Poly\mathbf{Poly} has objects as on the left, and the category Dir\mathbf{Dir} has objects as on the right: 3y5+2y2+4:Ob(Poly)and35y+22y+40y:Ob(Dir)3\mathcal{y}^5+2\mathcal{y}^2+4:\mathop{\mathrm{Ob}}(\mathbf{Poly}) \qquad\text{and}\qquad 3\cdot 5^\mathcal{y}+2\cdot2^\mathcal{y}+4\cdot 0^\mathcal{y}:\mathop{\mathrm{Ob}}(\mathbf{Dir}) 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 EBE\to B. That is, both Dir\mathbf{Dir} and Poly\mathbf{Poly} have interpretations as categories of bundles in Set\mathbf{Set}, but with different sorts of maps: Dir\mathbf{Dir} maps are forwards on base and forwards on fibers, whereas Poly\mathbf{Poly} 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 Dir\mathbf{Dir} for a while, but a few days ago I found a bunch of adjunctions LX ⁣:DirPoly ⁣:RX L_X\colon\mathbf{Dir}\rightleftarrows\mathbf{Poly}\colon R_X one for every X:SetX:\mathbf{Set}. Moreover, when XX has at least two elements, this adjunction is a nuclear adjunction, i.e. it’s both monadic and comonadic. That means that Poly\mathbf{Poly} is equivalent to the category of algebras for the induced monad on Dir\mathbf{Dir} and that Dir\mathbf{Dir} is equivalent to the category of coalgebras for the induced comonad on Poly\mathbf{Poly}.

I’ll try to keep this blog post pretty short. First I’ll describe Dir\mathbf{Dir} and Poly\mathbf{Poly} in terms of bundles. Then I’ll give the two functors LXL_X and RXR_X 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 X=0X=0, and how the coalgebras for the comonad on Poly\mathbf{Poly} correspond to “sets with elements marked for deletion”.

2 Dir\mathbf{Dir} and Poly\mathbf{Poly} in terms of bundles

A bundle of sets is just a function π ⁣:EB\pi\colon E\to B; here EE is called the total space and BB is called the base space. For each b:Bb:B, denote the fiber by Ebπ1(b)EE_b\coloneqq\pi^{-1}(b)\subseteq E. So we could denote this bundle by b:BEbπB \begin{CD} \sum_{b:B}E_b \\@VV{\pi}V \\B \end{CD} Here’s a picture of the bundle where the base B=4B=4 has four elements and the four fibers are E1=4E_1=4, E2=1E_2=1, E3=2E_3=2, and E4=0E_4=0:

Note that for any function f ⁣:BBf\colon B\to B', we can take the pullback of π ⁣:EB\pi'\colon E'\to B' and in so doing get another bundle, denoted f(π)f^*(\pi'), sitting over BB: b:BEf(b)b:BEbf(π)πBfB \begin{CD} \sum\limits_{b:B}E'_{f(b)} @>>> \sum\limits_{b':B'}E'_{b'} \\@V{f^*(\pi')}VV @VV{\pi'}V \\B @>>{f}> B' \end{CD}

What’s the appropriate kind of map between bundles? The most obvious choice to a category theorist would be a commutative square: EEππBfB \begin{CD} E @>>> E' \\@V{\pi}VV @VV{\pi'}V \\B @>>{f}> B' \end{CD} This is equivalent to a map from π\pi to the pullback bundle f(π)f^*(\pi'): b:BEbfb:BEf(b)b:BEbπfππB=BfB(1) \begin{CD} \sum\limits_{b:B}E_b @>{f^\natural}>> \sum\limits_{b:B}E'_{f(b)} @>>> \sum\limits_{b':B'}E'_{b'} \\@V{\pi}VV @V{f^*\pi}VV @VV{\pi'}V \\B @= B @>>{f}> B' \end{CD} \tag{1} (where the right-most square is a pullback). These go forwards on the base, i.e. we have f ⁣:BBf\colon B\to B', and forwards on the fibers: for each b:Bb:B, there is an induced function fb ⁣:EbEf(b)f^\natural_b\colon E_b\to E'_{f(b)}. Another kind of map is forwards on the base and backwards on the fibers: b:BEbfb:BEf(b)b:BEbπfππB=BfB(2) \begin{CD} \sum\limits_{b:B}E_b @<{f^\sharp}<< \sum\limits_{b:B}E'_{f(b)} @>>> \sum\limits_{b':B'}E'_{b'} \\@V{\pi}VV @V{f^*\pi}VV @VV{\pi'}V \\B @= B @>>{f}> B' \end{CD} \tag{2} (where again the right-most square is a pullback). The backwards part is a map from the pullback bundle f(π)f^*(\pi') back to π\pi, i.e. a function f ⁣:f(π)πf^\sharp\colon f^*(\pi')\to\pi.

It turns out that we can represent a bundle as both a Dirichlet functor SetopSet\mathbf{Set}^\textnormal{op}\to\mathbf{Set} and as a polynomial functor SetSet\mathbf{Set}\to\mathbf{Set}. Namely π ⁣:EB\pi\colon E\to B corresponds to the following objects in Dir\mathbf{Dir} and Poly\mathbf{Poly}: dπb:B(Eb)yandpπb:ByEbd_\pi\coloneqq\sum_{b:B}(E_b)^\mathcal{y} \qquad\text{and}\qquad p_\pi\coloneqq\sum_{b:B}\mathcal{y}^{E_b} The maps (natural transformations) dπdπd_\pi\to d_{\pi'} between Dirichlet functors can be identified with the forwards-forwards bundle maps (1), and the maps (natural transformations) pπpπp_\pi\to p_{\pi'} between polynomial functors can be identified with the forwards-backwards bundle maps (2).

3 Adjunctions between Dir\mathbf{Dir} and Poly\mathbf{Poly}

In this section we provide an adjunction between Dir\mathbf{Dir} and Poly\mathbf{Poly} for each X:SetX:\mathbf{Set}. But we begin with something more basic: an adjunction between Setop\mathbf{Set}^\textnormal{op} and Set\mathbf{Set} for each X:SetX:\mathbf{Set}. Clearly, mapping into XX constitutes a functor X ⁣:SetopSetX^-\colon\mathbf{Set}^\textnormal{op}\to\mathbf{Set} given by ASet(A,X)A\mapsto\mathbf{Set}(A,X). This is part of an adjunction X ⁣:DirPoly ⁣:X. X^{-}\colon\mathbf{Dir}\rightleftarrows\mathbf{Poly}\colon X^{-}. For example, when X=2X=2, each of these functors 22^- 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 LX ⁣:DirPolyL_X\colon\mathbf{Dir}\to\mathbf{Poly}. On objects it is given by b:B(Eb)yb:By(XEb).\sum_{b:B}(E_b)^\mathcal{y}\quad\mapsto\quad\sum_{b:B}\mathcal{y}^{\left(X^{E_b}\right)}. In other words, the bundle EBE\to B is sent to a bundle with the same base, but where the fiber EbE_b has been replaced with the fiber XEbX^{E_b}. A Dirichlet (forwards-forwards) map ππ\pi\to\pi' of bundles as in (1) includes a function f ⁣:BBf\colon B\to B' and a function EbEf(b)E_b\to E'_{f(b)} for each b:Bb:B; the latter induces a function XEf(b)XEb,X^{E'_{f(b)}}\to X^{E_b}, and hence a polynomial (forwards-backwards) map LX(π)LX(π)L_X(\pi)\to L_X(\pi') of bundles, as in (2).

The functor RX ⁣:PolyDirR_X\colon\mathbf{Poly}\to\mathbf{Dir} is quite similar. On objects it is given by b:ByEbb:B(XEb)y.\sum_{b:B}\mathcal{y}^{E_b}\quad\mapsto\quad\sum_{b:B}\big(X^{E_b}\big)^\mathcal{y}. In other words, the bundle EBE\to B is again sent to a bundle with the same base, but where the fiber EbE_b has been replaced with the fiber XEbX^{E_b}. A polynomial (forwards-backwards) map ππ\pi\to\pi' of bundles as in (2) includes a function f ⁣:BBf\colon B\to B' and a function Ef(b)EbE'_{f(b)}\to E_{b} for each b:Bb:B; the latter induces a function XEbXEf(b),X^{E_b}\to X^{E'_{f(b)}}, and hence a Dirichlet (forwards-forwards) map RX(π)RX(π)R_X(\pi)\to R_X(\pi') of bundles, as in (1).

To see that these functors are adjoint, LX ⁣:DirPoly ⁣:RX(3) L_X\colon\mathbf{Dir}\rightleftarrows\mathbf{Poly}\colon R_X \tag{3} consider the bundle π ⁣:EB\pi\colon E\to B as an object of Dir\mathbf{Dir} represented by b:B(Eb)y\sum_{b:B}(E_b)^\mathcal{y} and the bundle π ⁣:EB\pi'\colon E'\to B' as an object of Poly\mathbf{Poly} represented by b:ByEb\sum_{b':B'}\mathcal{y}^{E'_{b'}}. We calculate: Dir(π,RX(π))Dir(b:B(Eb)y,b:B(XEb)y)b:Bb:BSet(Eb,XEb)b:Bb:BSet(Eb×Eb,X)b:Bb:BSet(Eb,XEb)Poly(b:By(XEb),b:ByEb)Poly(LX(π),π). \begin{aligned} \mathbf{Dir}(\pi,R_X(\pi'))&\cong \mathbf{Dir}\left(\sum_{b:B}(E_b)^\mathcal{y},\sum_{b':B'}\big(X^{E'_{b'}}\big)^\mathcal{y}\right)\\&\cong \prod_{b:B}\sum_{b':B'}\mathbf{Set}\left(E_b,X^{E'_{b'}}\right)\\&\cong \prod_{b:B}\sum_{b':B'}\mathbf{Set}\left(E_b\times E'_{b'},X\right)\\&\cong \prod_{b:B}\sum_{b':B'}\mathbf{Set}\left(E'_{b'},X^{E_b}\right)\\&\cong \mathbf{Poly}\left(\sum_{b:B}\mathcal{y}^{\left(X^{E_b}\right)},\sum_{b':B'}\mathcal{y}^{E'_{b'}}\right)\\&\cong \mathbf{Poly}(L_X(\pi),\pi'). \end{aligned}

Just as a minor point, I want to also note that both LXL_X and RXR_X preserve coproducts; this is unsurprising for LXL_X, 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 X ⁣:DirPoly ⁣:X. X^{-}\colon\mathbf{Dir}\rightleftarrows\mathbf{Poly}\colon X^{-}. The corresponding monad AXXAA\mapsto X^{X^A} on Set\mathbf{Set} is called the XX-continuation monad. Whenever XX 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 Setop\mathbf{Set}^\textnormal{op}.

That is, suppose you had a set AA and a function XXAAX^{X^A}\to A that satisfies the algebra axioms. For example, if X=2X=2 then this function lets you turn elements of the double power set of AA into elements of AA, 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 AA and such a function? How can you get from a subset of subsets of AA to an element of AA? Well one source of such AA’s is XBX^B for some BB. Indeed, it’s easy to (and we are about to) find a map of the form XXXBXB.(4)\tag{4} X^{X^{X^B}}\to X^B. An element of the domain is a function f ⁣:XXBXf\colon X^{X^B}\to X. Given one of those we’re supposed to find a function BXB\to X, so let’s give ourselves an element b:Bb:B and try to find an element of XX. This is not so bad. We just take the function evalb ⁣:XBX\textnormal{eval}_b\colon X^B\to X given by evalb(g)g(b)\textnormal{eval}_b(g)\coloneqq g(b), apply ff to it, and thereby find an element of XX, as desired. In other words, we have a function eval ⁣:BXXB\textnormal{eval}\colon B\to X^{X^B}, and our desired map (4) is Xeval ⁣:XXXBXBX^{\textnormal{eval}}\colon X^{X^{X^B}}\to X^B.

Well it turns out that any such set XBX^B, 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 X2X\cong 2: the category of complete atomic boolean algebras is equivalent to Setop\mathbf{Set}^\textnormal{op}. And supposedly, the same thing holds for XX with more than 2 elements.

Now let’s consider the monad MXRXLXM_X\coloneqq R_X\circ L_X on Dir\mathbf{Dir} and the comonad CXLXRXC_X\coloneqq L_X\circ R_X on Poly\mathbf{Poly} induced by the adjunction (3). They both send the bundle π ⁣:b:BEbB\pi\colon\sum_{b:B}E_b\to B to the bundle b:BXXEbB\sum_{b:B}X^{X^{E_b}}\to B.

An algebra for the monad MXM_X on Dir\mathbf{Dir} consists of a bundle π ⁣:EB\pi\colon E\to B, a function BBB\to B, which by the unit law must be the identity, and a function XXEbEbX^{X^{E_b}}\to E_b for each b:Bb:B, which by the algebra laws makes each EbE_b into a XXX^{X^-}-algebra. This means that EbE_b is in the image of the functor X ⁣:SetopSetX^-\colon\mathbf{Set}^\textnormal{op}\to\mathbf{Set}, for each b:Bb:B, and hence that π\pi is in the image of the functor RX ⁣:PolyDirR_X\colon\mathbf{Poly}\to\mathbf{Dir}. In other words, the adjunction (3) is monadic. To see that this adjunction is comonadic is completely analogous.

So the upshot is that Poly\mathbf{Poly} is equivalent to the category of algebras for the monad MXM_X on Dir\mathbf{Dir}, and that Dir\mathbf{Dir} is equivalent to the category of coalgebras for the comonad CXC_X on Poly\mathbf{Poly}. This is what it means for LX ⁣:DirPoly ⁣:RX L_X\colon\mathbf{Dir}\rightleftarrows\mathbf{Poly}\colon R_X 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 X2|X|\geq 2. We’ll leave the X=1X=1 case to the reader. In this section we’ll discuss the case where X=0X=0 is empty. We’ll see something interesting: the coalgebras for the comonad C0L0R0C_0\coloneqq L_0\circ R_0 on Poly\mathbf{Poly} are intuitively “sets with elements marked for deletion". I’ll explain what that means.

First, note that when X=0X=0 the functors XX^- and XXX^{X^-} are given by 0A{1 if A=00 if A0and00A{0 if A=01 if A0 0^A\coloneqq \begin{cases} 1&\textnormal{ if }A=0\\ 0&\textnormal{ if }A\neq 0 \end{cases} \qquad\text{and}\qquad 0^{0^A}\coloneqq \begin{cases} 0&\textnormal{ if }A=0\\ 1&\textnormal{ if }A\neq 0 \end{cases} An algebra for the monad M0R0L0M_0\coloneqq R_0\circ L_0 on Dir\mathbf{Dir} is just a bundle where every fiber has either 0 or 1 element, in other words, it can be identified with a subset ABA\subseteq B. A map of algebras (AB)(AB)(A\subseteq B)\to (A'\subseteq B') consists of a function f ⁣:BBf\colon B\to B' such that f(A)Af(A)\subseteq A'.

It’s more interesting to look at the category of coalgebras for the corresponding comonad C0C_0 on Poly\mathbf{Poly}. The objects can again be identified with subsets DBD\subseteq B. A map of coalgebras consists of a function f ⁣:BBf\colon B\to B' such that if f(b)Df(b)\in D' then bDb\in D.

Think of the coalgebra (subset) DBD\subseteq B as a set BB where elements of DD 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 Ay+DAy+DA\mathcal{y}+D\to A'\mathcal{y}+D', i.e. of C0C_0-coalgebras.

There is an induced equivalence of categories between the M0M_0-algebras and the C0C_0-coalgebras. It sends a subset ABA\subseteq B to its complement (BA)B(B\setminus A)\subseteq B. That is, a function BBB\to B' that sends active elements to active elements (i.e. a map of M0M_0-algebras) can be identified with a function BBB\to B' that sends deleted elements backwards to deleted elements (i.e. a map of C0C_0-coalgebras).

6 Conclusion

The monadic adjunction DirLXRXPoly \mathbf{Dir} \underset{\xleftarrow[R_X]{}}{\overset{\xrightarrow{L_X}}{\Rightarrow}} \mathbf{Poly} 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

  1. I denote by NN the NN-element set {1,2,,N}\{'1','2',\ldots,'N'\}, so that 00 represents the empty set, etc. But rather than write E1E_{'1'}, E2E_{'2'}, etc., I’ve written E1E_1, E2E_2, etc., for typographical reasons.↩︎

  2. Thanks to Alexander Gietelink Oldenziel for reminding me that this has a name (Stone-type duality) when X2X\cong 2.↩︎

  3. In standard polynomial form, bundles ABA\to B for which each fiber is either empty or singleton, i.e. subsets ABA\subseteq B, can be identified with affine polynomials Ay+DA\mathcal{y}+D, where BA+DB\cong A+D. The same bundle could be seen as the subset ABA\subseteq B or DBD\subseteq B, since each defines the other as its complement, D=BAD=B\setminus A and A=BDA=B\setminus D.↩︎

Leaving a comment will set a cookie in your browser. For more information, see our cookies policy.