To celebrate the fact that I’ve finally got latex working on the blog, I’m going to bore you with a post about combinatorics and categories…

After some nice student questions in the Foundations course the other day, David and I were playing around with the number of surjections that exist between finite sets. And somehow this led down the road of writing the number of maps between two finite sets as a sum over the number of pre-image sets. There’s a very nice formula for this, actually. The number of surjections from set of things to a set of things is given by , where is the Sterling number of the second kind, which counts the ways of partioning an n-element set into k subsets. (And it’s pretty easy to backwards reason why the number of surjections is this number!) The number of injections is the falling factorial, .

The total number of maps is well-known (and easy to see) to be . Let’s write , with an eye towards the categorification. But we would like to split these up by number of image elements. To get the total number of maps this way, we can imagine an intermediate -element set where is the size of the image of a given map. Then we map onto this -element set with a surjection, and then to the -element set with an injection. We thus decompose our arbitary map into a composition of an injection and a surjection. Then it’s tempting to write:

which even seems to fit the Einstein notation for summation nicely! Unfortunately it’s not quite right: we could, for example, throw in an permutation (ie, an automorphism) of the -element set to obtain a different realization of the same map; thus, we’re over-counting. So in fact, we have to divide by , or, if you prefer, . So our formula is then:

.

This last equality is actually the form that you’ll find in lots of combinatorics texts, like Stanley’s Enumerative Combinatorics, Volume 1. It’s part of a section called ‘The Twelvefold Way,’ about counting different kinds of functions.

By thinking of all the steps in terms of set maps, though, we actually have a nice general statement that works for lots of different categories. For example, the formula:

works just fine for finite groups! The groups are just all of the quotients of $G$. Additionally, what’s happened is we’ve given a nice description of all of the maps between and : they decompose as a surjection followed by an injection. This is pretty much the content of the first isomorphism theorem: The surjection is a quotient map, and the injection is the inclusion homomorphism. We’re allowed to throw in qutomorphisms of the quotient without any harm done, but if we want to describe all maps, we should control for those automorphisms in order to avoid over-counting!

So what we’re seeing here is that counting set maps by size of the image is pretty much the same as proving the first isomorphism theorem, which holds for all kinds of different categories…

Fun and games!