◀ THE FOLD0ROOT.AI // WORLD II · LOOT · THE INVENTORY◆ .dlw.fold
THE FOLD / LOOT / THE INVENTORY / THE HILBERT CURVE

THE HILBERT CURVE

one line that fills the plane, keeping neighbors near
1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION
The Hilbert curve is a space-filling curve: a single continuous line that visits every cell of a 2k×2k grid exactly once, and — crucially — consecutive cells on the line are always grid-neighbors (one step apart). That locality means points close along the 1-D curve are usually close in 2-D, which is why databases and image formats use the Hilbert index for spatial locality. The map index ↔ (x,y) is a pure bit-twiddle with rotations.

LIT verified live: for grids up to 64×64 the index↔(x,y) map is a bijection, and every pair of consecutive indices lands on cells at Manhattan distance 1 (window.__hilbert). FIG no framing; exact.
2 HOW IT WAS WEAVED · AI + HUMAN
David (human) seated this at the-inventory — the flat index over a 2-D grid that keeps neighbors near, the way a well-ordered inventory keeps like beside like. The Hilbert curve is that locality-preserving index. AVAN (AI) built the instrument: the d→(x,y) and (x,y)→d bit-rotations, the bijection check, and the adjacency check.

Credit as content: David Hilbert (1891). The weave: David names the inventory; I fold the 1-D index into 2-D with quadrant rotations and confirm it visits every cell once, with each step landing on a neighbor.
3 ONE DIMENSION
The order-1 U-shape is copied into each quadrant, two copies rotated, and joined end to end — recursively. The result is one unbroken path where every step moves to an adjacent cell.
4 TWO DIMENSIONS · INTERACTIVE
The Hilbert curve at a chosen order; the index↔(x,y) bijection and the step-1 adjacency are checked over the whole grid.
5 THREE DIMENSIONS + AVAN’S INVERSE
The green forward object: a 1-D order that preserves 2-D locality.
AVAN’s addition (the inverse-companion): lay a single line through a 2-D grid so that consecutive points stay grid-neighbors — fold the index into (x,y) with recursive quadrant rotations. The inverse of ‘scan row by row, where the end of one row jumps far from the next’ is ‘a Hilbert fold, where every step stays adjacent.’ Magenta is the long row-end jumps of raster order; green is the always-adjacent Hilbert path. Nearby on the line, nearby in the plane.
LIT Genuine Hilbert space-filling curve (Hilbert 1891). Verified live: for grids N x N with N up to 64, d2xy and xy2d are exact inverse bijections over all N^2 indices, and every pair of consecutive indices d, d+1 maps to cells at Manhattan distance exactly 1 (window.__hilbert.bijection && .adjacent).

FIG No framing: the d->(x,y) and (x,y)->d bit-rotations, the bijection check, and the step-1 adjacency check run in-browser over the whole grid and hold. The AVAN inverse is honest — folding the 1-D index into 2-D with recursive quadrant rotations gives an order where every step stays adjacent, so nearby on the line means nearby in the plane; magenta is the long row-end jumps of raster order, green the always-adjacent Hilbert path.
◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE INVENTORY · David Lee Wise (ROOT0), with AVAN