The Same Shape of Math Is Why Your Brain Can Navigate a Room and Why Your Password Survives a Quantum Computer

There’s a genuinely striking coincidence sitting at the center of two completely unrelated scientific stories. In 2005, researchers May-Britt and Edvard Moser discovered a class of neurons in the brain’s entorhinal cortex that fire in an almost impossibly tidy pattern: as an animal moves through space, each “grid cell” activates at multiple locations arranged in a perfect hexagonal lattice, tiling the environment like a honeycomb. It’s one of neuroscience’s most mathematically elegant discoveries, and it earned a Nobel Prize. Around the same broad era, cryptographers building the next generation of encryption, designed to survive attacks from quantum computers, settled on a completely different-sounding foundation: the near-impossible difficulty of finding the shortest vector in a high-dimensional lattice. Both fields, in other words, built something important out of lattices. What makes the comparison worth taking seriously rather than dismissing as wordplay is that both are using, quite precisely, the same underlying mathematical object — and getting opposite kinds of value out of it, for a single, identifiable reason.

Scientific Foundation

Grid cells in the medial entorhinal cortex fire in a hexagonal pattern for a reason that turns out to be mathematically exact rather than merely elegant-looking. A hexagonal, or triangular, lattice is the provably densest possible way to pack points into a two-dimensional plane, a classical result with roots going back to Lagrange — its packing ratio, π divided by the square root of 12, beats a simple square grid by a specific, calculable margin. Formal information-theoretic analysis of grid cell coding makes this precise: a hexagonal arrangement of firing fields outperforms a square lattice arrangement by about 15.5 percent in Fisher Information, a rigorous measure of how much spatial information a neural population can encode with a given density of cells. Evolution, in other words, didn’t stumble onto a decent solution to the problem of representing space efficiently with a limited number of neurons. It converged on the actual, mathematically optimal one — a global maximum, not a local compromise.

Lattice-based cryptography, the leading family of encryption schemes designed to resist attacks from future quantum computers, rests on a structurally related but functionally opposite mathematical foundation. Its security depends on the presumed difficulty of the Shortest Vector Problem: given an arbitrary description of a lattice in many dimensions, find its shortest nonzero vector. Standards now adopted by the U.S. National Institute of Standards and Technology, including CRYSTALS-Kyber and CRYSTALS-Dilithium, along with related schemes like NTRU and Falcon, all ultimately lean on some version of this same hard problem or its close cousins, the Closest Vector Problem and Learning With Errors. Decades of dedicated cryptanalytic effort, including specifically quantum algorithms designed to attack it, have failed to find an efficient solution, and researchers now hold as a working conjecture that no polynomial-time algorithm, classical or quantum, exists for approximating it well.

Cross-Domain Connection

Here’s the genuinely precise, non-obvious link: both fields are working with essentially the same mathematical object, a lattice, and a version of the same question — what is the shortest, or densest, or most efficient arrangement of vectors within it — but they get radically different answers to “how hard is this problem” purely as a function of one variable: dimension. In two dimensions, the dimension grid cells operate in, the densest-lattice problem is completely solved, has been for centuries, and is computationally trivial to find — you can derive the hexagonal answer by hand. Evolution exploited exactly that tractability, building an efficient neural coding scheme around a problem simple enough for biology to stumble into and refine through selection. Cryptography operates in the opposite regime entirely: security researchers are explicit that lattice dimension has to be pushed well over 300 for these problems to remain hard — below roughly dimension 80, the shortest vector problem is considered easy, and easy is exactly what cryptography can’t use. The same family of problems that biology solved effortlessly at dimension 2 becomes, at dimension 300-plus, one of the most computationally resistant problems known to mathematics, with no proven optimal answer even in principle for most of those dimensions. The identical mathematical machinery flips from “an efficiently exploitable resource” to “the wall security is built on,” purely because of how many directions you’re allowed to move in.

