# Combinatorial species

In combinatorial mathematics, the theory of combinatorial species is an abstract, systematic method for analysing discrete structures in terms of generating functions. Examples of discrete structures are (finite) graphs, permutations, trees, and so on; each of these has an associated generating function which counts how many structures there are of a certain size. One goal of species theory is to be able to analyse complicated structures by describing them in terms of transformations and combinations of simpler structures. These operations correspond to equivalent manipulations of generating functions, so producing such functions for complicated structures is much easier than with other methods. The theory was introduced, carefully elaborated and applied by the Canadian group of people around André Joyal.

## Definition of species

Schematic illustration of a combinatorial species structure on five elements by using a Labelle diagram

Any structure — an instance of a particular species — is associated with some set, and there are often many possible structures for the same set. For example, it is possible to construct several different graphs whose node labels are drawn from the same given set. At the same time, any set could be used to build the structures. The difference between one species and another is that they build a different set of structures out of the same base set.

This leads to the formal definition of a combinatorial species. Let ${\displaystyle {\mathcal {B}}}$ be the category of finite sets, with the morphisms of the category being the bijections between these sets. A species is a functor

${\displaystyle F\colon {\mathcal {B}}\to {\mathcal {B}}\ }$

For a set A the set F[A] is called the set of F-structures on A, or the set of structures of species F on A. Further, by the definition of a functor, if φ is a bijection between sets A and B, then F[φ] is a bijection between the sets of F-structures F[A] and F[B], called transport of F-structures along φ.[1]

For example, the "species of permutations" maps each finite set A to the set of all permutations of A, and each bijection from A to another set B naturally induces a bijection from the set of all permutations of A to the set of all permutations of B. Similarly, the "species of partitions" can be defined by assigning to each finite set the set of all its partitions, and the "power set species" assigns to each finite set its power set.

There is a standard way of illustrating an instance of any structure, regardless of its nature. The adjacent diagram shows a structure on a set of five elements: arcs connect the structure (red) to the elements (blue) from which it is built.

The choice of ${\displaystyle {\mathcal {B}}}$ as the category on which species operate is important. Because a bijection can only exist between two sets when they have the same size, the number of elements in F[A] depends only on the size of A. (This follows from the formal definition of a functor.[citation needed]) Restriction to finite sets means that |F[A]| is always finite, so it is possible to do arithmetic with such quantities. In particular, the exponential generating series F(x) of a species F can be defined:

${\displaystyle F(x)=\sum _{n\geq 0}f_{n}{\frac {x^{n}}{n!}}}$

where ${\displaystyle f_{n}}$ is the size of F[A] for any set A having n elements.

Some examples:

• The species of sets (traditionally called E, from the French "ensemble", meaning "set") is the functor which maps A to {A}. Then ${\displaystyle f_{n}=1}$, so ${\displaystyle E(x)=e^{x}}$.
• The species S of permutations, described above, has ${\displaystyle f_{n}=n!}$. ${\displaystyle S(x)=1/(1-x)}$.
• The species T2 of pairs (2-tuples) is the functor taking a set A to A2. Then ${\displaystyle f_{n}=n^{2}}$ and ${\displaystyle T_{2}(x)=x(x+1)e^{x}}$.

## Software

Operations with species are supported by SageMath[2] and, using a special package, also by Haskell.[3][4]

## Notes

1. ^ Federico G. Lastaria, An invitation to Combinatorial Species. (2002)
2. ^ Sage documentation on combinatorial species.