Documentation

PolyFun.PFunctor.Lens.Bang

The multiset exponential on lenses #

The exponential bang P of a polynomial functor P has the positions of P and, at a position a, the finite multisets of directions of P at a as directions. A lens bang P ⇆ Q is a forward map on positions with a backward map sending a direction of Q to a finite multiset of directions of P; this is the shape of a morphism of the Diller–Nahm variant of the Dialectica category (de Paiva, The Dialectica categories, 1991).

On the category of lenses bang is a comonad, the of-course modality of linear logic (Girard, Linear logic, Theoret. Comput. Sci. 50, 1987): the counit (dereliction) sends a direction to the singleton multiset and the comultiplication (digging) sends a multiset of multisets to its sum. For the parallel product ⊗, each bang P is a commutative comonoid by weakening (the empty multiset) and contraction (the sum of two multisets), as in Lafont's model of the exponential (Logiques, catégories et machines, thesis, Paris 7, 1988). The functor bang sends the categorical product * to the parallel product and the terminal object 1 to the unit y; these are the Seely isomorphisms (Seely, Linear logic, ∗-autonomous categories and cofree coalgebras, Contemp. Math. 92, 1989).

Main definitions #

Main results #

A multiset over a sum is the sum of its left part and its right part.

The left part of a sum of multisets of left and right elements.

The right part of a sum of multisets of left and right elements.

@[reducible, inline]

The multiset exponential: the positions of P, and at a position the finite multisets of directions of P at it.

Equations
Instances For

    The comonad structure #

    The action of the exponential on a lens: the backward map acts on each element of a multiset.

    Equations
    Instances For

      The counit (dereliction): a direction demands itself once.

      Equations
      Instances For

        The comultiplication (digging): a multiset of multisets demands their sum.

        Equations
        Instances For

          The exponential preserves identities.

          The exponential preserves composition.

          Left counit law: the counit at bang P after the comultiplication is the identity.

          Right counit law: the exponential of the counit after the comultiplication is the identity.

          Coassociativity of the comultiplication.

          Weakening and contraction #

          Weakening: no direction is demanded.

          Equations
          Instances For

            Contraction: a position is duplicated, and a pair of multisets demands their sum.

            Equations
            Instances For

              Weakening on the left after contraction is the inverse of the left unitor.

              Weakening on the right after contraction is the inverse of the right unitor.

              The Seely isomorphisms #

              A finite multiset over a sum is a pair of finite multisets.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For

                The Seely isomorphism: the exponential of a categorical product is the parallel product of the exponentials (Seely 1989).

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For

                  The Seely isomorphism at the unit: the exponential of the terminal object is the unit of the parallel product.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For

                    Contraction is the Seely image of the exponential of the diagonal.

                    The comonad on the category of lenses #

                    The exponential as an endofunctor of the category of lenses.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For

                      The exponential as a comonad on the category of lenses.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For

                        The commutative comonoid structure #

                        @[instance_reducible]

                        bang P is a comonoid for the parallel product, by weakening and contraction.

                        Equations