Tutorial #14: A Pairing Theorem in A322111

Self-dual multiset partitions, bipartite trees, generating functions, and an unexpected meeting at the OEIS

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.

Definition 1.1 (Multiset)

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.

Example 1.2

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.

1 1 1 multiplicity 3 2 multiplicity 1 3 3 multiplicity 2 { }
The multiset {1, 1, 1, 2, 3, 3} as stacks of chips. The stack heights are the multiplicities; the set of distinct elements is {1, 2, 3}.

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."

Definition 1.3 (Multiset partition)

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.

Example 1.4

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.

1 1 L₀ = {1, 1} 1 2 L₁ = {1, 2} 2 3 3 L₂ = {2, 3, 3} { }
The partition M = { {1,1}, {1,2}, {2,3,3} } as three boxes of chips. Boxes don't care about the order of chips inside them, and the outer multiset doesn't care about the order of boxes — only the contents matter.
Note. The word "partition" here is being used in a generalized sense. A classical set partition of a set S divides S into disjoint nonempty subsets. A multiset partition is more permissive: vertices may appear in multiple parts, and may appear with multiplicity within a single part. So multiset partitions are not a special case of set partitions, despite the similar name.
Definition 1.5 (Dual of a multiset partition)

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.

Example 1.6 (Computing a dual carefully)

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.

v=1 v=2 L₀ L₁ 1 1 0 2 M = { {1,2}, {2,2} } rows = parts, cols = vertices transpose (swap rows ↔ cols) L₀ L₁ v=1 v=2 1 0 1 2 dual(M) = { {0}, {0,1,1} } rows v=1,2 read: {0}, {0,1,1} taking the dual = transposing the incidence matrix
The dual operation is incidence-matrix transposition. Entry (i, v) records how many times vertex v appears in part i. Swapping rows and columns gives the incidence matrix of the dual; each row of the transposed matrix can be read off as a part of dual(M).

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} }.)

Definition 1.7 (Isomorphism, self-dual)

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.

an isomorphism is a relabeling of vertices 1 2 2 3 M = { {1,2}, {2,3} } π: 1↦a, 2↦b, 3↦c a b b c M′ = { {a,b}, {b,c} } boxes don't move — only the vertex labels are renamed
Isomorphism means "the same picture with different labels." The bijection π: 1 \mapsto a,\ 2 \mapsto b,\ 3 \mapsto c turns one partition into the other. Self-duality is the special case where M' happens to be dual(M).
Example 1.8 (A self-dual partition)

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.

Definition 1.9 (Multiset density)

The multiset density of a multiset partition M, denoted density(M), is the integer

density(M) = ( ∑parts p |distinct(p)| ) − |parts(M)| − |vertices(M)|

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.

Example 1.10 (Computing density)

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(M) = 5 − 3 − 3 = −1.

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.

Definition 1.11 (The sequence A322111)

The integer sequence A322111 is defined by

A322111(n) = number of isomorphism classes of self-dual, connected, multiset partitions of weight n with multiset density −1.

