A monad consists of an endofunctor and natural transformations and , the unit and multiplication of a monad, satisfying
An algebra for a monad is with satisfying and . A morphism of algebras for a monad satisfies . These objects and morphisms form the Eilenberg-Moore category ; its composition works because is a functor.
For the list monad, is the set of finite ordered lists, including the empty list. The map applies to each entry; and concatenates a list of lists. The unit laws say that adding singleton brackets and then flattening changes nothing. Associativity says that flattening a list of lists of lists in either order produces the same ordered sequence. These descriptions also prove naturality.
If is an algebra for a monad, define
The singleton law gives . Apply the algebra associativity law to and to obtain . Applying it to and shows
Thus is a monoid. Applying the same law to shows inductively that is necessarily ordered multiplication of its entries, with the empty product .
Conversely, any monoid defines such a list-fold map . The monoid unit proves , and associativity and the unit prove that multiplying flattened lists equals multiplying their individual products, including empty sublists. Hence . An algebra morphism preserves the empty-list value and two-entry-list values, so it is a monoid homomorphism; conversely a monoid homomorphism preserves every ordered product and is an algebra morphism. Therefore
Thus list-monad algebras are monoids, with the identification also matching every morphism.
The free algebra functor is
The monad laws make an algebra action, and naturality of makes a morphism of algebras for a monad. Let forget the action. Define
The proposed inverse is an algebra morphism because
Naturality of and the algebra unit law give . If is an algebra morphism, then
The formulas are natural in both variables, so . Its unit is , and its counit at has underlying map . Thus the monad induced by an adjunction has endofunctor , unit , and multiplication . It is exactly the original monad, not merely a monad with the same endofunctor.
For an algebra for a monad , consider the fork in the Eilenberg-Moore category
Here is the counit at , and . The arrow is an algebra morphism by , which also says that it coequalizes the two arrows.
Let be an algebra morphism with . Define . Naturality of at gives
Since is an algebra morphism,
Thus is an algebra morphism with . Any other such factorization satisfies . This proves the full coequalizer universal property inside the algebra category.
The pair is moreover a reflexive pair: its common section is , with underlying map , because and . Hence every monad algebra is a reflexive coequalizer of free algebras. This reflexive free-algebra presentation of a monad algebra needs no general existence theorem for arbitrary algebra-category colimits.

Articles by others on the same topic (0)

There are currently no matching articles.