Notes on combinatorial species (Méndez 2015)
In December I got the book Set Operads in Combinatorics and Computer Science (Méndez 2015) from the library. I didn’t read the whole thing, but I’ll share some notes I took on the parts that I read.
These will probably be pretty messy, and risk not being super useful, unless you happen to be unfamiliar with exactly the topics I felt warranted more explanation, and familiar with exactly the topics I felt could be taken for granted.
Chapter 1
1.1
I didn’t find their example of labeled parenthesized words as a set operad particularly compelling. For one thing, it was difficult to understand that they were considering but .
I also wonder whether, coming from a CS/PL background, I would find this structure to be a poor motivator for operads for the same reason that the list monad isn’t a good prototypical example for why we care about monads in Haskell. But I have no idea what e.g. an “IO operad” would look like; the book isn’t focused on this.
Chapter 2
This chapter introduces combinatorial species.
2.1
Their intuition: “a combinatorial species is a class of finite labeled structures that is closed by relabeling.”
More precisely, a combinatorial species is a map from finite sets to finite sets (where we denote the image of a set using square brackets ), along with a map from bijections to functions which preserves the identity function and composition.
Using the language of category theory, a species is a functor
where is the category of finite sets and functions and is the category of finite sets and only isomorphisms (i.e. bijections).
But actually — the image of an isomorphism under a functor is always another isomorphism () so we can instead write:
Likewise, a morphism of species is a morphism in the functor category (i.e. a natural transformation between two functors). Best not to get too caught up in the category theory though; the operations on species that we care about are mostly different from any old functor category.
Last intuition: a species is an arbitrary algebraic data type, like
type Foo a = (a, DayOfWeek, a -> Bool)
which has the property that Foo a
is finite whenever a
is finite.
We don’t require that Foo
be a covariant or contravariant functor,
but it does need to be an “invariant functor” —
in the Haskell sense
that given a pair of inverse maps (a -> b, b -> a)
we can
convert between Foo a
and Foo b
.
In other words, it needs to respect isomorphism, as all types should.
An example species: the set of undirected unlabeled graphs with vertices .
We also evaluate species at natural numbers, so e.g. means .
For any species and set , the symmetric group acts on via the action of on morphisms: .
has as its skeleton the discrete category , and the cardinality of is determined by the cardinality of , so we could take sets of numbers as our only labels and limit our consideration to just the values . But this makes things uglier.
The generating function for a species is a formal power series with rational coefficients:
Note the use of parentheses instead of square brackets.
Keep in mind that the generating function doesn’t give us a complete picture of a species. We can exhibit two species which are distinct but have the same generating function.
Aside: What is a “permutation”, anyway?
When I was in grade school I was told that a permutation was a choice of how to arrange the elements of a set.
When I went to university I was told that a permutation is a bijection from a set to itself.
These are basically the same idea, right? After all, there are of them either way.
In fact, finite orderings and finite endobijections become equivalent as soon as you fix an ordering as your “origin.” Then given any other ordering you can make a bijection that sends the least element of the fixed ordering to the least element of the given one, etc. Another way to say this is that an endobijection is like the difference between two orders. But since it was arbitrary which fixed ordering we chose to start with, the isomorphism we obtain this way is also arbitrary. (This is why it’s harder to see the distinction between these notions for sets like where we have an obvious choice of fixed ordering.)
This is reminiscent of the difference between a point (in an affine space) and a vector (in a vector space) — we get a vector by subtracting two points, and given any point you can create a coordinate system fixing that point at the origin, but our choice of origin is arbitrary.

(Some google suggests what I’m describing is the idea of a principal homogeneous space.)
Anyway, working with species gives us a chance to clearly distinguish these two notions of permutation in our minds - since they yield different ideas of what it means to relabel them.
There is a species of permutations:
And there is a species of orderings a.k.a. lists:
These species have the same generating function:
These species are not equivalent even though they have the same cardinalities. The intuition behind this is that, to relabel a permutation, we need to undo the relabeling on the way in and then do it on the way out, whereas to relabel a list we only do it on the way out.
In general in mathematics, automorphisms (isomorphisms from an object to itself) capture the idea of a symmetry of a structure. For example:
- The map that reverses a list defines an automorphism of (the species of lists);
- The map that sends a graph to its complement defines an automorphism of (the species of graphs).
We also define two elements of a species () to be isomorphic if there exists a bijection such that .
This relation, when restricted to two structures on the same input set , induces an equivalence relation on which can be thought of as erasing labeling information.
This lets us easily see that there is no isomorphism : there is only one isomorphism class on , whereas the isomorphism classes on are cycle types. (The cycle type of a permutation is the multiset of the lengths of the cycles that it factors into.)
Chapter 3
In general, operations on species are going to be inspired by operations on generating functions. For example, and are species with generating functions and respectively:
(We use for an arbitrary one-element set.)
The species has the identity as its generating function:
You might ask why we don’t define as with the species. The answer is that it’s a little nicer to be able to see, given an element of , which was used to build the set — especially when we start to build more complicated species.
Finally, the exponential species is always a singleton:
(The same reasoning as before applies for why we don’t define .) Notice its generating function involves a nice identity from calculus:
The book also invites us to consider two different interpretations for : it can be the species of graphs on which are totally connected (cliques), or the species of graphs on which are totally disconnected. Since there’s one of each for any , these are all equivalent. I don’t know what the motivations for these interpretations are.
We define a species to be connected if when .
For a connected species , there is a unique morphism from given by:
Arithmetic on species
Since generating functions given by power series are summed termwise, the sum of two species is just their pointwise disjoint union:
Infinite sums are permitted as long as the sum does not become infinite at any individual point. For example, if is a species, we can express it as:
where is the truncation of to give structure only on sets of cardinality .
We say a species is positive if , and denote by the positive species obtained by truncating of to only nonempty inputs (so a species is positive iff ).
The product of species is the first major place where operations on species start to diverge from the categorical notions.
The product of two species is a species written or whose value on a vertex set is a set whose elements consist of:
- A choice of partition of into two disjoint parts ;
- an element of ;
- an element of .
This is consistent with a desire to make the generating function of the species look like the product of the power series:
More references
- Species and Functors and Types, Oh My! — a paper about realizing these ideas in the context of Haskell.
- Species: making analytic functors practical for functional programming — I haven’t read this one, but it’s on my list.