("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:

n : 0 1 2 3 4 5 6 7 8 9 10 a(n) : 1 1 1 2 2 5 5 13 13 37 37

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.

Figure 1 — A self-dual multiset partition of weight 7
parts (membranes) vertices (objects) 2 1 1 1 2 { 1, 1 } L₀ : { 1, 2 } L₁ : { 2, 3, 3 } L₂ : 1 R₁ 2 R₂ 3 R₃ M = { {1,1}, {1,2}, {2,3,3} }   ·   weight = 7   ·   density = 5 − 3 − 3 = −1   ·   self-dual under 1 ↔ 3
Figure 1. The multiset partition { {1,1}, {1,2}, {2,3,3} } as a bipartite incidence graph. The three parts (rectangles) are on the left; the three distinct vertices (circles) are on the right. An edge connects part p to vertex v whenever v appears in p; the edge is labeled with the multiplicity. As verified in Example 1.8, this partition is self-dual under the relabeling 1 ↔ 3.
Exercise 1 (warm-up)

Compute the dual of each of the following multiset partitions:

  1. { {1,2}, {2,3} }
  2. { {1}, {1}, {1,2} }
  3. { {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.

Definition 2.1 (Bipartite incidence graph)

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.

Example 2.2

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.

parts (L) vertices (R) 2 1 1 1 2 L₀ L₁ L₂ R₁ R₂ R₃
The bipartite incidence graph of M = { {1,1}, {1,2}, {2,3,3} } in its bare graph-theoretic form: three squares on the left (the parts), three circles on the right (the distinct vertices), and five edges each carrying a positive integer weight (shown in orange). There is exactly one edge between each connected pair — the weight is a label on the edge, not a count of parallel edges. The same graph appears in Figure 1 with the multiset contents drawn inside each part.

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

density(M) = ( ∑p |distinct(p)| ) − k − m

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:

density(M) = |edges of incidence graph| − |left nodes| − |right nodes|

Equivalently, if we let E denote the number of edges and V = k + m the total number of nodes, then

density(M) = E − V.

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:

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:

Theorem 2.3 (Density-tree correspondence)

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.)

Proof. Connected graphs satisfy E ≥ V − 1 with equality if and only if they are trees. Density = E − V = −1 means E = V − 1, exactly the tree condition.

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.

Figure 2 — The same partition as a bipartite tree
part (membrane) vertex (object) edge label = multiplicity 2 1 1 1 2 L₀ 1 L₁ 2 L₂ 3 k + m − 1 = 3 + 3 − 1 = 5 edges connected acyclic bipartite graph   ⟹   tree k = 3 parts m = 3 vertices
Figure 2. The same multiset partition as in Figure 1, redrawn with the parts (squares) and vertices (circles) laid out as nodes of a path graph. Edge weights shown above each edge. The graph has six nodes and five edges, satisfying k + m − 1 = 2k − 1 = 5. The fact that there are exactly k + m − 1 edges and the graph is connected is what makes it a tree. The multiplicities 2, 1, 1, 1, 2 happen to be palindromic, hinting at the self-duality.
Example 2.4 (Try this now)

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.)

L₀ 2 L₁ 3 L₂ 1 6-cycle density = 0
The partition { {1,2}, {2,3}, {3,1} } has 6 edges and 6 nodes, so density = 0. Its incidence graph is a hexagonal cycle — connected but not acyclic, hence not a tree.
Exercise 2

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. { {1, 2, 3} }
  2. { {1, 2}, {2, 3}, {3, 1} }
  3. { {1, 2}, {3, 4} }
  4. { {1, 2, 3}, {1, 2, 3} }
Exercise 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.

A322111(n) = number of isomorphism classes of self-dual edge-weighted bipartite trees on (k, k) nodes with total edge weight n, for some k ≥ 1. n : 0 1 2 3 4 5 6 7 8 9 10 a(n) : 1 1 1 2 2 5 5 13 13 37 37

The pairs starting from n = 3 are unmistakable. We naturally pose the question:

Question. Why does A322111(2t − 1) = A322111(2t) for t ≥ 2? Is there a bijection?

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.

Figure 3 — A322111, first eleven terms
A322111(n) for n = 0 .. 10 1 5 10 20 37 a(n) (sqrt scale) 1 0 1 1 1 2 2 3 2 4 = 5 5 5 6 = 13 7 13 8 = 37 9 37 10 = n   (weight) every odd-indexed value equals the next even-indexed value
Figure 3. The first eleven terms of A322111 displayed as a stair-step bar chart (with a square-root vertical scale, since the values grow rapidly). The pairing is visible to the naked eye after the third term: each odd-indexed value equals the very next even-indexed value. Our task in §4 and §5 is to explain this pattern by finding a bijection between odd- and even-weight self-dual trees.

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.

Definition 4.1 (Graph automorphism)

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).

Intuition. An automorphism is a "symmetry" of the graph: a way of relabeling the vertices that leaves the graph looking exactly the same. A square has 8 automorphisms (the 4 rotations and 4 reflections of its symmetry group D₄). A path on 5 vertices has 2 automorphisms (the identity and the "flip"). The complete graph K_n has all n! automorphisms.

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.

