markov#
The free Markov category, i.e. a semicartesian category with a supply of commutative comonoid, see Fritz and Liang [FL23].
Summary#
A Markov diagram is a symmetric diagram with |
|
A Markov box is a symmetric box in a Markov diagram. |
|
Symmetric swap in a Markov diagram. |
|
A permutation in a Markov category. |
|
The copy of an atomic type |
|
A Markov functor is a symmetric functor that preserves copies. |
Axioms#
>>> x = Ty('x')
>>> copy, merge = Copy(x), Merge(x)
>>> unit, delete = Merge(x, n=0), Copy(x, n=0)
Commutative monoid#
>>> unitality = Equation(unit @ x >> merge, Id(x), x @ unit >> merge)
>>> associativity = Equation(merge @ x >> merge, x @ merge >> merge)
>>> commutativity = Equation(Swap(x, x) >> merge, merge)
>>> assert unitality and associativity and commutativity
>>> Equation(unitality, associativity, commutativity, symbol='').draw(
... doctest="docs/_static/frobenius/monoid.svg")
Cocommutative comonoid#
>>> counitality = Equation(copy >> delete @ x, Id(x), copy >> x @ delete)
>>> coassociativity = Equation(copy >> copy @ x, copy >> x @ copy)
>>> cocommutativity = Equation(copy >> Swap(x, x), copy)
>>> assert counitality and coassociativity and cocommutativity
>>> Equation(counitality, coassociativity, cocommutativity, symbol='').draw(
... doctest="docs/_static/frobenius/comonoid.svg")
Coherence#
>>> assert Equation(Diagram.copy(x @ x, n=0), delete @ delete)
>>> assert Equation(Diagram.copy(x @ x),
... copy @ copy >> x @ Swap(x, x) @ x)
>>> assert Equation(Diagram.merge(x @ x, n=0), unit @ unit)
>>> assert Equation(Diagram.merge(x @ x),
... x @ Swap(x, x) @ x >> merge @ merge)
Note
Equality of Markov diagrams is computed by translation to hypergraph.
Both copy and merge boxes are translated to spiders, thus when they appear
in the same diagram they automatically satisfy the frobenius axioms.