algebra over a monad in nLab
Context
Categorical algebra
Contents
Idea
There are different, related ways in which one could view the notion of algebra over a monad:
- If one views monads as a generalization of algebraic theories (see algebraic theory - relation to monads), an algebra over a monad is the corresponding generalization of an algebra over a theory. In particular, if one views a monad as a way of prescribing particular operations, an algebra is a context where those specified formal expressions can be evaluated to an actual result.
- From the 2-dimensional point of view, an algebra over a monad is a special case of a module over a monad for the bicategory Cat, where the arrow is from the terminal category.
- If one views monads as a way to model computational effects (see monad in computer science), an algebra is a context in which the extra effects can be reincorporated into the main data.
Algebras over a monad are usually objects equipped with extra structure, not just properties. (They can also be seen as algebras over the underlying endofunctor, satisfying extra compatibility properties.)
The corresponding dual notion is that of coalgebra over a comonad.
Definition
Let (T,η,μ)(T,\eta, \mu) be a monad on a category 𝒞\mathcal{C}.
Algebras
Definition
An algebra over TT (or just TT-algebra or TT-module) consists of:
such that the following diagrams commute in 𝒞\mathcal{C} (cf. the definition of module object here):
(1)Unit Property: \text{Unit Property:}
(2)Action Property: \text{Action Property:}
Homomorphisms
Let (A,a)(A,a) and (B,b)(B,b) be TT-algebra. A homomorphism of TT-algebras is a morphism f:A→Bf \colon A \to B of 𝒞\mathcal{C} which makes the following diagram commute.
The category formed by TT-algebras and their homomorphisms is known as the Eilenberg-Moore category of TT and often denoted by 𝒞 T\mathcal{C}^T.
Free algebras
Given a monad (T,μ,η)(T,\mu,\eta) on a category 𝒞\mathcal{C}, then for every object XX of 𝒞\mathcal{C}, the object TXT X is canonically equipped with a TT-algebra structure, given by the multiplication map μ\mu of the monad. The relevant diagrams commute by the monad axioms.
TT-Algebras of this sort are called free TT-algebras.
Given any morphism ϕ:X→Y\phi \colon X \to Y of 𝒞\mathcal{C}, the morphism Tϕ:TX⟶TYT \phi \colon T X \longrightarrow T Y is evidently a homomorphism of TT-algebras, by naturality of μ\mu. But not every homomorphism of TT-algebras between the free TT-algebras TXT X and TYT Y arises this way, in general.
However, for any morphism of the form
f:X⟶TY f \colon X \longrightarrow T Y
in 𝒞\mathcal{C} (called a TT-Kleisli morphism), the induced morphism
(3)μ Y∘Tf:TX→TfTTY→μ YTY \mu_{Y} \circ T f \;\colon\; T X \xrightarrow{\;\; T f \;\;} T T Y \xrightarrow{\;\; \mu_Y \;\;} TY
is a homomorphism of TT-algebras between these free TT-algebras, as one verifies again using the naturality of μ\mu. Now, all homomorphisms of TT-algebras between the free algebras TXT X and TYT Y do arise this way.
Moreover, given in addition a morphism in 𝒞\mathcal{C} of the form g:Y⟶TZg \colon Y \longrightarrow T Z, then, under this association, the composition of the corresponding TT-algebra morphisms (3) of ff and gg equals the TT-algebra homomorphism corresponding to their Kleisli composite, defined by
g∘ Tf≔X→fTY→TgTTZ→μ ZTZ. g \circ_T f \;\coloneqq\; X \xrightarrow{ f } T Y \xrightarrow{ T g } T T Z \xrightarrow{ \mu_Z } T Z \,.
The category of Kleisli morphisms equipped with this Kleisli composition is called the Kleisli category and is equivalent to the full subcategory of TT-algebras on the free TT-algebras (see there for more).
Tensor product
In the case of a commutative monad TT , one can define a tensor product of monad algebras, see there for more.
Examples
Many monads are named after their (free) algebras:
-
The algebras of the free monoid monad on Set are monoids, and the morphisms of algebras the monoid homomorphisms.
-
The algebras of the free commutative monoid monad on Set are commutative monoids, and their morphisms the monoid homomorphisms between them.
-
The algebras of the free group monad on Set are groups, and their morphisms are the group homomorphisms.
-
…and so on.
In these cases, the notion of free group, free monoid, et cetera coincide with the notion of free algebra given above.
-
Given a monoid or group MM, the algebras of the MM-action monad on Set are the MM-sets, i.e. sets equipped with an action of MM. The morphisms are the equivariant maps.
-
The example above generalizes to action monads given by monoid objects in a general monoidal category. Famous examples of this construction in mathematics are smooth actions of Lie groups on manifolds and actions of rings on their modules.
-
The algebras of the maybe monad (−) *:Set→Set(-)_*\colon Set \to Set, which adds a disjoint point, are the pointed sets.
-
The algebras of the power set monad are the sup-semilattices.
-
The algebras of the distribution monad are convex spaces, and more generally algebras of probability monads correspond to generalized convex spaces or conical spaces (see probability monad - algebras).
Generalizations
An algebra over a monad is a special case of a module over a monad in a bicategory. See there for more information.
The Eilenberg-Moore and Kleisli categories are also special cases of more general 2-dimensional universal constructions, namely the Eilenberg-Moore object and the Kleisli object. See those pages for more information.
-
algebra over a monad, module over a monad, algebra over an endofunctor, coalgebra over an endofunctor, algebra over a profunctor
-
Eilenberg-Moore category, Kleisli category, Eilenberg-Moore object, Kleisli object
References
General
See the References at monad, such as:
- Saunders MacLane, §VI.2 of: Categories for the Working Mathematician, Graduate Texts in Mathematics 5 Springer (1971) [doi:10.1007/978-1-4757-4721-8]
An introduction to the basic ideas, which gives some intuition for newcomers, can be found in
- Paolo Perrone, Chapter 5 of: Notes on Category Theory with examples from basic mathematics, [arXiv:1912.10642]
Kleisli/extension system-style
For monads presented in “extension system”/“Kleisli triple”-form (the way traditionally used for monads in computer science – i.e. in terms of a “bind”-operation taking Kleisli maps to actual morphisms, not explicitly referring to the monad product) there is the corresponding “Kleisli-triple style” or “Mendler style” [Uustalu (2021), p. 4] for presenting the algebra/module-structures for these monads:
-
F. Marmolejo, Richard J. Wood, Def. 3.1 in: Monads as extension systems – no iteration is necessary TAC 24 4 (2010) 84-113 [tac:24-04]
-
Thorsten Altenkirch, James Chapman, Tarmo Uustalu, Def. 2.11 in: Monads need not be endofunctors, Logical Methods in Computer Science 11 1:3 (2015) 1–40 [arXiv:1412.7148, pdf, doi:10.2168/LMCS-11(1:3)2015]
(stated in the generality of relative monads)
-
Tarmo Uustalu, p. 4 of: Monads and Interaction Lecture 2 lecture notes for MGS 2021 (2021) [pdf, pdf]
See also
- R. F. C. Walters, Chapter I of: A categorical approach to universal algebra, Ph.D. Thesis (1970) [anu:1885/133321]
Last revised on August 11, 2023 at 14:17:48. See the history of this page for a list of all contributions to it.