Let and be symmetric monoidal categories. A (lax) symmetric monoidal functor consists of
(i) a Functor ; (ii) a morphism ; (iii) morphisms , natural in (the coherence maps),
obeying bookkeeping axioms compatible with associators, unitors and symmetries. It is strong if the are isomorphisms and strict if identities. The preorder version is a Monoidal Monotone Map; reversing the gives oplax monoidal functors.
Sources: 7 Sketches §6.4.1 (Rough Definition 6.68, Example 6.69, Exercise 6.70), Definition 2.41, Exercise 5.69; DaoFP §14.9 (“Monoidal Functors”: lax monoidal functors, functorial strength, applicative functors, closed functors), §17.7 (applicatives as monoids under Day Convolution), §20.1 (change of enriching category).
Examples
- Power set with direct image, , (Example 6.69; naturality is 7S Exercise 6.70).
- Decoration functors , e.g. sending a finite set of nodes to the set of circuits on it, with the disjoint union of circuits (Eq. 6.81); these build decorated cospan categories (Theorem 6.77). The constant functor recovers plain cospans (7S Exercise 6.78).
- , , strong monoidal since (7S Exercise 5.69); monoidal functors carry monoid objects to monoid objects.
- Applicative functors (DaoFP §14.9): a lax monoidal endofunctor of ,
unit :: () -> f (),(>*<) :: (f a, f b) -> f (a, b), equivalentlypureand<*>; every Monad is applicative. Lax monoidal functors are monoids for Day Convolution. - The semantics functor is a strict monoidal (prop) functor; Change of Base uses a monoidal functor between enriching categories; operad functors are the operadic analogue.
- Functorial strength (DaoFP §14.9, §20.2) is a related notion: in a closed category strong = enriched.
Laxness as an approximation
In probabilistic learning, lax monoidality measures what an approximation throws away: Bayesian Inversion is only a lax monoidal functor on open models, because the parallel composite of two inversions sees only the marginals of a correlated prior — the defect is the mutual information of the branches (Lax Functor, Bayesian Lens).
Docs: Theories (Catlab)
# Example 6.69: the power set as a lax monoidal functor (Set, 1, ×) → (Set, 1, ×)
powerset(S) = [Set(c) for c in Iterators.map(collect, Iterators.filter(_ -> true, subsets(collect(S))))]
image(f, A::Set) = Set(f(a) for a in A) # P on morphisms
φ(A::Set, B::Set) = Set((a, b) for a in A, b in B) # φ_{S,T}(A, B) = A × B
# naturality (Exercise 6.70): φ(image(f, A), image(g, B)) == image(((a,b),) -> (f(a), g(b)), φ(A, B))#check CategoryTheory.LaxMonoidalFunctor -- ε : 𝟙_ D ⟶ F.obj (𝟙_ C), μ : F.obj X ⊗ F.obj Y ⟶ F.obj (X ⊗ Y), coherence
#check CategoryTheory.MonoidalFunctor -- strong: ε and μ isomorphisms
#check CategoryTheory.LaxBraidedFunctor -- compatible with braidings/symmetry-- DaoFP §14.9: a lax monoidal endofunctor of Hask (= Applicative)
class Functor f => Monoidal f where
unit :: () -> f ()
(>*<) :: (f a, f b) -> f (a, b)
-- equivalent to Applicative: pure x = fmap (const x) (unit ()); ff <*> fa = fmap (uncurry ($)) (ff >*< fa)
-- functorial strength (free in Hask)
strength :: Functor f => (a, f b) -> f (a, b)
strength (a, fb) = fmap (\b -> (a, b)) fbLax monoidal functors in programming (DaoFP §14.9)
Monoidal functors map monoids to monoids, and only the lax data , is needed: a Monoid Object goes to . For endofunctors preserving the cartesian product this is the Haskell class class Monoidal f where unit :: f (); (>*<) :: f a -> f b -> f (a, b) (DaoFP Exercise 14.9.1). In a Cartesian Closed Category lax monoidal endofunctors coincide with lax closed ones (), i.e. applicative functors; every strong Monad is one. The category of monoidal categories and monoidal functors is a 2-Category.