Definition 4.2 (Color-swapping automorphism)

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.

Observation 4.3 (No fixed vertices)

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.

Observation 4.4 (σ acts on edges)

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.

orbit of size 1 · fixed edge σ u v σ(e) = e as a set; σ swaps the endpoints u ↔ v orbit of size 2 · swapped pair e₁ e₂ σ σ σ(e₁) = e₂ and σ(e₂) = e₁
How σ can act on an edge. Left: a fixed edge is one whose two endpoints get swapped by σ, so σ maps the edge to itself (as an unordered set). Right: a non-fixed edge is sent to a different edge; the two edges form a 2-element orbit. These are the only two possibilities; the parity argument f + 2c = 2k - 1 then forces f to be odd.

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:

f + 2c = total edges = 2k − 1.

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.

Lemma 4.5 (Unique Fixed Edge)

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.

Figure 4 — A self-dual bipartite tree with the unique fixed edge
a color-swapping automorphism σ on a bipartite tree σ e₀ (fixed) u₀ σu₀ σu₁ u₁ σu₂ u₂ σu₃ u₃ 7 edges = 1 fixed + 2 × 3 swapped f = 1, c = 3 edge count: 2k − 1 = 7 (odd) ⟹ f + 2c = 7 ⟹ f is odd ⟹ f ≥ 1 the lemma asserts: f = 1 (exactly)
Figure 4. A self-dual bipartite tree on (4, 4) nodes. The color-swapping automorphism σ is a 180° rotation of the figure about its center; the dashed green arrows indicate which vertex pairs σ swaps. The unique σ-fixed edge sits at the center, highlighted; its endpoints u₀ and σ(u₀) are exchanged by σ, but the edge as a set is mapped to itself. Every other edge belongs to a 2-orbit (a "mirror pair"). The tally: 7 = 1 + 2 × 3.
Proof of the Unique Fixed Edge Lemma

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.

delete e₁ → two components → σ tries to move R₂ to B, but R₂ is already in A A B e₁ (deleted) L₁ R₁ e₂ L₂ R₂ σ sends R₂ → B … R₂? but R₂ is in A! ✗
The contradiction in pictures. Deleting e₁ splits T into two components A (containing L₁) and B (containing R₁), and σ swaps them. A second fixed edge e₂ would have both endpoints in one component (say A), but then σ(R₂) would need to be simultaneously in B (because σ swaps the components) and equal to L₂ (which is in A). No vertex can be in two components at once.

Therefore σ cannot have two distinct fixed edges, so f ≤ 1. Combined with f ≥ 1, we conclude f = 1.

Why this proof is satisfying. The argument uses three different facts about trees: that every edge is a bridge, that deleting a bridge gives two components, and that automorphisms preserve connectivity. None of these is hard, and combining them gives a clean contradiction. The proof is short, but the conclusion is strong: it gives us a canonical structural feature of every self-dual bipartite tree, which is exactly what §5 needs to build the bijection.
Exercise 4

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.

Exercise 5 (★)

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:

weight(T) = m₀ + 2(m₁ + m₂ + ⋯ + m_{k−1}).
a self-dual tree: one fixed edge in the middle, the rest in mirrored pairs mirror axis m₃ m₂ m₁ m₁ m₀ m₁ m₁ m₂ m₃ left half: weight m₁ + m₂ + m₃ right half: same weights (mirror) weight(T) = m₀ + 2(m₁ + m₂ + m₃)  ⟹  parity of weight(T) = parity of m₀
Why weight parity is controlled by the fixed edge alone. The orange center is the unique fixed edge, of weight m₀. Every other edge belongs to a 2-orbit, and σ preserves weights, so the two edges in each orbit share a common weight m_i. Summing over all 2-orbits contributes an even number 2(m_1+m_2+⋯+m_{k-1}) to the total. So weight(T) ≡ m_0 \pmod 2 — increasing m_0 by 1 is the only way to flip the parity.

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₀.

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.

