nLab relative monad

Contents

Contents

Idea

A relative monad T:AET \colon A \to E is much like a monad except that its underlying functor is not required to be an endofunctor: rather, it can be an arbitrary functor between categories. To even formulate such a notion, (for instance the definition of the unit), the two categories have to be related somehow, typically via a specified comparison functor J:AEJ \colon A \to E, in which case we say that TT is a monad relative to JJ.

Ordinary monads are the special case of JJ-relative monads where JJ is the identity functor.

In generalisation of the relation between adjunctions and monads, relative monads are related to relative adjunctions. Dually, relative comonads are related to relative coadjunctions.

Definitions

Let J:AEJ \colon A \to E be a functor between categories, the root.

In extension form

The following definition is a variation of the formulation of a monad in extension form:

Definition

A JJ-relative monad TT [ACU15, Def. 2.1] comprises:

  • a function T:|A||E|T \colon |A| \to |E|, the underlying functor;

  • for each object X|A|X \in |A|, a morphism η X:JXTX\eta_X \colon JX \to TX in EE, the unit;

  • for each morphism f:JXTYf \colon JX \to TY in AA, a morphism f :TXTYf^\dagger \colon TX \to TY in EE, the extension operator,

such that, for each X,Y,Z|A|X, Y, Z \in |A|, the following equations hold:

  • f=f η Xf = f^\dagger \circ \eta_X for each f:TXTYf \colon TX \to TY (left unitality);

  • (η X) =1 TX(\eta_X)^\dagger = 1_{TX} (right unitality);

  • (g f) =g f (g^\dagger \circ f)^\dagger = \g^\dagger \circ f^\dagger for each f:JXTYf \colon JX \to TY and g:JYTZg \colon JY \to TZ.

It follows that TT is canonically equipped with the structure of a functor. For each f:XYf \colon X \to Y in AA:

Tf:=(η JYJf) . T f \;:=\; \big( \eta_{J Y} \circ J f \big)^\dagger \,.

and that the unit η\eta and the extension operator () ({-})^\dagger are then natural transformations.

In particular, in the special case that JJ is the identity functor, Def. reduces to the definition of monad in extension form.

As monoids in a skew-monoidal category, skew-multicategory, or multicategory

Monads are, by definition, monoids in monoidal categories of endofunctors. It is similarly possible to present relative monads as monoids in categories of functors. However, generally speaking, arbitrary functor categories are not monoidal. However, given a fixed functor J:AEJ \colon A \to E, the functor category [A,E][A, E] may frequently be equipped with skew-monoidal structure. The notion of a skew-monoidal category is like that of a monoidal category except that the unitors and associators are not necessarily invertible. Monoids may be defined in a skew-monoidal category analogously as to in a monoidal category, and a monoid in [A,E][A, E] (equipped with the skew-monoidal structure induced by JJ) is precisely a JJ-relative monad.

Theorem

(ACU15, Thm. 3.4)
Let J:AEJ \colon A \to E be a functor for which Lan J:[A,E][E,E]\mathrm{Lan}_J \colon [A, E] \to [E, E] exists (e.g. if AA is small and EE cocomplete). Then [A,E][A, E] admtis a skew-monoidal structure, with unit JJ and tensor F JG=(Lan JF)GF \circ^J G = (\mathrm{Lan}_J F) \circ G, and a relative monad is precisely a monoid in ([A,E],J, J)([A, E], J, \circ^J).

When J:AEJ \colon A \to E is a free completion of AA under a class \mathcal{F} of small colimits, then this skew-monoidal structure on [A,E][A, E] is properly monoidal, since it is equivalent to the \mathcal{F}-colimit preserving functors EEE \to E, and the monoidal structure is just functor composition.

More generally, if Lan J\mathrm{Lan}_J does not exist, we may still define a skew-multicategory? structure on [A,E][A, E]. Thus, relative monads are always monoids.

Theorem

(AM, Thm. 4.16)
Let J:AEJ \colon A \to E be a functor. Then [A,E][A, E] admits a unital skew-multicategory structure, and a relative monad is precisely a monoid therein.

This skew-multicategory structure is representable just when Lan J\mathrm{Lan}_J exists, recovering the result of ACU15. When JJ is a dense functor, the above theorem simplifies.

Theorem

(AM, Cor. 4.17)
Let J:AEJ \colon A \to E be a dense functor. Then [A,E][A, E] admits a unital multicategory structure, and a relative monad is precisely a monoid therein.

As monads in the bicategory of distributors

An alternative useful perspective on relative monads is the following.

Theorem

