Universita` degli Studi di Torino

Scuola di Scienze della Natura

Corso di Studi in Matematica

Combinatorial species and transitive relations

Tesi di laurea di secondo livello - A.A. 2012/2013

candidato: relatore:

Daniele P. Morelli Prof.ssa Lea Terracini

Combinatorial species and transitive relations

Daniele P. Morelli

Contents

Preface 4

Introduction 8

1 Preliminary Notions 9 1.1 Integer sequences and power series ...... 9 1.2 Obtaining generating function from recurrences ...... 13 1.3 Labeled and unlabeled structures ...... 15 1.4 Basic notions about categories ...... 16 1.5 Species of Structures ...... 18 1.6 Series associated to species ...... 18 1.7 of species ...... 21

2 Classical enumerative tools 23 2.1 Stirling numbers of the second kind ...... 23 2.2 Burnside’s lemma ...... 24 2.3 M¨obiusinversion ...... 26 2.4 Partitions ...... 26 2.5 Euler Transform ...... 29

3 Operations on species 31 3.1 Sum of species ...... 31 3.2 Product of species ...... 32 3.3 Composition of species ...... 36 3.4 Derivative of a species ...... 41 3.5 Pointing of a species ...... 43 3.6 Cartesian product of species ...... 44 3.7 Functorial composition ...... 45

4 Relation theory 47 4.1 Basic notions and results about relations ...... 47 4.2 Operations on relations ...... 49 4.3 Posets, order ideals and lattices ...... 50

2 5 Algebraic approaches to partial orders 53 5.1 Monomial orders and Gr¨obnerbases ...... 53 5.2 Toric ideals ...... 55 5.3 Hibi ideal of a poset ...... 57 5.4 Toric ideals associated to posets ...... 57 5.5 Order ideals and cartesian product of posets ...... 58 5.6 Adjoint in the of posets ...... 60

6 Counting transitive relations 63 6.1 Transitivity ...... 63 6.2 Indecomposable partial orders ...... 67 6.3 Graded orders ...... 71 6.4 Finite topologies ...... 74

7 Conclusions 77 7.1 Experimental investigations ...... 77 7.2 Posets and graded posets ...... 79

Appendix 82 A1 Common species and operations ...... 82 A2 PARI/gp Routines ...... 84 A3 Tables of integer sequences ...... 89

References 96

3 Preface

The use of power series for combinatorial purposes dates back at least to the age of Euler, who gave some of the first non-trivial examples of ordinary generating functions. Some times later Laplace had the insight that alge- braic operations on power series correspond to -theoretic manipulations on the object counted by the sequences of coefficients of such series. As al- ways happens in mathematics, several decades of studies and investigations were needed to understand how a bunch of technical tools can in fact be unified in a general setting, and a theoretical background be given to such mathematical machinery. When a scientifical discipline needs clarification on a foundational level, the most problematic aspects appear to emerge with respect to definitions rather than theorems. For instance, a good definition of combinatorial struc- ture is not easy to formulate, and a lot of philosophical questions must be answered: what is the difference between labeled and unlabeled structures? Is it possible to formulate the concept of labeled structure without refer- explicitly to a specific set of labels but without making the structure unlabeled? Is it possible to give a rigorous combinatorial interpretation of functional composition? Is there a general notion of isomorphism, which is independent of the particular kind of structure considered? Is there a functional equivalent of the action of making a vertex distinguishable from the others (like in rooted trees)? How does the action of the symmetric group Sn over a set with n elements induces a correspondent action over the structures of some kind built over this set? The theory of combinatorial species, introduced by Andr´eJoyal in the Eighties (see [6]), constitutes an unifying step in the foundations of combi- natorics. It provides a general setting for most well-known results in discrete mathematics, and a solid background for the understanding and the use of generating functions and of the study of labeled and unlabeled combinatorial structures. It also helps solving most of the previously mentioned questions. This theory helps us understand most previously known but somewhat obscure facts, and to give new insights in the understanding of combina- torics. We could trace a parallel with (that in fact provides the basic notions on which the theory of species is constructed), which is a well-known example of a generalizing instrument that made clear a lot of known results. The concept of the fundamental group of a topological space, for instance, would be a lot less clear if we did not know what a category is and what a is. In the words of Gian-Carlo Rota:1

Every discovery of a new scientific fact is a challenge to uncover the uderlying mathematical structure. This structure is not “ab-

1From [11].

4 stracted” from nature, as psychologists would have us believe. It is the basic makeup of nature, it was always there, waiting to be told and staring at us all the time. The natural laws discovered by scientists will be refined like a metal, polished like a jewel and finally stored as theorems in the archives of mathematics. Math- ematicians triumphantly point to mechanics as the example of a theory that began as an empirical science, and that eventually made its way into mathematics as a generalized geometry, geom- etry with time added. Mathematicians believe that every science will sooner or later meet the fate that befell mechanics.

This may sound excessively positivist, but it is undeniable that the most important advances in mathematics are those that help us understand the “underlying mathematical structure” of some kind of discovery. Even the solution of a big problem is most often credited for the new technical ma- chinery provided and for the general understanding of a subject, rather than for supplying a mere answer to a mathematical question. On the other hand, we must admit that a good theory should in fact be able to solve new and important problems. We are confident that the theory of species will soon prove itself worth of this task, and this work would like to provide some insights that this theory allows us to make. We’d like to cite Rota again:2

It would probably be counterproductive to let it be known that behind every “genius” there lurks a beehive of research mathe- maticians who gradually built up to the “final” step in seemingly pointless research papers. And it would be fatal to let it be known that the showcase problems of mathematics are of little or no in- terest for the progress of mathematics. [...] There is a second way by which mathematics advances, one that mathematicians are also reluctant to publicize. It happens when- ever some commonsense notion that had heretofore been taken for granted is discovered to be wanting, to need clarification or definition. Such foundational advances produce substantial divi- dends, but not right away.

I like to remember how seemingly small changes in mathematical nota- tion can drastically enhance the power of our thinking. The first use of the arrow notation f : X → Y for the identification of a function dates around 1941.3 Before that date, the notation f(X) ⊆ Y was mostly used. Very few years after, the theory of categories was born.

2From the foreword of [1]. 3W. Hurewicz, On duality theorems, Bull. Am. Math. Soc., 47, 562–563 (1941), as cited in [9].

5 This is not just an historical curiosity. Category theory is the discipline of arrows, after all. Obviously, it could have been discovered even before the introduction of the arrow notation, but it didn’t, because a bunch of symbols were needed to let us keep in mind that, verily, a function is a map. The theory of species seems to be something like that: a new way to define things and refer to them. It is useful because most important com- binatorial constructions are automatically handled by the algebraic tools provided by it, and it is enlightning because it gives an elegant theoretical instrumentation that also helps us recall the true (onthological and ethimo- logical) nature of : not simply the art of counting, but the art of combining.

6 7 Introduction

This work is intended to introduce the theory of combinatorial species and to give some ideas about how it may help to find solutions to some open problems in enumerative combinatorics. In particular, we focused on the enumeration of binary relations over a finite set, specifically transitive rela- tions. The first section is intended to review some basic facts about combina- torics and to introduce the notion of combinatorial species. Basic notions about integer sequences and power series are recalled, and standard ways to relate those sequences to power series are introduced. Fundamental re- sults about ordinary and exponential generating functions are stated, and a general notion of isomorphism is defined, leading to the dichotomy between labeled and unlabeled structures. Section two is devoted to the study of some well-known enumerative tools which will be useful in the foregoing discussion. Stirling numbers of the second kind, Burnside’s lemma and the basic theory of integer partitions (including Euler transform) are treated. Also, a brief introduction to M¨obius inversion is given. The third section is a survey of the operations that can be defined over combinatorial species. Some classical examples are introduced and we’ll state and prove very important results relating those operations to functional operations over the corresponding generating series. Section four introduces the theory of binary relations, with particular attention to the transitive ones. Some important results about posets are recalled (including a celebrated result by Garrett Birkhoff). The fifth section is a survey of some contemporary algebraic approaches to the theory of partial orders. The theory of Hibi rings is introduced, and we also report a characterisation of the associated toric rings in terms of Gr¨obnerbases. Also, some categorical results about posets are stated, and a theorem about adjoint functors is derived. Section six is about some kinds of transitive relations. Classical results are recalled and translated in the language of combinatorial species, leading to functional equations that allow us to compute or relate the number of particular families of transitive relations. Bijective proofs relating transitive relations with topological spaces over finite sets are also stated and proved. The conclusion offers some possible uses of the machinery developed before, and spots out some unsolved problems. The appendix contains several tables summarizing properties of and se- ries associated to species, some PARI/gp code, and the most important integer sequences studied in this work.

8 1 Preliminary Notions

In this section we introduce the algebraic concepts needed to develop an efficient foundation for the theory we want to construct. The main ideas about generating functions are first presented, and some basic results and operations are recalled. Then we are going to give an abstract and flexible theoretical background for the subsequent developments: category theory is known for its great generality and constitutes an ideal basis for the funda- mental notions we will introduce.

1.1 Integer sequences and power series

Let a0, a1, a2... be an integer sequence (i.e. a function N → Z). Most often such a sequence will count the number of some kind of combinatorial structures, i.e. an is the number of such structures built over a set with n elements.

Definition 1.1 The ordinary generating function of the sequence

a0, a1, a2, a3... is the formal power series

∞ X n 2 3 anx = a0 + a1x + a2x + a3x + ... n=0

We can define the sum of two power series as follows:

X n X n X n anx + = bnx = (an + bn)x where the sums range over all non negative integers n. The product of f and g is defined according to Cauchy’s rule:

n X n X (f · g)(x) = cnx , where cn = akbn−k k=0

P n It is well known that a series f = anx has a reciprocal if and only if a0 6= 0. Another important binary operation is composition:

∞ X n (f ◦ g)(x) = an(g(x)) . n=0 A standard result says that the computation of the n-th term of the com- position f ◦ g is possible iff g(0) = 0 (or if f is a polynomial). Clearly, the series 0, 1, and x behave as neutral elements with respect to addition, product, and composition. The set Z[[x]] of formal power series is a ring when equipped with sum and product, and ◦-invertible elements form a group with respect to composition. We will denote with f −1(x) the reciprocal of f(x) (i.e. the inverse with respect to product), and f (−1) the reverse of f(x) (i.e. the inverse with respect to composition), wheneter they are defined. We now give a simple but fundamental result allowing us to invert many combinatorial identities involving power series.

Lemma 1.1 Let f(x), g(x) and h(x) be power series, such that the constant term of h(x) be zero. If f(x) = g(h(x)) then the equation g(x) = f(h(−1)(x)). holds. 

Also, we state and prove the following

Lemma 1.2 Let f(x), g(x) and h(x) be power series. If the constant term of h is zero, and the constant terms of f and g are equal, then the equation

f(x) = g(h(x)) can be inverted as

h(x) = (g − c)(−1)((f − c)(x)), where c is the constant term of f and g.

Proof: Let us write g as (g − c) + c:

f(x) = ((g − c) + c) ◦ h(x).

Composition of power series is distributive on the right with respect to sum, so we get f(x) = ((g − c) ◦ h)(x) + (c ◦ h)(x). Now, the composition of a constant term c with an arbitrary series is the constant c itself, so a rearrangement of the terms yelds

f(x) − c = ((g − c) ◦ h)(x).

10 Finally we can compose to the left with the reverse series (g − c)(−1) (this is possible because the constant term of g − c is zero). 

The preceding two lemmas allow us to conclude that, given an arbitrary identity between power series of the form f = g ◦ h, we can most often recover any of the three series involved by knowing the other two. Another important operation is the (formal) derivative: if

X n f(x) = anx then X n Df(x) = nan+1x . Most often we will use the xD operator, corresponding to a derivation and a multiplication by the formal indeterminate. We are now going to state some basic results about ordinary power series. A more exhaustive analysis of the following propositions can be found in [14]. We will often use the term ogf in place of ordinary generating function. The first result introduce the so-called shift operator:

∞ Theorem 1.1 Let {an}n=0 be an integer sequence, and let f be its ordinary generating function. For any integer k > 0, the series

k−1 f − a0 − a1x − ... − ak−1x xk is the ogf of the sequence {an+k}. 

We now give an important interpretation of the derivative operator D:

Theorem 1.2 Let P be a polynomial and D the derivation operator. Also, ∞ let {an}n=0 be an integer sequence, and let f be its ordinary generating ∞ function. Then P (xD)f is the ogf of the sequence {P (n)an}n=0. 

For instance, if P (y) = y2 + 3y + 1, then P (xD) = x2D2 + 3xD + 1 can be seen as a new operator and we have P (xD)f = x2f 0 + 3xf + 1. The ∞ previous theorem says that if f is the ogf of the sequence {an}n=0, then 2 0 ∞ x f + 3xf + 1 is the ogf of the sequence of {P (n)an}n=0. The next result is a generalisation of Cauchy’s rule for multiplication:

∞ Theorem 1.3 Let {an}n=0 be an integer sequence, and let f be its ordinary generating function. Then the series f k is the ogf of the sequence ( )∞ X an1 an2 ...ank n1+...+nk=n n=0

11 where the sum ranges over all ways to write n as a sum of k integers. 

Finally we state a result giving a fast and simple way to compute the partial sums of a given sequence:

∞ Theorem 1.4 Let {an}n=0 be an integer sequence, and let f be its ordinary generating function. Then the series f/(1 − x) is the ogf of the sequence

∞  n  X  aj j=0  n=0 of partial sums. 

We now turn to another kind of generating function: the exponential one. The only difference is the presence of a factorial term n! appearing at the denominator of the n-th term:

Definition 1.2 The exponential generating function of the sequence

a0, a1, a2, a3, ... is the formal power series

∞ X an a2 a3 xn = a + a x + x2 + x3 + ... n! 0 1 2 6 n=0

We will also write egf in place of exponential generating function, for the sake of brevity. Also, we’ll write egf(an) to refer to the egf of the sequence ∞ {an}n=0. The calculus of egfs presents some differences with respect to the ordi- nary case. The sum of two such series is defined term-by-term as in the ordinary case: (f + g)(x) = f(x) + g(x). The product of two exponential series presents an interesting property. If f = egf(an), g = egf(bn), then   ∞ k ! ∞ j k+j X akx X bjx X akbsx f · g = · = , k!  j!  k!j! k=0 j=0 k,j≥0 that is,   X X akbj xn  k!j!  n≥0 k+j=n

12 and the coefficient of xn/n! in f · g is given by

X n!akbj . k!j! k+j=n

Then, in the exponential case, the Cauchy product becomes

∞ ! ∞ ! ∞ n ! X xn X xn X X n xn a · b = a b n n! n n! k k n−k n! n=0 n=0 n=0 k=0 We now turn to the basic properties of the egfs. We begin with the shift operator:

∞ Theorem 1.5 Let D be the derivative operator. Also, let {an}n=0 be an integer sequence and f its egf. Then, for any integer k > 0, the series Dkf is the egf of the sequence {an+k}. 

The next results is exactly the same as for ogfs:

Theorem 1.6 Let P be a polynomial and D the derivation operator. Let ∞ {an}n=0 be an integer sequence and f its egf. Then P (xD)f is the egf of the ∞ sequence {P (n)an}n=0. 

We end this section with a very useful notation we will use in the fol- lowing:

P∞ n Definition 1.3 Given an ordinary series F (x) = n=0 fnx , we will often use the notation [xn]F (x) to indicate the coeffcient of xn in the expansion n of F (i.e. fn). Similarly, we may use the notation [x /n!]F (x) to indicate the coefficient of xn/n! if f is an exponential generating function.

1.2 Obtaining generating function from recurrences Using generating functions can be very useful when trying to understand the behaviour of some integer sequence defined from a recurrence relation. We now give a couple of simple examples which are very illustrative, as the technique used is very general and can be applied in a great amount of situations. A general treatment of this subject can be found in Wilf’s classical book [14]. Some insights about this kind of problems are also trated in [3]. The following section will also make clear the meaning of some aforementioned propositions. Suppose to have a sequence of integer numbers a(n)(n ≥ 0) satisfying the recurrence a(n) = a(n − 1) + a(n − 2). (1.1)

13 This is a very celebrated recurrence that, equipped with suitable initial conditions, gives rise to Fibonacci’s sequence. The initial conditions are a(0) = 0, a(1) = 1. We also assume a(n) = 0 if n < 0. From these informations we can obtain a generating function for the Fibonacci numbers, and an approximate formula (which in fact can be made exact by rounding) for computing them. Note that the recurrence (1.1) of Fibonacci numbers is true for every integer n with the exception of n = 1. Still, we can write

a(n) = a(n − 1) + a(n − 2) + [n = 1], where in the last summand we used Iverson’s notation: [n = 1] is 1 if n = 1 and 0 otherwise. Now it is easy to see that the equation is true for all positive values of n. Now, by multiplying by a formal indeterminate xn and summing over all non-negative values of n, we get

∞ ∞ ∞ ∞ X X X X a(n)xn = a(n − 1)xn + a(n − 2)xn + [n = 1]xn i=1 i=1 i=1 i=1 Now we can see that the first member is nothing but the ogf of the integer sequence we are studying. Let us call it F (x). The other summands can be written in terms of F (x) by means of proposition 1.1. We get:

F (x) = xF (x) + x2F (x) + x, and, solving for F , x F (x) = . 1 − x − x2 which is the celebrated generating function for Fibonacci numbers. Another pretty example is about binary rooted trees, which are an im- portant kind of structure very often used by computer scientists. A possible recurrent definition would be the following:

Definition 1.4 Binary rooted trees are defined recursively as follows. The is a binary rooted tree. If r is a singleton, and B1 and B2 are binary rooted trees, then the ordered triple (r, B1,B2) is a binary rooted tree.

B1 and B2 are called left and right subtrees, respectively. The theory of species we want to present allows us to translate this definition into an equation that is satisfied by the species B of binary rooted trees. In particular, we have that if B(x) is the ogf of binary rooted trees, then the following equation holds:

B(x) = 1 + xB2(x),

14 from which we can easily get √ 1 − 1 − 4x B(x) = . 2x Expanding this function (e.g. by using generalized Newton binomial for- mula) one gets

∞ 2 3 4 5 X n B(x) = 1 + x + 2x + 5x + 14x + 42x + ... = cnx n=0

2n −1 where cn = n (n + 1) is the n-th Catalan number. One could obtain this result by a purely combinatorial argument: we see that each binary rooted tree is determined by its left and right subtree. If these subtrees have size j, k respectively, then the whole tree has size j + k + 1, and in other words the numbers cn counting binary rooted trees must satisfy the recurrence

n−1 X cn = cjcn−j−1. j=0

Now we can see that the left side of this equation can be interpreted as a coefficient of a product of two ordinary generating functions. In fact, by P denoting B(x) = n≥0 cn, we may notice that the left side is nothing but n P∞ the coefficient of x in the Cauchy product of B(x) and k=0 ck−1 = xB(x). We then obtain B(x) − 1 = xB2(x) recovering the functional equation satisfied by B(x).

1.3 Labeled and unlabeled structures

Given a finite set U = {u1, u2, ..., un} we consider a kind of combinato- rial structure on U. One of the most important dichotomies arising in the study of such constructions is the distinction between labeled and unlabeled structures. Informally speaking, a labeled structure is one in which each element is given a label, that is a name or mark making it distinguishable from the others. For example, we know that we can define n! linear orders on a set of n elements (in fact, each non-trivial of the elements gives another linear order). But if we make the elements undistinguishable, then only one linear order exists on a set of n elements. In the former case we’ll talk about labeled linear orders, and in the latter we’ll talk about unalbeled linear orders.

15 So, the unlabeled case is the object of study when we argue “up to isomorphism”. The use of generating functions and the theoretical under- ground provided by category theory will make this dinstinction precise. As an example, let’s consider the difference between ordinary and expo- nential generating functions. Let an enumerate the structure of “type A” and bn the structures of “type B”. Let’s remember the Cauchy rule in the P n ordinary case: if f = ogf(an) and g = ogf(bn), then (f · g)(x) = cnx , Pn where cn = k=0 akbn−k. The form of the coefficients cn conveys the fact that we can use such a multiplication rule to enumerate the number of struc- tures obtained by sticking togheter a structure of type A and a structure of type B, such that the sum of the elements involved is n. By contrast, the multiplication of exponential generating functions,

∞ ! ∞ ! ∞ n ! X xn X xn X X n xn a · b = a b , n n! n n! k k n−k n! n=0 n=0 n=0 k=0 n involves a binomial term k which will turn out to be useful in counting problems where we need to take count of the relabeling of the elements. In n fact, there are k ways to choose which subset of k elements must be given the first kind of structure. We can thus say that ordinary generating functions are more useful when considering unlabeled structures, and exponential generating functions are usually preferred when studying the labeled case.

1.4 Basic notions about categories Definition 1.5 A category C is a class Ob(C) of objects togheter with a set Hom(A, B) of for each A, B ∈ Ob(C), such that the follow- ing conditions are satisfied:

• For all objects A, B, C and for each f ∈ Hom(A, B) and g ∈ Hom(B,C), the composition g ◦ f exists in Hom(A, C);

• For each A ∈ Ob(C) the identity idA ∈ Hom(A, A) exists, such that for each object B and for each f ∈ Hom(A, B) and g ∈ Hom(B,A), the identities idA ◦ f = f and g ◦ idA = g hold; • Composition is associative. That is, f ◦ (g ◦ h) = (f ◦ g) ◦ h for all f, g, h such that the composition is defined.

Definition 1.6 Given two categories C, D, a covariant functor from C to D is a rule F associating to each object A of C an object F [A] of D, and to each morphism f ∈ Hom(A, B) a morphism F [f] ∈ Hom(F [A],F [B]) preserving identities and composition, that is:

• F [idA] = idF [A] for each A in Ob(C);

16 • F [f ◦ g] = F [f] ◦ F [g] for all morphisms f, g such that the composition is defined.

The morphism F [f] is called the transport of f.

Definition 1.7 Let C and D be two categories, and let F : C → D and G : C → D be two covariant functors. We say that a between F and G if for each A ∈ C a morphism µA : F [A] → G[A] is defined and is such that the following diagram commutes for all A, B ∈ C and for all f : A → B: µ F [A] A / G[A]

F [f] G[f]

 µ  F [B] B / G[B]

If all the morphisms µA are invertible in the category D, then we say that the equivalence is natural, and that F and G are naturally equivalent.

The concept of natural transformation can be treated as the translation of the concept of morphism for categories. The last important comcept we would like to recall is that of adjunction. In a category C, for each couple of objects A and B, a hom-set HomC(A, B) is defined. The idea of adjunction has an interpretation that can be expressed by referring on the mutual behavior of such hom-sets under the action of two functors:

Definition 1.8 Let F : C → D and G : D → F be functors, A ∈ C and B ∈ D. If a bjection

HomC(A, G[B]) ≡ HomD(F [A],B) exists, which is natural in the variables A and B (i.e. if it is defined in a manner which does not depend on the particular choise for A and B), then we say that F and G form and adjoint pair. In particular, we say that F is a left adjoint and G a right adjoint.

The idea of adjoint functor seems a bit complicated, but it happens that they emerge with surprising frequence in a lot of different areas of mathematics. We will find an adjunction in the category of partially ordered sets in subsection 5.6.

17 1.5 Species of Structures The term structure is one of the basic ones in mathematics. Informally speaking, a structure s is a construction χ which one defines on a basic set U, so we may write, for example, s = (U, χ). For instance, we may encode the concept of a rooted tree over the set U = {a, b, c, d, e} as χ = {{a}, {{a, b}, {b, c}, {b, d}, {d, e}}}, where the first element of χ is a singleton indicating which is the root, and the second component is a set of couples indicating the edges of the tree. One may notice that for each φ between U and V , where V = {1, 2, 3, 4, 5}, an (isomorphic) rooted tree is immediately defined over V , namely: {{φ(a)}, {{φ(a), φ(b)}, {φ(b), φ(c)}, {φ(b), φ(d)}, {φ(d), φ(e)}}}. All we did was substituting each element occurring in the formal defini- tion of χ with the corresponding image under the action of φ. This example motivates the definition of combinatorial species as a func- tor from the category of sets with to itself: Definition 1.9 A species of structures is a covariant functor F : B → B, where B is the category of finite sets, where morphisms are bijections. We will often refer to a combinatorial species simply as a species. Other synonims include species of structures and structors. Given a species F and a set U, then F [U] is the set of all F -structures over U. Given a bijection σ : U → V , its image under the action of F is denoted F [σ] and constitutes a bijection from F [U] to F [V ], called the transport of σ along F . We often refer to an element in F [U] as an F -structure (built on the ground set U), or as a structure of type F . We also prefer in most cases to consider a canonical set of n elements, namely [n] = {1, 2, 3, ..., n}. The mapping from a set U to the set of all structures of a given type built on U is illustrated in Figure 1 in the case of the species G of simple graphs. The mapping from a permutation σ : U → U is also illustrated in Figure 2 for U = {a, b, c} again in the case of simple graphs.

1.6 Series associated to species Let [n] = {1, 2, 3, ..., n} be the canonical set with n elements. Given a species F , let fn = |F [n]| be the number of F -structures built on the set [n]. Definition 1.10 The generating series of the species F is the exponential formal power series ∞ X fn F (x) = egf(f ) = xn. n n! n=0

18 Figure 1: The species of simple graphs is a functor G mapping each set U to the set G[U] containing all simple graphs on the elements in U.

As previosly mentioned in subsection 1.3, exponential power series are often useful when dealing with labeled structures. We are now going to in- troduce another kind of generating series used to study unlabeled structures. Let’s consider the canonical n-set [n], and define an equivalence relation ∼ on F [n] as follows:4 s ∼ t if and only if there is a permutation σ :[n] → [n] such that F [σ](s) = t. In this case we also say that s and t have got the same isomorphism type. The quotient set F [n]/ ∼ is then the set of all isomorphism types of F -structures of order n. Let fen = |F [n]/ ∼ | be its .

Definition 1.11 The (isomorphism) type generating series of the species F is the ordinary formal power series

∞ X n Fe(x) = ogf(fen) = fenx . n=0 The last important series associated to a series we are going to introduce is the series. In order to define it we must introduce some no- tations. Let σ be a permutation belonging to the symmetric group of order n (which we denote with Sn). The cycle type of σ is a vector (σ1, ..., σn) of integers, where σi is the number of cycles of length i in the cyclic decompo- sition of σ. For instance, we may have σ ∈ S9, σ = (1, 3, 5)(4, 2)(6)(7, 9, 8), and its cycle type is then (1, 1, 2, 0, 0, 0, 0, 0, 0). Now, consider such a permutation σ and its transport F [σ] along a species functor F . As we already know, the transport is a permutation

4With a little abuse of notation we write F [n] in place of F [[n]].

19 of F [U]. We are interested in the subset Fix(F [σ]) ⊆ F [U] whose elements are the F -structures fixed by the permutation F [σ], and more precisely in its cardinality |Fix(F [σ])|. For example, if σ = idU , then by functoriality F [σ] = idF [U] and each structure s ∈ F [U] is fixed, so Fix(F [σ]) = F [U]. Definition 1.12 The cycle index series of a species F is the formal power series in a countable infinity of indeterminates ∞ ! X 1 X Z (x , x , ...) = |Fix(F [σ])|x σ1 x σ2 ... . F 1 2 n! 1 2 n=0 σ∈Sn The explicit computation of the cycle index series is usually a difficult task, but its importance can be immediately seen by means of the following important result: Theorem 1.7 Let F be a species. Then the following identities hold:

F (x) = ZF (x, 0, 0, 0, 0, ...); 2 3 4 Fe(x) = ZF (x, x , x , x , ...). Proof: The first identity can be instantly verified by direct computation. Let us look at the term X |Fix(F [σ])|xσ1 · 0σ2 · 0σ3 · ....

σ∈Sn

σ1 σ2 σ3 We can see that for each n ≥ 0 we have x · 0 · 0 · ... = 0, unless σk 6= 0 for each k > 1 (so necessarily σ1 = n). In other words, only the identity idn contribute to the sum for each n, so ∞ X 1 Z (x, 0, 0, 0, ...) = |Fix(F [id ])|xn, F n! n n=0 and since every F -structure is fixed by the identity, one finally has ∞ X 1 Z (x, 0, 0, 0, ...) = f xn = F (x). F n! n n=0 The second part of the theorem requires an application of Burnside’s Lemma (see Theorem 2.3). We have ∞ ! X 1 X Z (x, x2, x3, ...) = |Fix(F [σ])|xσ1 x2σ2 x3σ3 ... F n! n=0 σ∈Sn ∞ ! X 1 X = |Fix(F [σ])|xn n! n=0 σ∈Sn ∞ X = |F [n]/ ∼ |xn n=0 = Fe(x)

20 We now want to rewrite the cycle index series ZF by considering a pos- sible way to regroup its terms. It is easy to see that the cycle type of the transport F [σ] of a permutation σ only depends on the cycle type of σ. In particular, the number of fixed points of F [σ] only depends on the numbers σ1, σ2, ... constituting the cycle type of the given permutation σ. Thus, in definition 1.12 we can regroup all permutations having the same cycle type, as they contribute to the same monomial in ZF . The number of permuta- tions on n elements having cycle type (n1, n2, n3, ...) is given by n! n n n 1 1 n1!2 2 n2!3 3 n3!... so, by substituting in the cycle index series and simplifying the n!, we get

n n n X x1 1 x2 2 x3 3 ... ZF (x1, x2, ...) = |Fix(F [n1, n2, n3...])| n n n 1 1 n1!2 2 n2!3 3 n3!... n1+2n2+3n3+...<∞ (1.2) where |Fix(F [n1, n2, n3...])| is the number of F -structures over a set of P k≥1 knk elements fixed by any permutation having cycle type (n1, n2, n3, ...).

1.7 Isomorphism of species When are two species the same? The condition F [U] = G[U] for all sets U, the equal sign meaning purely set-theoretical equality, is often too restrictive. We will need a more flexible notion of equivalence, and this can be achieved by categorical reasonment. Let us recall the natural equivalence of functors (definition 1.7 in subsection 1.4), and give the following:

Definition 1.13 F and G being species, we say that there is a combi- natorial equality between them, and write F = G, if there is a natural equivalence between F and G seen as functors. Namely, for all sets U, V and for each σ : U → V , invertible morphisms µU , µV can be found such that the following diagram commutes:

µ F [U] U / G[U]

F [σ] G[σ]

 µ  F [V ] V / G[V ]

With abuse of language, we will often say equality in place of combina- torial equality. We will see in many examples that the equality of species implies the equality of their generating, type generating, and cycle index series.

21 A weakier notion is that of equipotent species: two species F and G are said to be equipotent iff F (x) = G(x). In this case we write F ≡ G. We can immediately see that F ≡ G does not imply F = G by considering the species S of permutations and L of linear orders. There are n! permutations and linear orders on a set with n elements, so S(x) = L(x) = 1/(1 − x) and thus S ≡ L, but isomorphism types behave quite differently in S and L. In particular, there is only one linear order type for each n, so Le(x) = 1/(1−x), Q∞ k while (as Euler showed, see subsection 2.4) we have Se(x) = k=1(1 − x) , so the type generating series are different and we conclude that L= 6 S.

22 2 Classical enumerative tools

This section will be dedicated to the introduction of some known tools and theorems used in combinatorics. Sometimes we will see that the theory we want to construct will allow us to restate these result into a general setting.

2.1 Stirling numbers of the second kind The number of ways to partition a set with n elements in k parts is called the Stirling number of the second kind, and we will denote it with S(n, k). We can easily derive a recurrence formula for those numbers:

Theorem 2.1 S(0, 0) = 1, and for (n, k) 6= (0, 0) we have

S(n, k) = S(n − 1, k − 1) + kS(n − 1, k).

Proof: Let us consider the set of all partitions of [n] in k parts, and divide this set in the of two subset. In the first subset we put all the partitions in which the element n lives in a class all by itself. By erasing the number n from each one of those partitions, what remains is the set of all partitions of n − 1 in k − 1 parts (and these are S(n − 1, k − 1)). In the second subset we have the partitions of [n] where n lives in a class with other elements. By erasing n in all such partitions we do not lose a class, so we have partitions of n − 1 in k parts. It is easy to see that we will have k different copies of any such partitions, so in this second subset we have kS(n − 1, k) partitions. 

To find a closed formula for the Stirling numbers we will proceed as P n follows. Let Bk(x) = n≥0 S(n, k)x be the generating function of such numbers for fixed k. From the recurrence, by multiplying both sides by a formal factor xn and summing on n we can find X X X S(n, k)xn = S(n − 1, k − 1)xn + k S(n − 1, k)xn n≥0 n≥0 n≥0 and we can rewrite this equation as

Bk(x) = xBk−1(x) + kxBk(x)(k ≥ 1,B0(x) = 1) and then x B (x) = B (x)(k ≥ 1,B (x) = 1). k 1 − kx k−1 0 So, after iterated substitution, we can finally write

xk B (x) = (k ≥ 0). k (1 − x)(1 − 2x)(1 − 3x)...(1 − kx)

23 By using the partial fraction method we can rewrite the previous formula in a different form. We want to find the numbers aj so that the following equation holds:

k 1 X aj = . (1 − x)(1 − 2x)(1 − 3x)...(1 − kx) 1 − jx j=1 to do so, let fix j, 1 ≤ j ≤ k, multiply both sides by 1 − jx, and let x = 1/j. We get jk−1 a = (−1)k−j . j (j − 1)!(k − j)! Finally we can derive a closed formula for the Stirling numbers of the second kind:

 xk  S(n, k) = [xn] (1 − x)(1 − 2x)(1 − 3x)...(1 − kx)  1  = [xn−k] (1 − x)(1 − 2x)(1 − 3x)...(1 − kx)  k  X aj = [xn−k]  1 − jx j=1 k X 1 = a [xn−k] j 1 − jx j=1 k X n−k = ajj j=1 k X jn = (−1)k−j j!(k − j)! j=1

2.2 Burnside’s lemma Consider a finite set X and a finite permutation group G acting on X. For each x ∈ X let Stab(x) = {g ∈ G : gx = x} be the stabilizer of x. Given an element x, we say that the orbit of x is the set Orb(x) = {y ∈ X : ∃g ∈ G (y = gx)}. One can see that, whenever x and y are in the same orbit, then their stabilizers are conjugate subgroups of G, and must then have the same cardinality. The main result we should recall is the following well-known orbit-stabilizer Theorem:

Theorem 2.2 For each element x ∈ X,

|G| = |Stab(x)| · |Orb(x)|

24 Proof: Let us fix x ∈ X and write the group G as the disjoint union of right cosets: m [ G = gkStab(x). k=1

Then we may find a one-to-one correspondence between each coset gkStab(x) and the element gky ∈ Orb(x) for an element y ∈ X. To prove this is a −1 bijection, we may notice that for i 6= j we have giy 6= gjy, otherwise gj gj would be an element of Stab(x) and thus gi ∈ gjStab(x), contradicting the fact that giStab(x) ∩ gjStab(x) = ∅. Now, for any element y in Orb(x) we have y = gx for some g ∈ G. From the coset decomposition it follows that g = hs for some s ∈ Stab(x), and so y = sx, hence every element of Orb(x) correspond to a coset. 

We can now give the important result known as Burnside’s Lemma:

Theorem 2.3 The number |X/G| of orbits of X under the action of G satisfies the following identity: X |X/G| · |G| = |Fix(g)| g∈G where Fix(g) is the set of elements in X fixed by g.

Proof: By the previous result we can write: X |Fix(g)| = |{(g, x) ∈ G × X : gx = x}| g∈G X = |Stab(x)| x∈X X |G| = |Orb(x)| x∈X X 1 = |G| |Orb(x)| x∈X   X X 1 = |G|  |[x]| [x]∈X/G x∈[x] X = |G| 1 [x]∈X/G = |G| · |X/G| thus obtaining the thesis. 

25 If G is finite, then we can also write

P |Fix(g)| |X/G| = g∈G |G| expressing the fact that the number of orbits is the average of the cardinal- ities of the sets of elements in X fixed by elements in the group.

2.3 M¨obiusinversion

Let f, g be functions from N − 0 to some suitable ring, as Z. We can define the convolution X (f ∗ g)(n) = f(d)g(n/d) d/n where the sum ranges over all divisors d of n. It results that the set of all those functions are a ring with respect to component-wise sum and the ∗ convolution, with identity e such that e(1) = 1 and e(n) = 0 for n > 1. We also define u(n) to be the constant function u = 1. M¨obiusfunction is defined as  1 if n = 1  k µ(n) = (−1) if n = p1p2...pk where pi 6= pj for i 6= j  0 otherwise

Theorem 2.4 We have µ ∗ u = e

Proof: By induction on the factors of n. If n = 1 it is obvious. Let now be Qk ai n = i=1 pi . If d is divisible for a square, then µ(d) = 0. So the theorem holds for all non-squarefree numbers. Otherwise we have X X X X µ(d) = µ(d) = µ(1)+ µ(pi)+ µ(pipj)+...+µ(p1...pk) =

d/n d/p1...pk 1≤i≤k 1≤i

k k = 1 − k + − ... + (−1)k = (1 − 1)k = 0 2 k and the thesis follows. 

2.4 Partitions Given a set U, a partition of U is a family of subsets of U (called blocks, or parts) mutually disjoint and whose union is U. We already saw (in subsection 2.1) that the number of such partitions having k blocks is given

26 by the Stirling number of the second kind S(n, k) where n = |U|. So the total number of with n elements is the n X B(n) = S(n, k). k=0 Two set partitions are isomorphic if and only if there is a permutation σ : U → U such that for all x, y ∈ U we have that x ∼ y ↔ σ(x) ∼ σ(y), where x ∼ y means that x and y belong to the same block. Hence two set partitions are isomorphic if and only if they have the same number of subset of order k for each 0 < k < n. Therefore we can compute the number of isomorphism types of set partition of order n by computing the number of integer partitions of n. An integer partition is a way to write a number (say n) as the sum of positive integer less or equal to n. One of the most celebrated results by Euler in combinatorics is the or- dinary generating function for the number of integer partitions. In the language of species, we can regard this result as the determination of the type generating series Be(x) for the species B of set partitions. Theorem 2.5 Let p(n) be the number of integer partition of n. Then ∞ ∞ X Y 1 p(n)xn = (2.1) 1 − xk n=0 k=1 Proof: Let us consider the infinite formal product (1 + x + x2 + x3 + ...)(1 + x2 + x4 + x6 + ...)...(1 + xk + x2k + x3k + ...) (2.2) and try to compute the coefficient of xn if we carry out all the computa- tions. Only the first n factors contribute to this coefficient, and we get a contribution of 1 for each way to write xn as a product of factors xici . So the n coefficient of x is equal to the number of ways to write n = c1+2c2+...+ncn, where ci ≥ 0. This is just another way to write an integer partition, and the correspondence is easily seen to be bijective. Now, each factor 1 + xc + x2c + x3c + ... is a geometric series that can be written as (1 − xc)−1, and we are done. 

As an example, let n = 15 and consider how the partition: 15 = 1 + 1 + 1 + 2 + 2 + 3 + 5 corresponds to the choise of monomials given by x15 = x1·3 · x2·2 · x3·1 · x4·0 · x5·1 Euler discovered a lot of interesting properties about integer partitions by manipulating this generating function. As an example, we can recall the following

27 Theorem 2.6 The number of integer partitions of n where each part has odd size is equal to the number of partitions of n into distinct parts, for each positive integer n.

Proof: Let use the identity (1 + x)(1 − x) = (1 − x2), to get

1 1 1 1 − x 1 − x2 1 − x3 · · ·... = · · ·... = (1+x)·(1+x2)·(1+x3)·... 1 − x 1 − x3 1 − x5 1 − x2 1 − x4 1 − x6 The product in the first member is quite like the one in (2.2) but only has odd factors. This is the function that counts partition having odd parts. In the last member we have a product where each factor has only powers of x where the exponent is 0 or 1. In other words we are counting partitions in distinct parts. 

Let us now compute a useful and interesting recurrence formula for the partition numbers p(n).

Theorem 2.7 The partition numbers p(n) satisfy (for each n ≥ 1)

n 1 X p(n) = σ(k)p(n − k), (2.3) n k=1 where σ(n) is the sum of the divisors of n.

Proof: Consider equation (2.1):

∞ ∞ Y 1 X = p(n)xn = F (x), 1 − xn n=1 n=0 and take the logarithm on both sides:

∞ X 1 log = log(F (x)), 1 − xn n=1 then let us derive both sides and multiply by x:

∞ ! X nxn F (x) = xF 0(x). 1 − xn n=1 Now, let us write for simplicity

∞ X nxn = W (x) 1 − xn n=1

28 and, by expanding the geometric series we get

∞ ∞ ! X X xk nxn = W (x). n=0 k=0 It is not too hard to see that the coefficient of xn in W (x) is equal to the sum of divisors of n, which we indicate with σ(n). Now, F (x) is the generating function of the numbers p(n), and by Theorem 1.2 we have that xF 0(x) is the ordinary generating function of the numbers np(n). We can thus write

W (x)F (x) = xF 0(x) and carrying out the product in the left side by Cauchy’s rule and comparing coefficients we get n X σ(k)p(n − k) = np(n) k=1 which is nothing but equation (2.3). 

2.5 Euler Transform The number of integer partition of an integer is just a special case of a most general problem, which will be treated now. We say that a sequence b0, b1, ... is the Euler transform of a sequence a0, a1, ... if their ordinary generating functions are related by the following equation:

∞ ∞ X n Y 1 bnx = (2.4) (1 − xn)an n=0 n=1

The Euler transform of a sequence (ai)i≥0 is a new sequence such that its n-th indicates how many partitions of n there are, assuming that ai distinguishable versions of the number i are allowed (for each i ≥ 0). We see that, in order to the question to be well-posed, we must ignore the value of a0, and we always assume b0 = 1. It is possible to give a complete answer to this problem by generalizing the results in the previous section. A detailed treatment can be found in [14] and [15]. The result is that, introducing the auxiliary numbers

∞ X cn = d · ad d/n the Euler transform of the numbers an is given by

n−1 ! 1 X b = · c + c b . n n n k n−k k=1

29 Similarly, the inverse transform (giving the bn in terms of the an) can be computed by writing n−1 X cn = nbn − ckbn − k k=1 and then 1 X a = µ(n/d)c , n n d d/n where µ is the M¨obiusfunction. If the sequence an counts the number of unlabeled connected structures of some kind, then the sequence bn counts the number of unlabeled struc- tures (not necessarily connected) of the same kind. This will be useful when comparing the type generating series of the composition of species, in sub- section 3.3.

30 3 Operations on species

Once the concept of combinatorial species is introduced, we may define several operations on them. This allows us to construct new species from old ones, and also to understand the inner nature of naturally-arising species in terms of simpler ones. This often leads to equations between species that can be translated into equations between generating series, giving access to powerful enumerative methods.

3.1 Sum of species Definition 3.1 Given two species F and G, we define the sum F + G as follows: given a finite set U, an (F + G)-structure on U is an F -structure on U, or (exclusive) a G-structure on U. We can thus write

(F + G)[U] = F [U] + G[U] where “+” means disjoint union. If σ : U → U is a bijection, the transport (F + G)[σ] is defined as

 F [σ](s) if s ∈ F [U] (F + G)[σ](s) = G[σ](s) if s ∈ G[U] for any (F + G)-structure s.

In order to make this definition work properly, one must be sure that F [U]∩G[U] = ∅, that is, no G-structure is also an F -structure and viceversa. This can always be assured by considering, say, F [U] × {0} in place of F [U] and G[U] × {1} in place of G[U]. Directly from the previous definition we get the following

Theorem 3.1 The sum of species is associative, commutative, and the empty species 0 (such that 0[U] = ∅ for each set U) behaves as a neutral element.

Moreover, it is immediate to prove the following result relating sum of species with sum of power series:

Theorem 3.2 Given two species F,G, we have

• (F + G)(x) = F (x) + G(x),

• (F^+ G)(x) = Fe(x) + Ge(x),

• ZF +G(x1, x2, ...) = ZF (x1, x2, ...) + ZG(x1, x2, ...).

31 We can consider, as an example, the species E of sets (i.e. E[U] = {U} for each U) as the sum of Eeven and Eodd, the species of sets having an even (respectively, odd) number of elements. By considering the exponential series of these two last species one gets

P 2n 1 2 1 4 Eeven(x) = n≥0 x = 1 + 2 x + 24 x + ... = cosh(x) P 2n+1 1 3 1 5 Eodd(x) = n≥0 x = x + 6 x + 120 x + ... = sinh(x), which gives an interesting combinatorial interpretation of the identity ex = cosh(x) + sinh(x).

3.2 Product of species Consider a decomposition of a finite set U into two disjoint parts, that is, an ordered pair (U1,U2) of (possibly empty) disjoint subsets of U whose union is U. Notice that the order of the summands matters. We can now introduce the following

Definition 3.2 The product F · G of two species F and G is the species defined as follows: for any finite set U, an (F · G)-structure on U is a decomposition (U1,U2) of U togheter with an F -structure on U1 and a G- structure on U2. In formulas we may write X (F · G)[U] = F [U1] × G[U2]

U1+U2=U the sum ranging over all possible decompositions of U. An (F · G)-structure s can be thus written as s = (f, g) where f, g are F and G structures on the respective blocks of the decomposition. Given a bijection σ : U → U, the transport (F · G)[σ] is defined, for each (F · G)-structure s = (f, g), as

(F · G)[σ](s) = (F [σ1](f),G[σ2](g)),

where σi = σ|Ui is the restriction on Ui (i = 1, 2). Informally speaking, an (F · G)-structure on U is obtained by sticking toghether an F -structure and a G-structure on complementary subsets of U. One can also prove that F · G and G · F are combinatorially equivalent (see subsection 1.7). We now give the algebraic interpretation of the product of species by means of their generating series:

Theorem 3.3 Given two species F,G, we have

• (F · G)(x) = F (x) · G(x),

32 Figure 2: An example of (G · B)-structure. It is obtained by dividing the underlying set U in two parts, equipping the first part with a G-structure (a graph) and the second with a B-structure (a partition).

• (^F · G)(x) = Fe(x) · Ge(x),

• ZF ·G(x1, x2, ...) = ZF (x1, x2, ...) · ZG(x1, x2, ...).

Proof: Each (F · G)-structure is, by definition, given by a bipartition of the n ground set. There are k ways of choosing a subset of cardinality k from a ground set of cardinality k, and for each such choise we can pick one from fn F -structures to put on this k-subset and one from gn−k G-structures to put on the complement. By letting k cycle from 0 to n, the number of (F · G)-structures we can contruct on a set of cardinality n is given by n Xn f g , so the first identity follows from Cauchy’s rule for product k n n−k k=0 in the exponential case. The second part of the theorem is analogue, but we must carry on the argument in the unlabeled case. So we have only one way to choose a k-element subset for each k, and the number of isomorphism n X types of (F · G)-structures is simply fengen−k. The result follows from k=0 Cauchy’s product in the ordinary case. The general idea (third point) proceeds as follows. Consider ZF ·G. An F · G structure (which is built on the partition U1 ∪ U2) is a fixed point with respect to a permutation σU → U only if for any two elements in the same cycle of σ, they both are in Ui for some i ∈ {1, 2}. Also, we need that the substructure of F on U1 is a fixed point of the restriction of σ to U1 (and the same for G and U2). So the set of (F · G)-structures fixed by σ is constructed by convoluting F and G structures which are fixed points with respect to the aforementioned restricted partitions. This is translated as a multiplication of ZF and ZG. 

33 Let’s now see a classical example, giving a new way to count the number of d´erangements (permutations with no fixed points) of a set with n ele- ments. Consider a set U, |U| = n, and a permutation σ : U → U. We can partition the set U in two blocks: the subset F of fixed points u (such that σ(u) = u), and the remaining subset U − F . We then see that an arbitrary permutation on U can be considered as the combination of a d´erangement over U − F and the identity function over F (as illustrated in Figure 4).

Figure 3: An arbitrary permutation of a set U can be decomposed as a d´erangement of a subset of U and of the identity permutation of the com- plementary subset.

In the language of species, this means that the species of d´erangements D satisfies the equation S = D · E where S is the species of permutation and E is the species of sets (i.e. E[U] = {U} for each set U). Passing to exponential generating series one gets   X n! X 1 x = D(x) · xn , n!  n!  n≥0 n≥0 that is, 1 = D(x)ex. 1 − x Multiplying both sides by e−x we obtain

e−x D(x) = , (3.1) 1 − x which is the exponential generating function counting labeled d´erangements. P dn n So we can write D(x) = n≥0 n! x where dn is the number of d´erangements

34 of a set of n elements. By expanding the left side of (3.1) we can get an explicit formula for the numbers dn:

n X k dn = (−1) /k! k=0

−1 and we may also immediately prove the known fact that dn/n! → e as n → ∞.

We give another well-known example of an application of the multipli- cation of two species. Consider M and N, finite sets of cardinality m and n respectively. The enumeration of surjective functions from M to N is a classical problem which is not totally trivial. We want to give an answer to such a question by considering a generic (not necessarily surjective) function f : M → N. We first notice that N can be partitioned in two blocks, im(f) and N − im(f). The restriction of f to its image is, by definition, surjective. In a similar way as before, we can then say that the following equation holds between species: Fun(m, n) = Sur(m, n) · E, where Fun(m, n) is the species of all function from a set of m elements to a set of n elements, and Sur(m, n) is the species of surjective such functions. The previous equation implies the following identity involving exponential generating functions:

X nm xn = Sur (x) · ex, n! m n≥0 where Surm(x) is the generating function of the number of surjective function from a set with m elements. We obtain

n ! X X n xn Sur (x) = (−1)k(n − k)m m k n! n≥0 k=0

xn and, by taking the coefficient of n! , we obtain a formula for the number of surjective functions from M to N. One can verify this formula by a more elementary combinatorial reason- ing. We can see that a surjective function can be identified with a way to partition the domain set in such a way that each class is mapped in a certain element of the codomain. So there are S(m, n) ways to partition the domain (S(m, n) being a Stirling number of the second kind) and n! ways to choose how to map the classes on the codomain set. By comparing the results of this section with the formula for the Stirling numbers of the second kind we came up with in section 2.1, one can easily see that the two approaches give the same answer.

35 3.3 Composition of species Before introducing the operation of composing species, we should first look at a motivating example. Consider the species End of endofunctions, that is: End[U] = {φ : U → U}. We can represent an arbitrary φ ∈ End[U] as a (an arrow from x to y indicating that φ(x) = y). Let’s call recurrent points those x ∈ U such that φn(x) = x for some n. These points, in the directed graph, lie on a cycle. The other points are such that φn(x) 6= x for each n, and they cannot lie on a cycle. It is clear that the directed graph associated to the endofunction can thus be seen as a permutation of disjoint rooted trees, as illustrated in Figure 5. We are assuming that a rooted tree must have a root, so no nonvoid rooted tree exists.

Figure 4: An endofunction can be seen as a collection of rooted trees (roots are depicted in black), which roots are permuted.

We are now going to introduce the operation of composition ◦, so that the previous example can be translated in the following equation between species: End = S ◦ A, where S is the species of permutation and A is the species of rooted trees. Both notations A ◦ B and A(B) will be used to express composition, where A and B are combinatorial species.

Definition 3.3 Let F and G be two species, such that G[∅] = ∅. The com- posite species F ◦ G is defined as follows: an (F ◦ G)-structure on a set U is a triplet (π, φ, γ), where: • π is a partition of the set U, • φ is an F -structure on the set of parts of π,

36 • γ = (γp)p∈π is a vector, and for each part p of the partition π, γp is a G-structure on p.

We can also write, for any finite set U: X Y (F ◦ G)[U] = F [π] × G[p] π p∈π where the sum ranges over all partitions of U. Given a bijection σ : U → V , the transport (F ◦G)[σ] is given by setting, for all s ∈ (F ◦ G)[U],

(F ◦ G)[σ](s) = (¯π, φ,¯ (¯γπ¯)p¯∈π¯) where π¯ is the transport of π along σ, p¯ = σ(p) ∈ π¯, γ¯p¯ is obtained by γp by G-transport along σ|p, and φ¯ is obtained from φ by F -transport along the bijection φ¯ inducd by π on φ.

The following image gives a visual explaination of the concept of com- position.

Figure 5: An example of (G ◦ C)-structure. It is contructed by partitioning the underlying set in different blocks, giving a C-structure (oriented cycles) to each block, and endorsing the set of all blocks with a G-structure (a simple graph).

A structure of type A(B) for arbitrary species A and B, will be also called an A-assembly of B-structures. If A = E, then we may simply call it an assembly of B-structures.

37 We now state a result relating the composition of two species with their associated series. A motivation of this result will be given at the end of this section.

Theorem 3.4 Let F and G be two species, and suppose that G[∅] = ∅. Then: • (F ◦ G)(x) = F (G(x)),

2 3 • (F^◦ G)(x) = ZF (Ge(x), Ge(x ), Ge(x ), ...), 2 3 2 4 6 • ZF ◦G = ZF (ZG(x, x , x ),ZG(x , x , x ), ...). Note that the second identity is rather different from what one may expect. In general we have F^◦ G 6= Fe(Ge(x)). In fact, we know that S = E◦C, that is, the species of permutations is the composition of the species of sets with the species of cycles, but we can easily verify that Se(x) 6= Ee(Ce(x)). By noticing that Se(x) counts the isomorphism classes of permutations, and that the isomoprhism type of a permutation is determined bijectively by an integer partition of n, we can use (2.1) derived in section 2.4 obtaining

∞ Y 1 Se(x) = . (1 − x)k k=1 On the other hand, we know that there is only one cycle (and one set) for each n up to isomorphism, so 1 Ce(x) = Ee(x) = 1 + x + x2 + x3 + ... = . 1 − x and 1 x − 1 Ee(Ce(x)) = 1 = , 1 − 1−x −x which is clearly different from Se(x). Let us now recall the motivating example at the beginning of the previous section, and the equation between species

End = S ◦ A. (3.2)

Let us consider a tree on n vertices, and choose two (not necessarily distinct) vertices v1 and v2 (the head and the tail). What we get is a vertebrate. We have n2 choices for the head and the tail, and we can note that there is only one path (the vertebral column) from v1 to v2. The vertices from v1 to v2 are linearly ordered, and all the other vertices lie on rooted trees having the root on the vertebral column. We can thus say that a vertebrate is given by the composition of a (nonempty) linear order with rooted trees. In formulas

Ver = L+ ◦ A, (3.3)

38 where Ver is the species of vertebrates, L+ is the species of nonempty linear orders and A is the species of rooted trees. From the above reasonment, vn, 2 the number of vertebrates on n vertices, is equal to n tn, where tn is the number of trees on n vertices. We can also note that the number of (labeled) linear orders is the same as the number of permutations (namely, n!). So, by comparing (3.2) and (3.3) we can write

End(x) = (S ◦ A)(x) = (L+ ◦ A)(x) = Ver(x) and so there are the same number of endofunctions and vertebrates on a n n 2 set of n vertices for all n (and this number is n ). We get n = n tn, from which we finally solve for tn obtaining the celebrated Cayley’s formula for n−2 the enumeration of labeled trees: tn = n .

One of the most common type of composition is with the species E of sets. Let R be a species such that R[∅] = ∅, and consider the composition E ◦ R = E(R). The generic structure of this kind is a partition of the vertex set where each block is endorsed with an R-structure. By Theorem 3.4 we have (E ◦ R)(x) = eR(x). Consider now the species E+ of nonempty sets and let us examine the composite R ◦ E+, where R is an arbitrary species. An (R ◦ E+)-structure on [n] is a partition of the set [n] together with an R-structure on the set of blocks of the partition. The labeled enumeration of structures of type R ◦ E+ is straightforward provided one can compute the series R(x): P∞ n Theorem 3.5 Let R(x) = n=0(rnx )/n! be the generating series of the species R, and let E+ be the species of nonempty sets. Then (R ◦ E+)(x) = P∞ n n=0(anx )/n!, where n X an = S(n, k)rk, k=1 S(n, k) being Stirling numbers of the second kind.

Proof: We must prove that there are an structures of type R(E+). Recall that, given a set with n elements, there are S(n, k) partitions of this set made of k blocks. For any such partition, we have rk ways to put an R structure on the set of blocks, and we are done by the principle of multiplication. 

The unlabeled enumeration of a species R(E+) is possible thanks to the Euler Transform, so if X n Re(x) = renx n≥0 then ∞ Y 1 R^(E+)(x) = . (1 − xk)rek k=2

39 Consider now a species M and its exponential generating series M(x). Given a set [n] we can partition M[n] into isomorphism classes, and the quotient π(M[n]) is such that X Mf(x) = |π(M[n])|xn. n≥0

The notation Mf suggests the fact that the previous series may be the (exponential) generating series of a species Mf associated with M. In fact we have the following

Theorem 3.6 Let M be a species, and let Mf be a species such that a Mf- structure is a couple (σ, h) where h is an M-structure and σ is an automor- phism of h. Then Mf(x) is the exponential generating series of the species Mf.

Proof: Let Sn act on M[n] where the action is given by the transport of permutations: Sn × M[n] → M[n] (σ, h) → M[σ](h) and so, by Burnside’s lemma (Theorem 2.3), |π(M[n])| = |{(σ, h): M[σ](h) = h}|/n!. The thesis follows. 

We now want to give a sketch of the proof of the second point in Theorem 3.4. We begin by considering the species X such that X(U) = {U} iff |U| = 1 and X(U) = ∅ otherwise. Naturally X(x) = x. The power Xn is isomorphic to the species of linear orders of length n. In the following, E will denote the species of sets and N will be an arbitrary species such that N[∅] = ∅.

Definition 3.4 A crown of N-structures is an assembly h ∈ E ◦ N of N- structures endorsed with an automorphism σ : h → h cyclically permuting the elements of h. Its lenght is the number of elements in the assembly.

Let Cn(N) denote the species of crowns of N-structures of length n.

n Theorem 3.7 The type generating series (C^n(N))(x) is equal to Ne(x )/n, where Ne is the species associated to N as in theorem 3.6.

Proof: Consider that Xn is the species of linear orders of length n. So, a structure s (on a set U) of type Ne(Xn) is an Ne-assembly of linear orders of length n. For each i = 1, ..., n let Ci the set of elements of rank i in each linear order in s. We can define functions

σi : Ci → Ci+1

40 for each i = 1, ..., n − 1, and a function σn : Cn → C1 mapping the n- th element of each linear order to the first one. Now, each Ci is a set of representative of the partition of the elements in U where classes are the linear orders (i.e. each Ci has one and only one element for each linear orders), so we can endorse each Ci with an N-structure. We end up with a crown of length n on U, where we can distinguish the initial N-structure C1 (let us call it a marked crown). On the other hand, let us consider a marked crown of Ne-structures (σ, h), where h is an N-crown and σ is a cyclic permutation, and where C1 is the initial N-structure. Let Ci = σ(Ci − 1), for each i = 2, ..., n. We easily obtain a structure of type Ne(Xn). Finally, as there are n ways to choose the initial structure, we have that (C^n(N))(x) n is equal to Ne(x )/n. 

We now consider the most generic case in which the permutation σ is not necessarily cyclic. We must then consider the species W of assemblies of crowns of N-structures. Let s be a W -structure. We say that w has d d dn genus x1 1 x2 2 ...xn if there are di crowns of length i in the assembly s. In particular, s is of genus xn if and only if it is a crown of length n.

Theorem 3.8 The species W of assemblies of crown of N-structures of d d dn genus x = x1 1 x2 2 ...xn has type generating series given by 1 Ne(x)d1 Ne(x2)d2 ...Ne(xn)dn aut(x)

d d dn where aut(x) = 1 1 2 2 ...n d1!d2!...dn!. 

3.4 Derivative of a species Definition 3.5 Given a species F , we define the derivative F 0 as follows: an F 0-structure on a set U is a couple s = (f, ∗), where f is an F -structure on U ∪ {∗} where ∗ is an element not in U. The transport F 0[σ] (where σ : U → V ) is given, for any F 0-structure s = (f, ∗) on U, by

F 0[σ](s) = F [σ+](f), where σ+ : U + {∗} → V + {∗} is the permutation fixing ∗ and agreeing with σ on every element different from ∗ .

The combinatorial meaning of this operator is to take a set augmented with ∗ and consider an F -structure on this new set. The easiest way to define a canonical way to choose the new element ∗ is to use U itself, so the agumented set is in fact U S{U}, which set-theorists call successor set. The condition ∗ ∈/ U is then assured by the axiom of foundation.

41 Figure 6: An example of G0-structure, where G is the species of simple graphs. Note that this is in fact a G0 structure on seven vertices.

Theorem 3.9 For the derivative operator on an arbitraty species F , the following identities hold:

0 d • F (x) = dx F (x),

  • F 0(x) = ∂ Z (x1, x2, x3, ...) e ∂x1 F

 ∂  • Z 0 (x , x , x ...) = Z (x , x , x , ...) F 1 2 3 ∂x1 F 1 2 3

Proof: The second equality follows from the third and from the definition of type generating series. The first equality can be proved directly, as it follows from the shift operator for exponential generating functions (Theorem 1.5), considering that there are |F [n + 1]| possible F -structure on n + 1 elements. The third equality can be proved as follows: we can begin by noticing that !  ∂  ∞ 1 X X σ1−1 σ2 ZF (x1, x2, x3, ...) = |Fix(F [σ])|σ1x1 x2 ... ∂x1 n! n=1 σ∈Sn

Now consider an F 0-structure on the set [n], fixed by F 0[σ], where σ is an arbitrary permutation of [n]. We can consider an F 0-structure on the set [n] as an F -structure on the set [n + 1], where the element ∗ has been σ1 σ2 σm substituted with n + 1. Let us fix a monomial x1 x2 ...xk in ZF and prove that the corresponding coefficient x σ1−1x σ2 ...x σk in ∂ Z is the 1 2 m ∂x1 F σ1−1 σ2 σ same as the coefficient of x1 x2 ...xm k in ZF 0 divided by σ1 (we are assuming σ1 > 0, otherwise the result is immediate). The idea is to consider a permutation fixing k = σ1 points and comparing respective coefficients in the series involved. Consider thus a permutation of [n] with cycle type

42 (σ1, ..., σm). Let θ(0, σ2, σ3, ..., σm) be the number of permutations having cycle type (0, σ1, σ2, ..., σm). Finally, by letting k = σ1 and considering the factorial terms in the definition of the cycle index series,

1 n n! 1 1 (n − 1)! 1 1 n − 1 = = · · = · · n! k k!(n − k)! (n − 1)! k (k − 1)!(n − k)! (n − 1)! k k − 1 and that means that 1 n 1 1 n − 1 θ(0, σ , ..., σ ) = θ(0, σ , ..., σ ) n! k 2 m (n − 1)! k k − 1 2 m the results following. 

3.5 Pointing of a species Definition 3.6 Given a species F , we define the pointing F • as follows: an F •-structure on a set U is a couple s = (f, u), where f is an F -structure on U and u is a distinguished element in U. In formulas we may write

F •[U] = F [U] × U.

The transport F •[σ] (where σ : U → V ) is given by

F •[U](s) = (F [σ](f), σ(u)), for any F •-structure s = (f, u) on U.

We thus have that |F •[n]| = n|F [n]|. The most classical example of pointing is given by the species A of rooted trees, which is given by pointing the species a of trees: a• = A Let us now examine the relations between associated series of a species and its pointed version. The following results is a consequence of the previ- ous definition and of Theorem 3.9.

Theorem 3.10 Given a species F and its pointed species F •, the following identities hold:

• d • F (x) = x dx F (x),

• F •(x) = x ∂ Z (x1, x2, x3, ...) e ∂x1 F ∂ • Z • (x , x , x ...) = x Z (x , x , x , ...) F 1 2 3 1 ∂x1 F 1 2 3

43 Figure 7: An example of G•-structure, where G is the species of simple graphs. It is obtained by making a vertex distinguishable.

3.6 Cartesian product of species Consider a set U and two species F and G. We want to endorse U with an F -structure and a G-structure at the same time. The cartesian product is the operation conveying this kind of construction. Definition 3.7 Given two species F and G, the cartesian product F × G is defined as follows: an (F × G)-structure on a finite set U is a couple s = (f, g), where f is an F -structure on U and g is a G-structure on U. We thus have (F × G)[U] = F [U] × G[U]. The transport of a bijection σ : U → V is defined by setting (F × G)[σ](s) = (F [σ](s),G[σ](s)) for any (F × G)-structure s on the set U. We can immediately see that |(F ×G)[U]| = |F [U]|·|G[U]|. It is also easy to see that the cartesian product corresponds to the Hadamard (coefficient- wise) product of series:

X fn X gn X fn · gn xn × xn = xn. n! n! n! n≥0 n≥0 n≥0 More generally: Theorem 3.11 The series associated to F × G satisfy • (F × G)(x) = F (x) × G(x),

2 3 • (F^× G)(x) = (ZF × ZG)(x, x , x , ...), 2 3 2 3 2 3 • ZF ×G(x, x , x , ...) = ZF (x, x , x , ...) × ZG(x, x , x , ...) for any choice of combinatorial species F and G. 

44 Figure 8: An example of C × B-structure, where C is the species of oriented cycles and B the species of set partitions.

3.7 Functorial composition By remembering that a combinatorial species is a functor from the category B of finite sets into itself, it is immediate to define a new operation by considering the composition of two species seen as functors. Let us try to explain what should such a composition do. Given two species functors F and G and a finite set U, we know that G[U] is the set of all G-structures on U. So, F [G[U]] is the set of all F -structures built on the set of all G-structures on U. We can thus give the following

Definition 3.8 Let F and G be species. The functorial composition of F and G is defined for any finite set U as follows. We have

(F G)[U] = F [G[U]], and given a bijection σ : U → V , we can simply define the transport by setting (F G)[σ] = F [G[σ]]. Let us now consider the exponential generating series of the functorial composition of two species. It is immediate to see that the number of distinct

(F G)-structures on n elements is given by fgn , where fn and gn are the numbers of F -structures and G-structures on n elements, respectively. We can thus define a corresponding operation on series, given by

X xn X xn X xn f g = f . n n!  n n! gn n! n≥0 n≥0 n≥0

We still have to understand how the isomorphism type and cycle index series behave with respect to functorial composition. We start by giving a preliminary result:

45 Theorem 3.12 Let G be a species of structure, σ ∈ Sn a permutation, and k > 0 an integer. The number of cycles of length k in G[σ] is

1 X (G[σ]) = µ(k/d)|FixG[σd]| k k d|k the sum ranging over all divisors of k and where µ is the Moebius function.

Proof: We can notice that an element is a fixed point of the permutation τ k if and only if it is found in a cycle of τ of length d, where d divides k, that is k X |Fix(τ )| = dτd. d|k By applying M¨obiusinversion to this identity we get

1 X τ = µ(k/d)|Fix(τ k)|. k k d|k

k k For τ = G[σ], we have by functoriality τ = G[σ ] and the result follows. 

This result allows us to conclude that we can compute the cycle lengths (G[σ])k if we know the coefficients of ZG. We can now give the following

Definition 3.9 The composition ZF ZG is defined by X 1 X Z Z = |Fix(F [(G[σ]) , (G[σ]) , ...]|x σ1 x σ2 ... F  G n! 1 2 1 2 n≥0 σ∈Sn

Also, we easily get the following

Theorem 3.13 Given two species F,G, we have

• (F G)(x) = F (x)G(x),

2 3 • (F^G)(x) = (ZF ZG)(x, x , x , ...),

• ZF G(x1, x2, ...) = ZF (x1, x2, ...)ZG(x1, x2, ...).

46 4 Relation theory

Relations are one of the most elementary concepts in mathematics, but still offer a great amount of interesting and extremely difficult problems. We begin by introducing some basic facts about relations and some operations that we may introduce on them.

4.1 Basic notions and results about relations In this section we will make extensive use of logical symbols and termi- nology. Symbols like ∧ (conjunction), ∨ (disjunction), → (implication), ¬ (negation), ∀ (universal quantifier), ∃ (existential quantifier) will be used with their common meanings.

Definition 4.1 A binary relation over a set S is a subset R of S × S. We’ll usually write aRb when (a, b) ∈ R.

Given a set U endorsed with a relation R ⊂ U k, we will write (U, R) and call it a relational set.

Definition 4.2 The characteristic function of a relation R ⊆ U × U is a function χR : U × U → {0, 1}, where χR(a, b) = 1 iff (a, b) ∈ R.

Definition 4.3 A directed graph (or digraph) is a set U of vertices, along with a collection of directed arrows (i.e. ordered couples of vertices in U).

We can associate in an obvious way a graph to each relation R on U. Let U be the set of vertices, and add an arrow pointing from a to b iff aRb. We may denote this graph as GR.

Definition 4.4 A 0, 1-matrix (or binary matrix) is an n × n matrix where each element is 0 or 1.

If a relation R ⊆ U × U is given, we can label the elements of the set U as x1, ..., xn, and then construct a corresponding 0, 1-matrix MR = (mij) by letting mij = 1 iff xiRxj. MR is the of the graph GR, under the same labeling of the vertices. Note that, in order to construct this matrix, we must label the elements of the underlying set. The study of those matrices can be fruitful, but the age-old dilemma of distinguishing when they refer to isomorphic relations may arise. The enumeration of binary relations is trivial in some cases and extremely difficult in other cases, and, as usual, the unlabeled enumeration is most often harder than the labeled one. For example, consider an arbitrary relation on n elements and its cor- responding binary matrix M = (mij). The number of such relations (or

47 matrices) is obviously 2n2 . If we want to know the number of nonisomor- phic relations on n vertices we should (for example) compute the number of orbits under the action of the symmetric group Sn on the set of all n × n binary matrices, where the action is given by

φ · (mij) = mφ(i)φ(j) for each φ ∈ Sn, which is not at all a trivial task. We now continue by recalling the most important properties a relation can satisfy. We list those properties on a table for convenience. Name Condition Reflexive ∀x xRx

Irreflexive ∀x ¬xRx

Coreflexive, Diagonal ∀x, y xRy → x = y

Symmetric ∀x, y xRy → yRx

Antisymmetric ∀x, y xRy ∧ yRx → x = y

Transitive ∀x, y, z xRy ∧ yRz → xRz

Euclidean ∀x, y, z xRy ∧ xRz → yRz

Total ∀x, y xRy ∨ yRx

Extensional ∀x, y, z (zRx ↔ zRy) → x = y

Dense ∀x, y xRy → ∃w(xRw ∧ wRy)

Some important kinds of relation can be defined by combining two or more properties from the previous list: Definition 4.5 A quasiorder (or preorder) is a binary relation which is both transitive and reflexive. Definition 4.6 A partial order is a binary relation which is transitive, antisymmetric and reflexive. The Hasse diagram of a partially ordered set is a graphical represen- tation in which vertices are depicted as dots and each vertex is connected by undirected edges to its immediate predecessors (which are conventionally put in an lower position). Definition 4.7 A soft order is a binary relation which is both transitive and antisymmetric. Definition 4.8 An equivalence relation is a binary relation which is transitive, symmetric and reflexive.

48 Figure 9: The Hasse diagram of the order relation a < b < c < d, e < d a < e < f.

4.2 Operations on relations It is possible to define operations taking relations as arguments, so that we may construct new relations from old ones.

Definition 4.9 Given a relation R on a set U, the opposite of R is denoted Rop and defined by ∀x, y ∈ U xRopy ↔ yRx.

Definition 4.10 Given a relation R on a set U, the complement of R is denoted R¯ and defined by

∀x, y ∈ U xRy¯ ↔ ¬(xRy).

We may see that if R is a relation on U and MR is the associated matrix according to some labeling of the elements in U, then: MRop is the transpose t (MR) , and MR¯ is obtained by MR by substituing each 0 with a 1 and vice- versa. Also, the directed graph GRop can be obtained by reversing all the arrows of GR, and GR¯ is the (directed) complementary graph of GR.

Definition 4.11 The union of two relations R,S over a set U is defined as follows: ∀x, y ∈ U x(R ∪ S)y ↔ (xRy ∨ xSy).

Definition 4.12 The intersection of two relations R,S over a set U is defined as follows:

∀x, y ∈ U x(R ∩ S)y ↔ (xRy ∧ xSy).

Definition 4.13 The difference of two relations R,S over a set U is de- fined as follows:

∀x, y ∈ U x(R − S)y ↔ (xRy ∧ ¬(xSy)).

49 Definition 4.14 The composition of two relations R,S over a set U is defined as follows:

∀x, y ∈ U x(R ◦ S)y ↔ ∃z(xRz ∧ zSy).

Definition 4.15 Given two relations R on U and R0 on U 0, the cartesian product R × R0 is a relation over U × U 0 defined by

∀x, y ∈ U, ∀x0, y0 ∈ U 0 (x, x0)(R × R0)(y, y0) ↔ (xRy ∧ x0R0y0).

From a matricial point of view, if MR is an (n × n)-matrix, and MR0 is an (m × m)-matrix, then MR×R0 is an (nm × nm)-matrix corresponding to the Kronecker product of MR and MR0 .

4.3 Posets, order ideals and lattices Let (P, ≤) be a finite poset. Two elements a, b ∈ P are said to be comparable if one of the conditions a ≤ b and b ≤ a holds. They are incomparable if they are not comparable. A subset C ⊆ P is said to be a chain if the restriction of the relation ≤ to C is a total order. The length of the chain C is |C| − 1. The rank of a poset is the maximum length of its chains. An antichain is a subset A ⊆ P of mutually incomparable elements. The weight of the poset P is the maximum cardinality of its antichains. A subposet of (P, ≤) is a poset (Q, ) such that Q ⊂ P and  is the restriction of ≤ to Q (i.e. a  b iff a ≤ b for eacg a, b ∈ Q). Given a partial order (P, ≤) and two elements a and b, we say that a is an immediate predecessor of b, or that b is an immediate successor of a, if a ≤ b and there is no element c ∈ P such that a ≤ c ≤ b.

Definition 4.16 Let P = (P, ≤P ) and Q = (Q, ≤Q) be (finite) posets. An order-preserving map from P to Q is a function φ : P → Q such that, for each a, b ∈ P , a ≤P b implies φ(a) ≤Q φ(b). An order-preserving map φ being bijective and such that the inverse map is also order-preserving is called an order isomorphism. If such an isomorphism exists from P to Q we say that P and Q are isomorphic and we write P =∼ Q.

Definition 4.17 A lattice is a poset (L, ≤) such that for each couple of elements a and b in L, there is an unique greatest lower bound a ∧ b (called the meet of a and b), and an unique least upper bound a ∨ b (called the join of a and b).

The most classical example of lattice is the of any set X ordered by inclusion, i.e. (P(X), ⊆). This is known as the boolean lattice of order n = |X|. Each lattice clearly has a unique maximal element, 1,ˆ and a unique minimal element, 0.ˆ

50 Definition 4.18 A lattice (L, ≤) is said to be distributive if the distribu- tive laws

a ∨ (b ∧ c) = (a ∨ b) ∧ (a ∨ c); a ∨ (b ∧ c) = (a ∧ b) ∨ (a ∧ c) hold for any choice of elements a, b, c in L.

Definition 4.19 Let (L, ≤) be a distributive lattice. An element a ∈ L is said to be meet-irreducible (respectively, join-irreducible), if for all elements b and c in L such that a = b ∧ c (respectively, a = b ∨ c), then one has either a = b or a = c (or both).

Let now (P, ≤) be a finite poset, P = {p1, ..., pn}. We give the following

Definition 4.20 An order ideal (or poset ideal) of (P, ≤) is a subset I ⊆ P such that for each a ∈ I and b ∈ P , if b ≤ a then b ∈ I. We will denote with I(P ) the set of all order ideals of P .

We must notice that if I and J are poset ideals, then I ∪ J and I ∩ J are also order ideals. It follows that (I(P ), ⊆) is a lattice. It is also easy to see that this is in fact a distributive lattice. An important theorem by Birkhoff guarantees the converse:

Theorem 4.1 Let (L, ≤) be a finite distributive lattice. Then there is a unique (up to isomorphism) finite poset P such that L =∼ I(P ).

Proof: Let P ⊆ L be the subset of all the join-irreducible elements, and let I(P ) be the lattice of order ideals of P . We want to show that L =∼ I(P ) by defining a map φ : I(P ) → L W I 7→ a∈I a mapping each ideal in the join of all the elements in it. In particular φ(∅) = 0.ˆ It is immediate to see that φ is order preserving. It is also surjective, because each element a ∈ L is the join of all the elements in the principal ideal generated by a, that is, a = V ({b ∈ L : b ≤ a}). We must prove that φ is injective. Let I 6= J be ideals of P , and without loss of generality assume ∗ ∗ J * I. Let b be a maximal element of J with b ∈/ I. We want to show that φ(I) 6= φ(J). If not, we should have _ _ a = b. a∈I b∈J By distributivity we can also write ! _ _ a ∧ b∗ = (a ∧ b∗). a∈I a∈I

51 ∗ W  ∗ ∗ ∗ Now, b is join-irreducible and thus a∈I a ∧ b < b , but, since b ∈ J, we have ! _ _ b ∧ b∗ = (b ∧ b∗) = b∗ b∈J b∈J which is impossible because this would imply b∗ ∈ I, a contradiction. So φ is injective. The inverse function φ−1 is defined as follows: for each c ∈ L, let φ−1(c) be the set of all join-irreducible elements a ∈ L with a ≤ c. It is easy to see that φ−1(c) is an ideal of P and that φ−1 is order-preserving. So I(P ) is isomorphic to L via φ. Since P is isomorphic to the subposet of L consisting of all join-irreducible elements, then if Q is another poset such that I(Q) =∼ I(P ), then Q =∼ P , so the unicity up to isomorphism is also proved. 

52 5 Algebraic approaches to partial orders

In this section we shall embark in a purely algebraic approach to the theory of partial orders. We begin by giving a few basic notations about mono- mial orders and Gr¨obnerbases, then we introduce some canonical algebraic structures associated to a given poset P . We will derive some general results in a more category-theoretical setting.

5.1 Monomial orders and Gr¨obnerbases

Let K be a filed and let K[x1, ..., xn] be the ring of polynomials with coef- ficients in K. Also, let T ⊂ K[x1, ..., xn] be the set of all monic monomials. Also, recall that a well order on a set A is a total order such that every nonempty subset of A has a minimal element. We say that u is a monomial of f if the coefficient of u in f is nonzero.

Definition 5.1 A monomial order on T is a well order < on T such that • 1 < u for all 1 6= u ∈ T ;

• u < v implies uw < vw for all w ∈ T .

a an Given a monic monomial x1 1 ...xn , we can consider the degree vector a a = (a1, ..., an), writing x for this monomial. We can also define monomial orders by comparing those vectors. In particular we need the following

Definition 5.2 The graded reverse lexicographic order

Given a polynomial f ∈ K[x2, ...xn], the leading monomial of f is the biggest monomial in f (with respect to some fixed monomial order <) having nonzero coefficient. We indicate this monomial with LM<(f). We will write I C A to say that I is an ideal of the ring A. Now, let us consider an ideal I C K[x1, ..., xn] and, for each f, consider the leading monomial LM<(f).

Definition 5.3 Let < be a fixed monomial order. Let I C K[x1, ..., xn]. The initial ideal in<(I) is the ideal generated by the leading monomials of the nonzero polynomials in I.

Definition 5.4 Let < be a fixed monomial order. A set of polynomials B = {g1, ..., gs} is said to be a Gr¨obnerbasis for an ideal I C K[x1, ..., xn] if B ⊂ I and the leading monomials LM<(gi) generate the initial ideal in<(I).

53 We now recall some properties of Gr¨obnerbases. Proofs can be found in [5]. The first result we recall is the so-called division algorithm:

Theorem 5.1 Let S = K[x1, ..., xn] and let < be a monomial order on S. Let g1, g2, ..., gs be nonzero polynomials of S. Then, given a polynomial 0 6= f ∈ S, there exist polynomials f1, f2, ..., fs and r of S such that

f = f1g1 + ... + fsgs + r and such that

• if r 6= 0, no monomial u in f belongs to the ideal generated by the leading monomials LM<(gi),(i = 1, ..., s).

• if fi 6= 0, then LM<(f) ≥ LM<(figi). 

It is well-known that, whenever g1, ..., gs constitutes a Gr¨obnerbasis of I = (g1, ..., gs), then the value of r in the previous theorem is independent on the order in which we perform the division algorithm. We can then refer to such remainder r as the normal form of f with respect to the Gr¨obner basis G G = {g1, ..., gs}, and we refer to such remainder as f . Also, a polynomial f G belongs to I = (g1, ..., gs) if and only if its remainder vanishes, i.e. f = 0. We say that f reduces to zero with respect to g1, ..., gs if, in the division algorithm, there is a standard expression

f = f1g1 + ... + fsgs + r with r = 0.

Definition 5.5 Let < be a fized monomial order. A Gr¨obnerbasis G = {g1, ..., gs} is said to be reduced if the following conditions hold:

• The coefficient of LM<(gi) is 1 for each i = 1, ..s. That is, each element of G is monic.

• If i 6= j, then no monomial iof gi is divisible by LM<(gj).

We can now state the fundamental result:

Theorem 5.2 Let < be a fized monomial order and I an ideal of K[x1, ..., xn]. Then a reduced Gr¨obnerbasis of I exists and is unique. 

We still need to introduce an important notion which will be used later:

54 Definition 5.6 Let f and g be nonzero polynomials and fix a monomial order <. Let cf and cg be the coefficients of LM<(f) and LM<(g) in f and g respectively. The polynomial

lcm(LM (f), LM (g)) lcm(LM (f), LM (g)) S(f, g) = < < f − < < g cf LM<(f) cgLM<(g) is called the S-polynomial of f and g.

The following result is known as Buchberger’s Criterion:

Theorem 5.3 Let I be a nonzero ideal of K[x1, ..., xn] and G = {g1, ..., gs} a system of generators of I. Then G is a Gr¨obnerbasis of I if and only if, for all i 6= j, S(gi, gj) reduces to zero with respect to g1, ..., gs. 

5.2 Toric ideals

Let S = K[x1, ..., xn], and A = {u1, ..., um} a set of monomials in S. The toric ring of A is the subring K[A] = K[u1, ..., um] of S.

Definition 5.7 Let R = K[t1, ..., tm] be the polynomial ring with m inde- terminates, and consider the map

π : R → K[A] ti 7→ ui

The kernel ker(π) is the toric ideal of A and is denoted by IA.

3 2 3 As an example, consider K[x, y, z], A = {x, xy, x y , z } and π : K[t1, t2, t3, t4] defined by  x if i = 1   xy if i = 2 π(t ) = i x3y2 if i = 3   z3 if i = 4

2 3 2 Let us notice that π(t1t2 ) = x y = π(t3), so in this case the function π is not injective. Its kernel is by definition the toric ideal of A, which is IA = (t3 − t1t2) A binomial of R is a polynomial of the form u − v, where u and v are monomials of R. The toric ideal in the previous example was generated by a binomial. We now want to prove that general fact that toric ideals are always generated by binomials, by giving the following characterisation:

Theorem 5.4 The toric ideal IA of a set of monomials A = {u1, ..., um} is generated by those binomials u − v of R such that π(u) = π(v).

55 Proof: Let f = c1w1 + ... + crwr be a polynomial belonging to IA, where wi is a monomial of R, and ci ∈ K. Suppose that π(u1) = ... = π(uk) and π(u1) 6= π(ul) for k < l ≤ r. We know that the monomials belonging to the toric ring K[A] constitute a basis of K[A] as a K-vector space. By definition of IA, we have that π(f) = 0, and so

c1 + c2 + ... + ck = 0, that is, c1 = −(c2 + ... + ck). We may then write

c1uu + ... + crur = c2(u2 − u1) + ... + ck(uk − u1), where for each i = 2, ...k, π(ui) = π(u1). Considering that f ∈ IA, working by induction gives the desired result. 

Definition 5.8 A binomial f = u − v in IA is said to be primitive iff there is no other binomial f 0 = u0 − v0, f 0 6= f, such that u0 divides u and v0 divides v.

We end this section by proving another important result that gives a complete characterisation of the Gr¨obnerbasis of a toric ideal of a set of monomials.

Theorem 5.5 The toric ideal IA has a reduced Gr¨obner basis consisting of primitive binomials.

Proof: Let f and g be binomials and fix a monomial order <. Then their S-polynomial S(f, g) is a binomial. Also, if f1, ..., fs and g are binomials, then the remainder of g with respect to g1, ..., gs is a binomial. By using Buchberger’s algorithm, one gets a Gr¨obnerbasis whose elements are bino- mials. Also, the reduced Gr¨obnerbasis will be composed by binomials. Let G be the Gr¨obnerbasis of IA with respect to <. Let f = u−v be a binomial 0 0 in IA and suppose that u is its leading monomial. Also, let g = u − v be 0 0 another binomial in IA, with g 6= f, and suppose that u divides u and v divides v. By hypothesis, u belongs to the minimal system of monomial 0 0 generators of in<(IA), so if u = LM<(g), then u = u and we must have 0 0 f = g, which is a contradiction. So v = LM<(g), and since v divides v, by 00 00 definition 5.5 we have v ∈ in<(IA). So there is a binomial h = u − v ∈ G 00 00 with u = LM<(h) and u divides v. This contradicts the fact that G is a reduced Gr¨obnerbasis. So we have that each element in G must be a primitive binomial and we are done. 

56 5.3 Hibi ideal of a poset

Let (P, ≤) be a finite poset, P = {p1, ..., pn}. Let K[x1, ...xn, y1, ..., yn] be the ring of polynomials in 2n indeterminates over the field K. We associate to each element pi ∈ P the couple of indeterminates xi and yi. For each order ideal I of the poset P we associate the squarefree mono- mial     Y Y uI =  xi  yj pi∈I pj ∈/I of K[x1, ..., xn, y1, ..., yn]. In other words, the monomial uI is the product of all the xi such that pi belongs to the ideal I, multiplied by the product of all the yj such that pi is not a member of I.

Definition 5.9 Let P = {p1, ..., pn} be a finite poset, and for each order ideal I of P , let uI be the monomial previously defined. The Hibi ideal of P is denoted as HP and is the monomial ideal generated by all the uI for I ∈ I(P ): HP = (uI : I ∈ I(P ))

Before continuing, we should remark that, in the case (P, ≤) is a total order, then P = {p1, ..., pn} with pi ≤ pj iff i ≤ j as natural numbers. We can thus define a map φ : K[t0, ..., tn] → HP such that φ : ti 7→ x1x2...xiyi+1yi+2...yn. It is immediate to see that φ is a morphism of K-algebras and that it is bijective. So we can consider Hibi rings as a generalisation of polynomial rings. In the case of total orders of n elements, we obtain polynomial rings in n + 1 indeterminates.

5.4 Toric ideals associated to posets Let P be a finite poset and recall the notations introduced before. Let

AP = {uI : I ∈ I(P )} be the set of all monomials associated to order ideals of P . We can consider the toric ideal IAP of this set, i.e. (definition 5.7) the kernel of the surjective morphism π : K[t1, ..., tm] → K[AP ] defined by setting π(tI ) = uI (the ts being indexed by ideals of P ). Let us fix a total order < on the ts such that tI < tJ if I ⊂ J, and let us consider the reverse graded lexicographic order

57 Theorem 5.6 The reduced Gr¨obnerbasis of the toric ideal IAP with respect to the ordering

tI tJ − tI∩J tI∪J where neither I ⊂ J nor J ⊂ I.

Proof: If I and J are order ideals of P , then I ∪ J and I ∩ J are order ideals of P . It is clear that the binomial tI tJ − tI∩J tI∪J belongs to IAP and, if neither I ⊂ J nor J ⊂ I, its initial monomial is tI tJ . Once we show that the set of those binomials tI tJ − tI∩J tI∪J with neither I ⊂ J nor J ⊂ I is a

Gr¨obnerbasis of IAP with respect to

I1 ⊂ I2 ⊂ ... ⊂ Iq.  q   Then Q x divides π (Qq t ), and so must also divide π Qq t . pi∈I1 i i=1 Ii j=1 Jj We thus have that I1 ⊂ Jj for all j = 1, ..., q. Since I1 6= Jj for each j = 1, ..., q, it follows that tI1

q q Y Y tIj

5.5 Order ideals and cartesian product of posets In the following, Letters such as P,Q will denote finite partially ordered sets. We will denote with ≤P the order relation defined on P .

Definition 5.10 If P is a poset, then P op denotes the opposite order. That is, a ≤P b if and only if b ≤P op a for all a and b.

Let (P, ≤P ), (Q, ≤Q) be posets. The set-theoretical cartesian product P × Q (containing couples as (p, q) with p ∈ P and q ∈ Q) becomes a poset when equipped with the order

0 0 0 0 (p, q) ≤ (p , q ) iff (p ≤P p ∧ q ≤Q q ).

58 Figure 10: The Hasse diagram of the cartesian product of partial orders is the cartesian product of the Hasse diagrams of the factors.

We also know that if P is a poset, then I ⊂ P is an order ideal of P if for all a, b ∈ I the following holds:

(a ∈ I ∧ b ≤ a) → b ∈ I.

Let I(P ) be the distributive lattice whose elements are order ideals of P ordered by inclusion. Also, let J (L) be the subposet of a lattice L whose elements are the join-irreducible elements. Birchoff’s result (theorem 4.1) states that there is a canonical isomorphism P =∼ J (I(P )). Given an operation ∗ on posets, can we characterize I(P ∗Q) in terms of simpler objects as I(P ) and I(Q)? In the case of disjoint union the answer is: I(P ∪ Q) =∼ I(P ) × I(Q) As a set-theoretical isomorphism (i.e. bijection) the statement is clear. In- deed it is an order isomorphism as it is not hard to prove. We now want to give a similar carachterisation of I(P × Q), where × is the cartesian product.

Theorem 5.7 Let P and Q be posets. The number of poset ideals of P × Q is equal to the number of order-reversing function from Q to I(P ).

59 Proof: Let (P, ≤P ) and (Q, ≤Q) be poset, and consider the product (P × Q, ≤P ×Q) with the cartesian order defined before. We can find, in P × Q, |Q| canonical subposets isomorphic to P . Those will be called fibers (i.e. if q ∈ Q we will denote with Pq the fiber of P corresponding to q). Now, let I be an order ideal of P × Q. It must then be a subposet of P × Q closed under ≤P ×Q. Given a fiber Pq, let Iq be I ∩ Pq. Now, we have that 0 if q ≤Q q , then Iq ⊇ Iq0 . Indeed, assuming the contrary we would have 0 that some (p, q ) ∈ Iq0 exists such that (p, q) is not in Iq. But as I is an 0 0 ideal then if (p, q ) ∈ I and q ≤Q q then (p, q) is in I and thus in Iq, a contradiction. We then have that, in order to give an ideal of the product, 0 one must give a family of |Q| ideals Iq of P such that q ≤Q q implies Iq ⊇ Iq0 . This is equivalent to give an order reversing function from Q to I(P ). This order-reversing function from Q to I(P ) is associated to an order-preserving function (i.e. order morphism)

op ρI : Q → I(P ) where ρ(q) = Iq seen as an ideal of P . The viceversa is easy: given an order reversing-function we immediately construct an order ideal of P × Q. 

It is interesting that the previous argument is valid also by interchanging the roles of P and Q. Because the cartesian product is commutative, then we also have the not so trivial fact:

Corollary 5.1 The number of order-reversing functions from Q to I(P ) is equal to the number of order-reversing functions from P to I(Q), for any choise of finite posets P and Q. 

5.6 Adjoint functors in the category of posets We would now give an order relation on the sets of order-reversing functions. Let P,Q be posets and

0 0 Hom(P,Q) = {f : P → Q : p ≤P p → f(p) ≤Q f(p )}.

Note that the set of order reversing function from P to Q is then given by op Hom(P ,Q). We can define an order P,Q on Hom(P,Q) by saying that

f P,Q g iff ∀p ∈ P (f(p) ≤Q g(p))

it is clear that, given order ideals I ⊆ J of P × Q, then the restrictions of those ideals on the fibers satisfy the condition Iq ⊆ Jq for each q. So the order morphism op ρI : Q → I(P )

60 Figure 11: An order ideal of the cartesian product of two posets is uniquely determined by an order reversing function from one of the factors to the ideals of the other factors.

where ρ(q) = Iq seen as an ideal of P , must be such that ρI Qop,L(P ) ρJ . We can finally state the general fact Theorem 5.8 We have the order Hom(Qop, I(P )) =∼ Hom(P op, I(Q)) =∼ I(P × Q) where each poset in the equation is endorsed with the natural previously defined order induced by ≤P and ≤Q. 

Let now P be the category of posets, where morphisms are order-preserving functions. The last result from the previous section can be rewritten as I(P × Q) =∼ Hom(Q, I(P )op). Also, it immediate to see that an ideal is just an order preserving function to the two-element boolean algebra B = {0, 1} where 0 ≤B 1. We also have that a bigger ideal corresponds to a smaller function (with respect to the previously defined order relation on the Hom-sets). This means that (I)(P ) =∼ Hom(P,B)op. We can thus write Hom(P × Q, B)op =∼ Hom(Qop, Hom(P,B)op) that is,

Hom(P × Q, B) =∼ Hom(Q, Hom(P,B)op). The reasoning in the proof of this formula can in fact be generalized, allowing us to replace B with an arbitrary poset. The proof is almost the same: just replace ideal inclusion in I(P × Q) with functions ordering in Hom(P × Q, B)

61 for an arbitrary poset B. What we end up with, considering definition 1.8, is the content of the following:

Theorem 5.9 For each poset P , the functors

(− × P ): P → P and Hom(P, −)op : P → P are an adjoint pair. 

This investigation of the properties of cartesian product of posets may lead to further results related to Hibi ideals. As an example, one may ask how to express the Hibi ideal of a cartesian product of two posets in terms of the Hibi ideals of the factors. This kind of question would probably go outside the aims of the present work, but we’ll probably make some efforts in this direction in the future, in order to close the circle relating the results in this section with those in the previous one.

62 6 Counting transitive relations

6.1 Transitivity Let us recall the definition of transitivity:

Definition 6.1 A relation R on a set U is called transitive if, for each x, y, z ∈ U, the following implication holds:

xRy ∧ yRz → xRz.

Despite the simplicity of such a definition, transitivity often gives rise to complicated behaviours, and the enumaration of transitive relations is still an open problem (both in the labeled and in the unlabeled case). No simple formulas for the enumeration of transitive relations, qua- siorders and partial orders are known, but some results relating the numbers of such relations can be obtained with relatively little effort. Some of these results can be expressed in the language of combinatorial species of struc- tures, leading most often to functional equations relating their generating functions. The first result we will prove is the relation between quasiorders and partial orders. Let us consider a quasiorder, and define a partition of the set of vertices, where in a single block we put vertices in mutual relation (e.g. xRy and yRx). By transitivity, in a single block we must have a total relation. Note that the species of total relations is obviously equivalent to the species E of sets.

Figure 12: A graphical motivation of the fact that a quasiorder can be seen as a partial order on disjoint nonempty sets.

63 So we can consider a quasiorder as a partial order on the single blocks, where each block is endorsed with a simple set-relation (that is, each block is an E-structure), as illustrated in Figure 13. We immediately get the following

Theorem 6.1 There is a combinatorial equality between species

Q = P (E+) where Q the species of quasiorders, and P the species of partial orders. 

Pn We can use Theorem 3.5 to infer the formula qn = k=1 S(n, k)pk, where n n qn = [x ]Q(x), pn = [x ]P (x), and S(n, k) are the Stirling numbers of the second kind. The next important result about transitive relation is a Theorem by Klaˇska (see [8]), relating labeled transitive relations and labeled partial or- ders. Let U be a set, W a subset of U, π a partition of U − W . We denote with T (U) the set of transitive relations on U, with Ta(U) the set of tran- sitive and antisymmetric relations on U, and with P (U) the set of partial orders on U. We can now introduce the following

Theorem 6.2 There is a bijection   [ [ f : T (U) →  P (W ∪ π) W ⊂U π∈P(U−W ) Proof: Consider a transitive relation R on the set U. We can partition U in two blocks. Let W ⊂ U be the set of vertices w such that ¬(wRw), and let the other block be U − W . By transitivity we can see that no elements a, b in UW can be in mutual relation (because (aRb ∧ bRa) → (aRa ∧ bRb) and so a and b would be in U − W ). In other words we know that the restriction of R to W is antisymmetric. We then partition U −W using the equivalence relation ∼ defined as a ∼ b iff aRb ∧ bRa. Let (U − W )/ ∼ be the set of equivalence classes. The original transitive relation on U induces a unique transitive and antisymmetric relation R0 on W ∪ (U − W )/ ∼. We can then make the relation R0 reflexive by adding loops to the vertices in W . We end up with a partial order on the set W ∪ (U − W )/ ∼. To see why this correspondence is a bijection, proceed as follows: given a partial order ≤ on W ∪ π, delete all loops on the vertices in W , then substitute to each block α in π a set of |α| vertices, and for each a ∈ α ∈ π and b ∈ β ∈ π, define aRb iff α ≤ β. It is not hard to see that the result is a transitive relation and the two processes are mutually inverse. 

From this result a counting formula is also derived in [8]:

64 Theorem 6.3 Let tn be the number of labeled transitive relation on n ele- ments, and pn the number of labeled partial orders on n elements. Then, for each n the following formula holds:

n k ! X X n t = S(n − s, k − s) p n s k k=1 s=0

Proof: We have that tn = |T ([n])| and so  

[ [ tn =  P (W ∪ π)

W ⊂U π∈P(U−W ) n−k ! X X = S(n − k, m)pk+m W ⊂U m=0 n n−k ! X n X = S(n − k, m)p k k+m k=0 m=0 n k ! X X n = S(n − s, k − s) p s k k=1 s=0 and the proof is completed. 

We now want to translate this result into a combinatorial equation be- tween species. This is not too hard if we pay attention to the bijection defined in Theorem 6.2. We said that a transitive relation on U can be seen as a partial order on W ∪ π, where W is a subset of U and π is a partition of the complement U − W . In other words, this partial order is a relation on a set of elements that can be (i) single elements in W , (ii) non-empty classes in the partition π. In order to make the bijection work properly, we must be able to distinguish between single elements in W and singletons in the partition π. We can consider the elements of type (i) as X-structures (where X is the species of sets with one element), and elements of type (ii) as E+-structures (where E+ is the species of nonempty sets). Figure 14 illustrates this construction. Therefore we can see that Klaska’s idea translates into the following

Theorem 6.4 There is a combinatorial equality between species

T = P (X + E+) where T is the species of transitive relations, and P the species of partial orders. 

65 Figure 13: On the left a transitive relation is showed. Elements with a loop are depicted in dark (loops have been omitted for clarity). On the right we see that equivalence classes on the subset of element with a loop, and singletons containing the elements whitout a loop, are in a transitive and antisymmetric relation. Reflexivity can be then achieved by adding the necessary loops.

We may now consider the exponential generating series (X + E+)(x) = 2x + x2/2 + x3/6 + x4/24 + ..., and, assuming that we know the generating function P (x) = 1 + x + 3x2/2 + 19x3/6 + 219 ∗ x4/24 + ... we can compute the composition, yelding 2 3 4 P (X + E+)(x) = 1 + 2x + 13x /2 + 171x /6 + 3994x /24 + ... which is in fact T (x). Theorem 6.4 is a true combinatorial equality, so we could be able to get more information from it, as a counting formula relating the number of isomorphism types of transitive relations and partial orders. We recall that formula (3.4) allows us to compute the type generating series of the composition of two species. In our case we may write (writing W in place of X + E+ for the sake of clarity)

2 3 (P^◦ W )(x) = ZP (Wf(x), Wf(x ), Wf(x ), ...), so, assuming we know the cycle index series ZP of partial orders, we may immediately get the type generating series Te(x) for transitive relations. Ex- plicit calculations of an initial segment of ZP can be made by hand, yelding 2 3 ZP (x1, x2, x3, ...) = 1 + x1 + (3x1 + x2)/2 + (19x1 + 9x1x2 + 2x3)/6 + ...

66 k k 2k 3k and substituting Wf(x ) = 2x + x + x + ... in place of xk in the previous equation we get Te(x) = 1 + 2x + 8x2 + 39x3 + ... which is the type generating function of the species of transitive relations. The coefficients we obtained this way are consistent with the values known from the litterature (see [2], [10]).

6.2 Indecomposable partial orders When cataloguing combinatorial structures belonging to some family, it is often interesting to define a subfamily of indecomposable structures, and to see how such special structures are related (in terms of generating functions) to the entire family. When dealing with partial orders, we can introduce several notions of indecomposability, leading to different equations between species.

Definition 6.2 A partially ordered set (U, ≤) is connected if so is its Hasse diagram seen as an undirected graph.

Obviously, an arbitrary poset is a disjoint union of nonempty connected poset, and by means of the considerations made in subsection 3.3, we can immediately state the following Theorem 6.5 We have a combinatorial equality between species

c E(P+ ) = P,

c where (P+) is the species of nonempty connected partial orders. 

We can thus write c E(P+(x)) = P (x), which is the equivalent statement in terms of exponential generating series. P c (x) By remembering that E(x) = ex, we have that P (x) = e + and so

c P+ = log(P (x)).

Definition 6.3 A partially ordered set (U, ≤) is vertically indecompos- able if for no W ⊂ U we have that W × (U − W ) ⊆≤.

So a vertically indecomposable poset is one where we can not find a subset W such that for each w ∈ W and for each u ∈ U − W the condition w ≤ u holds. We may notice that an arbitrary poset can be obtained by linearly or- dering two or more nonempty vertically indecomposable posets. We should only verify that the decomposition in indecomposable sub-orders is unique.

67 This is easily achieved: By supposing two different decompositions we may write P = P1 < P2 < ... < Pn = S1 < S2 < ... < Sm where the Pi and the Si are disjoint vertically indecomposable posets and A < B means ∀a ∈ A ∀b ∈ B(a ≤ B). Let i be the smallest indices such that Pi 6= Si. But then Pi ∩ Si is a proper indecomposable subset of Pi (and of Si), contradicting the assumed minimality of the decompositions.

Figure 14: An arbitrary poset can be seen as a linear ordering of verti- cally indecomposable posets. Here a poset is depicted, and its vertically indecomposable components are indicated in the right.

Linear orders constitute a species whose exponential generating series and type generating series coincide, and are given by 1 L(x) = Le(x) = 1 + x + x2 + x3 + x4 + ... = 1 − x We can now state the following result:

Theorem 6.6 We have a combinatorial equality

v P = L(P+),

v where P+ is the species of nonempty vertically indecomposable posets. 

68 By considering the exponential generating series equivalent of this equa- tion, v P (x) = L(P+(x)), we can compute the number of labeled posets provided we know the number of labeled vertically irreducible posets. By remembering Lemma 1.1, we can also write v (−1) P+(x) = P (L (x)), where L(−1)(x) is the reverse (the inverse with respect to composition) of the series L(x). This allows us to compute the number of vertically irreducible posets in terms of the number of arbitrary labeled posets. In this case, the unlabeled enumeration is not too harder than the labeled one. By theorem 6.6 and remembering theorem 3.4, we can write

v v 2 Pe(x) = ZL((P^− 1)(x), ((P^− 1)(x)) , ...) 2 3 v = ZL(x, x , x , ...) ◦ (Pf(x) − 1) which can be inverted by lemma 1.2 obtaining

v 2 3 (−1) Pf(x) − 1 = (ZL(x, x , x , ...) − 1) ◦ (Pe(x) − 1)(x).

Now, the cycle index series ZL(x1, x2, x3, ...) of linear orders is easily com- puted and is equal to 1 ZL(x1, x2, x3, ...) = 1 − x1 from which we can finally obtain

x Pe(x) − 1 Pfv(x) = ◦ (Pe(x) − 1) = 1 + x Pe(x) which is a functional equation relating the ordinary (isomorphism type) generating series of partial orders and vertically partial orders. This allow us to compute the coefficients of Pev(x), that is, the number of vertically indecomposable partial orders up to isomorphism. One problem is the determination of vertically irreducible and connected posets. We can see that the normal procedure to find the connected analogue of a species (i.e. composition to the left with the species E+ in the labeled case, and Euler transform in the unlabeled case) in this case fails. This happens because the property of being vertically irreducible is not preserved by disjoint unions. This means that an arbitrary vertically irre- ducible poset is not the union of vertically irreducible components. Let us try to bypass this problem by introducing some notation: Let P be (the species of) posets, P c be connected posets, P v be vertically irreducible posets, and P vc be connected vertically irreducible posets. Let

69 P d = P −P c indicate disconnected posets (this is in fact an equality between virtual species, see [1]). An easy (but crucial) fact to prove is that all disconnected posets are vertically irreducible. In other words, we have the equality P d = P vd. Now we can simply remember that P v = P vd + P vc and substitute: P v = P d + P vc. We may finally state: P vc = P v + P c − P. This easily allow us compute the sequences counting labeled and unlabeled connected vertically irreducible posets. See the appendix for explicit com- putations. We now turn to yet another possible notion of indecomposability. Definition 6.4 A partially ordered set (U, ≤) is reduced if for all x, y ∈ U the conditions •{z : z ≤ x} ∪ {y} = {z : z ≤ y}, •{z : z ≥ x} = {z : z ≥ y} ∪ {x}, imply x = y. More informally, we may say that a poset is reduced if it can’t be ob- tained by a smaller one by substituting some vertices with a linear order of length greater than 1. Given an arbitrary partial order and two elements x, y contradicting the previous definition, we immediately get by transitivity and antisymmetry that they must be in relation (without loss of generality we may suppose x ≤ y). More generally, given such a vertex x, the set of vertices y 6= x satisfying the two conditions in when compared with x must be linearly ordered. This yelds Theorem 6.7 The following combinatorial equality holds: r P = P (L+), r where L+ is the species of nonempty linear orders and P is the species of reduced partial orders. 

As in the previous case, we can consider the exponential generating series of the species appearing in the previous equation and write r P (x) = P (L+(x)), which can be inverted again by means of Lemma 1.1 obtaining r (−1) P (x) = P (L+(x) ).

70 Figure 15: An arbitrary poset can be seen as a reduced order on nonempty linear orders.

6.3 Graded orders A graded order is a poset (P, ≤) in which vertices have got a precise notion of height (or rank). We may, for example, define a function h : P → N, requiring that each non-minimal element has image bigger than all its predecessors. This is easily achieved by setting

h(p) = max{h(q): q < p} + 1.

Now let p l q indicate that q is an immediate predecessor of p. Are we always able to define h so that p l q implies h(p) = h(q) + 1? The answer is no, as illustrated in Figure 17 (a): This motivates the following

Definition 6.5 Let (P, ≤) be a poset. We say that P is graded iff a func- tion h : P → N exists such that p l q implies h(p) = h(q) + 1. A slightly stronger notion is the following:

Definition 6.6 Let (P, ≤) be a poset. We say that P is strongly graded iff a function h : P → N exists such that p l q implies h(p) = h(q) + 1 and, for each minimal element m, h(m) = 1.

A stronger notion again is the following:

Definition 6.7 Let (P, ≤) be a poset. We say that P is tiered iff all the maximal chains in P have the same length.

71 Figure 16: (a) A poset which is not graded; (b) A graded poset which is not strongly graded; (c) A strongly graded poset which is not tiered; (d) a tiered poset.

In the following part we essentially follow the methods described in [7]. The height of a strongly graded poset is the value h(x) where x is an arbitrary maximal element.

Theorem 6.8 The number of strongly graded posets of height h built over n labeled vertices is given by

h ! X n! Y psg(n) = (2ui−1 − 1)ui (6.1) u1!u2!...uh! u1+...+uh=n i=2 the sum ranging over all compositions (ordered partitions) of n into h posi- tive summands.

Proof: Let us construct a strongly graded poset by first partitioning the set of vertices into h blocks. In the i-th block we put the vertices of rank i. The number of composition of n into h positive parts is equal to the number of possible choices of cardinality for the different blocks. For each such choise we also need to decide what vertices go in each block, and the number of possible choices (having fixed the ui of the blocks) is given by the multinomial coefficient  n  . u1 u2 ... uh Now, the strongly graded condition implies that each vertex in the i-th block must be an immediate successor of any nonvoid subset of vertices in u the (i − 1)-th block. There are 2 i−1 − 1 nonvoid subsets of a set with ui−1 elements. Varying i, we have that the total number of choices (having fixed

72 the partitioning of the vertices) is given by

h Y (2ui−1 − 1)ui i=2 the thesis follows. 

The same argument can be applied in the unlabeled case. The difference is that no multinomial arises, and we must consider that there are only ui unlabeled nonempty subsets of a set with ui elements. We obtain the following result:

Theorem 6.9 The number of strongly graded posets of height h built over n unlabeled vertices is given by

h ! sg X Y ui pe (n) = ui−1 u1+...+uh=n i=2 the sum ranging over all compositions (ordered partitions) of n into h posi- tive summands. 

We now want to count the number of (not necessarily strongly) graded posets by modifying the previous method. First of all consider this variation of the right side of equation 6.1:

h ! X n! Y c(n, h) = 2ui−1ui (6.2) u1!u2!...uh! u1+...+uh=n i=2 but now let the sum range over all composition of n into nonnegative in- tegers, i.e. zero summands are allowed. This means that we are counting posets where minimal elements may appear in ranks different that the first one, and that ranksmay be void. Also, we do not require that the set of vertices in the (i − 1)-th row to which an arbitrary vertex in the i-th row is connected should be necessarily nonvoid. So the term (2ui−1 − 1)ui is replaced with (2ui−1 )ui = 2ui−1ui . We want to prove that the number of graded posets on n vertices and of height at most h can be expressed in terms of the numbers c(n, h) previously defined. Consider a graded poset over n vertices and of height at most h. Let us say that a vertex a is connected to a vertex b if a = b or if a directed path a = v0 ≥ v1 ≥ ... ≥ vm = b exists. Consider a structure X counted by c(n, h). Formally speaking, X is a Sh poset together with a partition X = i=1 Xi such that elements in the i-th

73 row may only be connected to elements in the (i − 1)-th row (i = 2, ..., h), and where rows can be empty. Now, partition the vertices of X in subsets Yh,Yh−1, ..., Y1 as follows: Yh contains the vertices connected to the elements in the first row of X. We can see that the restriction of the order of X to Yh 0 makes it into a graded poset. Now let X = X − Yh and let Yh−1 be the set of vertices connected to vertices in the second row of X0. Continue this way until all vertices of X are put into some of the Yi. We obtained h graded posets Yi, (i = 1, ..., h) such that Yi has height at most i. It is easy to see that such a structure X can be uniquely associated to an h- of graded posets in this way. On the other hand, given the tuple of graded posets Yi, (i = 1, ..., h) such that Yi has height at most i we can recover X. This finally allows us to write X c(n, h) = b(u1, 1)b(u2, 2)...b(uh, h). (6.3) u1+...+uh=n Now, let

X b(n, h) X c(n, h) B (x) = xn,C (x) = xn, h n! h n! n≥0 n≥0 be the exponential generating series of the numbers b(n, h) and c(n, h) for fixed h. So equation (6.3) can be written in terms of generating functions as Ch(x) = B1(x)B2(x)...Bh(x), (h ≥ 1)

Now it is clear that B1(x) = C1(x) and so we can write for each h > 1

Bh(x) = Ch(x)/Ch−1(x).

This allows us to compute recursively the generating functions Bh(x) and, by coefficient extraction, the number of graded poset of height at most h, for each positive value of h. It is clear that if a graded poset has n elements, it cannot have height greater than n, so the numbers b(n, n) count the number of all graded posets on n vertices. See the appendix for some integer sequences related to graded posets

6.4 Finite topologies It is well known that bijections exist between some families of transitive relations and finite topologies. We recall the following

Definition 6.8 A topology on a set U is a family τ of subsets of U such that:

• U ∈ τ and ∅ ∈ τ.

74 • the intersection of a finite number of elements of τ is in τ. • the union of an arbitrary number of elements of τ is in τ. The elements of τ are called open sets. The complement of an open set is said to be closed. A set is said to be clopen if it is both open anc closed. The discrete topology is obtained by letting τ be the power set of U (that is, by letting each point be a clopen) As we are considering finite sets, we can drop the finiteness restriction on the second point and say that a topology on a finite set U is a family τ of subsets of U closed under arbitrary intersection and union, and such that the empty set and U itself belong to τ. We will write (U, τ) to intend the set U endorsed with the topology τ. Also, recall that a topological space is T0 iff for each (unordered) couple of points, there is an open set containing one of the points but not the other. Stronger separation axioms are trivial if the ground set is finite. To see why, consider a finite T1 space (i.e. a space where for each couple of points (x, y) there is an open set containing x but not y and viceversa). This space must necessarily have the discrete topology. In fact, a space is T1 iff each point is a closed set, and so the complement of a point is the finite union of closed sets and each point must thus be open. So every point is clopen.

Definition 6.9 A basis B for a topology τ on U is a family of open sets (called basic) such that each open set is he union of elements in the basis.

We need the following

Theorem 6.10 B is a basis for (U, τ) iff, for each u ∈ A ∈ τ, there is a B ∈ B such that u ∈ B ⊆ A. 

For each u ∈ U let Au be the intersection of all the open sets containing 0 u. Let us define a relation ≤ on U by letting u ≤ u if Au ⊆ Au0 . We will write u < u0 if the inclusion is proper. It is easy to prove that the family of open sets Au(u ∈ U) is the unique minimal basis for the topology τ. In fact, if C is another basis, fixed a point u there is (due to the previous result) a C ∈ C such that u ∈ C ∈ Au. So C = Au and then Au ∈ C for each u. Theorem 6.11 Finite topologies are in one-to-one correspondence with qua- siorders.

Proof: The relation ≤ introduced before is clearly reflexive and transitive. We will see how to recover the topological space (U, τ) from the relational set (U, ≤). Consider u ∈ U and define Au = {x ∈ U : x ≤ u}. It is obvious to see that the sets Au are a basis for a topology on U. In fact, they exactly correspond to the open sets defined before. 

We can give yet another correspondence by means of the following

75 Theorem 6.12 Finite T0 topologies are in one-to-one correspondence with partial orders.

Proof: Let ≤ be the relation defined before between points of a topological space. This is not antisymmetric iff there are two points x and y in U such that Ax = Ay, that is, iff each open set containing either point also contains the other, iff the topology is not T0. The thesis follows by taking into account the previous Theorem. 

As a corollary, we can now apply this correspondence to Theorem 6.1 and Theorem 3.5 to get a formula relating the number of finite topologies with the number of finite T0 topologies:

n X tn = S(n, k)zk k=1 where tn and zn are the number of topologies and T0 topologies on a set with n elements, respectively.

76 7 Conclusions

In this last section we would like to review the contents of the work by giving particular emphasis on some crucial questions that have been (and, more importantly) have not been answered. We’d also want to suggest some possible further developings that might be useful in giving new insights on the treated subjects. The following diagram shows the most important combinatorial species treated in this work. A solid arrow between two species A and B means that we have the knowledge of a combinatorial equation relating A and B (where all the other species involved in the equation are known). A dotted arrow means that we have a canonical combinatorial construction allowing us to construct a species in terms of another one, but not in a way that seems easily convertible into an equation between the related species.

T op o / T T op O 0 O

  P o / Q O Eb O EE EE EE EE EE EE EE  EE"  Lat T

In the previous diagram, T op and T0T op indicate the species of finite topologies and of finite T0 topologies. T,Q and P are the species of tran- sitive, quasiorders, and partial orders. Lat is the species of distributive lattices.

7.1 Experimental investigations

Equation (6.1), Q = P (E+), and (6.4), T = P (E+ + X), can be combined in order to find an equation relating T and Q. By means of lemma 1.1:

(−1) P = Q ◦ (E+) and by substitution:

(−1) T = Q ◦ (E+) ◦ (E+ + X).

(We recall that the notation W (−1) stands for the compositional inverse). In those equation composition is in fact the most important operation. As the computation of the composition of ordinary (unlabeled) generating functions

77 for species is quite hard (we have to dispose of the cycle index series), we shall only analyze the labeled use of those equations. In the appendix we listed some PARI/gp functions developed to study exponential and ordinary series related to species. We can introduce a trans- formation taking the coefficients counting the labeled structures of type A and returning the coefficients of the exponential series for

(−1) B = A ◦ (E+) ◦ (E+ + X).

In other words, this transformation W consists of the composition with the function f(x) = (expx − 1)(−1) ◦ (exp(x) − 1 + x) = log(ex + x), that is, the exponential generating function of the sequence

[0, 2, −3, 11, −58, 409, −3606, 38149, −470856, 6641793] Which appens to be absent from the OEIS. We can then write T (x) = (Q ◦ W )(x), where W (x) is the egf of this sequence. Experimenting with this function we see that it behaves as a shift oper- ator for the Bell numbers (treated as coefficients of eex−1):

W([1, 1, 2, 5, 15, 52, 203, ...]) = [1, 2, 5, 15, 52, 203, 877, ...]

This suggests that a deeper investigation of the function f(x) and of its coefficients may be fruitful.

The kind of experimentation suggested in the previous subsection can lead to some interesting results. Recall that the shift operator for exponen- tial series is differentiation (see proposition 1.5), and that the egf for the Bell numbers is given by B(x) = eex−1. We then see that W (x) satisfies   x d x ee −1 = ee −1 ◦ W (x), dx that is, x W (x) ee −1 = ee −1+W (x). We can solve for W (x) obtaining

W (x) = log(ex + x).

We call W (x) the compositional shift function for the funtion B(x). The computation of the compositional shift function for an arbitrary function F (x) can be achieved easily, provided that the constant and linear terms of the series expansion of F (x) are equal. We can define a PARI/gp function using the routines defined in the appendix. The command

78 cs(F) = invcom(ece(deriv(egf(F,x))11), F) returns the first 11 coefficients (from 0 to 10) of the egf of the compositional shift function of the function whose coefficients are stored in the vector F . See the appendix A3 for informations about the code.

Similar studies can be done by remembering equation 6.4:

T = P ◦ (E+ + X) and reversing it by writing

(−1) P = T ◦ (E+ + X) .

(−1) If we investigate the exponential generating function for (E+ + X) we find the coefficients  1 1 1 1 13 47 73 2447 16811  0, , − , , , − , , , − , , ... 2 8 32 128 512 2048 8192 32768 131072 whose numerators seem to be sequence A217538 of the OEIS, which is a se- quence related with the Lambert W function, cfr. OEIS sequence A001662. Sequences A001662 and A001662 appear to be identical with the exception of the 17-th term. Investigations in this direction can be found in R. M. Corless, D. J. Jeffrey and D. E. Knuth, A sequence of series for the Lambert W Function.

7.2 Posets and graded posets We ignore if the notion of strongly graded order that we gave in section 6.3 has already been introduced in the litterature (usually the term “strongly graded poset” is used to mean tiered poset). This notion has in fact some interesting properties. If we try to count labeled and unlabeled graded orders using formulas provided by Theorems 6.8 and 6.9, we get the sequences

[1, 1, 3, 19, 195, 3031, 67263, 2086099, 89224635, ...] and [1, 1, 2, 5, 15, 52, 203, 877, 4140, 21147, 115975, ...], which appear to be sequences A001832 and A000110 of the OEIS, re- spectively. Sequence A000110 are the Bell numbers, the other one counts connected bipartite graphs. A combinatorial proof of those equalities be- tween integer sequences seems not immediate to derive. The counting formula that allowed us to compute all graded posets are due to Klarner ([7]) who found the first six terms in the Sixties. We ignore if any subsequent work on this counting problem has ever been done, be- cause no more terms other than these six terms have been computed until

79 now. We simply used more powerful computers to find the first 15 terms of the sequence counting graded posets, in circa 2 hours of computation time. Please see appendix A3 for some PARI/gp codes. Another thing that should be done about graded posets is an investiga- tion about their relation with arbitrary posets. Is it possible to interpret the species of graded (resp. strongly graded, resp. tiered) posets to the species of arbitrary posets? In other words, we want the knowledge of a species H such that the equation P = H(GP+) holds, where GP+ indicates the species of nonempty graded orders (say). Unfortunately, no canonical way to decompose an arbitrary poset into graded parts seems to be easily provided. The exponential generating function for such a species H must anyway satisfy the law

P (x) = H(GP+(x)) and, solving for H (lemma 1.1), we have

(−1) H(x) = P ((GP+) ) and so the coefficients [xn/n!]H(x) can be easily computed:

[1, 1, 0, 0, 0, 240, 12600, 985320, 98159040, 13338440640, ...]

This sequence is not known, and without further investigations we naturally cannot have any idea about what those numbers actually count. We must note that finding a relation between P and GP (i.e. finding a species H as above) would solve the problem of the enumeration of all the labeled “hard” structures treated in this work (posets, transitive relations, etc), by making it at least as easy as the enumeration of graded orders. It is not surprising, then, that such a relation is not easy to find.

80 From a print in Sir Isaac Newton’s copy of Trait´ede Combinaisons, by Redmond de Monmort, Paris, 1713.

81 Appendix

A1 Common species and operations The following table is a survey of the most well-known combinatorial species. For each species F , the generating functions F (x) and Fe(x) are provided.

Species Generating series Type generating series Zero 0(x) = 0 e0(x) = 0

Empty set 1(x) = 1 e1(x) = 1

Singletons X(x) = x Xe(x) = x

x 1 Sets E(x) = e Ee(x) = 1−x 1 1 Linear orders L(x) = 1−x Le(x) = 1−x 1 Q∞ 1 Permutations P (x) = 1−x Pe(x) = k=1 1−xk x Cyclic permutations C(x) = − log(1 − x) Ce(x) = 1−x ex−1 Q∞ 1 Set partitions B(x) = e Be(x) = k=1 1−xk

The followig table lists the main properties of the operation we intro- duced in Section 3. The equality sign = stands for combinatorial equality (Definition 1.13).

Property Notes Involving F + (G + H) = (F + G) + H Associativity +

F + G = G + F Commutativity +

F + 0 = 0 + F = F Neutral element +

F · (G · H) = (F · G) · H Associativity ·

F · G = G · F Commutativity ·

82 Property Notes Involving F · 1 = 1 · F = F Neutral element ·

F · 0 = 0 · F = 0 Absorbing element ·

F · (G + H) = F · G + F · H = 0 Distributivity +, ·

F ◦ (G ◦ H) = (F ◦ G) ◦ H Associativity ◦

F ◦ X = X ◦ F = F Neutral element ◦

(F + G) ◦ H = F ◦ H + G ◦ H Distributivity +, ◦

(F · G) ◦ H = F ◦ H · G ◦ H Distributivity ·, ◦

(F + G)0 = F 0 + G0 Additivity +,0

(F · G)0 = F 0 · G + F · G0 Leibniz rule +, ·,0

(F ◦ G)0 = (F 0 ◦ G) · G0 Chain rule ·, ◦,0

(F + G)• = F • + G• Additivity +, •

(F · G)• = F • · G + F · G• Leibniz rule +, ·, •

(F ◦ G)• = (F 0 ◦ G) · G• Chain rule ·, ◦,0

F × (G × H) = (F × G) × H Associativity ×

F × G = G × F Commutativity ×

F × 1 = 1 × F = F Neutral element ×

F × 0 = 0 × F = 0 Absorbing element ×

F × (G + H) = F × G + F × H = 0 Distributivity +, ×

(F × G)• = F • × G = F × G• Discharge •, ×

F (GH) = (F G)H Associativity  • • • F E = E F = F Neutral element , 

(F × G)H = F H × GH Distributivity ×, 

83 A2 PARI/gp Routines In this section we list the main routines we did using PARI/gp. PARI/gp is a free Computer Algebra System originally created by Herni Cohen and maintained at http://pari.math.u-bordeaux.fr. elimina(v,k) This general purpose function eliminates the k-th element of a vector v.

elimina(v,k)= { return( vecextract(v,(2^length(v)-1) - 2^(k-1) ) ); }

fill(v,n) Another general purpose function that adds zeroes to a vector until it reaches length n. fill(v,n)= { if(length(v)>=n,return(v)); return(concat(v,vector(n-length(v),i,0))); }

84 ogf(w,x) This function returns the ordinary generating function of the vector w with respect to the indeterminate x. ogf(w,x)= { return(sum(i=1,length(w),w[i]*x^(i-1))); } egf(w,x) This function returns the exponential generating function of the vector w with respect to the indeterminate x. egf(w,x)= { return(sum(i=1,length(w),(1/((i-1)!))*w[i]*x^(i-1))); } oce(s,n) This function returns a vector containing the first n coefficients of the ordi- nary series s. oce(s,n)= { return(vector(n,i,polcoeff(s,i-1))); } ece(s,n) This function returns a vector containing the first n coefficients of the ex- ponential series s. ece(s,n)= { return(vector(n,i,(i-1)!*polcoeff(s,i-1))); }

85 invcom(A,B) Returns the coefficients of W (x) such that the egfs A(x) of A and B(x) of B satisfy A(x) = B(W (x)). invcom(A,B)= { local(ah); if(A[1]!=B[1],print("cannot compute");return(0)); uno=vector(length(B),i,i==1); ah(x) = serreverse(Ser(egf(B-B[1]*uno,x))); uno=vector(length(A),i,i==1); return(ece(subst(ah(x),x,egf(A-A[1]*uno,x)),length(A))); } et(a) This function returns the Euler tranform of the vector of integers a (see subsection 2.5).

et(a)= { local(b,c); a=elimina(a,1); c=fill([1],length(a)); b=fill([1],length(a)); for(n=1,length(a), c[n]=sumdiv(n,d,d*a[d]) ); for(n=1,length(a), b[n]=(1/n)*(c[n]+sum(k=1,n-1,c[k]*b[n-k])) ); b=concat([1],b); return(b); }

86 iet(a) This function returns the inverse Euler tranform of the vector of integers a (see subsection 2.5). iet(b)= { local(a,c); b=elimina(b,1); c=fill([1],length(b)); a=fill([1],length(b)); for(n=1,length(b), c[n]=n*b[n]-sum(k=1,n-1,c[k]*b[n-k]) ); for(n=1,length(b), a[n]=(1/n)*(sumdiv(n,d,c[d]*moebius(n/d))) ); a=concat([0],a); return(a); } nextcom(n,k,r) This procedure computes the next combination of n into k non negative summands, in lexicographical order. The argument r is the previous com- bination. Let r = 0 to generate the first combination (i.e. [n, 0, 0, ..., 0]).

nextcom(n,k,r)= { local(i,j,rr); if(r==vector(k,i,(i==k)*n),print("END."); return(0)); if(r==0,return(vector(k,i,(i==1)*n))); rr=r; if(r[1]>0,rr[1]=r[1]-1;rr[2]=r[2]+1); if(r[1]==0, chi=r[1]; i=1; while(chi==0,i=i+1;chi=r[i]); rr[1]=r[i]-1; rr[i+1]=r[i+1]+1; rr[i]=0; ); return(rr); }

87 C(n,h) This function computes the numbers c(n, k) described in subsection 6.3.

C(n,h)= { local(r,ret,i,j,k,stop); stop=0; ret=0; r=vector(h,i,(i==1)*n); while(stop==0, mn=(n!)/(prod(j=1,h,(r[j])!)); ret=ret+mn*prod(k=2,h,(2^r[k-1])^r[k]); if(r!=vector(h,i,(i==h)*n),r=nextcom(n,h,r),stop=1); ); return(ret); }

To compute the number of graded orders on n vertices the following instruc- tions can be used. First of all, fix the number maxx of terms to compute. The construction of the matrix MC described below is the most compu- tationally expensive step. The other instructions compute the generating functions defined in 6.3 and the coefficients b(n, k) counting the number of graded posets on n elements and of height at most k.

MC=matrix(maxx+1,maxx+1,i,j,C(i-1,j-1));

CC(h,x)=sum(n=0,maxx,(x^n)*MC[n+1,h+1]/(n!));

BB(h,x)=if(h==1,CC(h,x),CC(h,x)/CC(h-1,x)); b(n,h)=polcoeff(Ser(BB(h,x)),n)*n!;

88 A3 Tables of integer sequences The following pages contain tables listing several integer sequences treated in this work. Such sequences counts the number of labeled and unlabeled structures of combinatorial interests. Values for n = 0, ..., 15 are listed. Ref- erences to the OEIS, the Online Encyclopedia of Integer Sequences, founded and mantained by Neil Sloane at www.oeis.org, are included for each se- quence, except for those not present in the site, which hopefully will be added in the near future.

When dealing with structures that admit a notion of connectedness, most often empty structures (i.e. built over the empty set) are considered to be trivially connected, unless the definition of such structures explicitly implies the contrary.

Labeled transitive relations

all connected OEIS: A006905 OEIS: absent n t(n) tc(n) 0 1 1 1 2 2 2 13 9 3 171 109 4 3994 2647 5 154303 110481 6 9415189 7291543 7 878222530 726434549 8 122207703623 106312974249 9 24890747921947 22465350835849 10 7307450299510288 6771847676632679 11 3053521546333103057 2883916106465622053 12 1797003559223770324237 1720792953946798909927 13 1476062693867019126073312 1427968172285571102335605 14 1679239558149570229156802997 1637002867699829205840095585 15 2628225174143857306623695576671 2577011453377960519672777065693

89 Labeled quasiorders (also labeled topologies)

all connected OEIS: A000798 OEIS: A006058 n q(n) qc(n) 0 1 1 1 1 1 2 4 3 3 29 16 4 355 145 5 6942 2111 6 209527 47624 7 9535241 1626003 8 642779354 82564031 9 63260289423 6146805142 10 8977053873043 662718022355 11 1816846038736192 102336213875523 12 519355571065774021 22408881211102698 13 207881393656668953041 6895949927379360277 14 115617051977054267807460 2958271314760111914191 15 88736269118586244492485121 1756322140048351303019576

Labeled partial orders (also labeled T0 topologies)

all connected OEIS: A001035 OEIS: A001927 n p(n) pc(n) 0 1 1 1 1 1 2 3 2 3 19 12 4 219 146 5 4231 3060 6 130023 101642 7 6129859 5106612 8 431723379 377403266 9 44511042511 40299722580 10 6611065248783 6138497261882 11 1396281677105899 1320327172853172 12 414864951055853499 397571105288091506 13 171850728381587059351 166330355795371103700 14 98484324257128207032183 96036130723851671469482 15 77567171020440688353049939 76070282980382554147600692

90 Vertically indecomposable labeled partial orders

all connected OEIS: A046908 OEIS: A046906 n pv(n) pvc(n) 0 1 1 1 1 1 2 1 0 3 7 0 4 97 24 5 2251 1080 6 80821 52440 7 4305127 3281880 8 332273257 277953144 9 36630174931 32418855000 10 5711638291981 5239070305080 11 1249898984911567 1173944480658840 12 381230073532620577 363936227764858584 13 161042140788424003291 155521768202208047640 14 93667063572594041040421 91218870039317505477720 15 74610767840852891620692727 73113879800794757415243480

Labeled reduced partial orders

all connected OEIS: A066302 OEIS: A066303 n pr(n) prc(n) 0 1 1 1 1 1 2 1 0 3 7 6 4 75 50 5 1531 1220 6 50673 42122 7 2613703 2278248 8 202180723 182111666 9 22853355895 21094774212 10 3701983130913 3479970392642 11 846741042881779 807001730170592 12 270316009546766571 260359119927269882 13 119343586350194910211 115887302333840512956 14 72325998629777739416209 70677462143507496419690 15 59798727157327673157936319 58725460618979611312258632

91 Labeled graded posets

all connected OEIS: A001833 OEIS: A228551 n pg(n) pgc(n) 0 1 1 1 1 1 2 3 2 3 19 12 4 219 146 5 3991 2820 6 106623 79682 7 3964339 3109932 8 199515459 163268786 9 13399883551 11373086100 10 1197639892983 1049057429762 11 143076298623259 128748967088412 12 23053861370437659 21220651011079346 13 5062745845287855271 4747770003765805380 14 1530139311543346178223 1456585782002699624642 15 6414414661324600868901791 6390825031791150383749864

Table: labeled graded posets with n vertices of height h. n \ h 1 2 3 4 5 6 7 8 1 1 0 0 0 0 0 0 0 2 1 2 0 0 0 0 0 0 3 1 12 6 0 0 0 0 0 4 1 86 108 24 0 0 0 0 5 1 840 2190 840 120 0 0 0 6 1 11642 55620 31800 6840 720 0 0 7 1 227892 1858206 1428000 384720 60480 5040 0 8 1 6285806 82938828 80529624 24509520 4626720 584640 40320

92 Unlabeled transitive relations

all connected OEIS: A091073 OEIS: absent c n et(n) et (n) 0 1 1 1 2 2 2 8 5 3 39 25 4 242 157 5 1895 1325 6 19051 14358 7 246895 199763 8 4145108 3549001 9 90325655 80673244 10 2555630036 2352747542 11 93810648902 88240542454 12 4461086120602 4261209044877 13 274339212258846 264988507673267 14 21775814889230580 21207485269909946 15 2226876304576948549 2182146922863398203

Unlabeled quasiorders (also unlabeled topologies)

all connected OEIS: A001930 OEIS: A001928 c n qe(n) qe (n) 0 1 1 1 1 1 2 3 2 3 9 6 4 33 21 5 139 94 6 718 512 7 4535 3485 8 35979 29515 9 363083 314474 10 4717687 4255727 11 79501654 73831813 12 1744252509 1653083021 13 49872339897 47941962135 14 1856792610995 1803010446411 15 89847422244493 87882300251730

93 Unlabeled partial orders (also unlabeled T0 topologies)

all connected OEIS: A000112 OEIS: A000608 c n qe(n) qe (n) 0 1 1 1 1 1 2 2 1 3 5 3 4 16 10 5 63 44 6 318 238 7 2045 1650 8 16999 14512 9 183231 163341 10 2567284 2360719 11 46749427 43944974 12 1104891746 1055019099 13 33823827452 32664984238 14 1338193159771 1303143553205 15 68275077901156 66900392672168

Vertically indecomposable unlabeled partial orders

all connected OEIS: A046907 OEIS: A003431 v vc n pe (n) pe (n) 0 1 1 1 1 1 2 1 0 3 2 0 4 7 1 5 31 12 6 184 104 7 1351 956 8 12524 10037 9 146468 126578 10 2177570 1971005 11 41374407 38569954 12 1008220289 958347642 13 31559446774 30400603560 14 1269310589336 1234260982770 15 65562045668340 64187360439352

94 95 References

[1] F. Bergeron, G. Labelle, P. Leroux, Combinatorial species and tree-like structures, (1998).

[2] G. Brinkmann, B.D. McKay, Counting unlabelled topologies and tran- sitive relations, Ghent University and Australian National University, (2007).

[3] R.L. Graham, D.E. Knuth, O. Patashnik, Concrete Mathematics, Addison-Wesley, (1989).

[4] F. Harary, E. Palmer, Graphical enumeration, Academic Press, New York and London, (1973).

[5] J. Herzog, T. Hibi, Monomial ideals, Springer GTM 260, (2011).

[6] A. Joyal, Une th´eoriecombinatoire des s´eriesformelles, Advances in Mathematics, 42, 1-82, (1981).

[7] D.A. Klarner, The number of graded partially ordered sets, Journal of combinatorial theory, 6, 12-19, (1969).

[8] J. Klaˇska, Transitivity and partial orders, Mathematica Bohemica, 122, no. 1, 75-82, (1997).

[9] S. MacLane, Categories for the working mathematician, GTM 5, 2nd ed., Springer, (1997).

[10] G. Pfeiffer, Counting transitive relations, Journal of integer sequences, 7, (2004).

[11] G.C. Rota, Mathematical Snapshots, Killian Faculty achievement award lecture, (1997).

[12] N. Sloane, Online encyclopedia of integer sequences, www.oeis.org.

[13] R. Stanley, Enumerative combinatorics, volumes 1 and 2, Cambridge University Press, (1997, 1999).

[14] H.S. Wilf, Generatingfunctionology, Academic Press, Inc., (1994).

[15] H.S. Wilf, Lectures on integer partitions, online publication.

96

Printed in the Fall of year 2013 in order to Praise our Lord Nyarlatothep, the creeping chaos.