Definition 5.1 (The bijection Φ)

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.

Theorem 5.2 (Pairing Theorem)

For all t ≥ 1, A322111(2t − 1) = A322111(2t).

Proof. The map Φ sends an isomorphism class of self-dual decorated trees of weight 2t − 1 to one of weight 2t. We must verify that Φ is well-defined and is a bijection between these two sets.

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.

Figure 5 — The bijection Φ in action
odd weight (n = 3) 1 1 1 L₀ 1 L₁ 2 M = { {1}, {1, 2} } weight 1 + 2 = 3   ·   m₀ = 1 Φ m₀ ↦ m₀ + 1 even weight (n = 4) 1 2 1 L₀ 1 L₁ 2 Φ(M) = { {1}, {1, 1, 2} } weight 1 + 3 = 4   ·   m₀ = 2 The unique fixed edge (highlighted) is the only place where the increment is unambiguous. Inverting Φ at even weight requires m₀ ≥ 2, which is automatic by parity. a(2t − 1) = a(2t) for all t ≥ 1.
Figure 5. The bijection Φ applied to the smallest non-trivial example. Left: a self-dual decorated tree of weight 3, encoding the partition { {1}, {1, 2} }, with fixed-edge multiplicity m₀ = 1. Right: the image under Φ, encoding { {1}, {1, 1, 2} } at weight 4, with m₀ = 2. The fixed edge (highlighted in both) is the only place where the weight changes.
Exercise 6

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.

Reminder. A generating function for a sequence (a₀, a₁, a₂, …) is the formal power series A(x) = a₀ + a₁ x + a₂ x² + ⋯. We treat x as a formal symbol and don't worry about convergence; the goal is to use algebraic operations on power series (addition, multiplication, substitution, exponentiation) to relate sequences to each other. If you've taken a generating-functions chapter in a combinatorics course, this will be familiar.

We start by observing that the data of a self-dual edge-weighted bipartite tree of weight n consists of two pieces:

  1. The weight m₀ of the unique fixed edge (which has the same parity as n);
  2. 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

R(x) = ∑j ≥ 0 r_j x^j

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).

r₂ = 3  ·  the three rooted edge-weighted trees of total edge weight 2 root other node 2 (a) 1 1 (b) 1 1 (c)
What R(x) counts. A rooted edge-weighted tree is a rooted tree (filled node is the root) in which each edge carries a positive integer weight (shown in orange). The total edge weight is the sum of the weights. Here are all three such trees of total weight 2: a single edge of weight 2 (a), two weight-1 edges sharing a root (b), and a length-2 path with both edges of weight 1 (c). The outer multiset construction in R(x) = \exp(\sum S(x^k)/k) captures the fact that in (b), the two children hang off the root as an unordered pair.

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

S(x) = x · R(x) / (1 − x)

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:

R(x) = exp ( ∑k ≥ 1 S(x^k) / k ).
What's the exp doing here? Multisets of objects of generating function S(x) have generating function exp(∑k≥1 S(x^k)/k). This is the unlabeled (Pólya) version of the exponential formula, sometimes written as MSET(S). The terms with k > 1 come from accounting for the symmetries of repeated branches (you don't count the same multiset twice when several copies of the same branch hang off the root). For a more complete derivation, see Tutorial 10 ("Pólya enumeration").

This recursion lets us compute the coefficients r_j one at a time, using only previously-computed values. Concretely:

Example 6.1 (Computing the first few r_j)

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:

R(x) = 1 + x + 3x² + 8x³ + 24x⁴ + 71x⁵ + 224x⁶ + 710x⁷ + 2318x⁸ + 7659x⁹ + 25703x¹⁰ + ⋯

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.

