rigid#

Implements the free rigid monoidal category.

The objects are given by the free pregroup, the arrows by planar diagrams.

>>> unit, s, n = Ty(), Ty('s'), Ty('n')
>>> t = n.r @ s @ n.l
>>> assert t @ unit == t == unit @ t
>>> assert t.l.r == t == t.r.l
>>> left_snake, right_snake = Id(n.r).transpose(left=True), Id(n.l).transpose()
>>> assert left_snake.normal_form() == Id(n) == right_snake.normal_form()
>>> from discopy import drawing
>>> drawing.equation(
...     left_snake, Id(n), right_snake, figsize=(4, 2),
...     path='docs/_static/imgs/rigid/snake-equation.png')
../_images/snake-equation.png

discopy.rigid.Ob(name[, z])

Implements simple pregroup types: basic types and their iterated adjoints.

discopy.rigid.Ty(*t)

Implements pregroup types as lists of simple types.

discopy.rigid.PRO([n])

Objects of the free rigid monoidal category generated by 1.

discopy.rigid.Diagram(dom, cod, boxes, offsets)

Implements diagrams in the free rigid monoidal category.

discopy.rigid.Id([dom])

Define an identity arrow in a free rigid category

discopy.rigid.Box(name, dom, cod, **params)

Implements generators of rigid monoidal diagrams.

discopy.rigid.Swap(left, right)

Implements swaps of basic types in a rigid category.

discopy.rigid.Cup(left, right)

Defines cups for simple types.

discopy.rigid.Cap(left, right)

Defines cups for simple types.

discopy.rigid.Functor(ob, ar[, ob_factory, ...])

Implements rigid monoidal functors, i.e. preserving cups and caps.