A book proof of the middle levels theorem

We give a short constructive proof for the existence of a Hamilton cycle in the subgraph of the $(2n+1)$-dimensional hypercube induced by all vertices with exactly $n$ or $n+1$ many 1s.

The n-dimensional hypercube Q n is the graph that has as vertices all bitstrings of length n, and an edge between any two bitstrings that differ in a single bit.The weight of a vertex x of Q n is the number of 1s in x.The kth level of Q n is the set of vertices with weight k.
Theorem 1.For all n ≥ 1, the subgraph of Q 2n+1 induced by levels n and n + 1 has a Hamilton cycle.
Theorem 1 solves the well-known middle levels conjecture, and it was first proved in [Müt16] (see this paper for a history of the problem).A shorter proof was presented in [GMN18] (12 pages).Here, we present a proof from 'the book'.
Proof.We write D n for all Dyck words of length 2n, i.e., bitstrings of length 2n with weight n in which every prefix contains at least as many 1s as 0s.We also define D := n≥0 D n .Any x ∈ D n can be decomposed uniquely as x = 1u0v with u, v ∈ D. Furthermore, Dyck words of length 2n can be identified by ordered rooted trees with n edges as follows; see Figure 1: Traverse the tree with depth-first search and write a 1-bit for every step away from the root and a 0-bit for every step towards the root.For any bitstring x, we write σ s (x) for the cyclic right rotation of x by s steps.We write A n and B n for the vertices of Q 2n+1 in level n or n + 1, respectively, and we define and s ∈ {0, . . ., 2n} we define ⟨x, b, s⟩ := σ s (xb).Note that we have Thus, we think of every vertex of M n as a triple ⟨x, b, s⟩, i.e., an ordered rooted tree x with n edges referred to as the nut, a bit b ∈ {0, 1}, and an integer s ∈ {0, . . ., 2n} referred to as the shift.
The second step is to glue the cycles of the factor F n to a single Hamilton cycle.We call an ordered rooted tree x ∈ D n pullable if x = 110u0v for u, v ∈ D, and we define p(x) := 101u0v ∈ D n .We refer to p(x) as the tree obtained from x by a pull operation.In words, the leftmost leaf of x is in distance 2 from the root, and the edge leading to this leaf is removed and reattached as the new leftmost child of the root in p(x); see Figure 3.For any pullable tree x = 110u0v ∈ D n with u, v ∈ D, we define y := ⟨x, 0, 0⟩ = x0 and z := ⟨p(x), 0, 0⟩ = p(x)0, and we consider the 6cycle G(x) := (y, f (y), f 6 (y), f 5 (y), z, f (z)) = (110u0v0, 110u1v0, 100u1v0, 101u1v0, 101u0v0, 111u0v0), which has the edges (y, f (y)) and (f 6 (y), f 5 (y)) in common with the cycle C(y), and the edge (z, f (z)) in common with the cycle C(z); see Figure 4. Consequently, if C(y) and C(z) are two distinct cycles, then the symmetric difference between the edge sets of C(y), C(z) and G(x) is a single cycle on the same set of vertices, i.e., G(x) glues the cycles C(y) and C(z) together.We define S(x) := {f i (y) | i = 0, . . ., 6} ∪ {z, f (z)}, and we claim that for any two pullable trees x ̸ = x ′ , we have S(x) ∩ S(x ′ ) = ∅, i.e., the cycles C(x) and C(x ′ ) are (vertex-)disjoint.To see consider the shifts of the vertices in S(x) and S(x ′ ), which are 0, 1, 1, 2, 2, 3, 3, 0, 1.It follows that if S(x) ∩ S(x ′ ) ̸ = ∅, then we have x = x ′ , p(x) = x ′ , or x = p(x ′ ).These cases are ruled out by the assumption x ̸ = x ′ , the fact that p(x) = 10 • • • and x ′ = 11 • • • differ in the second bit, and that x = 11 • • • and p(x ′ ) = 10 • • • differ in the second bit, respectively.
To complete the proof, it remains to show that the cycles of the factor F n can be glued to a single cycle via gluing cycles G(x) for a suitable set of pullable trees x ∈ D n .As argued before, none of the gluing operations interfere with each other.Using the interpretation of the cycles of F n as equivalence classes of ordered rooted trees under tree rotation, it suffices to prove that every cycle can be glued to the cycle that corresponds to the star with n edges.As each gluing cycle corresponds to a pull operation, this amounts to proving that any ordered rooted tree x ∈ D n can be transformed to the star (10) n via a sequence of tree rotations and/or pulls.Indeed, this is achieved as follows: We fix a vertex c of x to become the center of the star (this vertex never changes), and we repeatedly perform the following three steps; see Figure 5: (i) rotate x to a tree x ′ such that c is root and the leftmost leaf of x ′ is in distance d > 1 from c; (ii) apply d − 2 rotations to x ′ to obtain a tree x ′′ whose leftmost leaf has distance 2 from the root; (iii) perform a pull.As step (iii) decreases the sum of distances of all vertices from c, we reach the star after finitely many steps.
This completes the proof of the theorem.□

Figure 1 .
Figure 1.A Dyck (left) and the corresponding ordered rooted tree (right).

iii) p Figure 5 .
Figure 5. Illustration of steps (i)-(iii) that make a tree more star-like.