definition example

For a Monoidal Category , an -actegory is a category with a functor (the action)

and natural isomorphisms and satisfying the coherence laws of a monoid action — pentagon- and triangle-shaped diagrams. The spelling is deliberate: an actegory is a vertical categorification of a Monoid Action, with the monoid replaced by a monoidal category and the action equations by coherent isomorphisms.

Sources: Capucci & Gavranović, Actegories for the Working Amthematician arXiv:2203.16351 (notes); Capucci, Gavranović, Hedges & Fjeldgren Rischel, Towards Foundations of Categorical Cybernetics arXiv:2105.06332 (notes) Definitions 1, 6, Proposition 5; Riley, Categories of Optics arXiv:1809.00738 (notes); Janelidze & Kelly, A note on actions of a monoidal category, TAC 9 (2001).

Why it matters: parameters and residuals act on data

In categorical cybernetics is a category of parameters (or of residuals, contexts, states) and says how a parameter is attached to a piece of data. Two constructions are defined over an actegory rather than over a monoidal category:

  • — morphisms are pairs . Taking acting on itself by recovers the familiar of Cruttwell et al. Capucci et al. (Proposition 5) prove is a monad on -actegories: a twice-parametrised map is a once-parametrised one with parameter .
  • Mixed optics — a map is an element of : the forward pass stores a residual which the backward pass consumes. Different actions give lenses (cartesian product), prisms (coproduct), grates, Kleisli optics, …

Separating the category of parameters from the category of data is what allows, for example, a discrete parameter space acting on smooth maps, or a probabilistic residual acting on deterministic data.

Examples

  • Every monoidal category acts on itself: (the regular actegory).
  • acts on any category with coproducts by copowers: .
  • A strong functor / strong monad is a functor between actegories commuting with the actions up to coherent maps; the strength of a monad is exactly this (Monad).
  • acting on itself by gives , the home of neural network layers (Para Construction).
  • A symmetric monoidal category acting on its Kleisli category of a commutative monad — e.g. deterministic parameters acting on stochastic maps.

Docs: plain Julia — Catlab has no dedicated API for this; related: Catlab v0.16 docs · GATlab standard library

# An actegory in miniature: the monoidal category (types, ×) acting on vectors by "tagging".
# Action on objects: M • X = (M, X); on morphisms: (m, f) ↦ (p, x) -> (m(p), f(x)).
act(m, f) = ((p, x),) -> (m(p), f(x))
# coherence: (M ⊗ N) • X ≅ M • (N • X), realised by reassociation
δ(((m, n), x)) = (m, (n, x))
ε((_, x)) = x                                     # J • X ≅ X with J the unit type
v = ((:lr, :momentum), [1.0, 2.0])
δ(v) == (:lr, (:momentum, [1.0, 2.0]))            # true
ε((nothing, [1.0, 2.0])) == [1.0, 2.0]            # true
act(p -> p + 1, x -> 2x)((1, 3.0)) == (2, 6.0)    # functoriality of • on a pair of maps: true
import Mathlib
open CategoryTheory MonoidalCategory
-- an actegory: a monoidal category C acting on a category D, up to coherent isomorphism
structure Actegory (C : Type*) [Category C] [MonoidalCategory C] (D : Type*) [Category D] where
  act : C × D ⥤ D
  unitor : ∀ X : D, act.obj (𝟙_ C, X) ≅ X
  associator : ∀ (M N : C) (X : D), act.obj (M ⊗ N, X) ≅ act.obj (M, act.obj (N, X))
  -- naturality of `unitor`, `associator` and the pentagon/triangle laws are omitted here
-- The regular actegory of (Hask, (,), ()): M • X = (M, X).
act :: (m -> m') -> (x -> x') -> (m, x) -> (m', x')
act f g (m, x) = (f m, g x)
 
delta :: ((m, n), x) -> (m, (n, x))      -- (M ⊗ N) • X ≅ M • (N • X)
delta ((m, n), x) = (m, (n, x))
 
epsilon :: ((), x) -> x                   -- J • X ≅ X
epsilon ((), x) = x