Retrotransformations

Published

October 20, 2023

This post is cross-posted at the Topos Institute blog.

In recent work, Michael Lambert and I showed that cartesian double theories and their models, which are span-valued cartesian lax functors, provide a unifying framework for doctrines, at least up to a certain level in the hierarchy of categorical logic (). We considered two kinds of morphisms between lax double functors, namely lax natural transformations and modules, and showed that they form the arrows and proarrows of a (virtual) double category. Yet there is a third known kind of morphism between lax functors, transformations whose components are proarrows rather than arrows. We did not consider such “protransformations” between models of double theories. Are they good for anything? The answer, it turns out, is yes!

In this post, we will see that lax protransformations of a special kind, which I call “retrotransformations” after Robert Paré’s “retrocells” (), generalize a concept that has attracted interest lately: cofunctors. A cofunctor between categories is the purest distillation of the bidirectional mapping that occurs in a split opfibration or a delta lens, where objects are sent “forward” and morphisms are sent “backward” in a compatible way. The inspiration for this post is Bryce Clarke’s PhD thesis, The double category of lenses (), where cofunctors are shown to be the “retromorphisms” arising from retrocells in a double category. Alternatively, cofunctors are morphisms between polynomial comonoids, a point of view thoroughly investigated by my colleagues at Topos Institute ().

The big picture is that retrotransformations fit into this table:

Single object Multi-object
Functor Natural transformation
Cofunctor Retrotransformation
Profunctor Module

The left column lists notions of morphism between categories. The right column lists notions of morphism between lax functors F,G:DE, which when specialized to lax functors F,G:1Span recover the left column. Thus, a retrotransformation is a “multi-object cofunctor” or, more generally, a “multi-object retromorphism.”

Retrotransformations between models of double theories are a device for generating new kinds of “generalized cofunctors,” which seems especially useful since cofunctors are so much less studied than functors or profunctors. As illustrations, we define “monoidal cofunctors” between monoidal categories and “multicofunctors” between multicategories. Analogously, we can define delta lenses between monoidal categories and between multicategories.

Lax protransformations

As usual with such matters, protransformations have a slick, conceptual definition, which then needs to be unpacked to be useful in any concrete situation. Let’s start with the conceptual definition.

Definition 1 Let F,G:DE be lax functors between double categories, viewed as pseudocategories in Cat. A lax protransformation τ:FG is a lax natural transformation from F to G, internal to Cat.

So, a lax protransformation τ:FG consists of first, a functor τ0:D0E1, the components of the protransformation, which must well-typed in that the diagram

commutes; and second, a natural transformation

giving the pronaturality comparisons of the lax protransformation, which must also be well-typed in that the pasting below involving the source functor

is equal to the identity on F0s=sF1:D1E0, and similarly for the target functor. That is to say, the source and target of each component of τ1 are identity arrows. Finally, the naturality comparisons must be coherent with respect to external composition and identities. We omit these final two commutative diagrams, but they can be found in (, Equations 3.5 & 3.6).

We are halfway done unpacking the definition. When it is fully unpacked, we recover a definition mildly generalizing that in (, Definition 3.8.2). With the abbreviations τx:=τ0(x), τf:=τ0(f), and τm:=(τ1)m for objects x, arrows f, and proarrows m in D, a lax protransformation τ:FG:DE is seen to consist of

  • for each object xD, a proarrow τx:FxGx in E, the component of τ at x;

  • for each arrow f:xy in D, a cell τf in E of the form

    called the component of τ at f;

  • for each proarrow m:xy in D, a globular cell τm in E of the form

    called the pronaturality comparison of τ at m.

These must satisfy the following axioms.

  • Functorality of components: τfg=τfτg and τ1x=1τx.

  • Naturality with respect to cells: for every cell α:mn in D with source f and target g,

  • Coherence with respect to external composition: for every pair of composable proarrows m:xy and n:yz in D,

  • Coherence with respect to external identities: for every object xD,

Finally, we say that a lax protransformation τ is pseudo if τ1 is a natural isomorphism, i.e., each comparison cell τm is invertible. This definition of a pseudo protransformation agrees with (, Definition 3.8.2).

