The costructure-cosemantics adjunction for comodels for computational effects

Richard Garner
DOI: https://doi.org/10.48550/arXiv.2011.14520
2020-11-30
Abstract:It is well established that equational algebraic theories, and the monads they generate, can be used to encode computational effects. An important insight of Power and Shkaravska is that comodels of an algebraic theory T -- i.e., models in the opposite category Set^op -- provide a suitable environment for evaluating the computational effects encoded by T. As already noted by Power and Shkaravska, taking comodels yields a functor from accessible monads to accessible comonads on Set. In this paper, we show that this functor is part of an adjunction -- the "costructure-cosemantics adjunction" of the title -- and undertake a thorough investigation of its properties. We show that, on the one hand, the cosemantics functor takes its image in what we term the presheaf comonads induced by small categories; and that, on the other, costructure takes its image in the presheaf monads induced by small categories. In particular, the cosemantics comonad of an accessible monad will be induced by an explicitly-described category called its behaviour category that encodes the static and dynamic properties of the comodels. Similarly, the costructure monad of an accessible comonad will be induced by a behaviour category encoding static and dynamic properties of the comonad coalgebras. We tie these results together by showing that the costructure-cosemantics adjunction is idempotent, with fixpoints to either side given precisely by the presheaf monads and comonads. Along the way, we illustrate the value of our results with numerous examples drawn from computation and mathematics.
Logic in Computer Science,Category Theory
What problem does this paper attempt to address?
The core problem that this paper attempts to solve is to explore whether the construction from monad to comonad can form an interesting relationship in the algebraic theory of computational effects, and further reveal the specific properties of this relationship. Specifically: 1. **Transformation from monad to comonad**: The paper aims to verify whether the process of transforming a monad with rank (i.e., an accessible monad) into a comonad on Set can establish an interesting association between monad and comonad. 2. **Construction of adjoint pairs**: The paper shows that this construction provides an adjoint pair (adjunction) from accessible monad to accessible comonad, namely the so - called "costructure - cosemantics adjunction". This adjoint pair has the following forms: \[ \text{Mnda(Set)}^{\text{op}} \xrightarrow{\text{Cosem}} \text{Cmda(Set)} \] and \[ \text{Cmda(Set)} \xrightarrow{\text{Costr}} \text{Mnda(Set)}^{\text{op}} \] 3. **Introduction of behavior categories**: In order to gain a deeper understanding of this adjoint pair, the paper introduces the concept of "behavior category". For each accessible monad \( T \), its image under cosemantics is a presheaf comonad induced by a clearly described behavior category \( B_T \). Similarly, for each accessible comonad \( Q \), its image under costructure is a presheaf monad induced by another behavior category \( B_Q \). 4. **Idempotency of adjoint pairs**: The paper proves that this adjoint pair is idempotent, and its left and right fixed points are presheaf monad and presheaf comonad respectively. Through these studies, the paper not only answers the questions about the relationship between monad and comonad raised by Power and Shkaravska, but also provides new perspectives and tools for further understanding the algebraic theory of computational effects.