(AM, Thm. 4.22)
Let J:AEJ \colon A \to E be a dense functor. A JJ-relative monad is precisely a monad in the bicategory of distributors whose underlying 1-cell is of the form E(J,T)E(J, T) for some functor T:AET \colon A \to E.

Relative to a distributor

The above definition makes sense even more generally when JJ is a distributor EAE ⇸ A, i.e. a functor A op×ESet\mathbf A^{op} \times E \to Set. Explicitly, we ask for:

  • a functor T:AET \colon A \to E;

  • a unit η XJ(X,TX)\eta_X \in J(X, T X) for each X|A|X \in |A|, natural in X|A|X \in |A| (equivalently, an element of the end, η X|A|J(X,TX)\eta \in \int_{X \in |A|}J(X, T X));

  • an extension operator () :J(X,TY)C(TX,TY)(-)^\dagger \colon J(X, T Y) \to \mathbf C(T X, T Y) natural in X,Y|A|X,Y \in |A|

with essentially the same equations. We recover the previous definition by taking the corepresentable distributor E(J,=)E(J-,=). See Remark 4.24 of AM24.

Examples

Generic examples

Example

(relative monads induced from actual monads)
Given

  • a functor

    J:AEJ \,\colon\, A \to E,

  • a \; monad

    T:EET \,\colon\, E \to E

    with

    • unit \; η () T\eta^T_{(-)}

    • extension operator \; bind Tbind^T

the composite

  • TJ:AET \circ J \,\colon\, A \to E

defines a AA-relative monad (Def. ) with

  • unit

    η X TJη J(X) T\eta^{T J}_X \,\coloneqq\, \eta^T_{J(X)}

  • extension operator

    bind TJ(J(X)kTJ(Y))bind T(J(X)kTJ(Y)). bind^{T J}\big( J(X) \overset{k}{\to} T \circ J(Y) \big) \;\coloneqq\; bind^T\big( J(X) \overset{k}{\to} T \circ J(Y) \big) \,.

This example is stated in ACU15, Prop. 2.3 (1). More generally, we can precompose any relative monad with a functor to obtain a new relative monad: see Proposition 5.36 of AM24.

Proof

The required conditions on the relative monad structure TJT \circ J immediately reduce to those of the monad structure of TT:

Given

k:J(X)TJ(X),:J(X)TJ(X) k \,\colon\, J(X) \to T \circ J(X') ,\;\;\; \ell \,\colon\, J(X') \to T \circ J(X'')

we have

left unitality:

bind TJ(k)η X TJ bind T(k)η J(X) T =k \begin{array}{l} bind^{T J}(k) \circ \eta^{T J}_{X} \\ \;\equiv\; bind^T(k) \circ \eta^T_{J(X)} \\ \;=\; k \end{array}

right unitality:

bind TJ(η X TJ) bind T(η J(X) T) =id TJ(X) \begin{array}{l} bind^{T J}\big( \eta^{T J}_{X} \big) \\ \;\equiv\; bind^T\big( \eta^T_{J (X)} \big) \\ \;=\; id_{T \circ J(X)} \end{array}

associativity:

bind TJ(bind TJ()k) bind T(bind T()k) =bind T()bind T(k) bind TJ()bind TJ(k) \begin{array}{l} bind^{T J}\big( bind^{T J}(\ell) \circ k \big) \\ \;\equiv\; bind^{T}\big( bind^{T}(\ell) \circ k \big) \\ \;=\; bind^T(\ell) \circ bind^T(k) \\ \;\equiv\; bind^{T J}(\ell) \circ bind^{T J}(k) \end{array}

A concrete instance of Exp. is spelled out in Exp. below.

Example

A relative monad on the embedding J:FinSetSetJ \colon \mathbf{FinSet} \to \mathbf {Set} is equivalent to an abstract clone. These are equivalent to finitary monads and single-sorted algebraic theories.

Example

Fixing a category 𝕍\mathbb{V} with finite products, to give a Freyd category is to give a strong relative monad on the Yoneda embedding 𝕍[𝕍 op,Set]\mathbb{V}\to [\mathbb{V}^{\mathrm{op}},\mathbf{Set}].

Example

The presheaf category-construction ([ op,Set])(\mathbb{C}\mapsto [{\mathbb{C}}^{\mathrm{op}},\mathbf{Set}]) may be regarded as a relative pseudomonad on the inclusion CatCAT\mathbf{Cat}\to \mathbf{CAT}. (See also Yoneda structures.)

Example

A monad on C \mathbf C with arities in A C A\subseteq \mathbf C is the same thing as a relative monad for the embedding ACA\to \mathbf C. (Here AEA\subseteq E is required to be a dense subcategory, so that to give a functor AEA\subseteq E is to give a functor EtoEE\toE preserving JJ-absolute colimits.)

