### Relative Endomorphisms

#### Posted by Qiaochu Yuan

Let $(M, \otimes)$ be a monoidal category and let $C$ be a left module category over $M$, with action map also denoted by $\otimes$. If $m \in M$ is a monoid and $c \in C$ is an object, then we can talk about an **action** of $m$ on $c$: it’s just a map

$\alpha : m \otimes c \to c$

satisfying the usual associativity and unit axioms. (The fact that all we need is an action of $M$ on $C$ to define an action of $m$ on $c$ is a cute instance of the microcosm principle.)

This is a very general definition of monoid acting on an object which includes, as special cases (at least if enough colimits exist),

- actions of monoids in $\text{Set}$ on objects in ordinary categories,
- actions of monoids in $\text{Vect}$ (that is, algebras) on objects in $\text{Vect}$-enriched categories,
- actions of monads (letting $M = \text{End}(C)$), and
- actions of operads (letting $C$ be a symmetric monoidal category and $M$ be the monoidal category of symmetric sequences under the composition product)

This definition can be used, among other things, to straightforwardly motivate the definition of a monad (as I did here): actions of a monoidal category $M$ on a category $C$ correspond to monoidal functors $M \to \text{End}(C)$, so every action in the above sense is equivalent to an action of a monad, namely the image of the monoid $m$ under such a monoidal functor. In other words, monads on $C$ are the universal monoids which act on objects $c \in C$ in the above sense.

Corresponding to this notion of action is a notion of endomorphism object. Say that the **relative endomorphism object** $\text{End}_M(c)$, if it exists, is the universal monoid in $M$ acting on $c$: that is, it’s a monoid acting on $c$, and the action of any other monoid on $c$ uniquely factors through it.

This is again a very general definition which includes, as special cases (again if enough colimits exist),

- the endomorphism monoid in $\text{Set}$ of an object in an ordinary category,
- the endomorphism algebra of an object in a $\text{Vect}$-enriched category,
- the endomorphism monad of an object in an ordinary category, and
- the endomorphism operad of an object in a symmetric monoidal category.

If the action of $M$ on $C$ has a compatible enrichment $[-, -] : C^{op} \times C \to M$ in the sense that we have natural isomorphisms

$\text{Hom}_C(m \otimes c_1, c_2) \cong \text{Hom}_M(m, [c_1, c_2])$

then $\text{End}_M(c)$ is just the endomorphism monoid $[c, c]$, and in fact the above discussion could have been done in the context of enrichments only, but in the examples I have in mind the actions are easier to notice than the enrichments. (Has anyone ever told you that symmetric monoidal categories are canonically enriched over symmetric sequences? Nobody told me, anyway.)

Here’s another example where the action is easier to notice than the enrichment. If $D, C$ are two categories, then the monoidal category $\text{End}(C) = [C, C]$ has a natural left action on the category $[D, C]$ of functors $D \to C$. If $G : D \to C$ is a functor, then the relative endomorphism object $\text{End}_{\text{End}(C)}(G)$, if it exists, turns out to be the codensity monad of $G$!

This actually follows from the construction of an enrichment: the category $[D, C]$ of functors $D \to C$ is (if enough limits exist) enriched over $\text{End}(C)$ in a way compatible with the natural left action. This enrichment takes the following form (by a straightforward verification of universal properties): if $G_1, G_2 \in [D, C]$ are two functors $D \to C$, then their hom object

$[G_1, G_2] = \text{Ran}_{G_1}(G_2) \in \text{End}(C)$

is, if it exists, the right Kan extension of $G_2$ along $G_1$. When $G_1 = G_2$ this recovers the definition of the codensity monad of a functor $G : D \to C$ as the right Kan extension of $G$ along itself, and neatly explains why it’s a monad: it’s an endomorphism object.

**Question:** Has anyone seen this definition of relative endomorphisms before?

It seems pretty natural, but I tried guessing what it would be called on the nLab and failed. It also seems that “relative endomorphisms” is used to mean something else in operad theory.

## Re: Relative Endomorphisms

I would say that the general construction is that of the right (Kan) extension in a bicategory $\mathcal{A}$ of a morphism $f : A \rightarrow B$ along itself, yielding a monad $[f,f]$ on $B$ acting on $f$, as in the following diagram. This is the codensity monad construction generalised from

Catto an arbitrary bicategory. $\begin{matrix} A & \overset{f}{\longrightarrow} & B \\ {}_{f} \searrow & \overset{\alpha}{\Leftarrow} & \swarrow_{[f,f]} \\ & B \\ \end{matrix}$This incorporates your setting because a monoidal category $M$ acting on a category $C$ gives a bicategory $\mathcal{A}$ with two objects $0$ and $1$, with $\mathcal{A}(0,0) = 1$, $\mathcal{A}(0,1) = C$, $\mathcal{A}(1,1) = M$, $\mathcal{A}(1,0) = 0$, and composition given by the action. The relative endomorphism monad of $c$ is then the right extension of $c$ along itself, $c$ being seen as a morphism $c : 0\rightarrow 1$.