Counting Algebraic Structures
Posted by John Baez
The number of groups with elements goes like this, starting with :
0, 1, 1, 1, 2, 1, 2, 1, 5, …
The number of semigroups with elements goes like this:
1, 1, 5, 24, 188, 1915, 28634, 1627672, 3684030417, 105978177936292, …
Here I’m counting isomorphic guys as the same.
But how much do we know about such sequences in general? For example, is there any sort of algebraic gadget where the number of gadgets with elements goes like this:
1, 1, 2, 1, 1, 1, 1, 1, … ?
No! Not if by “algebraic gadget” we mean something described by a bunch of operations obeying equational laws — that is, an algebra of a Lawvere theory.
This follows from a result of László Lovász in 1967:
- László Lovász, Operations with structures, Acta Mathematica Academiae Scientiarum Hungarica 18, (1967) 321–328.
On Mastodon, Omar Antolín sketched a proof that greases the wheels with more category theory. It relies on a rather shocking lemma:
Super-Yoneda Lemma. Let be the category of algebras of some Lawvere theory, and let be two algebras whose underlying sets are finite. If the functors and are unnaturally isomorphic, then .
Here we say the functors and are unnaturally isomorphic if
for all . We’re not imposing the usual commuting naturality square — indeed we can’t, since we’re not even giving any specific choice of isomorphism!
If and are naturally isomorphic, you can easily show using the Yoneda Lemma. But when they’re unnaturally isomorphic, you have to break the glass and pull out the Super-Yoneda Lemma.
Given this shocking lemma, it’s easy to show this:
Theorem. Let be two algebras of a Lawvere theory whose underlying sets are finite. If for some natural number then .
Here’s how. Since , we have natural isomorphisms
so for any the sets and have the same cardinality. This means we have an unnatural isomorphism
The lemma magically lets us conclude that
Now, how do we use this to solve our puzzle? Let be the number of isomorphism classes of algebras whose underlying set has elements. We must have
since we’ve just seen that nonisomorphic algebras with elements give nonisomorphic algebras with elements. So, for example, we can never have , since . Thus, the sequence can’t look like the one I showed you, with
Nice! So let’s turn to the lemma, which is the really interesting part.
I’ll just quote Omar Antolín’s proof, since I can’t improve on it. I believe the ideas go back to Lovász, but a bit of category theory really helps. Remember, and are algebras of some Lawvere theory whose underlying sets are finite:
Let be the set of monomorphisms, which here are just homomorphisms that are injective functions. I claim you can compute the cardinality of using the inclusion-exclusion principle in terms of the cardinalities of for various quotients of .
Indeed, for any pair of elements , let be the set for homomorphisms such that . The monomorphisms are just the homomorphisms that belong to none of the sets , so you can compute how many there are via the inclusion-exclusion formula: you’ll just need the cardinality of intersections of several .
Now, the intersection of some is the set of homorphisms such that for all , . Those are in bijection with the homorphisms where is the quotient of obtained by adding the relations for each .
So far I hope I’ve convinced you that if and are unnaturally isomorphic, so are and . Now it’s easy to finish: since is non-empty, so is , so is isomorphic to a subobject of . Similarly is isomorphic to a subobject of , and since they are finite, they must be isomorphic.
Beautiful!
But if you look at this argument you’ll see we didn’t use the full force of the assumptions. We didn’t need and to be algebras of a Lawvere theory. They could have been topological spaces, or posets, or simple graphs (which you can think of as reflexive symmetric relations), or various other things. It seems all we really need is a category of gadgets with a forgetful functor
that is faithful and has some extra property… roughly, that we can take an object in and take a quotient of it where we impose a bunch of extra relations , and maps out of this quotient will behave as you’d expect. More precisely, I think the extra property is this:
Given any and any surjection , there is a morphism such that the morphisms that factor through are precisely those for which factors through .
Can anyone here shed some light on this property, and which faithful functors have it? These papers should help:
Luca Reggio, Polyadic sets and homomorphism counting.
Anuj Dawar, Tomás Jakl and Luca Reggio, Lovász-Type theorems and game comonads.
Shoma Fujino and Makoto Matsumoto, Lovász’s hom-counting theorem by inclusion-exclusion principle.
but I haven’t had time to absorb them yet.
By the way, there’s a name for categories where the super-Yoneda Lemma holds: they’re called right combinatorial.
And there’s a name for the sequences I’m talking about. If is a Lawvere theory, the sequence whose th term is the number of isomorphism classes of -algebras with elements is called the fine spectrum of . The idea was introduced here:
- Walter Taylor, The fine spectrum of a variety, Algebra Universalis 5 (1975), 263–303.
though Taylor used not Lawvere theories but an equivalent framework: ‘varieties’ in the sense of universal algebra. For a bit more on this, go here.
I’m interested in which sequences are the fine spectrum of some Lawvere theory. You could call this an ‘inverse problem’. The direct problem — computing the fine spectrum of a given Lawvere theory — is already extremely difficult in many cases. But the case where there aren’t any equational laws (except trivial ones) is manageable:
- Michael A. Harrison, The number of isomorphism types of finite algebras, Proceedings of the American Mathematical Society 17 (1966), 731–737.
Some errors in Harrison’s paper were corrected here:
- Philip Tureček, Counting finite magmas.
I suspect Harrison and Tureček’s formulas could be nicely derived using species, since they’re connected to the tree-like structures discussed here:
- François Bergeron, Gilbert Labelle and Pierre Leroux, Combinatorial Species and Tree-Like Structures, Cambridge U. Press, Cambridge, 1998.
For all I know these authors point this out! It’s been a while since I’ve read this book.
Re: Counting Algebraic Structures
“If the functors hom(−,A) and hom(−,A) are unnaturally isomorphic” Pretty sure they’re naturally isomorphic.