A Natural Separation of Concerns
Total Page:16
File Type:pdf, Size:1020Kb
A Natural Separation of Concerns Edward Morehouse∗ Tallinn University of Technology Abstract In this paper we present a 3-dimensional graphical calculus to rep- resent the hierarchy of morphisms (functors, transformations and mod- ifications) between 2-dimensional categories of globular shape. In this setting the property of naturality, which is conventionally expressed in terms of equations between component diagrams, can be represented di- rectly as the separation of the natural structure from the portion of a diagram preceding it in the composition order. From this we recover the component-based presentations of natural structures as projections using global elements, where their relations correspond to a literal shift of per- spective. We then augment the graphical calculus in order to represent and reason about functors between 2-dimensional categories that preserve their composition only up to a directed comparison structure. To illus- trate the utility of this graphical calculus we consider the examples of cones and limits in 2-categories, as well as the Gray tensor product of 2-categories. 1 Introduction In his essay, On the role of scientific thought, Edsger Dijkstra advocates for the concept of a “separation of concerns” as a cornerstone of scientific think- ing [Dij82]. The basic premise is that the things we strive to understand are often quite complex, and this complexity can easily overwhelm our abilities to reason about them. A useful method for coping with our limited capacities to reason about complex things is to identify attributes that are both tractable and independently meaningful, and to study them in their own right, while keeping in mind that our understanding of such attributes affords us only a partial understanding of the things from which they are derived. In the words of Dijkstra, A scientific discipline separates a fraction of human knowledge from the rest: we have to do so, because, compared with what could be known, we have very, very small heads. It also separates a fraction of the human abilities from the rest; again, we have to do so, because the maintenance of our non-trivial abilities requires that they are exercised daily and a day—regretfully enough—has only 24 hours. ∗This research was supported by the ESF funded Estonian IT Academy research measure (project 2014-2020.4.05.19-0001). 1 Theories of higher-dimensional categorical structures are examples of ideas that some people, present company included, struggle to fit into their heads and keep resident there. In low dimensions diagrammatic reasoning can be a useful tool for gaining insight into categorical structures and their properties. The concept of naturality emerges quite early, both chronologically and con- ceptually, in the study of categories. Saunders Mac Lane is alleged [Bae] to have said, “I didn’t invent categories to study functors; I invented them to study natural transformations.” The naturality of categorical structures, in- cluding transformations and modifications, is conventionally expressed in terms of equations between component diagrams. However, naturality has another diagrammatic interpretation that allows us to reason about natural structures independently of their component-based presentations. This allows us to see the component diagrams as mere projections of the structures themselves, and the relations that they obey as arising from a simple shift of perspective. 2 A Gloss on Natural Transformations An elementary presentation of a natural transformation [Mac98] between func- tors between (ordinary) categories α ∶ (ℂ → 픻) (F → G) consists of an assign- ment of a component morphism αA ∶ 픻 (FA → GA) to each object A ∶ ℂ such that for each morphism 푓 ∶ ℂ (A → B) there is a commuting naturality square in 픻 (FA → GB): F푓 FA FB αA αB (2.1) GA GB G푓 Such diagrammatic representations of categorical structures and properties are useful, especially when the composition involved is strict, because we may freely assemble them into compound diagrams of structures and properties by pasting them together along compatible boundaries. A logically equivalent and often more perspicuous perspective is achieved by con- sidering the dual-graph presentation of such a diagram, where each 푘-dimensional cell of an 푛-dimensional diagram is drawn as an (푛−푘)-dimensional region [JS91; Sel11; BV17], with points sometimes “fattened up” to beads to facilitate label- ing. For example, the dual of the diagram above can be drawn as follows (with the apparent crossing to be explained shortly). F푓 αB FB FA GB (2.2) GA αA G푓 This diagram asserts the equality of the parallel 1-dimensional paths F푓 ⋅αB and αA⋅G푓, depicted as the top and bottom boundaries, between the 0-dimensional objects FA and GB, depicted as the left and right boundaries. Note that the 2 square interior in diagram (2.1), and its graph dual, the apparent intersection point in diagram (2.2), represent a property (namely, morphism equality) rather than a structure of 픻, as there are no 2-dimensional structures in a 1-dimensional category. Rather than regarding the naturality of α as a property in the codomain category 픻, we may instead regard it as a property in an ambient globular 2-dimensional category where objects are suitably small categories and arrows are functors between them. We do this by regarding an object of the domain category A ∶ ℂ as a global element or constant functor from the singleton category A ∶ ퟙ → ℂ, and an arrow 푓 ∶ ℂ (A → B) as a (necessary natural) 2-cell between such1. In this setting the naturality condition for α asserts that: A F A F 푓 α ퟙ ℂ 픻 = ퟙ ℂ 픻 (2.3) α 푓 B G B G Here we have expressed this equation as a relation between diagrams, which necessarily have equal boundaries in all dimensions. We can also express it as a relation within a diagram by enlisting another dimension, in which the boundaries are the two diagrams related in equation (2.3): 푓 F α 픻 = B A ퟙ α G 푓 This asserts the equality of the parallel 2-dimensional paths (푓 ⋅⋅ F) ⋅ (B ⋅⋅ α) and (A ⋅⋅ α) ⋅ (푓 ⋅⋅ G), depicted as the top and bottom boundaries, between the parallel 1-dimensional paths A ⋅ F and B ⋅ G, depicted as the back and front boundaries, between the 0-dimensional objects ퟙ and 픻, depicted as the left and right boundaries. Briefly, our notation for globular composition is ordered diagrammatically, with the number of infix dots indicating the number of dimensions below that of the highest-dimensional cell being composed at which the composition takes place. For reasons that will be explained shortly, we will draw this volume diagram with the surface containing the natural transformation separated from the surface 1The global elements are sometimes written using a variant notation, such as “⌜A⌝” and “⌜푓⌝”, in order to distinguish them from the objects and morphisms. But we prefer to disam- biguate using either context or explicit boundary annotations instead. 3 preceding it in the composition order: 푓 F α B (2.4) ퟙ A ℂ 픻 α G 푓 If we were to view this diagram, which we can think of as embedded within a cube, from the perspective of the normal vector of its 0-dimensional domain face ퟙ we would see projected into 픻 precisely the naturality square depicted in diagram (2.2), with the apparent intersection point of the lines 푓 and α repre- senting the only 2-dimensional attribute available in a 1-dimensional category, namely, the equality relation between parallel arrows. But what if we were to draw diagram (2.4) in a more “meandering” way so that when we take the projection into 픻 it appears that there are three cross- ings rather than one? Later when we consider directed naturality of higher- dimensional structures we will impose a progressivity requirement in order to rule out meaningless projection diagrams, but in the case of natural transfor- mations between functors no such restriction is needed. Morphism equality is an equivalence relation so both of the following diagrams represent the equality F푓 ⋅ αB = F푓 ⋅ αB, the former by reflexivity and the latter by diagram (2.2) together with symmetry and transitivity. Thus only the parity of the apparent crossings matters, and this is determined by the diagram boundary. F푓 αB F푓 αB , αA G푓 (2.5) F푓 αB F푓 αB If we add another natural transformation β ∶ (ℂ → 픻) (G → H) then the volume diagram corresponding to the naturality of the composition of α and β along their shared 1-cell G, the so-called “vertical” composition α ⋅ β, is shown below on the left. Its projection into 픻 is shown in the middle, whose dual diagram, the conventional pasting diagram depicting the naturality of vertical composites of natural transformations, is shown on the right. 푓 F푓 α F푓 αB βB FA FB F β αA αB B G푓 ퟙ ℂ G 픻 , , GA GB A G푓 βA βB α H β HA HB 푓 αA βA H푓 H푓 Alternatively, we can add another category 피, functors I, J ∶ 픻 → 피, and a nat- ural transformation γ ∶ (픻 → 피) (I → J). The volume diagram corresponding 4 to the naturality of the composition of α and γ along their shared 0-cell 픻, the so-called “horizontal” composition α ⋅⋅ γ, is shown below. 푓 α I γ F B ퟙ A ℂ 픻 피 G γ J α 푓 Depending on our perspective, its projection into 피 looks, up to homotopy and modulo gratuitous consecutive crossings, like one of the following: I(F푓) I(αB) γ(GB) I(F푓) I(αB) γ(GB) I(F푓) I(αB) γ(GB) I(G푓) γ(FB) I(αA) , , J(αB) (2.6) γ(GA) J(F푓) γ(FA) J(αA) J(G푓) γ(FA) J(αA) J(G푓) γ(FA) J(αA) J(G푓) Leaving aside for the moment the diagram with the triple-crossing critical point, in each of the other diagrams all of the pairwise crossings represent morphism equalities as instances of diagram (2.2), two by the naturality of γ and the third as a functor image of the naturality of α.