← All papers
First page of A proof of Lehmer's permutation conjecture for neighbor-swap graphs

A proof of Lehmer's permutation conjecture for neighbor-swap graphs

Tom Verhoeff

math.CO Oct 1, 2026 · v1 cs.DM cs.LO
The combinatorial proof of the reformulated Lehmer conjecture, including the hypercube gluing constructions, is formalized in Lean 4 over Mathlib.
In 1965, D. H. Lehmer conjectured that the permutations of every multiset admit an imperfect Hamiltonian traversal by adjacent swaps: a walk in the neighbor-swap graph that visits every word, with some words visited twice in order to reach a neighbor and return. The question is posed as an unsolved research problem in Knuth's Art of Computer Programming. Verhoeff (2017) chose the stutter words, in which every domino is a double, as the words to be reached this way, and reformulated the conjecture as the Hamiltonicity of the graph $N(S)$ on the non-stutter words, with two exceptional families — binary signatures with an odd multiplicity, and the permutations of $(2k,1,1)$ — that admit a Hamiltonian path but no cycle. This article proves the reformulated conjecture, and with it Lehmer's conjecture. The key structure is a partition of the words into hypercubes: the swaps inside dominoes turn each class of words with the same domino contents into a hypercube, and the stutters are exactly the $0$-dimensional classes. When every multiplicity is even, Hamiltonian cycles of the hypercubes are glued along a spanning tree, with no finite check. The case of exactly one odd multiplicity reduces to the all-even case and to a theorem of Stachowiak (1992), the one inherited Hamiltonicity input, which also settles two or more odd multiplicities. The only finite ingredients are two explicit cycles, of 28 and 84 words. Every construction is implemented in Python and checked against brute-force graphs, and the proof is formalized in Lean 4 over Mathlib.

Lehmer (1965) conjectured that the permutations of every multiset admit an imperfect Hamiltonian traversal by adjacent swaps. The problem is listed as unsolved in Knuth's TAOCP. Verhoeff reformulated it as Hamiltonicity of the non-stutter subgraph N(S), with two exceptional families.

Words are partitioned into hypercubes by domino contents, and stutters are the 0-dimensional classes. In the all-even case, boustrophedon Hamiltonian cycles of the hypercubes are glued along a spanning matching tree. The one-odd case reduces to the all-even case and to Stachowiak's theorem, which also covers two or more odd multiplicities. The family (2j,2,1) is handled by a grid construction. Constructions are checked in Python against brute-force graphs, and the proof is formalized in Lean 4 with Mathlib.

The reformulated conjecture is proved, and with it Lehmer's conjecture. The exceptional families are shown to be exact. The only finite ingredients are two explicit cycles, of 28 and 84 words.