It is interesting to ask what lax protransformations look like in examples, but we will set this aside for now and turn immediately to a specialization of the concept.

Retrotransformations

We are interested in lax protransformations whose components at objects, despite being proarrows, are obtained from ordinary arrows. That is what companions in a double category do. A companion of an arrow f:xy is a proarrow f!:xy along with two cells that bind f and f! together in a suitable way. For a review of companions, see (). A double category with companions and conjoints is precisely an equipment (, Theorem 4.1), but merely having companions is enough for present purposes.

A retrotransformation between lax functors is a lax protransformation whose components at objects are companions, in a coherent way.

Definition 2 Let D and E be double categories, where E has companions, and let F,G:DE be lax functors. A retrotransformation (ϕ,τ):FG consists of

  • a natural transformation ϕ:F0G0 between functors, and
  • a lax protransformation τ:FG between lax functors

such that

  • for every object x in D, the proarrow τx=(ϕx)!:FxGx in E is the companion of the arrow ϕx:FxGx, and
  • for every arrow f:xy, the cell τf is induced by the naturality square for ϕ at f.

Let us clarify the meaning of the last condition. By the sliding rule for companions (), the component of a retrotransformation at an arrow f:xy

can be identified with a special cell

The last condition in the definition of a retrotransformation says that the cell τ¯f is the image under the external identity id:E0E1 of the naturality square

So, contrary to initial appearances, a retrotransformation actually contains less data than a general lax protransformation. There is, for each object xD, the component ϕx:FxGx, and for each proarrow m:xy in D, the pronaturality comparison

The sliding rule cannot be used to simplify these cells, which are what give retrotransformations their distinctive character.

The following proposition explains how a retrotransformation between lax functors is a “multi-object retromorphism” in the sense of Paré (). Recall that if D is a strict double category and F:DSpan is a lax functor, then each set Fx in the image of F becomes the set of objects of a category. To say this more generally and precisely, for any double category E, a lax functor F:DE sends each object x in D to a category object (Fx,Fidx,Fx,x,Fx) in E. For more details, see ().

Proposition 1 Let F,G:DE be lax functors from a strict double category D to a double category E with companions, and let (ϕ,τ):FG be a retrotransformation. Then for each object x in D, the pair (ϕx,τidx) is a retromorphism from the category (Fx,Fidx,Fx,x,Fx) to the category (Gx,Gidx,Gx,x,Gx) in E. In particular, when E is Span, the pair (ϕx,τidx) is a cofunctor between categories.

Proof. For each object xD, the component ϕx:FxGx is the arrow part of a retromorphism and the comparison cell

is the retrocell part of the retromorphism. The two coherence axioms for a lax protransformation immediately give the two axioms of a retromorphism (, Definition 6.1). The last statement follows because retromorphisms between categories (in Span) are known to be cofunctors (, Example 6.7).

Corollary 1 A retrotransformation between lax functors 1Span is precisely a cofunctor between categories.

Delta lenses between lax functors

The description of a delta lens as a compatible pairing of a functor with a cofunctor () suggests that a delta lens between lax functors should be defined as a compatible pairing of a natural transformation with a retrotransformation.

Definition 3 Let D and E be double categories, where E has companions, and let F,G:DE be lax functors. A delta lens (ϕ,τ) from F to G is a (strict) natural transformation ϕ:FG together with a lax protransformation τ:FG, satisfying the following two compatibility axioms.

  • Compatibility on objects: the pair (ϕ0,τ) is a retrotransformation, where ϕ0:F0G0 denotes the ordinary natural transformation underlying ϕ.
  • Compatibility on proarrows: for every proarrow m:xy in D, we have

The second axiom says that the cell τm is a section of ϕm, modulo the binding cells for the companions (denoted by square brackets).

Proposition 2 Let F,G:DE be lax functors from a strict double category D to a double category E with companions, and let (ϕ,τ) be a delta lens from F to G. Then for each object x in D, the pairs (ϕx,ϕidx) and (ϕx,τidx) form a lens from the category (Fx,Fidx,Fx,x,Fx) to the category (Gx,Gidx,Gx,x,Gx) in E.

