Endofunctors as expression builders

103 Views Asked by At

I was recently reading through Bartoz Milewski's blog posts on category theory on monads and the Eilenberg-Moore algebra(see here). He mentions that if $T:C \to C$ is an endofunctor then it can be realized as the functor that builds exapnsion trees for the example of a simple algebra with a binary operation. How exactly is an expression of type $m a$?

I am also not convinced by the definition of an algebra over a monad which is a pair $(A,v)$ where $A$ is an onject of $C$ and $v$ is a morphism $T(A) \to A$ which satisfies some coherence axioms. In what sense is this is an algebra?

1

There are 1 best solutions below

1
On

The usual take-away is that whenever you have a category $C$ equipped with a monad, you can see the monad as a algebraic theory in $C$. For instance, for $C$ the category of sets, you have the monad of groups, the monad of abelian groups, the monad of vector spaces, and so on...

When a theory is presented this way, a monad sends an object onto the free object generated by this object. So in the sets, and for a given theory, the monad sends a set to all algebraic expressions that you can build from that set and that make sense in this theory, as such algebraic expression form usually the free object. Moreover, the unit and the multiplication of the monad explain to you how with an algebraic expression made from algebraic expression made from a set, you can just "develop and simplify" everything in order to get a big algebraic expression made from the initial set. In that sense, the monad in itself can be seen as the signature of your theory, and the unit and multiplication present the axioms of the theory.

So with this you can see why you want to define an algebra of the monad the way you define it. You first want a functor $T(A) \to A$, meaning that you can make sense in $A$ of any algebraic expression in your theory. The coherence axiom says exactly that the sense you chose for the algebraic expression is compatible with the axioms of the theory (unit and multiplication of the monad). This is also known as a model of the theory.

Here I voluntarily emphasize the intuition on what happens in sets, and state things a bit loosely, but the intuition is definitely here. There are results to make these precise, but that involve defining precisely theory (I think finitary Lawvere theories) and imposing some condition on the monad (I think cartesian monad), and you can prove an equivalence between them. I can't state the exact result on top of my head, maybe someone can help there, but I believe this intuition is still important.

EDIT : After a bit of checking, I think the first concept you should look at is finitary monads https://ncatlab.org/nlab/show/finitary+monad as well as their relations to Lawvere theories