You're reading the public-facing archive of the Category Theory Zulip server.
To join the server you need an invite. Anybody can get an invite by contacting Matteo Capucci at name dot surname at gmail dot com.
For all things related to this archive refer to the same person.
I was wondering what are the algebras for the continuation monad . Google does not seem to help almost at all, apart from the cryptic sentence here
I am surprised that the algebras for such a well-known monad are so mysterious to find. Can you tell me more?
My motivation was: find a meaning for algebras, free algebras, and Kleisli composition in the Kleisli category. Understand better the relation between a continuation monad and a two-player game. In case you have information about this as well, feel free to answer!
I have a folklore-y belief from functional programming that virtually nothing is known about general algebras. And a distant memory of a conversation I had with Martín Escardó like 7 years ago when he told me the same, although don't take my word for that
Here https://twitter.com/johncarlosbaez/status/1113951766071074816?s=21 John claims that the EM category of is exactly
Well, yes, I agree with that; but what is the category of algebras for a generic ?
Jules Hedges said:
Here https://twitter.com/johncarlosbaez/status/1113951766071074816?s=21 John claims that the EM category of is exactly
What is meant by 'is exactly' exactly?
Also, I'm having flashbacks from learning about the ultrafilter monad.
Keith Peterson said:
What is meant by 'is exactly' exactly?
By default (ie. when I haven't actually thought about it) I use "is" to mean equivalence of categories
I'd guess it's probably an isomorphism of categories
What are the unit and multipilcation of this monad?
The unit is , the multiplication is....... a bit complicated, but if you do type directed programming it's the thing that you find
Multiplication has type
You get given and . You want to get an which you can get by producing an input to , of type
We can build such a thing as the function that, given an input , return
So in summary,
This is the goto tool (pun somewhat intended) in typed functional programming when you want to do evil control flow shenanigans and make people's brains explode
Thanks!
Exercise for the reader with half an hour on their hands: it's much less well known that is also a monad, called the selection monad (discovered by Martín Escardó). It's generally similar but its multiplication operator is much more complicated; derive it by the same method of type directed programming
(This is an example of an exercise that you could, in theory, give to 1st year students as soon as they learn the natural deduction calculus rules for purely implicational intuitionistic logic; but you shouldn't, because it's deceptively outrageously difficult)
Nathaniel Virgo said:
What are the unit and multipilcation of this monad?
Yet, proving that this is a monad in fact can be done the slick way: it's the monad induced by the adjunction
;-)
Jules Hedges said:
I'd guess it's probably an isomorphism of categories
Why would you guess that?
I'm not Jules, but let me take a stab: if "the category of algebras of is " is taken to mean that and are equivalent, then "the category of algebras of is exactly " should say something stronger (otherwise, why add the word "exactly"?). A reasonable reading then is that the statement asserts that and are isomorphic. Of course, one might interpret both statements in a stricter sense (so that these claims assert an isomorphism and an equality respectively) or something else (e.g. an equivalence and an equality), but these seem less likely.
I don't think "is exactly" necessarily implies anything stronger than "is". I would probably read it as just indicating some emphasis or surprise.
Plus, in this particular case, I think the categories are actually only equivalent.
In retrospect, I agree that it's not a necessity: it's just _a_ reasonable interpretation
fwiw I think "exactly" in the sentence a is exactly b
was meant to indicate the fact that we know a non-tautological description for a
that makes use of b
, and wow, they reduce into each other in some abstract rewriting system! In this sense, the category of sheaves on a space is exactly the category of certain continuous maps over said space, and 2+2 is exactly 4; exactness is contextual, to avoid going crazy in the rabbit-hle of when two things are the same.
But let's go back to the category theory now: a few thoughts
Maybe using the adjunction that generates the continuation monad one could argue that an algebra map is an endomorphism of in the opposite category where the monad is defined, such that something happens. Can one extract some more information from this description, or it is bound to be tautological?
Also, another question: let be the continuation monad on , . Then, we all agree that the cat of -algebras is the opposite of . Is it true that if is an Heyting algebra, the category of -algebras is the opposite of the topos of sheaves with as subobject classifier?
If true, this is certainly something more than we knew few days ago.
(Saw this while going through a huge pile of unread posts.)
In the case of , taking to have cardinality greater than 1, in every case the category of algebras is equivalent to , i.e., is monadic.
It's already been pointed out that this has a left adjoint, namely . By the crude monadicity theorem, it suffices to check that reflects isomorphisms and preserves reflexive coequalizers.
We know preserves reflexive coequalizers -- that's a special case of how Paré proved his theorem that for a topos , that preserves reflexive coequalizers. Also, for any set , we know that preserves connected limits and in particular equalizers. Therefore, , being isomorphic to a composite
of functors that preserve reflexive coequalizers, also preserves reflexive coequalizers. Then , being a retract of a functor that preserves reflexive coequalizers, must also preserve reflexive coequalizers.
Isomorphisms in are epi-monos, so to see that reflects isomorphisms, it suffices that it reflects epis and monos. For that, it suffices that is faithful, or in other words that is a cogenerator. But this in turn follows from the fact that is a cogenerator and there is a monomorphism .
Todd, this is very neat, thanks for taking the time to share it from your email :-)
What surprised me the most about this is that the algebras are the same for every of cardinality .
You're welcome! Of course, one would also like a more intuitive understanding as well. That shouldn't be too hard to cook up.
Seemingly related is the fact that is also monadic for any non-zero vector space . This fact came up around the time Tom Leinster was writing his series of articles about ultrafilters and measures. Again, what is crucial is the fact that such is an injective cogenerator; see here.
What this also reminds me of is the fact that there are many Lawvere theories whose models are Boolean algebras. The usual Lawvere theory is opposite to the category of finitely generated free Boolean algebras, which by a baby version of Stone duality may be identified with the category of finite sets of cardinality . But now here comes a nice trick: if is any category with finite products, and is its Cauchy completion, then also has finite products, and moreover the category of product-preserving functors is equivalent to the category of product-preserving functors . For example, the Cauchy completion of finite sets of cardinality is the category of nonempty finite sets. But then, the same is true if we start instead with finite sets of cardinality of ! It follows that if we take our Lawvere theory to be , then we get the same category of algebras, i.e., Boolean algebras!
That may seem a little weird. It shows that there are many "underlying set" functors . But it makes a little more sense if you consider that the number of chains in a Boolean algebra with elements is . Circling back around then to the top of this post, I propose that if we think of as the category of complete atomic Boolean algebras, then the functor sends a CABA = power set to the set of 2-fold chains in . (Well, that's one way of thinking about it; there are others.)
Wow!
I wonder, was this really an open question, or is it "known" but just not well known
May I propose that someone writes this down somewhere more permanent than here (for example an nCafe post)?
(Thanks!) I think it's known to certain people like Lawvere. Certainly a conversation he had with me exerted an influence. I'd bet @Tom Leinster knows it on some level as well, and he may have written something like this down himself.
For example, Tom wrote this Cafe post, linking to this section in an nLab article. And definitely check out this other Cafe post, as well as his paper.
I wonder, if you squint enough, if this (namely that is "backwards") "explains" why is the "monad for the side effect of really gnarly control flow shenanigans"