Proof. The pair (ϕx,ϕidx) is a functor, whereas (ϕx,τidx) is a cofunctor/retromorphism by the previous proposition. That these are suitably compatible also follows directly. Specifically, Clarke () defines a delta lens between category objects abstractly, but gives a concrete description in (, Equation 5.19). That equation is precisely the second compatibility axiom above, instantiated at the proarrow idx:xx.

Corollary 2 A delta lens between lax functors 1Span is precisely a delta lens between categories.

Cartesian lax protransformations

In order to study generalized cofunctors between categorical structures such as monoidal categories and multicategories, we must consider models of cartesian double theories and lax protransformations between such models. One way to define a cartesian double category is as a pseudocategory in CartCat, the 2-category of categories with finite products, functors preserving finite products, and natural transformations. This immediately suggests the following definition.

Definition 4 Let F,G:DE be cartesian lax functors between cartesian double categories, viewed as pseudocategories in CartCat. A cartesian lax protransformation is lax natural transformation from F to G, internal to CartCat.

Equivalently, a lax protransformation τ:FG between cartesian lax functors is cartesian if the underlying functor τ0:D0E1 preserves finite products, i.e., there are canonical isomorphisms τx×xτx×τx and τ1D01E1.

No extra conditions are needed for a retrotransformation or delta lens (ϕ,τ) between cartesian lax functors. Since natural transformations and companions both preserve products, the assignment τx=(ϕx)! is always product-preserving.

Example: monoidal cofunctors between monoidal categories

To my knowledge, no notion of structure-preserving cofunctor between monoidal categories has been defined in the literature. We give a definition using the machinery developed so far. Let TPsMon be the cartesian double theory of pseudomonoids (, Theory 6.6), whose models are (weak) monoidal categories.

Definition 5 A monoidal cofunctor (resp. monoidal delta lens) between monoidal categories is a retrotransformation (resp. delta lens) between the corresponding cartesian lax functors TPsMonSpan.

Let’s sketch what a monoidal cofunctor amounts to concretely. Let (ϕ,τ):FG be a retrotransformation between models F,G:TPsMonSpan, regarded as monoidal categories. The generating object x of TPsMon yields a cofunctor (ϕx,τidx) between the underlying categories of the monoidal categories. By naturality with respect to the arrows :x2x and I:1x in TPsMon, the diagrams

commute, i.e., the object map of the cofunctor strictly preserves the monoidal product and unit. Next, naturality with respect to the cells id:idx2idx and idI:1idx says that the morphism map of the cofunctor preserves the monoidal product and unit. For example, the first of the two equations is

The equation is well-typed (i.e., the cell τ exists) by the above naturality square for :x2x, and it says that the monoidal product of the liftings of a pair of morphisms is equal to the lifting of the monoidal product. Finally, naturality with respect to the associator and unitor cells in the double theory say that liftings of morphisms preserve associators and unitors in the monoidal categories.

Thus, a monoidal delta lens from a monoidal category C to another D is a strict monoidal functor CD together with a monoidal cofunctor CD, which share an object map and have the property that the cofunctor’s lifting operation is a section of the functor’s morphism map.

It may seem strange that monoidal cofunctors and monoidal delta lenses strictly preserve monoidal products, even for weak monoidal categories, but this is consistent with related ideas in the literature. Shulman defines a monoidal opfibration between monoidal categories to be a functor that is both an opfibration and a strict monoidal functor, such that the monoidal product of the domain category preserves opcartesian liftings (). A monoidal delta lens is what remains of a split monoidal opfibration when the universal property is discarded, just as a delta lens is for a split opfibration.

Example: multicofunctors between multicategories

Although often regarded as obscure, multicategories are in many ways simpler than monoidal categories, and the same is true for multicofunctors compared with monoidal cofunctors. Let TPromon be the cartesian double theory of promonoids (, Theory 6.8), whose (lax) models are multicategories. In this theory, there is a unique proarrow of form pn:xnn for every arity n0, whose image in a model is the span of n-ary multimorphisms.

Definition 6 A multicofunctor (resp. delta lens) between multicategories is a retrotransformation (resp. delta lens) between the corresponding cartesian lax functors TPromonSpan.

