POSETS : a Mathematica Package PART 1: Basic Commands and Families of Posets
Total Page:16
File Type:pdf, Size:1020Kb
POSETS : A Mathematica Package PART 1: Basic Commands and Families of Posets Curtis Greene, Eugenie Hunsicker, Department of Mathematics, Haverford College 19041, July 1990 Updates 1992-94: John Dollhopf, Sam Hsiao, Curtis Greene Updates 2008: Erica Greene, Curtis Greene Updates 2010-12: Ian Burnette, Curtis Greene 1. Introduction This document illustrates a Mathematica package designed to generate, display, and explore finite partially ordered sets ("posets"), emphasizing properties of use in combinatorics. The package has two distinctive features: (1) a large repertoire of built-in examples (Boolean lattices, subword posets, lattices of partitions, distributive lattices, Young's lattice, Bruhat orders, etc.), and (2) the ability to generate a poset directly from its formal definition, i.e., from a Mathematica program defining its "covering function". A poset may also be defined by listing its covering pairs, or by giving any generating set of ordered pairs, or the incidence matrix corresponding to such a relation. In addition, there are tools for constructing new posets from old: product and sum, subposet, distributive lattice of order ideals, etc. Once a poset has been generated (“built”), a large number of additional tools are available for studying its combina- torial structure. These existing tools reflect the authors' combinatorial interests: enumerative invariants, chains, multichains, antichains, rank generating functions, Mobius functions, linear extensions, and related topics. A good reference for these topics is Richard Stanley's book, Enumerative Combinatorics V1 (Wadsworth, 1986). About this documentation: our intention has not been to write a "users manual", but rather to give an informal demonstration of principal features. The documentation consists of two segments: Part 1 (this notebook) illustrates the basic commands by applying them to some well-known combinatorial families of posets. Part 2 (a second notebook) contains more complicated examples and illustrations, as well as “case studies” illustrating applications to combinatorial problems of interest. For a complete list of commands, one can print out the “usage” section of the package, which contains a precise description of the syntax for each command. The package is available on the web at http://www.haverford.edu/math/cgreene.html. It is available in both notebook and plain ascii text formats. The authors welcome comments, questions, bug reports, criticisms, and other suggestions. Such communications should be directed to [email protected], or to Curtis Greene, Department of Mathematics, Haverford College, Haverford PA 19041. 2. Basic Instructions Loading the package The current version of the package (June 2012) is called Posets300.m. It may be placed in a directory or folder on Mathematica's search path for input. Windows users will typically put it in the AddOns/ExtraPackages folder. Directories on the current search path can be identified using the $Path command, for example, under Windows one gets. 2 posets300-doc1a.nb The current version of the package (June 2012) is called Posets300.m. It may be placed in a directory or folder on Mathematica's search path for input. Windows users will typically put it in the AddOns/ExtraPackages folder. Directories on the current search path can be identified using the $Path command, for example, under Windows one gets. $Path *open cell to see an example* Once the@D packageH has been placed in a proper directory,L it can be loaded by typing << posets300.m More simply, one can just open the file and click the "run package" button. Using the package To generate a poset, type Build[<def>,<name>] where <def> is a "definition" (of one of three types, to be described below), and <name> is a string used to identify the poset in subsequent computations. If no name is supplied, the package creates one automatically. The elements of a poset may be represented by any object recognized by Mathematica, typically by lists, strings, or integers. These objects become "labels" for elements of the poset. A poset definition may have any one of the following forms: (1) A triple {f, <minlist>, H} , where f is a Mathematica function that generates, from an element w of P a list consisting of its immediate successors (or covers); <minlist> is an explicit list of of the minimal elements of P; and H is an upper bound for the height of the poset (not necessarily the exact height.) (2) A pair {<relations>, N} , where N is an integer and <relations> is a set of pairs of integers £ N. This should be an acyclic relation generating the partial order. It need not be a transitive relation, nor must it be a minimal generat- ing set. (3) A matrix M, which is the incidence matrix of an acyclic relation generating the partial order. Again, the relation represented by M need not be transitive, nor must it be minimal. The effect of Build[<def>,<name>] is to generate three fundamental objects associated with the poset: (1) An object P[<name>]. This is a list of the elements of P. The elements of P[<name>] serve as "labels" for P. If P is defined by order relations or by an incidence matrix, then the labels are just indices, i.e. P[<name>] = {1,2, ..., Card[P]}. (2) An object Rank[<name>]. This is a list showing the rank of each element of P, defined (initially) as the length of the longest chain descending from x. (If P is a "strongly ranked poset", these ranks coincide with the usual definition of rank. If not, they can be changed to produce different structural representations of P. See the note below.) The indexing of the array Rank[<name>] agrees with that of P[<name>]. (3) An object CoverRelations[<name>]. This is a list of pairs of indices {i,j} that defines a minimal generating set for the order relation. (1) An object P[<name>]. This is a list of the elements of P. The elements of P[<name>] serve as "labels" for P. If P is defined by order relations or by an incidence matrix, then the labels are just indices, i.e. P[<name>] = {1,2, ..., Card[P]}. (2) An object Rank[<name>]. This is a list showing the rank of each element of P, definedposets300-doc1a.nb (initially) as the 3 length of the longest chain descending from x. (If P is a "strongly ranked poset", these ranks coincide with the usual definition of rank. If not, they can be changed to produce different structural representations of P. See the note below.) The indexing of the array Rank[<name>] agrees with that of P[<name>]. (3) An object CoverRelations[<name>]. This is a list of pairs of indices {i,j} that defines a minimal generating set for the order relation. All other commands and operations in the package refer to these objects, and many other derived objects are available. For a full list of commands and objects, with precise syntax, refer to the "usage" portion of the package itself. An index may be found at the end of this document. In cases where obejcts or functions depend on results returned by other functions, these are called automatically. For example, many functions need to compute ZetaP[<name>], the incidence matrix of the transitive closure of the cover relation, and this is done automatically when required. The user need not be concerned with the order in which comands are executed. Once computed, objects are "remembered", so that time is not wasted computing them again. Elements of the poset are always maintained in a "natural", or topologically sorted order. When P is a ranked (or graded) poset, the elements of each rank are grouped together, and a separate object PGraded[<name>][[k]] lists the elements of rank k. This notebook was executed with build version Ver 3.00dz4 Cautionary note about rank functions: The values in Rank[name] initially give only a "first approximation", guaranteed to be valid only if P is a strongly ranked poset (the rank function is equal to the longest descending chain minus 1). If a P is not known to be ranked, it should be tested using the RankedQ[name] command, which determines whether it is ranked and also adjusts Rank[name] so that its values are correct (if possible). There is also a radio button in the Diagram/Manipulate dashboard that achieves the same result. The values in Rank[name] affect the posititions of elements computed by the Diagram command; thus a poset may look different before and after RankedQ is applied. See the section on MajP[n], the majorization order, for further discussion and examples. 3. Fundamental Families of Posets SUBSETS OF A SET In the first example we generate the lattice of subsets of a 4-element set and compute several combinatorial invariants. In this command, Sets[4] is the built-in "definition" of the poset, and sub4 is a "tag name" (chosen by the user) to reference all of the objects associated with this poset. In[334]:= Build Sets 4 , sub4 Building poset sub4 ... @ @ D D Done 4 posets300-doc1a.nb Once a poset has been "built", its Hasse diagram may be displayed: Diagram sub4 @ D The elements of the poset may also be labeled, using the ShowLabels option. The yellow labels on the left show the “objects” of the poset; the blue labels on the right show the “indices” with which they may be referenced in the P[name] list. Diagram sub4, ShowLabels ® 1, 2 @ 8 <D 1, 2, 3, 4 16 8 < 1, 2, 3 12 1, 2, 4 13 1, 3, 4 14 2, 3, 4 15 8 < 8 < 8 < 8 < 1, 2 6 1, 3 7 1, 4 8 2, 3 9 2, 4 10 3, 4 11 8 < 8 < 8 < 8 < 8 < 8 < 1 2 2 3 3 4 4 5 8 < 8 < 8 < 8 < 1 8< Additional manipulation of the diagram is possible: stretching, changing the thickness of lines and points, adding a second set of labels, moving the labels around, identifying special sets of points.