Covering hypercubic grids by polygonal trails: capacity bounds and the optimum for $P(4,3)$
Aldo Roberto Pessolano, Marco Ripà
math.GM
Nov 17, 2026 · v1
TL;DR
Capacity theorem, large-grid lower bound, and boxed construction are verified in Lean 4 with Mathlib; finite exclusions are checked via native_decide reflection.
Abstract
The classical nine-dot puzzle asks for a polygonal trail through a square grid using as few segments as possible. We study its higher-dimensional analogue on $P(n,k):=\{0,\ldots,n-1\}^k$ for integers $n,k\ge2$, allowing arbitrary real vertices and unrestricted segment directions, and denote the minimum number of segments by $h(n,k)$. For $n\ge3$ and $k\ge2$, we give a geometric proof of the previously stated capacity bound: a trail of $r\ge1$ segments meets at most $1+r(n-1)$ grid points. Refinements of this bound, combined with exhaustive finite checks, establish $h(4,3)=23$ and $h(5,3)\ge32$. We also exhibit a $22$-segment trail through $63$ points of $P(4,3)$, the maximum possible, and a $23$-segment covering trail contained in $[0,4]^3$, which settles the corresponding box-constrained problem. The general capacity theorem, a large-grid lower bound refuting a previously proposed formula for $h(n,k)$, and the boxed construction are verified by the Lean 4 kernel, whereas the finite exclusions use native reflection and additionally trust the native compiler and runtime. A companion technical note provides the computational specification and reproducible proof artifacts.
Problem
The work studies the higher-dimensional nine-dot puzzle: find the minimum number h(n,k) of segments in a polygonal trail covering the grid {0,...,n-1}^k. Vertices may be arbitrary real points and segment directions are unrestricted.
Approach
A geometric least-counterexample argument proves the capacity bound that an r-segment trail meets at most 1+r(n-1) grid points. Refined capacity bounds for P(4,3) and P(5,3) reduce the problem to finite predicates over oriented segment states, which are settled by exhaustive search. The general theorem, the reductions, and the constructions are formalized in Lean 4 with Mathlib. The finite checks use native_decide, which also trusts the compiler and runtime.
Results
The authors establish h(4,3)=23 and h(5,3)≥32. They give a 22-segment trail through 63 points of P(4,3) and a 23-segment covering trail inside [0,4]^3, and a large-grid lower bound refutes a previously proposed formula for h(n,k).
| n \ k | 2 | 3 | 4 | 5 |
|---|
| 2 | 3 | 6 | 12 | 24 |
| 3 | 4 | 13 | 40 | 121 |
| 4 | 6 | **23** | [85,95] | [341,383] |
| 5 | 8 | [**32**,36] | [156,184] | [781,924] |
Known values and bounds for h(n,k) (rows n, columns k)