Structural and algebraic results (faithfulness, coordinate fields, flex dimension, explicit drawings with 231 crossings) are formalized in Lean 4 with Mathlib, about 3,400 lines.
Abstract
The Hamming graph H(d,3)=K_3^{box d} (n=3^d vertices) is the graph of single-symbol errors of ternary codes. Can it be drawn in the plane with every edge one unit long and no two non-adjacent vertices a unit apart? It can, for every d, joining two problems into one. Arithmetic: over which coordinate fields is it realizable? As a Minkowski sum of unit triangles, each H(d,3) has a (d-1)-parameter continuum of faithful realizations, whose field climbs the constructibility hierarchy (ruler-and-compass, origami, and beyond); the coordinate field is a number field only at countably many angles, so the graph has no canonical coordinate field. Combinatorial: beside the crossing number cr we introduce the unit-distance crossing number udcr(G), the fewest crossings over faithful unit drawings, so cr <= rcr <= udcr. We prove cr(H(d,3))=Theta(n^2) (one-page 7/6 n^2 above, with an exact closed form; spectral bisection Omega(n^2) below) and cr <= 2/3 n^2 via a two-page book layout; and udcr(H(d,3))=O(n^2 log n), with explicit upper bounds such as udcr(H(3,3)) <= 231 (conjecturally exact). A structure theorem makes every faithful planar realization a Minkowski sum, so the realization variety is an explicit (d-1)-parameter flex, of exact dimension d-1 at every Minkowski realization, containing the udcr optimum; the matching udcr=Omega(n^2 log n) is the central open problem. All explicit drawings and counts are verified in exact arithmetic with reproducible code, and the structural and algebraic results are formally verified in Lean 4 (github.com/haroldosfilho/HammingUDG).
Problem
The paper asks whether the Hamming graphs H(d,3) can be drawn in the plane as faithful unit-distance graphs, and over which coordinate fields this is possible. It also asks how many crossings such drawings need, via a new unit-distance crossing number udcr.
Approach
Vertices are placed at Minkowski sums of unit equilateral triangles. This gives a (d-1)-parameter flex of faithful realizations whose coordinate fields range across the ruler-and-compass, origami and exotic tiers. Crossing numbers are bounded using book layouts and spectral bisection. Explicit drawings are checked in exact arithmetic, and the structural and algebraic results are formalized in Lean 4 with Mathlib.
Figure 6: The faithful realizations of H(3,3) . Left: the faithfulness diagram over the two-parameter flex (\alpha_{v},\alpha_{w}) (bright = robustly faithful cells, safely off every ghost curve at the plotted tolerance; dark = the ghost curves themselves, a measure-zero set thickened for visibility). Right: four realizations of the same graph: ruler-and-compass \mathbb{Q}(\sqrt{2},\sqrt{3}) at (4
Results
H(d,3) is faithfully realizable for every d, and every faithful planar realization is a Minkowski sum. The crossing number satisfies cr = Theta(n^2) and udcr = O(n^2 log n), with udcr(H(3,3)) <= 231. The Lean formalization has no sorry; the asymptotic crossing bounds are not formalized.
Figure 11: Faithfulness of H(3,3) in \mathbb{R}^{3} : a generic two-parameter slice of the nine-dimensional spatial flex (turning two of the three unit triangles about fixed generic axes). Bright is robustly faithful (about 32\% of the sampled cells at the plotted tolerance); as in the plane, faithfulness fails only on a measure-zero set of ghost surfaces. The full spatial family of faithful reali