biclosed

Contents

biclosed#

The free biclosed monoidal category, i.e. with left and right exponentials.

Summary#

Ty

A biclosed type is a monoidal type that can be exponentiated.

Exp

A base type to an exponent type, called with **.

Over

An exponent type over a base type, called with <<.

Under

A base type under an exponent type, called with >>.

Diagram

A biclosed diagram is a monoidal diagram with Curry and Eval boxes.

Box

A biclosed box is a monoidal box in a biclosed diagram.

Eval

The evaluation of an exponential type.

Coeval

The coevaluation of an exponential type, i.e. the dagger of Eval.

Curry

The currying of a biclosed diagram.

Sum

A biclosed sum is a monoidal sum and a biclosed box.

Functor

A biclosed functor is a monoidal functor that preserves evaluation and currying.

Axioms#

Diagram.curry() and Diagram.uncurry() are inverses.

>>> x, y, z = map(Ty, "xyz")
>>> f, g, h = Box('f', x, z << y), Box('g', x @ y, z), Box('h', y, x >> z)
>>> from discopy.drawing import Equation
>>> Equation(f.uncurry(left=True).curry(left=True), f).draw(
...     path='docs/_static/biclosed/curry-left.png', margins=(0.1, 0.05))
../_images/curry-left.png
>>> Equation(h.uncurry().curry(), h).draw(
...     path='docs/_static/biclosed/curry-right.png', margins=(0.1, 0.05))
../_images/curry-right.png
>>> Equation(
...     g.curry(left=True).uncurry(left=True), g, g.curry().uncurry()).draw(
...         path='docs/_static/biclosed/uncurry.png')
../_images/uncurry.png