Tutorial #14: A Pairing Theorem in A322111
What you will learn in this tutorial. We meet a curious sequence of integers from the Online Encyclopedia of Integer Sequences and notice that its values come in pairs: 1, 1, 1, 2, 2, 5, 5, 13, 13, 37, 37, … The bulk of the tutorial is devoted to explaining why. Along the way we'll meet multiset partitions and their duals, learn how a number-theoretic statistic called "density" secretly encodes a tree structure, prove a small but load-bearing graph-theoretic lemma, build a bijection that establishes the pairing, derive a generating function, and discover that our "helper sequence" had been quietly sitting in the OEIS for twenty-six years under a completely different name. At the very end we'll peek at how the load-bearing lemma can be checked by a computer.
The story is more interesting than the statement, so I recommend reading sequentially rather than jumping to the punchline. Each section builds on the previous one. You'll find Definition, Example, Theorem, and Exercise boxes throughout — exercises appear at the end of the section whose material they exercise, so you can practice each idea while it's fresh. Stars (★) indicate harder problems. If you get stuck on a definition, the answer is almost always to write down a small example.
§1. Multiset partitions: definitions and examples
We begin with the central object of study, building it up piece by piece. If you haven't seen multisets before, the first definition is the only conceptual leap; everything afterward is bookkeeping.
A multiset is a collection of objects in which repetitions are allowed and order does not matter. We write multisets with curly braces, just like sets, but a multiset records how many copies of each element it contains. Thus {1, 1, 2} and {1, 2} are different multisets, even though they contain the same set of distinct elements. The number of copies of element x in a multiset M is called the multiplicity of x in M.
The multiset {1, 1, 1, 2, 3, 3} has six elements. Element 1 has multiplicity 3, element 2 has multiplicity 1, and element 3 has multiplicity 2. The set of distinct elements is {1, 2, 3}, but the multiset contains six elements counted with multiplicity.
The next object is built out of multisets, and it has a slightly recursive flavor: we'll be looking at multisets whose elements are themselves multisets. Don't let this throw you. The standard mental picture is "a partition of a multiset into smaller pieces."
A multiset partition is a multiset whose elements are themselves nonempty multisets. The inner multisets are called parts, and the elements appearing inside the parts (with their multiplicities counted across all parts) are called vertices. The weight of a multiset partition is the total number of elements across all parts, counted with multiplicity.
Consider M = { {1,1}, {1,2}, {2,3,3} }. This is a multiset of three parts. The first part is the multiset {1, 1}, the second is {1, 2}, and the third is {2, 3, 3}.
The vertices appearing in M are 1, 2, and 3 — three distinct vertices in total. The weight of M is 2 + 2 + 3 = 7, the sum of the sizes of the parts.
It's important to remember that the vertices are unordered labels; we could just as well have used {a, b, c} in place of {1, 2, 3}. Two multiset partitions are considered the same if one can be obtained from the other by relabeling vertices, a notion made precise in Definition 1.6.
The dual of a multiset partition M is constructed as follows. For each vertex v appearing in M, form a new "part" consisting of the indices of those parts of M that contain v, counted with multiplicity (so if v appears k times in part i, the index i appears k times in this new part). The dual is the multiset of all such new parts, one for each vertex.
Let M = { {1,2}, {2,2} }. Number the parts 0 and 1, so part 0 is {1, 2} and part 1 is {2, 2}.
- Vertex 1 appears in part 0 (once) and not in part 1. The new part for vertex 1 is {0}.
- Vertex 2 appears in part 0 (once) and in part 1 (twice). The new part for vertex 2 is {0, 1, 1}.
So the dual of M is { {0}, {0,1,1} }. Notice that since these new parts use 0 and 1 as labels rather than 1 and 2, the dual is on a "different" vertex set, but the labels are arbitrary; we relabel freely.
Take a moment to compute a few duals on your own before reading further. There's a subtle exercise of indexing that's easy to get wrong on the first try. (Try the multiset partition { {1,1,2}, {3} }. Answer: vertex 1 → {0,0}, vertex 2 → {0}, vertex 3 → {1}, so dual is { {0,0}, {0}, {1} }.)
Two multiset partitions are isomorphic if there is a bijection between their vertex sets that turns one into the other. (We never relabel parts; the multiset structure already ignores the order of the parts.)
A multiset partition is self-dual if it is isomorphic to its own dual.
Recall M = { {1,1}, {1,2}, {2,3,3} } from Example 1.4. Let's compute its dual. Number the parts 0, 1, 2.
- Vertex 1 appears in part 0 (twice) and in part 1 (once). New part: {0, 0, 1}.
- Vertex 2 appears in part 1 (once) and in part 2 (once). New part: {1, 2}.
- Vertex 3 appears in part 2 (twice). New part: {2, 2}.
So dual(M) = { {0,0,1}, {1,2}, {2,2} }. Now, is this isomorphic to M? We need a bijection between the vertex labels {0, 1, 2} of the dual and the vertex labels {1, 2, 3} of M that converts one into the other.
Try the relabeling 0 → 3, 1 → 2, 2 → 1. Then {0,0,1} becomes {3,3,2}, {1,2} becomes {2,1}, and {2,2} becomes {1,1}. So the dual after relabeling is { {3,3,2}, {2,1}, {1,1} } = { {1,1}, {1,2}, {2,3,3} }. That's exactly M! So M is self-dual.
Self-duality is a structural symmetry condition. Saying that a multiset partition is self-dual is saying something about the "shape" of how parts and vertices interlock — a shape that is invariant under swapping the roles of parts and vertices. We'll see in §2 that this has a beautiful geometric interpretation.
The multiset density of a multiset partition M, denoted density(M), is the integer
where |distinct(p)| is the number of distinct elements of part p (ignoring multiplicities), |parts(M)| is the total number of parts, and |vertices(M)| is the total number of distinct vertices appearing in M.
For M = { {1,1}, {1,2}, {2,3,3} }:
- {1,1} has 1 distinct element (just 1).
- {1,2} has 2 distinct elements (1 and 2).
- {2,3,3} has 2 distinct elements (2 and 3).
Sum: 1 + 2 + 2 = 5. Number of parts: 3. Number of vertices: 3 (namely 1, 2, 3). So
Density is a strange-looking statistic. We'll discover in §2 that it has a very natural meaning: it measures the "tree-ness" of an associated graph. Specifically, density 0 will correspond to the graph being a forest, and density −1 will correspond to a single tree.
We can finally state what our central sequence counts.
The integer sequence A322111 is defined by
("Connected" means that the bipartite incidence graph from §2 is connected as a graph; we'll see what this means concretely once we've defined the graph.)
The first eleven values of this sequence (the entire b-file at the time of writing) are:
Stare at this table. Starting from n = 3, the values come in pairs: 2, 2; 5, 5; 13, 13; 37, 37. This phenomenon is the central observation of these notes. The sequence "stutters." As far as I can determine, no one has previously remarked on this — which means it is either a small mathematical discovery or a coincidence I am about to be embarrassed by.
Figure 1 shows the example multiset partition we've been working with, drawn as a bipartite incidence graph (which we will define carefully in §2). For now, just absorb the picture: parts on the left, vertices on the right, edges connecting them.
Compute the dual of each of the following multiset partitions:
- { {1,2}, {2,3} }
- { {1}, {1}, {1,2} }
- { {1,1,2}, {2,2,3} }
Which (if any) are self-dual?
§2. The bipartite tree picture
The combinatorial definitions of §1 are accurate but unilluminating. To develop intuition, we recast every multiset partition as a graph. The recasting is so faithful that it loses no information.
Given a multiset partition M with k parts and m distinct vertices, the bipartite incidence graph of M is the bipartite graph whose left nodes are the parts of M (one node per part), whose right nodes are the distinct vertices of M (one node per vertex), and which has an edge between left node p and right node v whenever v appears in p. We do not count multiplicities here: the graph is a simple graph, with at most one edge between any pair of nodes. The multiplicities are recorded as edge weights — one positive integer per edge.
This is a faithful recoding: from the bipartite incidence graph plus its edge weights, you can recover the original multiset partition exactly. Each part-node tells you which part you're talking about; the edges incident to it tell you which vertices appear in that part; the edge weights tell you with what multiplicity.
The bipartite incidence graph of M = { {1,1}, {1,2}, {2,3,3} } is:
- Left nodes: L₀, L₁, L₂ (the three parts)
- Right nodes: R₁, R₂, R₃ (the three vertices)
- Edges: L₀–R₁ (weight 2), L₁–R₁ (weight 1), L₁–R₂ (weight 1), L₂–R₂ (weight 1), L₂–R₃ (weight 2)
This is exactly the graph drawn in Figure 1, with weights attached to the edges. It has 3 + 3 = 6 nodes and 5 edges.
Now we make a beautiful observation about the relationship between the density statistic and the combinatorial structure of this graph. Recall that density(M) is defined as
where k = |parts| and m = |vertices|. But the sum ∑p |distinct(p)| is exactly the number of edges in the bipartite incidence graph! Each distinct element of part p contributes exactly one edge (between p's left node and that vertex's right node). So:
Equivalently, if we let E denote the number of edges and V = k + m the total number of nodes, then
This puts us in well-trodden graph-theoretic territory. The quantity E − V is the negative of the well-known statistic V − E, which for a connected graph counts the number of independent cycles. (Sometimes called the cyclomatic complexity, or the rank of the cycle space.) In particular:
- A tree on V nodes has exactly V − 1 edges, so E − V = −1.
- More generally, a forest of c trees has V − c edges, so E − V = −c.
- A connected graph with one cycle has V edges, so E − V = 0.
The condition density = −1, plus the assumption that the partition is connected (i.e., the incidence graph is connected as a graph), is therefore equivalent to saying:
A connected multiset partition has multiset density −1 if and only if its bipartite incidence graph is a tree. (The multiplicities live as positive integer edge weights on the tree.)
Theorem 2.3 transforms the problem from "exotic combinatorics about indexed multisets" into "graph theory with a small piece of decoration." Self-dual multiset partitions of density −1 are edge-weighted bipartite trees with a self-duality condition that we'll now figure out how to encode.
First, what does self-duality mean for the tree? Taking the dual of a multiset partition swaps the roles of parts and vertices. In graph terms, this means swapping the left side and the right side of the bipartition. So the dual of M corresponds to the same tree, but with the left and right node sets exchanged. For the original and the dual to be isomorphic as multiset partitions, the underlying tree must admit a graph isomorphism that swaps the two sides of the bipartition while preserving the edge weights. This kind of structural symmetry will become the focus of §4.
For now, observe one immediate consequence: self-duality forces the two sides to have the same size. If the left side has k nodes and the right side has m nodes, and we want a bijection swapping them, we must have k = m. The tree therefore has 2k nodes and 2k − 1 edges. The number of edges is odd. This parity will do enormous work later.
Compute the density of the multiset partition { {1,2}, {2,3}, {3,1} }. Is the corresponding incidence graph a tree?
Solution. Each part has 2 distinct elements, summing to 6. There are 3 parts and 3 vertices. So density = 6 − 3 − 3 = 0. This is not −1, so the graph is not a tree. (In fact, it's a 6-cycle: a hexagon with the parts and vertices alternating around the rim.)
Compute the multiset density of each of the following multiset partitions, and decide whether the bipartite incidence graph is a tree, a forest with multiple components, or something with cycles:
- { {1, 2, 3} }
- { {1, 2}, {2, 3}, {3, 1} }
- { {1, 2}, {3, 4} }
- { {1, 2, 3}, {1, 2, 3} }
Show that for any multiset partition M, the dual of the dual of M is isomorphic to M itself. (In other words, the dual operation is an involution on isomorphism classes.) Hint: use the bipartite incidence graph picture of this section.
§3. A stuttering mystery
Let's pause and look at our sequence again, now that we have a geometric picture for the objects it counts.
The pairs starting from n = 3 are unmistakable. We naturally pose the question:
The fact that it's specifically odd-and-next-even pairs (and not some other pattern, like every-three-equal or "sum of two consecutive equals next") strongly suggests a parity-based bijection. The simplest such bijection would be a map that takes an object of weight 2t − 1 and produces an object of weight 2t by adding a single unit of weight somewhere. The question is: where?
We need to find a canonical, distinguished feature of every self-dual decorated bipartite tree — some structural element so unique that we can unambiguously say "increase its multiplicity by one." If we can find such a feature, the bijection writes itself.
The next two sections build that bijection. §4 establishes the load-bearing graph-theoretic lemma; §5 uses the lemma to construct the map and verify it really is a bijection.
§4. Graph automorphisms and the lemma
To formalize "self-duality" of an edge-weighted bipartite tree, we need to talk about graph automorphisms. If you've seen these in a graph theory or algebra course, this section will be a refresher; if not, the definitions are short.
An automorphism of a graph G is a bijection σ : V(G) → V(G) from the vertex set of G to itself, such that two vertices u and v are joined by an edge in G if and only if σ(u) and σ(v) are joined by an edge.
If the graph has edge weights, we further require that the weight of the edge between u and v equals the weight of the edge between σ(u) and σ(v).
The set of all automorphisms of G forms a group under composition, called the automorphism group Aut(G).
Now we add the bipartite structure into the picture. A bipartite graph has its vertices partitioned into two sets — the color classes — such that every edge goes between the two classes (no edge connects two vertices of the same class). For trees, the bipartition is always uniquely determined: 2-color the vertices alternately, starting from any vertex.
Let T be a bipartite graph with color classes L (left) and R (right). An automorphism σ of T is color-swapping if σ(L) = R and σ(R) = L — that is, if every left vertex is sent to a right vertex and vice versa.
The self-duality condition for our edge-weighted bipartite tree is exactly the existence of a color-swapping automorphism that preserves edge weights. (Verifying this is a small unwinding of definitions; do it as an exercise if you want to be sure.)
Before stating the lemma we need, let's make two small observations about color-swapping automorphisms.
If σ is a color-swapping automorphism, then σ has no fixed vertices. Reason: a fixed vertex v would satisfy σ(v) = v, but v is in one color class while σ(v) must be in the opposite class, and the two color classes are disjoint. So no such fixed vertex exists.
Any graph automorphism σ automatically permutes the edges: σ sends the edge {u, v} to {σ(u), σ(v)}. This gives a permutation σ_E of the edge set E(T), and σ_E partitions E(T) into orbits. We will particularly care about edges that are fixed by σ_E — that is, edges e with σ(e) = e as a set, even though σ may swap the two endpoints. We call these fixed edges.
A fixed edge is an edge whose two endpoints are swapped by σ. Every non-fixed edge belongs to a 2-orbit: a pair of edges that σ swaps with each other.
Why? Because σ² preserves colors (it's two color-swaps in a row), so for any edge e, the edge σ²(e) is in the same color-orbit as e. We need a slightly more careful argument to show that σ²(e) always equals e; this turns out to be true for trees, though it's not entirely obvious. (It's a consequence of the lemma we're about to state.) For now, take it as part of the structural picture: orbits have size 1 or 2 only.
With f denoting the number of fixed edges and c the number of 2-orbits, we have a count:
The right-hand side is odd, so f must be odd, and in particular f ≥ 1. There is always at least one fixed edge. The astonishing fact — and the load-bearing technical result of this tutorial — is that there is always exactly one.
Let T be a finite connected bipartite tree, and let σ be a color-swapping automorphism of T. Then σ has exactly one fixed edge.
The "at least one" half is the parity argument we just gave. The lemma's content is the upper bound: f cannot be 3, 5, 7, etc. To prove uniqueness we need a different technique.
We've already shown f ≥ 1. For the upper bound, suppose for contradiction that σ has two distinct fixed edges e₁ = {L₁, R₁} and e₂ = {L₂, R₂}, where σ swaps each Lᵢ with the corresponding Rᵢ. We will derive a contradiction from the tree structure.
Step 1: Delete the first fixed edge. Consider the graph T' = T \ {e₁} obtained by removing the edge e₁ (but keeping all the vertices). Since T is a tree, every edge of T is a bridge — an edge whose removal disconnects the graph. So T' has exactly two connected components. Call them A (containing L₁) and B (containing R₁).
Step 2: σ swaps these two components. The automorphism σ is a graph automorphism of T; it maps edges to edges, and in particular it maps the edge e₁ to itself. Therefore σ restricts to an automorphism of T' = T \ {e₁}. Now σ sends L₁ to R₁, and these two vertices live in different components of T'. Since σ is a bijection that sends connected sets to connected sets, it must send A entirely to B and vice versa.
Step 3: The second fixed edge gives a contradiction. Consider the second fixed edge e₂ = {L₂, R₂}. This is an edge of T, and in particular it is an edge of T' (it is not the same as e₁, since the two fixed edges are distinct). So both endpoints L₂ and R₂ live in the same connected component of T'.
But σ swaps them: σ(L₂) = R₂ and σ(R₂) = L₂. From Step 2, σ swaps the two components of T'. So if L₂ is in component A, then R₂ = σ(L₂) must be in component B. But we just said L₂ and R₂ are in the same component. Contradiction.
Therefore σ cannot have two distinct fixed edges, so f ≤ 1. Combined with f ≥ 1, we conclude f = 1. ∎
Find all self-dual multiset partitions of weight 5 with multiset density −1. (The answer should be 5 of them, since A322111(5) = 5.) For each one, draw its bipartite tree and find the unique color-swapping automorphism σ; identify the fixed edge.
Prove the following more general fact: let G be any finite connected bipartite graph (not necessarily a tree), and let σ be a color-swapping automorphism of G. Show that the number of fixed edges of σ has the same parity as the total number of edges of G. (For trees, this number is odd, hence at least 1; for graphs with cycles it can be 0, 2, 4, etc.)
§5. Building the bijection
With the lemma in hand, the bijection writes itself. Let T be a self-dual edge-weighted bipartite tree, and let e₀ be the unique σ-fixed edge guaranteed by Lemma 4.5. Let m₀ ≥ 1 denote its edge weight. The remaining 2k − 2 edges are partitioned by σ into k − 1 pairs. Within each pair, the two edges must carry the same weight (since σ preserves edge weights). Call these shared weights m₁, m₂, …, m_{k-1}.
The total weight of T is then:
This decomposition has an immediate parity consequence. Each mᵢ for i ≥ 1 is doubled, contributing an even amount to the total. So the parity of weight(T) is the same as the parity of m₀.
- If weight(T) is odd, then m₀ is odd; in particular, m₀ ≥ 1.
- If weight(T) is even, then m₀ is even; in particular, m₀ ≥ 2.
This is where the bijection comes from. The map that increments m₀ by 1 sends odd-weight trees to even-weight trees, and the map that decrements m₀ by 1 goes the other way. The constraint m₀ ≥ 2 on even-weight trees is exactly what makes the decrement well-defined.
Let Φ be the map on (isomorphism classes of) self-dual edge-weighted bipartite trees that increases the weight of the unique σ-fixed edge by 1.
For all t ≥ 1, A322111(2t − 1) = A322111(2t).
Well-defined. Suppose T and T' are isomorphic decorated trees, witnessed by a relabeling π. Then π conjugates the color-swapping automorphism σ of T into a color-swapping automorphism σ' = πσπ⁻¹ of T'. By Lemma 4.5, both σ and σ' have unique fixed edges, and π must take the unique fixed edge of T to the unique fixed edge of T' (because π takes σ-fixed structures to σ'-fixed structures). So Φ commutes with π, and Φ(T) ≅ Φ(T').
Injective. Suppose Φ(T₁) ≅ Φ(T₂). The witnessing relabeling sends fixed edge to fixed edge (same argument). Subtracting 1 from the weight of the fixed edge on both sides, we recover T₁ ≅ T₂.
Surjective. Let T' be a self-dual tree of weight 2t. Its fixed-edge weight m₀' is even, so m₀' ≥ 2. Decrease m₀' by 1 to obtain a tree T with m₀ = m₀' − 1 ≥ 1, and weight(T) = 2t − 1. Then Φ(T) = T', so Φ is surjective. ∎
Notice how essential the uniqueness in Lemma 4.5 is. If σ had multiple fixed edges, the inverse map would need to specify which one to decrement, and that choice could fail to commute with relabeling, breaking well-definedness. With exactly one, the choice makes itself.
Verify the Pairing Theorem by hand for t = 2: list all 2 self-dual decorated bipartite trees of weight 3 and all 2 self-dual decorated bipartite trees of weight 4, and exhibit the bijection Φ explicitly.
§6. Generating functions and an old friend
The Pairing Theorem cuts our work in half: we now only need to compute the odd-indexed terms of A322111 and the even-indexed terms come along for free. But it would be more satisfying to have a closed-form expression. To produce one, we'll use generating functions.
We start by observing that the data of a self-dual edge-weighted bipartite tree of weight n consists of two pieces:
- The weight m₀ of the unique fixed edge (which has the same parity as n);
- The structure on one side of the fixed edge — call it the "L-side." This is a rooted edge-weighted tree, hanging off the L-endpoint of the fixed edge. The "other side" is forced by σ: it's the mirror image of the L-side, so we don't need to count it separately.
If we let e denote the total edge weight on one side (the L-side), then the weight equation reads m₀ + 2e = n.
Define
where r_j is the number of (isomorphism classes of) rooted edge-weighted trees with total edge weight j. The sum starts at j = 0, with r₀ = 1 corresponding to the empty tree (just a root, no edges).
By a standard generating-function manipulation from the theory of combinatorial species, the generating function R(x) satisfies a recursive functional equation. A rooted tree consists of a root together with a multiset of "branches," where each branch is an edge with positive integer weight attached to a child rooted tree. The generating function for a single branch is
because x/(1-x) = x + x² + x³ + ⋯ encodes "a positive integer, weighted by itself" (i.e., the choices of edge weight, each contributing its value to the generating-function exponent), and R(x) attaches a child rooted tree below the edge. The multiset construction (Pólya / exponential formula) then gives:
This recursion lets us compute the coefficients r_j one at a time, using only previously-computed values. Concretely:
r₀ = 1 (the empty tree).
To compute r₁: a rooted tree of total edge weight 1 must have exactly one edge of weight 1, attached to a child which is the empty tree. So r₁ = 1.
To compute r₂: a rooted tree of total edge weight 2 has either (a) one edge of weight 2 attached to the empty tree, or (b) two edges of weight 1, each attached to the empty tree, hanging off the root as a multiset. Plus (c) one edge of weight 1 attached to a child which has edge weight 1 (a path of length 2). That gives r₂ = 3.
The full recursion produces:
Now comes a moment of mild humility. A search of the OEIS for the sequence 1, 1, 3, 8, 24, 71, 224, 710, 2318, 7659, 25703 returns exactly one result, and it is A052855: "Number of forests of rooted trees of nonempty sets with n points," contributed in January 2000 by the INRIA Encyclopedia of Combinatorial Structures. A French computer-algebra system computed our helper sequence twenty-six years before we needed it, and it has been sitting in the OEIS ever since, waiting for someone to notice that it was secretly the structural backbone of a self-dual multiset partition enumeration.
With R(x) = A052855 identified, the closed form for A322111 falls out. For odd weight n = 2t − 1, the admissible values of m₀ are {1, 3, 5, …, 2t − 1}, and the corresponding values of e = (n − m₀)/2 range over {0, 1, 2, …, t − 1}. Each value of e contributes r_e = A052855(e) trees. So:
For all t ≥ 1,
That is to say: A322111 is the sequence of partial sums of A052855, with each value duplicated. Two corners of the OEIS, neither suspecting the other's existence, are now connected by a thread.
Compute r₃ from the recursion in §6, and verify your answer matches r₃ = 8. (You'll need to enumerate rooted edge-weighted trees of total edge weight 3 by hand; there are 8 of them.) Suggestion: classify by the number of children of the root.
Prove that the generating function R(x) defined by the recursion R(x) = exp(∑_{k≥1} S(x^k)/k) with S(x) = xR(x)/(1-x) really does count rooted edge-weighted trees by total edge weight. (This is a Pólya-enumeration argument; see Tutorial 10 for the framework.)
§7. The numbers
The closed form makes computation essentially free. Here are the values of A322111 from n = 0 through n = 40, with the previously known terms (a(0) through a(10)) in plain rows and the thirty newly computed terms shaded.
| t | n = 2t−1 | a(2t−1) | n = 2t | a(2t) |
|---|---|---|---|---|
| — | — | — | 0 | 1 |
| 1 | 1 | 1 | 2 | 1 |
| 2 | 3 | 2 | 4 | 2 |
| 3 | 5 | 5 | 6 | 5 |
| 4 | 7 | 13 | 8 | 13 |
| 5 | 9 | 37 | 10 | 37 |
| 6 | 11 | 108 | 12 | 108 |
| 7 | 13 | 332 | 14 | 332 |
| 8 | 15 | 1042 | 16 | 1042 |
| 9 | 17 | 3360 | 18 | 3360 |
| 10 | 19 | 11019 | 20 | 11019 |
| 11 | 21 | 36722 | 22 | 36722 |
| 12 | 23 | 123875 | 24 | 123875 |
| 13 | 25 | 422449 | 26 | 422449 |
| 14 | 27 | 1453553 | 28 | 1453553 |
| 15 | 29 | 5040816 | 30 | 5040816 |
| 16 | 31 | 17599468 | 32 | 17599468 |
| 17 | 33 | 61814275 | 34 | 61814275 |
| 18 | 35 | 218252584 | 36 | 218252584 |
| 19 | 37 | 774226549 | 38 | 774226549 |
| 20 | 39 | 2758043727 | 40 | 2758043727 |
Five of the new terms (a(11) through a(15)) were independently cross-validated by a brute-force enumerator using the NetworkX graph isomorphism algorithm, which builds the bipartite multigraph directly and checks self-duality via side-swapping graph isomorphism — sharing no logic with the generating function approach. The values agreed to the digit. This is the kind of cross-check that lets one sleep at night.
Use the closed form of Theorem 6.2 and the values of A052855 to verify A322111(11) = 108. You'll need: A052855 = 1, 1, 3, 8, 24, 71, 224, …
§8. A computer-checked proof of the lemma
This last section is a brief tour of how the Unique Fixed Edge Lemma (Lemma 4.5) was checked by a computer. If you've never seen formal verification before, this will be your first taste; it's optional reading.
The proof assistant we'll look at is Lean 4, paired with a community mathematics library called Mathlib. Mathlib contains tens of thousands of formalized definitions and theorems, including a substantial graph theory library. The full proof of the Unique Fixed Edge Lemma is 380 lines of Lean code and contains zero unfinished steps. Let's translate the key pieces.
Setting up the definitions
The first thing we need is the formal definition of "color-swapping automorphism." In Lean:
/-- σ is color-swapping w.r.t. a Bool-coloring c if it flips every vertex's color. -/ def IsColorSwapping (c : G.Coloring Bool) (σ : G ≃g G) : Prop := ∀ v : V, c (σ v) = !c v
A few things to note:
G ≃g Greads as "graph isomorphism from G to itself" — i.e., a graph automorphism. Lean uses the notation≃gfor graph isomorphisms; thegdistinguishes them from set bijections (≃) or group isomorphisms (≃*).G.Coloring Boolis a function that 2-colors the vertices of G usingBool(true / false) as the two colors. For a tree, this coloring is uniquely determined up to swapping the colors.- The condition is that for every vertex
v, the color ofσ vequals the boolean negation of the color ofv. The exclamation mark!is Lean's notation for boolean negation.
And the definition of a fixed edge:
/-- An edge is fixed by σ if σ maps it to itself (swapping its endpoints). -/ def IsFixedEdge (σ : G ≃g G) (e : Sym2 V) : Prop := Sym2.map σ e = e
Edges of a graph on vertex type V are unordered pairs, which Lean
represents as elements of the type Sym2 V. The function
Sym2.map σ applies σ to both endpoints of an
edge. The condition for a fixed edge is that the result equals the original.
A small warm-up lemma: σ has no fixed vertices
This is Observation 4.3 from §4. In Lean:
theorem IsColorSwapping.no_fixed_vertex (hσ : IsColorSwapping c σ) (v : V) : σ v ≠ v := by intro h have := hσ v -- pulls out the fact c (σ v) = !c v rw [h] at this -- substitutes σ v ↦ v, giving c v = !c v simp at this -- simp recognizes the contradiction
Let's translate this line by line:
intro hsays "assume the negation we want to refute" — i.e., supposeσ v = v.have := hσ vinstantiates the hypothesishσatv, giving us the factc (σ v) = !c v.rw [h] at thisrewrites using the assumptionh(σ v = v) inside the hypothesisthis, transforming it toc v = !c v.simp at thisrecognizes thatc v = !c vis absurd (since boolean negation has no fixed point), and closes the goal automatically.
The Lean proof has the same three logical steps as the prose: introduce the assumption, derive the color equation, observe the contradiction. The notation is unfamiliar but the structure mirrors what you'd write on paper.
The main lemma: existence of a fixed edge
The mathematical content here is the parity argument from §4: the tree has
2k − 1 edges (an odd number), the action of
σ on edges decomposes into orbits, and odd-cardinality permutation actions
must fix at least one element. The Lean proof uses a Mathlib lemma called
Equiv.Perm.exists_fixed_point_of_prime that captures exactly this kind of
parity argument for prime-power-order group actions.
theorem IsTree.exists_fixed_edge (hT : G.IsTree) (hσ : IsColorSwapping c σ) : ∃ e ∈ G.edgeSet, IsFixedEdge σ e := by classical let σ_edge : Equiv.Perm G.edgeSet := σ.mapEdgeSet -- Decompose orderOf σ = 2^a * m with m odd obtain ⟨a, m, hm_odd, hk_eq⟩ := Nat.exists_eq_two_pow_mul_odd hk_ne -- |G.edgeSet| is odd (Task 1), so 2 ∤ |G.edgeSet| have h_not_dvd : ¬ 2 ∣ Fintype.card G.edgeSet := … -- Apply Equiv.Perm.exists_fixed_point_of_prime to σ_edge^m obtain ⟨⟨e, he⟩, hfe⟩ := Equiv.Perm.exists_fixed_point_of_prime h_not_dvd hpow -- Now we have an edge fixed by σ^m. We need it fixed by σ itself — -- a "bridge argument" closes this gap. …
The piece that surprised me — and that the formalization process exposed — is that the natural simplifying assumption σ² = identity turns out to be false in general! Color-swapping automorphisms can have order 4 or 8 or 16 — not just 2. The counterexample is the symmetric "double caterpillar" tree: a central edge with two isomorphic branches on each side, where σ swaps the central edge's endpoints AND simultaneously swaps the two branches on each side, giving order 4.
This forces a more sophisticated argument: decompose the order of σ as 2a · m with m odd, work with σ^m (whose order is a power of 2), and use a counting lemma about prime-power permutation actions to find an edge fixed by σ^m. The remaining gap — from "σ^m-fixed" to "σ-fixed" — is closed by the same kind of bridge argument we used in §4.
The uniqueness half
The uniqueness half of the lemma is our §4 proof, formalized. The Lean version follows the same three-step structure: pick two distinct fixed edges, delete the first one, observe that σ swaps the two resulting components, and derive a contradiction from the existence of the second fixed edge.
theorem IsTree.fixed_edge_unique (hT : G.IsTree) (hσ : IsColorSwapping c σ) {e₁ e₂ : Sym2 V} (he₁ : e₁ ∈ G.edgeSet) (he₂ : e₂ ∈ G.edgeSet) (hf₁ : IsFixedEdge σ e₁) (hf₂ : IsFixedEdge σ e₂) : e₁ = e₂ := by obtain ⟨a, a', rfl⟩ := Sym2.ind (fun u v => ⟨u, v, rfl⟩) e₁ obtain ⟨b, b', rfl⟩ := Sym2.ind (fun u v => ⟨u, v, rfl⟩) e₂ … -- Bridge argument: delete e₁, show that σ swaps the two resulting -- components, derive that b, b' must lie in the same component -- (because they're connected by edge e₂) and in different components -- (because σ swaps them), giving the contradiction. …
The full uniqueness proof in Lean is about 110 lines, most of it the technical machinery of stating "delete an edge and reason about the resulting components" formally. The mathematical content fits in the five sentences of §4's proof. There's a real gap between informal proof complexity and formal proof complexity, and one of the things you learn from formalization is which lemmas are easy on paper but hard in Lean (anything involving paths, cycles, or "obvious" connectivity statements) and which lemmas are hard on paper but easy in Lean (anything that reduces to algebra or simp).
The main theorem
With both halves in place, the main theorem is two lines:
theorem IsTree.unique_fixed_edge (hT : G.IsTree) (hσ : IsColorSwapping c σ) : ∃! e, e ∈ G.edgeSet ∧ IsFixedEdge σ e := by obtain ⟨e, he, hfe⟩ := hT.exists_fixed_edge hσ exact ⟨e, ⟨he, hfe⟩, fun e' ⟨he', hfe'⟩ => hT.fixed_edge_unique hσ he' he hfe' hfe⟩
The notation ∃! means "there exists a unique" — exactly the existence-and-uniqueness
statement we want. The proof says: get a fixed edge from the existence theorem; close the uniqueness obligation
by appealing to the uniqueness theorem.
What this gives us
Running #print axioms IsTree.unique_fixed_edge in Lean reports that the theorem
depends on three axioms: propext (propositional extensionality),
Classical.choice (the axiom of choice), and Quot.sound
(the quotient construction). These are the standard axioms underlying classical mathematics in Lean —
nothing exotic, no additional assumptions, no unfinished steps. The Lean kernel has checked that the proof
is correct, in the most pedantic sense possible.
What does this buy us? The main thing is citability: the proof exists as a digital artifact that anyone can verify in seconds by running the Lean compiler. For a small lemma like this, formal verification is overkill; for a large or contentious result, it's invaluable. As an undergraduate, you don't need to learn Lean to do mathematics, but it's worth knowing that the option exists. Several major recent results — the four-color theorem, the Kepler conjecture, Liquid Tensor Experiment — have been formally verified, and the technology is becoming more accessible every year.
The double caterpillar illustrated above is a bipartite tree on 6 vertices (3 on each side) that admits a color-swapping automorphism σ of order 4, showing that the assumption "σ² = id" is genuinely false in general. Construct a similar example on 8 vertices (4 on each side) with a color-swapping σ of order 4, different from the one shown. Hint: attach an extra mirrored pair of leaves to one of the existing leaves, and extend σ consistently.
§9. Further reading
This tutorial scratches the surface of several large subjects. If you'd like to go deeper, here are some starting points.
- The OEIS itself at oeis.org. Browse around. Several hundred sequences in the "Wiseman density" neighborhood — see the cross-references on A322111 — admit similar tree-decomposition arguments. Many of them are wide open.
- Generating functions and species. The standard reference is Flajolet & Sedgewick, Analytic Combinatorics (Cambridge, 2009), available free online. For a more elementary treatment, see Wilf's generatingfunctionology, also free online. Tutorial 10 of this series gives a friendly intro to Pólya enumeration.
- Membrane computing. The bipartite tree structure with multiset weights has a beautiful interpretation as a "P system" (named after Gheorghe Păun) — a model of computation inspired by the biological cell. Păun's tutorial in the Proceedings of the Brainstorming Workshop on Uncertainty in Membrane Computing (Palma de Mallorca, 2004) is the canonical reference. Self-dual P systems (those invariant under swapping membranes and objects) are an essentially unstudied subclass; the present tutorial is, as far as I know, the first to count them.
- Lean 4 and formal verification. Start with the textbook Mathematics in Lean (free online), which walks you from "what is a proof" through real analysis in Lean. The community is friendly and active on the Lean Zulip chat. If you prefer videos, Kevin Buzzard's "Xena Project" lectures are a great entry point for math undergraduates.
- Graph automorphisms and Burnside. A first course in algebra or combinatorics is likely to cover the orbit-counting theorem (Burnside / Cauchy-Frobenius). The structural arguments in §4 are in the same spirit. For a deeper dive, see Cameron's Permutation Groups (LMS Student Texts, 1999).
End of Tutorial #14. Next in the series: Tutorial #15, "Lattice paths and the cycle lemma."