The bijection between R(x) and A052855. A rooted tree where each non-root node carries a "size" (a positive integer) corresponds bijectively to a rooted tree where each edge carries a positive integer weight: just attach the size of each child to the edge connecting it to its parent. A052855 counts forests of rooted trees of nonempty sets, which corresponds to viewing the root of our tree as a "phantom root" and treating its children as the roots of separate trees in a forest. The numerics agree to all 21 terms I computed. The OEIS rewards those who search before they compute and gently humbles those who compute before they search.

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:

Theorem 6.2 (Closed form)

For all t ≥ 1,

A322111(2t − 1) = A322111(2t) = ∑j = 0t − 1 A052855(j).

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.

A322111 as a staircase of partial sums of A052855 a(1) = a(2) = 1 = 1 a(3) = a(4) = 1 1 = 2 a(5) = a(6) = 1 1 3 = 5 a(7) = a(8) = 1 1 3 8 = 13 a(9) = a(10) = 1 1 3 8 24 = 37 each row adds the next value of A052855 (highlighted in orange) block widths are proportional to A052855(j) = 1, 1, 3, 8, 24, …
A pictorial proof of Theorem 6.2. Row t consists of blocks of widths A052855(0), A052855(1), …, A052855(t-1); the total width equals A322111(2t-1) = A322111(2t). Passing from row t to row t+1 appends one new block (shown in orange).
Figure 6 — The bijective decomposition
step 1 · the self-dual decorated tree 2 1 1 1 2 L₀ R₁ L₁ R₂ L₂ R₃ weight 7 · m₀ = 1 (the fixed edge, in orange) step 2 · cut the unique fixed edge 2 1 L₀ R₁ L₁ cut R₂ L₂ R₃ 1 2 L-side (rooted at L₁) R-side (forced by σ) step 3 · L-side as a forest of rooted trees of nonempty sets  (A052855) L₁ phantom (discarded) size 1 R₁ → size 2 L₀ → forest point-count = 1 + 2 = 3 = (n − m₀)/2 = (7 − 1)/2 ✓
Figure 6. Decomposing a self-dual decorated tree into the data (m₀, F): the multiplicity of the fixed edge plus a forest of rooted trees of nonempty sets, the latter counted by A052855. Step 1: the original tree, with the fixed edge in orange. Step 2: cut the fixed edge, producing two components related by σ. Step 3: reinterpret the L-side as an A052855 forest by treating L₁ as a phantom root and giving each remaining node a "size" equal to the multiplicity of its incoming edge.
Exercise 7 (★)

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.

Exercise 8 (★★)

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.

A322111(n) for n = 0..40. Pairs (a(2t−1), a(2t)) shown side by side.
tn = 2t−1a(2t−1)n = 2ta(2t)
01
11121
23242
35565
4713813
59371037
61110812108
71333214332
8151042161042
9173360183360
1019110192011019
1121367222236722
122312387524123875
132542244926422449
14271453553281453553
15295040816305040816
1631175994683217599468
1733618142753461814275
183521825258436218252584
193777422654938774226549
20392758043727402758043727

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.

Exercise 9

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.

What is a proof assistant? A proof assistant (sometimes called an "interactive theorem prover") is a programming language in which you write mathematical statements and proofs, and the computer checks whether your proof is correct. The system has a small, trusted "kernel" that knows the rules of inference, and your proof must reduce — step by step, in formal detail — to those rules. If your proof has a gap or a wrong inference, the system rejects it.

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:

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:

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.

σ of order 4: a double caterpillar unique fixed edge σ r₁ r₂ u v l₁ l₂
The double caterpillar on six vertices. The central edge u\text{–}v is fixed (σ swaps its two endpoints). On the four leaves, σ acts as a 4-cycle r_1 → l_1 → r_2 → l_2 → r_1 (green arrows, numbered). Since σ^2 swaps r_1 ↔ r_2 and l_1 ↔ l_2 — which is not the identity — but σ^4 = \text{id}, the order of σ is exactly 4. The Unique Fixed Edge Lemma still holds: there is exactly one fixed edge, the central one.

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.

Exercise 10 (★)

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.


⁂   ⁂   ⁂

End of Tutorial #14. Next in the series: Tutorial #15, "Lattice paths and the cycle lemma."