constructive mathematics, realizability, computability
propositions as types, proofs as programs, computational trinitarianism
internalization and categorical algebra
algebra object (associative, Lie, …)
internal category ($\to$ more)
natural deduction metalanguage, practical foundations
type theory (dependent, intensional, observational type theory, homotopy type theory)
computational trinitarianism =
propositions as types +programs as proofs +relation type theory/category theory
In a category with internal homs $[-,-]$, given an object $S$, the continuation monad is the endofunctor $X \mapsto [[X, S], S]$.
In computer science this monad (in computer science) is used to model continuation-passing style of programming, and therefore this is called the continuation monad. The idea here is that a morphism $f \colon X \to Y$ in the Kleisli category of the continuation monad, hence a morphism in the original category of the form $X\longrightarrow [[Y,S],S]$ is much like a map from $X$ to $Y$ only that instead of “returning” its output directly it instead feeds it into a given function $Y \to S$ which hence continues the computation.
On the category of sets, the functor $[-,S] \colon\mathbf{Set}^{op}\to \mathbf{Set}$ is monadic (with left adjoint $[-, S]^{op} \colon \mathbf{Set} \to \mathbf{Set}^{op}$) whenever ${|S|}\geq 2$.
Thus the Eilenberg-Moore algebras of the continuation monad are equivalent to complete atomic Boolean algebras, as the category of these is equivalent to the opposite of the category of sets.
(This incidentally illustrates the fact that a category can be monadic over $\mathbf{Set}$ in multiple ways. In other words, one should not refer to a category $C$ as monadic over $Set$, unless everyone agrees to which “forgetful functor” $U\colon C \to \mathbf{Set}$ is being considered – better is to refer to a functor as monadic.)
This boils down to the assertion that such an $S$ is an injective cogenerator in the category of sets. It is injective because it is a retract of an injective object $2^S$ (using the fact that the subobject classifier $2$ is injective), and it cogenerates because there is an injection $2 \to S$ and $2$ cogenerates.
In more detail: an object $S$ is (internally) injective if $[-, S]: Set^{op} \to Set$ takes (coreflexive) equalizers in $Set$ to coequalizers in $Set$. The subobject classifier $2$ is injective (by, for example, the proof of Paré’s theorem for constructing finite colimits in an elementary topos). Since $S \times -: Set \to Set$ preserves connected limits such as equalizers, we have that $[S \times -, 2] \cong [-, 2^S]$ takes equalizers to coequalizers, i.e., $2^S$ is injective for any $S$. Then $S$, being a retract of $2^S$, has the property that $[-, S]$ takes equalizers in $Set$ to coequalizers, i.e., preserves coequalizers $Set^{op} \to Set$.
Also $[-, S]$ reflects isomorphisms. This is because isomorphisms in $Set$ are precisely epi-monos, and $S$ being an internal cogenerator means exactly that $[-, S]$ is faithful, and faithful functors reflect monos and epis.
Since $[-, S]$ preserves coequalizers and reflects isomorphisms, we conclude that it is monadic by Beck’s crude monadicity theorem.
As a monad in computer science:
Eugenio Moggi, Exp. 1.1 in: Notions of computation and monads, Information and Computation, 93 1 (1991) [doi:10.1016/0890-5401(91)90052-4, pdf]
Bartosz Milewski, §21.2.7 in: Category Theory for Programmers, Blurb (2019) [pdf, github, webpage, ISBN:9780464243878]
Tarmo Uustalu, p.27 of: Monads and Interaction Lecture 1 [pdf, pdf], lecture notes for MGS 2021 (2021):
The continuation monad is discussed in the generality of linear type theory as the linear double negation monad in
Paul-André Melliès, Nicolas Tabareau, Linear continuation and duality, 2008 (pdf)
Paul-André Melliès, The parametric continuation monad, Mathematical Structures in Computer Science, Festschrift in honor of Corrado Böhm for his 90th birthday (2013). (pdf)
The characterization of algebras is Proposition 10 of
A characterisation of (enriched) monads isomorphic to continuation monads is given in:
Last revised on December 30, 2023 at 12:46:12. See the history of this page for a list of all contributions to it.