Specific examples

Example

(linear span)
We spell out the simple but maybe instructive example of the construction which sends a set BB to the vector space which it spans, i.e. to the BB-indexed direct sum of some ground field 𝕂\mathbb{K}, regarded in 𝕂\mathbb{K}-vector spaces.

In detail, for 𝕂\mathbb{K} any ground field, consider:

  1. AA \coloneqq Set;

  2. E B:SetVect BE \coloneqq \int_{B \colon Set} Vect_B (or “VectBund”, for short, see there for more) the category of indexed sets of vector spaces – hence of vector bundles over sets (i.e. over discrete topological spaces)

    B \array{ \mathscr{H} \\ \big\downarrow \\ B }

    with possibly base-changing vector bundle maps between them:

    B f B \array{ \mathscr{H} &\longrightarrow& \mathscr{H}' \\ \big\downarrow && \big\downarrow \\ B &\underset{f}{\longrightarrow}& B' }
  3. the relativization functor given by sending a set to the trivial tensor unit-bundle over it:

    (1)J : Set B:SetVect B B B×𝕂 \array{ J &\colon& Set &\longrightarrow& \int_{B \colon Set} Vect_B \\ && B &\mapsto& B \times \mathbb{K} }

Notice that for each map f:BBf \;\colon\; B \to B' of base sets, there is a base change adjoint triple of functors

(2)f !f *f *:Vect BVect B. f_! \dashv f^\ast \dashv f_\ast \;\;\colon\;\; Vect_{B} \leftrightarrow Vect_{B'} \,.

In particular, for S=*S' = \ast the terminal singleton set, the left base change along the unique p X:S*p_X \colon S \to \ast is the operation which forms the direct sum of the (fiber-)vector spaces in the bundle, and regards the resulting vector space as a bundle over the point:

(p B) !:Vect BVect *=Vect. (p_B)_! \;\colon\; Vect_B \longrightarrow Vect_\ast \,=\, Vect \,.

In view of this, we claim that the functor

Q : Set B:SetVect B S (p B) !(B×𝕂)b:B𝕂 \array{ Q &\colon& Set &\longrightarrow& \int_{B \colon Set} Vect_{B} \\ && S &\mapsto& (p_B)_!\big( B \times \mathbb{K} \big) \mathrlap{ \;\simeq\; \underset{b \colon B}{\bigoplus} \mathbb{K} } }

which may be understood as sending a set to its 𝕂\mathbb{K}-linear span,

carries the structure of a monad relative to the functor JJ from (1) with

  1. unit given by

    η B : B×𝕂 b:B𝕂 (b,k) (k) b \array{ \eta_{B} &\colon& B \times \mathbb{K} &\longrightarrow& \underset{b \colon B}{\bigoplus} \mathbb{K} \\ && (b,k) &\mapsto& (k)_b }
  2. Kleisli extension given by

    (B×𝕂fb:B𝕂)(b:B𝕂(f(b,)) b:Bb:B𝕂) \Big( B \times \mathbb{K} \xrightarrow{f} \underset{ \mathclap{b' \colon B'} }{\oplus} \mathbb{K} \Big) \;\;\;\;\mapsto\;\;\;\; \Big( \underset{b \colon B}{\oplus} \mathbb{K} \xrightarrow{ \big( f(b,-) \big)_{b \colon B} } \underset{b' \colon B}{\oplus} \mathbb{K} \Big)

This specific example may be understood as a special case of the general situation of relative monads induced from an actual monad (Exmp. ): Here the actual monad in question is:

: B:SetVect B B:SetVect B [𝒱 p B] p !𝒱 \array{ \triangle &\colon& \int_{B \colon Set} Vect_B &\longrightarrow& \int_{B \colon Set} Vect_B \\ && \left[ \array{ \mathscr{V} \\ \big\downarrow\mathrlap{{}^p} \\ B } \;\;\; \right] &\mapsto& p_! \mathscr{V} }

This monad is in fact the reflective localization of the reflective subcategory-embedding of plain VectorSpaces into bundled/parameterized vector spaces:

VectVect * B:SetVect B. Vect \;\simeq\; Vect_\ast \xhookrightarrow{\phantom{--}} \int_{B \colon Set} Vect_B \,.

References

The concept was introduced, in the context of monads in computer science, in:

A comprehension development in the context of formal category theory may be found in:

Exposition:

On distributive laws for relative monads:

Last revised on April 6, 2024 at 11:06:19. See the history of this page for a list of all contributions to it.