There’s a second, sharpening point of contrast worth naming. Grid cells want maximal symmetry and regularity — a perfectly repeating hexagonal tiling is literally the target evolution converged on. Cryptographic lattices generally want the opposite: security proofs explicitly rely on lattices being effectively random and hard to describe compactly, because an attacker who could exploit hidden regularity or structure in a lattice could potentially find short vectors far faster than the hardness assumption allows. Some efficient real-world schemes, like NTRU and Ring- or Module-LWE variants, do deliberately introduce algebraic structure for speed, and this remains a genuinely live, debated tradeoff in the field — structured lattices are more efficient to implement but carry a documented, acknowledged risk that their structure could someday be exploited in ways unstructured lattices can’t be. Grid cells never face that tradeoff at all; there’s no adversary trying to break a rat’s sense of location by exploiting the regularity of its own neural code.

What Remains Undemonstrated

No published research connects grid cell neuroscience to lattice-based cryptography directly — this is a novel synthesis built from reading both literatures side by side, not an established finding in either field. It’s also worth tempering the “provably optimal” framing on the biology side: the Fisher Information optimality result for hexagonal grid cells is a property of a formal mathematical model of grid coding, and real biological grid cell modules show measurable noise, distortion, and organization into several discrete modules at different scales rather than one perfect, infinite hexagonal lattice — the brain approximates the mathematically optimal solution rather than implementing it with geometric perfection. And the claim that high-dimensional lattice packing is generally unsolved needs one honest exception: a small number of special dimensions, most famously 8 and 24, do have proven, celebrated optimal solutions, including Maryna Viazovska’s landmark 2016 proof for dimension 8. But the dimensions cryptography actually operates in, in the hundreds, remain firmly in the vast, unsolved territory outside those rare exceptions — which is precisely why they’re useful for security.

Why It Matters

The value here isn’t a cute coincidence about honeycombs and encryption. It’s a genuinely clarifying way to understand something true and underappreciated about mathematics itself: the exact same structure, a lattice, and the exact same category of question about it, can be either a source of elegant, efficient design or a source of unbreakable computational hardness, with nothing separating the two but scale. Low-dimensional lattice problems are solved, exploitable, and biology found the solution on its own. High-dimensional lattice problems remain unsolved, resistant, and human cryptographers built an entire security paradigm on that resistance. It’s a rare, clean illustration of how a single parameter can flip a mathematical object’s practical meaning entirely.

Human Dimension

There’s something worth sitting with in the image of a rat’s brain and a quantum-resistant encryption algorithm both reaching for a lattice, for exactly opposite reasons. One system needed a problem simple enough to be discoverable by blind evolutionary tinkering, and found the most elegant possible answer waiting at dimension two. The other needed a problem hard enough to resist the smartest adversaries and the fastest computers humanity can build, and found that same mathematical family becomes essentially unconquerable once you give it enough room to spread out. The lattice didn’t change. Only how many directions it was allowed to stretch into did — and that turned out to be the entire difference between a shortcut and a wall.

Sources:

1. Neuron (Cell Press) — “A unified theory for the computational and mechanistic origins of grid cells” — https://www.cell.com/neuron/fulltext/S0896-6273(22)00907-2

2. arXiv — “Probable nature of higher-dimensional symmetries underlying mammalian grid-cell activity patterns” — https://arxiv.org/pdf/1411.2136

3. Emergent Mind — “Hexagonal-Toroidal Grid Cells” — https://www.emergentmind.com/topics/hexagonal-toroidal-organization-of-grid-cells

4. PMC (National Institutes of Health) — “Grid Cell Firing Patterns Maintain their Hexagonal Firing Patterns on a Circular Track” — https://www.ncbi.nlm.nih.gov/pmc/articles/PMC10543478/

5. arXiv — “Post-Quantum Cryptography Algorithms Standardization and Performance Analysis” — https://arxiv.org/pdf/2204.02571

6. arXiv / MDPI — “Some Mathematical Problems Behind Lattice-Based Cryptography” — https://www.mdpi.com/2410-387X/10/1/10

7. IACR ePrint Archive — “Lattice-based Cryptography: A survey on the security of the lattice-based” — https://eprint.iacr.org/2025/304.pdf

8. ScienceDirect — “From hardness assumptions to energy-secure protocols: A systematic survey of Euclidean lattice-based cryptography” — https://www.sciencedirect.com/science/article/abs/pii/S004579062600039X

9. arXiv — “The Mathematical Foundation of Post-Quantum Cryptography” — https://arxiv.org/pdf/2404.19186

Idea originated at artificialideas.org. Article researched and written by Claude Sonnet 5. Published at artificialideas.org.