nLab relative monad

Contents

Contents

Idea

A relative monad T:JCT \colon \mathbf J \to \mathbf C is much like a monad except that it is not an endofunctor on one category, but more generally a functor between two different 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:JCJ \colon \mathbf J \to \mathbf C, in which case we say that TT is a monad relative to JJ.

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

In generalization of the relation between adjunctions and monads, relative monads are related to relative adjunctions.

Definitions

Let

  • J,C\mathbf J, \mathbf C be categories

  • J:JCJ \,\colon\, \mathbf J \to \mathbf C a functor.

As skew Kleisi triples

The following definition is a variation of the Kleisli triple-formulation of ordinary monads:

Definition

A relative monad TT on JJ is

  • a functor T:JCT \,\colon\, \mathbf J \to \mathbf C

equipped with

  1. a JJ-relative unit

    η X:JXTX\eta_X \,\colon\, J X \to T X

    natural in X:JX \colon \mathbf J,

  2. a JJ-relative Kleisli extension

    () *:C(JX,TY)C(TX,TY)(-)^* \colon \mathbf{C}(J X, T Y) \to \mathbf{C}(T X, T Y)

    natural in both X,Y:JX, Y \colon \mathbf J

such that for X,Y,Z:JX, Y, Z \colon \mathbf J and k:JXTYk \colon J X \to T Y the following equations hold:

  1. (left unitality)

    k=k *η X,k = k^* \circ \eta_X \;,

  2. (right unitality)

    η X *=1 TX,\eta_X^* = 1_{T X} \;,

  3. (associativity)

    ( *k) *= *k *(\ell^* \circ k)^* = \ell^* \circ k^*

    for every k:JXTYk \colon J X \to T Y and :JYTZ\ell \colon J Y \to T Z.

[ACU14, Def. 2.1]

Notice that for any f:XYf \colon X \to Y in J\mathbf J, one has

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

Example

(ordinary monads as Kleisli triples/extension systems)
In the special case that J=C\mathbf{J} = \mathbf{C} and J=idJ = id the identity functor, Def. reduces to the definition of ordinary monads, but in the guise known as “Kleisli triples” or “extension systems” which is nominally different from (though equivalent to) the way monads are traditionally presented in category theory/categorical algebra (namely as monoid objects internal to a category of endofunctors), but is exactly the form commonly used for monads in computer science.

As monoids in a skew-monoidal category

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.

In the general case that J\mathbf{J} is distinct from C\mathbf{C}, the functor category Func(J,C)Func(\mathbf J, \mathbf C) lacks a natural monoidal category structure (as opposed to the case of endofunctors Func(C,C)Func(\mathbf{C}, \mathbf{C})) so that the usual definition of monads as monoids cannot apply — but a suitable “skew” variant works:

The (skew-)composition of functors F,G:JCF,G \colon \mathbf J \to \mathbf C may be defined by first extending FF along JJ and then composing with GG. The resulting composition product on [J,C][\mathbf J, \mathbf C] is coherent but only laxly so, hence the need to appeal to skew-monoidal categories:

Theorem

(ACU14, Thm. 3.4)
Suppose J:JCJ \colon \mathbf J \to \mathbf C is such that Lan J:[J,C][C,C]\mathrm{Lan}_J \colon [\mathbf J, \mathbf C] \to [\mathbf C, \mathbf C] exists (e.g. if J\mathbf J is small and C\mathbf C cocomplete). Then [J,C][\mathbf J, \mathbf C] is skew-monoidal, with unit JJ and product F JG=(Lan JF)GF \circ^J G = (\mathrm{Lan}_J F) \circ G, and a relative monad is a monoid in ([J,C],J, J)([\mathbf J, \mathbf C], J, \circ^J).

When J:JCJ:\mathbf J \to \mathbf C is a free completion of J\mathbf{J} under colimits from some set \mathcal{F} of indexing types, then this skew-monoidal structure on [J,C][\mathbf J, \mathbf C] is properly monoidal, since it is equivalent to the \mathcal{F}-colimit preserving functors CC\mathbf C\to\mathbf C, and the monoidal structure is just functor composition.

Relative to a Profunctor

The above definition makes sense even more generally when JJ is a profunctor J op×CSet\mathbf J^{op} \times \mathbf {C} \to Set, i.e., we require

  1. a unit η X:J(X,TX)\eta_X \colon J(X, T X), a natural in X:JX \colon \mathbf J, that is an element of the end, η X:JJ(X,TX)\eta \in \int_{X: \mathbf J}J(X, T X)

  2. a Kleisli extension () *:J(X,TY)C(TX,TY)(-)^* \colon J(X, T Y) \to \mathbf C(T X, T Y) natural in both X,Y:JX,Y \colon \mathbf J

with essentially the same equations. This generalizes the previous definition by defining the profunctor to be C(J,=)\mathbf C(J-,=).

Examples

Generic examples

Example

(relative monads induced from actual monads)
Given

  • a functor

    J:JCJ \,\colon\, \mathbf{J} \to \mathbf{C},

  • an actual\; monad

    T:CCT \,\colon\, \mathbf{C} \to \mathbf{C}

    with

the composite

  • TJ:JCT \circ J \,\colon\, \mathbf{J} \to \mathbf{C}

becomes a J\mathbf{J}-relative monad (Def. ) with

  • relative unit

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

  • relative Kleisli extension

    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 ACU14, Prop. 2.3 (1).
Proof

The required conditions on the relative Kleisli structure of TJT \circ J immediately reduce to those of the actual Kleisli 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 the same thing as 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 J C \mathbf{J}\subseteq \mathbf C is the same thing as a relative monad for the embedding JC\mathbf{J}\to \mathbf C. (Here JC\mathbf{J}\subseteq \mathbf{C} is required to be a dense subcategory, so that to give a functor JC\mathbf{J}\subseteq \mathbf{C} is to give a functor CC\mathbf{C}\to\mathbf{C} 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. J\mathbf{J} \coloneqq Set;

  2. C B:SetVect B\mathbf{C} \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:

Abstract discussion via virtual equipments:

Exposition:

On distributive laws for relative monads:

Last revised on December 21, 2023 at 20:54:19. See the history of this page for a list of all contributions to it.