Monoidal Structures¶
A monoidal structure combines objects and morphisms
side by side (Mac Lane, 1998). The cartesian product pairs values, and the coproduct selects
a tagged alternative. Associators regroup nested combinations and braidings exchange their order.
These operations arrange inputs and outputs, and the chosen Algebra separately fixes how their
weights combine. The module gives the MonoidalStructure interface with the instances
CartesianProductMonoidal and CoproductMonoidal. On weighted relations the Cartesian product is
a symmetric monoidal product, not a categorical product.
monoidal
¶
Monoidal structures on V-enriched FinSet.
A monoidal structure (C, ⊗, I) consists of a bifunctor ⊗, a unit object I, and coherence isomorphisms (associator, unitors, braiding).
This module provides:
MonoidalStructure (abstract)
├── CartesianProductMonoidal — (FinSet, ×, 1)
└── CoproductMonoidal — (FinSet, +, ∅)
On finite sets and functions the cartesian product is a categorical
product, but the morphisms here are V-valued matrices, on which ×
is a symmetric tensor product and not a product: V-matrices have no
natural diagonals. The disjoint union + is a biproduct of
V-matrices over a semiring.
MonoidalStructure
¶
Bases: ABC
Abstract monoidal structure on a category.
Provides the monoidal product, unit object, and coherence isomorphisms that witness the monoidal laws.
product
abstractmethod
¶
associator
abstractmethod
¶
associator(a: SetObject, b: SetObject, c: SetObject) -> ObservedMorphism
The associator (A ⊗ B) ⊗ C → A ⊗ (B ⊗ C).
| PARAMETER | DESCRIPTION |
|---|---|
a
|
Three objects.
TYPE:
|
b
|
Three objects.
TYPE:
|
c
|
Three objects.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
ObservedMorphism
|
The associator isomorphism. |
Source code in src/quivers/categorical/monoidal.py
left_unitor
abstractmethod
¶
left_unitor(a: SetObject) -> ObservedMorphism
The left unitor I ⊗ A → A.
| PARAMETER | DESCRIPTION |
|---|---|
a
|
The object.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
ObservedMorphism
|
The left unitor isomorphism. |
Source code in src/quivers/categorical/monoidal.py
right_unitor
abstractmethod
¶
right_unitor(a: SetObject) -> ObservedMorphism
The right unitor A ⊗ I → A.
| PARAMETER | DESCRIPTION |
|---|---|
a
|
The object.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
ObservedMorphism
|
The right unitor isomorphism. |
Source code in src/quivers/categorical/monoidal.py
braiding
abstractmethod
¶
braiding(a: SetObject, b: SetObject) -> ObservedMorphism
The braiding A ⊗ B → B ⊗ A.
| PARAMETER | DESCRIPTION |
|---|---|
a
|
Two objects.
TYPE:
|
b
|
Two objects.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
ObservedMorphism
|
The braiding (swap) isomorphism. |
Source code in src/quivers/categorical/monoidal.py
CartesianProductMonoidal
¶
CartesianProductMonoidal(algebra: Algebra | None = None)
Bases: MonoidalStructure
The symmetric monoidal structure given by the cartesian product of sets.
The tensor of objects is their cartesian product (ProductSet) and
the unit is the one-element set (Unit = FinSet(name="1",
cardinality=1)). On V-matrices this is a symmetric tensor product
and not a cartesian one: a relation cannot be copied naturally, so
× is not the categorical product of V-matrices.
Since ProductSet auto-flattens, the associator (A×B)×C → A×(B×C) is the identity (both sides flatten to ProductSet(A,B,C)). The braiding A×B → B×A is a permutation tensor.
| PARAMETER | DESCRIPTION |
|---|---|
algebra
|
The enrichment algebra for coherence morphisms.
TYPE:
|
Source code in src/quivers/categorical/monoidal.py
product
¶
product(a: SetObject, b: SetObject) -> ProductSet
associator
¶
associator(a: SetObject, b: SetObject, c: SetObject) -> ObservedMorphism
(A × B) × C → A × (B × C).
Since ProductSet flattens, both sides are ProductSet(A,B,C), so this is the identity morphism.
Source code in src/quivers/categorical/monoidal.py
left_unitor
¶
left_unitor(a: SetObject) -> ObservedMorphism
I × A → A (project out the unit component).
The tensor maps (1, a₁, ..., aₙ) → (a₁, ..., aₙ). Since Unit has size 1, this is a "squeeze" that drops the trivial dimension.
Source code in src/quivers/categorical/monoidal.py
right_unitor
¶
right_unitor(a: SetObject) -> ObservedMorphism
A × I → A (project out the unit component).
The tensor maps (a₁, ..., aₙ, 1) → (a₁, ..., aₙ).
Source code in src/quivers/categorical/monoidal.py
braiding
¶
braiding(a: SetObject, b: SetObject) -> ObservedMorphism
A × B → B × A (swap permutation).
The tensor has shape (*a.shape, *b.shape, *b.shape, *a.shape) with unit on entries where the swap holds.
Source code in src/quivers/categorical/monoidal.py
EmptySet
didactic-model
¶
Bases: SetObject
The initial object (empty set) with cardinality 0.
Used as the unit for coproduct monoidal structure.
CoproductMonoidal
¶
CoproductMonoidal(algebra: Algebra | None = None)
Bases: MonoidalStructure
Coproduct monoidal structure: (FinSet, +, ∅).
The product is the coproduct (CoproductSet), the unit is the initial object (EmptySet with cardinality 0).
| PARAMETER | DESCRIPTION |
|---|---|
algebra
|
The enrichment algebra for coherence morphisms.
TYPE:
|
Source code in src/quivers/categorical/monoidal.py
product
¶
product(a: SetObject, b: SetObject) -> CoproductSet
associator
¶
associator(a: SetObject, b: SetObject, c: SetObject) -> ObservedMorphism
(A + B) + C → A + (B + C).
Since CoproductSet flattens, both sides are CoproductSet(A,B,C), so this is the identity.
Source code in src/quivers/categorical/monoidal.py
left_unitor
¶
left_unitor(a: SetObject) -> ObservedMorphism
∅ + A → A.
Since ∅ has size 0, CoproductSet(∅, A) has the same size as A. The unitor is the identity (offset for A starts at 0).
Source code in src/quivers/categorical/monoidal.py
right_unitor
¶
right_unitor(a: SetObject) -> ObservedMorphism
A + ∅ → A.
Since ∅ has size 0, CoproductSet(A, ∅) has the same size as A.
Source code in src/quivers/categorical/monoidal.py
braiding
¶
braiding(a: SetObject, b: SetObject) -> ObservedMorphism
A + B → B + A (block swap).
Swaps the two coproduct components.
Source code in src/quivers/categorical/monoidal.py
The EMPTY singleton is documented on the
categorical overview.
Cited sources¶
Saunders Mac Lane. Categories for the Working Mathematician. Volume 5 of Graduate Texts in Mathematics. Springer, 2 edition, 1998. URL: https://link.springer.com/book/10.1007/978-1-4757-4721-8, doi:10.1007/978-1-4757-4721-8.