Let’s take a quick look at a retrotransformation (ϕ,τ):FG, identifying the models F,G:TPromonSpan with multicategories M and N. The data consists of the component ϕx:FxGx, giving a map between objects f:ObMObN, and for each arity n0, the pronaturality comparison

giving a lifting operation τn:=τpn on n-ary multimorphisms, which can be pictured as

Because the theory of promonoids has no nontrivial arrows or cells, the only relevant axioms are the coherence axioms for lax protransformations. These axioms say that the lifting operations preserve composition of multimorphisms and identity morphisms in the multicategories.

Discussion

In a sense, this post completes the story about morphisms between models of cartesian double theories begun in (). There are three more-or-less known notions of morphism between lax double functor—natural transformations, protransformations, and modules—and they have all been shown to give useful notions of morphism between models, generalizing functors, cofunctors, and profunctors between categories.

There is plenty more that remains to be said. For starters, functors and cofunctors between categories form a double category () and so should natural transformations and retrotransformations between lax double functors. There is a known notion of modification between natural transformations and pseudo protransformations (, Definition 3.8.3) that could be plausibly be adapted to this purpose. However, the details need to be worked out. Beyond that, it is natural to wonder how all three notions of morphism between lax functors fit together and whether they can be united inside some three-dimensional structure.

References

Clarke, Bryce. 2020. “Internal Split Opfibrations and Cofunctors.” Theory and Applications of Categories 35 (44): 1608–33. http://www.tac.mta.ca/tac/volumes/35/44/35-44abs.html.
———. 2022a. “A General Framework for Cofunctors.” Presented at the Computer science theory seminar, Tallinn University of Technology. https://bryceclarke.github.io/talk-slides/2022-04-Computer-science-theory-seminar.pdf.
———. 2022b. “The Double Category of Lenses.” PhD thesis, Macquarie University. https://figshare.mq.edu.au/articles/thesis/22045073.
Grandis, Marco. 2019. Higher Dimensional Categories: From Double to Multiple Categories. World Scientific. DOI:10.1142/11406.
Lambert, Michael, and Evan Patterson. 2024. “Cartesian Double Theories: A Double-Categorical Framework for Categorical Doctrines.” Advances in Mathematics 444: 109630. DOI:10.1016/j.aim.2024.109630. arXiv:2310.05384.
Martins-Ferreira, Nelson. 2006. “Pseudo-Categories.” Journal of Homotopy and Related Structures 1 (1): 47–78. arXiv:math/0604549.
Niu, Nelson, and David Spivak. 2023. Polynomial Functors: A Mathematical Theory of Interaction. https://github.com/ToposInstitute/poly.
Paré, Robert. 2011. “Yoneda Theory for Double Categories.” Theory and Applications of Categories 25 (17): 436–89. http://www.tac.mta.ca/tac/volumes/25/17/25-17abs.html.
———. 2023. “Retrocells.” arXiv:2306.06436.
Shulman, Michael. 2008. “Framed Bicategories and Monoidal Fibrations.” Theory and Applications of Categories 20 (18): 650–738. http://www.tac.mta.ca/tac/volumes/20/18/20-18abs.html.

Footnotes

  1. Our usage of “natural transformation” follows Paré (). Under our orientation convention, where arrows are vertical and proarrows are horizontal, natural transformations are also called “vertical transformations.” However, the meaning of the latter phrase varies from author to author, hence our desire to avoid it.↩︎

  2. Besides using different terminology for pseudo protransformations, Grandis takes his comparison cells to go in the oplax, rather than the lax, direction. Of course, this makes no difference in the pseudo case.↩︎

  3. Terminology for categories internal to a double category varies. Paré () calls them “monads,” which is meant to evoke “monads in the underlying bicategory of the double category.”↩︎

  4. Recall that such a natural transformation automatically preserves finite products in the sense that it is a monoidal natural transformation for any choice of cartesian monoidal structure.↩︎

  5. A different but equivalent definition of a multicofunctor is as a retromorphism between category objects in the double category of T-spans, where T=List is the list monad (). Thanks to Bryce Clarke for pointing this out.↩︎