symmetric#

The free symmetric category, i.e. diagrams with swaps.

Summary#

Diagram

A symmetric diagram is a braided diagram with Swap boxes.

Box

A symmetric box is a braided box in a symmetric diagram.

Swap

The swap of atomic types left and right.

Category

A symmetric category is a braided category with a method swap.

Functor

A symmetric functor is a monoidal functor that preserves swaps.

Axioms#

The dagger of Swap(x, y) is Swap(y, x).

>>> x, y, z = map(Ty, "xyz")
>>> assert Diagram.swap(x, y @ z)[::-1] == Diagram.swap(y @ z, x)

Swaps have their dagger as inverse, up to braided.Diagram.simplify().

>>> swap_unswap = Swap(x, y) >> Swap(y, x)
>>> assert swap_unswap.simplify() == Id(x @ y)
>>> from discopy.drawing import Equation
>>> Equation(swap_unswap, Id(x @ y)).draw(
...     path='docs/_static/symmetric/inverse.png', figsize=(3, 2))
../_images/inverse1.png

The hexagon equations hold on the nose.

>>> left_hexagon = Swap(x, y) @ z >> y @ Swap(x, z)
>>> assert left_hexagon == Diagram.swap(x, y @ z)
>>> right_hexagon = x @ Swap(y, z) >> Swap(x, z) @ y
>>> assert right_hexagon == Diagram.swap(x @ y, z)
>>> Equation(left_hexagon, right_hexagon, symbol='').draw(
...     space=2, path='docs/_static/symmetric/hexagons.png', figsize=(5, 2))
../_images/hexagons1.png