Typesetting Commutative Diagrams Phisms Are Equal in the Given Category
Total Page:16
File Type:pdf, Size:1020Kb
466 TUGboat, Volume 15 (1994), No. 4 Typesetting Commutative Diagrams phisms are equal in the given category. For instance, saying that the diagram1 Gabriel Valiente Feruglio f / B University of the Balearic Islands A 0 Mathematics and Computer Science Dept. g g E-07071 Palma de Mallorca (Spain) / C D [email protected] 0 f Abstract commutes is exactly the same as saying that There have been several efforts aimed at providing TEX and its derivatives with a suitable mechanism for type- 0 0 setting commutative diagrams, with the consequent avail- g ◦ f = f ◦ g. ability of several macro packages of widespread use in the category theory community, and a long debate about the best syntax to adopt for commutative diagrams in As a notation, the graphic style of presenta- LATEX3 has taken place during 1993 in the CATEGORIES discussion list. From the user’s point of view, however, tion inherent to commutative diagrams makes state- there is not much guidance when it comes to choosing ments and descriptions involving categories more clear a macro package, and even after a decision is made, the and manageable than textual presentations. For in- conversion of diagrams from the particular conventions stance, consider the definition of an equalizer. A of a macro package to another macro package’s conven- morphism e : X → A is an equalizer of a pair of tions may prove to be rather hard. morphisms f : A → B and g : A → B if f ◦ e = Typesetting commutative diagrams is a surprisingly g ◦ e and for every morphism e0 : X0 → A satisfy- difficult problem, in comparison with TEX macro pack- ing f ◦ e0 = g ◦ e0 there exists a unique morphism ages for other purposes, as judged by the amount of code k : X0 → X such that e ◦ k = e0. needed and years of development invested. The existing An equivalent definition is that e is an equalizer macro packages for typesetting commutative diagrams if the upper part of the diagram are reviewed in this paper and they are compared accord- f e / / / ing to several criteria, among them the capability to pro- / X A B > O g } duce complex diagrams, quality of the output diagrams, } } } k } ease of use, quality of documentation, installation pro- 0 } e } cedures, resource requirements, availability, and porta- } 0 bility. The compatibility of the different macro packages X is also analyzed. commutes and, whenever the lower part of the dia- gram also commutes, there is a unique k such that the whole diagram commutes. −−∗−− As a tool for thought, proofs involving prop- erties that are stated in terms of commutative dia- grams can often be given in a “visual” way, in what has been called diagram chasing. For instance, the 1 Introduction proposition that if both inner squares of the follow- Commutative diagrams are a kind of graph that is ing diagram commute, then also the outer rectangle widely used in category theory, not only as a concise commutes, g and convenient notation but also as a powerful tool f / / B C for mathematical thought. A a c A diagram in a certain category is a collection b of nodes and directed arcs, consistently labeled with / / 0 0 0 A B C 0 0 g objects and morphisms of the category, where “con- f sistently” means that if an arc in the diagram is labeled with a morphism f and f has domain A and codomain B, then the source and target nodes of this arc must be labeled with A and B respectively. 1 All the diagrams in this paper have been typeset us- A diagram in a certain category is said to com- ing the XY-pic macro package, unless otherwise stated. The mute if, for every pair of nodes X and Y ,allthe reader should not infer any preference by the author for that paths in the diagram from X to Y are equal, in particular macro package, but should understand that some macro package is needed for the examples in the paper. Sam- the sense that each path in the diagram determines ple diagrams typeset with the other macro packages are given through composition a morphism and these mor- in Appendix I. TUGboat, Volume 15 (1994), No. 4 467 can be proven as follows: least for all but the simplest diagrams.) This gives (g0 ◦ f 0) ◦ a = g0 ◦ (f 0 ◦ a) (associativity) a first distinction, = g0 ◦ (b ◦ f) (commutativity • one object and all departing morphisms in each of left square) non-empty cell, or =(g0 ◦ b) ◦ f (associativity) ◦ ◦ =(c g) f (commutativity • either one object or one or more morphisms in of right square) each non-empty cell. = c ◦ (g ◦ f) (associativity). Commutative diagrams2 range from simple, rect- Whether they belong together with their source angular matrices of formulae and arrows to complex, object in a cell or they use a cell on their own, mor- non-planar diagrams with curved and diagonal ar- phisms are specified by the address of their target rows of different shapes. cell. Such addresses can be implicit, absolute or rel- ative to the source cell, and they can be either arbi- 2 Constructing commutative diagrams trary or limited by the available diagonal slopes. Commutative diagrams are constructed in most cases Moreover, some macro packages even support as rectangular arrays, as Donald Knuth does in Ex- symbolic addresses, by which nodes are tagged with ercise 18.46 of [4]. The objects or vertices are set identifier names and arrows are specified by making reference to the names of their source and target much like a \matrix in TEXoranarray environ- nodes. This is a step forward in the sense of the ment in LATEX, • • LATEX principle of emphasizing structural descrip- • • • tions, and in fact it is of great help for designing complex diagrams because it divides the task into • • • two separate subtasks, the one of producing a cor- • • • • • rect and elegant arrangement of nodes and the other of laying out the correct arrows and positioning their and the morphisms or arrows are set either right labels. after the vertex where they start, ◦ -◦ 3 Evaluation guidelines ◦ ◦ -◦ 6 6 6 The following aspects are considered in the next sec- tion for each of the macro packages in turn. The ◦ ◦ -◦ ◦? -? spirit of these guidelines is to give the potential user ◦? ◦?-◦ ? a feeling of what to expect from a macro package for typesetting commutative diagrams, and they are or in a cell on their own, based on the experience of the author during the last - • ◦ • few years, as user of some of the macro packages. ◦ ◦ - • ◦ • ◦ • 3.1 Arrow styles 6 6 6 ◦ ◦ ◦ ◦ ◦ The arrows used in commutative diagrams often are of different shapes, in order to distinguish different - • ◦ • ◦ • kinds of morphisms such as monomorphisms, epi- ◦ •? ◦ ◦ ◦ -•? morphisms, isomorphisms, and inclusions, to name ◦ ◦ just a few, and sometimes they have a shaft other ? ? ? • ◦ • ◦ -• than a solid line, for instance dashed or dotted, to indicate that it is the existence of the corresponding depending on the macro package being used, where morphisms which is being characterized. the grids correspond to the sample diagram pre- A collection of built-in arrow shapes and shafts sented in Appendix I. (Sketching a commutative is included in every macro package, and some macro diagram on such a grid on paper may prove to be a packages even provide facilities for defining new ar- mandatory step before typing the actual diagram, at row styles, for instance by defining a new control se- 2 The epithet “commutative” is traditional and originates quence name and choosing a particular combination in the fact that diagrams may be used to display equations of tail (the piece that appears at the source end), such as the commutative and associative laws. Although not head (the piece that appears at the target end), and all such diagrams which people draw commute in the formal sense given, this paper adheres to tradition and all such dia- shaft, from a predefined pallette of possible heads, grams are called commutative diagrams herein. tails, and shafts. 468 TUGboat, Volume 15 (1994), No. 4 3.2 Automatic stretching diagonal slopes and a wider variety of arrow heads Most of the macro packages provide for the auto- and tails to choose from. matic stretching of arrows to meet their source and In such a case, installation can get more com- METAFONT target nodes, where meeting a node means to get as plicated. is not as easy to drive or as A close to the (rectangular) box enclosing the node as familiar to the user as TEXorLTEX; many imple- dictated by some predefined parameter. mentations do not make it available, and on oth- While this may be appropriate for most hor- ers only the system administrator is able to install izontal and vertical arrows, in the case of diagonal fonts. A ready-to-use collection of the additional arrows it may leave the arrow too far from the node, fonts at standard magnifications is distributed, how- and extra diagram fine-tuning (see below) is needed ever, with some macro packages. in such cases in order to get the arrow closer to the 3.5 Documentation node. The macro package by John Reynolds, how- ever, incorporates basic facilities for associating a This ranges from small text files to comprehensive hexagon, octagon, or diamond to a node, instead user guides, and even to book chapters. of the usual rectangle, although it does not exploit 3.6 User support them in the macros for commutative diagrams. The authors of the different macro packages have 3.3 Diagram fine-tuning been receptive to comments and willing to provide Given a correct description of the structure, a macro user support.