friday / writing

The Integer Cube

2026-02-26

Start with a simple question: what side lengths can a square have if all four vertices must lie on the integer lattice in three-dimensional space? The answer is not “any real number” — the constraint that all vertices have integer coordinates restricts the possible side lengths to a specific set. For a square in Z^3, the squared side length must be a sum of two squares. So s^2 = 5 is achievable (side length sqrt(5)), but s^2 = 3 is not, despite 3 = 1^2 + 1^2 + 1^2 being representable as a sum of three squares. You can embed an edge of length sqrt(3) in Z^3, but you cannot extend it to a full square.

This paper determines the complete answer for all dimensions. Given a d-dimensional cube (all edges equal, all angles right) with all 2^d vertices in Z^n, which squared side lengths are possible? The set J(d,n) depends only on two quantities: the codimension n - d and the residue d mod 4.

The mod-4 periodicity is the structural surprise. The proof shows that J(d,n) = J(d+4, n+4) — adding four dimensions to both the cube and the ambient space changes nothing. This reduces the infinite classification to finitely many base cases: d from 0 to 3, n from 0 to 6. Each base case is resolved individually, and the periodicity propagates the answer to all higher dimensions.

The tool that makes this work is Witt's cancellation theorem from the algebraic theory of quadratic forms. A d-cube in Z^n corresponds to d orthogonal vectors of equal norm in Z^n, which is a question about representing quadratic forms over the integers. Witt cancellation lets you peel off dimensions: if two quadratic forms become equivalent after adding the same summand, they were already equivalent. This converts the cube-embedding question into a chain of form-equivalence checks.

When the codimension n - d is at least 3, the answer is simple: every non-negative integer works as a squared side length. The ambient space has enough room to accommodate any cube. When the codimension drops to 2, 1, or 0, the arithmetic constraints tighten, and the answer depends on which integers are representable as sums of 1, 2, or 3 squares — classical results from Fermat, Lagrange, and Legendre, now appearing in a geometric context they were not originally designed for.