Stack oranges in a flat box and let them settle. They will not settle randomly: the bottom layer forms a triangular grid, each orange touching six neighbours, and the next layer rests in the pockets between every three oranges below. The result is the pattern grocers have used for centuries and that any child instinctively rediscovers. The question, posed by Johannes Kepler in 1611, is whether this pattern is optimal: is there any other way to pack equally-sized spheres in three-dimensional space that achieves a higher density?
Kepler thought not, and recorded his guess in a small treatise on the geometry of snowflakes. The density of his proposed arrangement — the face-centred cubic packing, the same as hexagonal close packing — is
about of space filled with the spheres themselves and left as gaps. The Kepler conjecture is the assertion that no packing can do better. It sat as one of the most famous unproven statements in geometry for three hundred and ninety-eight years. The proof, when it finally came, was such a tour de force of computer-aided verification that the referees were unable to certify it as correct without a separate decade-long formal verification project. This article tells that story, sketches what makes the problem so hard, and looks briefly at the spectacular recent progress in higher dimensions.
The two-dimensional warm-up
Before tackling three dimensions, consider the analogous question in the plane: what is the densest way to arrange equal circles so that no two overlap?
Two natural candidates suggest themselves. The square packing lines circles up in a grid, each one touching four neighbours. Its density is . The hexagonal packing offsets each row by half a circle-width, so each circle touches six neighbours. Its density is — substantially higher.
The hexagonal packing wastes much less space. Each circle nestles into the gaps between three others, and the empty triangles between them are much smaller than the empty squares of the grid arrangement. The fact that the hexagonal packing is provably optimal in the plane was established by Axel Thue in 1890 and made rigorous by László Fejes Tóth in 1940 — about three centuries later than the two-dimensional version of Kepler’s question was posed by Thomas Harriot. Even the planar case took a long time.
Why three dimensions is hard
Now go up to three. The face-centred cubic stack of oranges places each orange in the pocket between three below it, and three above, so each orange touches twelve neighbours — six in its own layer, three above, three below. Calculation gives the density .
It is easy to see one surprising fact: the same density is achieved by infinitely many different stacking sequences. The orange grocer could shift each successive layer one way or the other relative to the one below, producing a family of equally-dense packings collectively known as the Barlow packings. So there is no unique “densest” arrangement, only a unique densest density.
The difficulty of proving that no packing does better lies in the fact that the proof must rule out every possible arrangement, including bizarre non-periodic ones in which the local geometry varies from place to place. Local arguments by themselves do not work, because there exist local clusters of unit balls — and even — that are denser than the corresponding cluster in the face-centred cubic packing. The Kepler conjecture is not the statement that the optimal local density is achieved by close packing; it is the statement that the optimal global density is. This distinction is what makes the problem so subtle.
Thomas Hales’s 1998 proof
Thomas Hales had been working on the conjecture since the 1980s. By the late 1990s he had developed a strategy with his student Samuel Ferguson: reduce the problem to a finite check by exploiting a clever combinatorial decomposition of three-space called a Voronoi-related decomposition. The decomposition assigns each sphere a small polyhedron, and one shows that if a packing has density above , then at least one of these polyhedra must violate a particular inequality from a finite list of candidates.
The catch is that the finite list runs to several thousand inequalities, each one a complicated nonlinear constraint on positions of nearby spheres, and each one had to be checked by extensive computer calculation. Hales’s proof, announced in 1998 and published in the Annals of Mathematics in 2005, ran to about three hundred pages of mathematics plus three gigabytes of computer code and output. The referees spent four years reviewing it and ultimately declared they were ” certain” of its correctness, while explicitly stating they could not vouch for every line of the computer-assisted part.
Hales took the unusual step of starting a project called Flyspeck to translate his proof into a form that a computer proof assistant could check completely. The project ran from 2003 to 2014 with contributions from many mathematicians; when it finished, the formal verification was airtight. The Kepler conjecture, after years, had become the Kepler theorem: no packing of equal spheres in three-space can exceed the density .
Dimensions 8 and 24: a different miracle
Three-dimensional sphere packing is now closed. But what about other dimensions? Mathematicians have asked the same question — what is the maximal density of a packing of equal spheres in ? — for every , and for most dimensions the answer is unknown. The gap between the best lower and upper bounds typically widens with .
There are two extraordinary exceptions. In dimension there exists a lattice called , discovered in the 19th century in connection with Lie algebras, whose associated sphere packing has astonishing density and symmetry. In dimension there exists the Leech lattice, discovered by John Leech in 1965, which similarly looks like it could be optimal. For half a century, both were strongly conjectured to give the maximum packing densities in their dimensions, but no proof was in sight.
In 2016 the Ukrainian mathematician Maryna Viazovska stunned the mathematical world with a fifteen-page paper that proved is optimal in dimension . Her method was completely different from anything used in three dimensions: she used the theory of modular forms — complex-analytic objects related to the symmetries of the upper half-plane — to construct a so-called magic function whose properties forced the bound. Within a week of her paper appearing, she and four collaborators (Henry Cohn, Abhinav Kumar, Stephen Miller, Danylo Radchenko) extended the construction to dimension and proved the Leech lattice is optimal there. In 2022 Viazovska was awarded the Fields Medal for these results.
The astonishing fact is that this method works perfectly in exactly two dimensions, and , and stubbornly does not work in any other. The magic functions that make the proof tick exist only in these dimensions, related to the existence of and the Leech lattice. The intermediate dimensions are not amenable to the same approach, and the densest packings there remain unknown.
What sphere packing is good for
The applications are surprisingly concrete. Every error-correcting code is essentially a sphere packing in a discrete high-dimensional space, where each codeword is the centre of a sphere and the radius is the maximum number of bit-flips the code can survive. Denser packings give better codes, capable of distinguishing more codewords at a given error tolerance. The and Leech lattices are not just curiosities; lattices closely related to them are used in real-world high-rate communication systems. The mathematics of optimal sphere packings is the mathematics of optimal codes, with a direct line to data transmission and storage.
In crystallography, atomic arrangements often realise close packings of metal atoms, and the geometry of such packings governs material properties like density and ductility. The lattice appears in string theory and in the structure of certain exceptional Lie groups, while the Leech lattice has connections to the largest sporadic finite simple group (“the monster”) and to the moonshine conjecture proved by Richard Borcherds in 1992.
A problem about stacking oranges, posed by Kepler in a pamphlet on snowflakes in 1611, turned out to be the gateway to some of the deepest mathematics of the twenty-first century — and remains one of the few classical conjectures from the seventeenth century where the answer is now known. The grocer was right all along, and proving it took mathematicians nearly four centuries.
Frequently asked
What was Kepler's conjecture exactly?
In 1611 Johannes Kepler published a small treatise called 'De Nive Sexangula' — 'On the six-cornered snowflake' — in which he asserted, without proof, that no arrangement of equally-sized spheres in three-dimensional space can be denser than the familiar face-centred cubic packing used by grocers stacking oranges. The maximum density he claimed is π/(3√2) ≈ 74.05%. The conjecture sat almost untouched for centuries; it was Hilbert's 18th problem (1900) and one of the most famous open questions in geometry until Thomas Hales settled it in 1998.
Why did the proof take 398 years?
Because the configuration space of sphere packings is vast and non-rigid. A naïve approach has to consider infinitely many arrangements, with no obvious way to reduce to a finite check. Hales reduced the problem to verifying a few thousand inequalities about a small number of special arrangements, then verified them by computer. The proof was so dependent on computer calculation that the referees of the Annals of Mathematics could only certify it as '99% certain'; a complete formal verification by the Flyspeck project, which checked every step inside a proof assistant, was finished only in 2014.
What is special about dimensions 8 and 24?
In most dimensions the densest known sphere packing is unknown, and the gap between best upper and lower bounds is large. But in dimensions 8 and 24 there exist extraordinarily symmetric lattices — the E8 lattice and the Leech lattice — that are conjectured to give the optimum. In 2016 Maryna Viazovska of Ukraine proved that E8 is indeed optimal in dimension 8, using a stunning argument with modular forms. Within a week she and four collaborators extended the method to dimension 24 and the Leech lattice. These remain the only dimensions above three where the sphere-packing problem has been completely solved.
Where does sphere packing actually matter?
Everywhere data needs to be transmitted reliably or compressed efficiently. Error-correcting codes are essentially sphere packings in high-dimensional discrete spaces — codewords are sphere centres, and the radius is the distance the code can tolerate. Modern wireless communication, deep-space probes, and CDs all use codes derived from optimal lattices. Crystallography and the theory of molecular structures uses sphere packings to model atomic arrangements. The 24-dimensional Leech lattice in particular has astonishing connections to monstrous moonshine, the largest sporadic finite simple group, and string theory.