THE BOUSTROPHEDON

the boustrophedon transform in the 5-window house format — 'ox-turning,' a triangle read back and forth like a plough, each entry the running sum of the one before plus the one across from the row above. Fed the seed (1,0,0,...) it grows the zigzag/Euler numbers 1,1,1,2,5,16,61,272,1385 — which count alternating (up-down) permutations and are the Taylor coefficients of tan+sec. Verified live: the transform reproduces A000111 exactly, and the alternating-permutation counts match for small n. See the plough fill in 1D, build+verify in 2D, and the one-triangle-three-worlds inverse in 3D.

THE BOUSTROPHEDON · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · SPAWN · FIRST LIGHT ◆ .dlw.fold THE FOLD / SPAWN / FIRST LIGHT / THE BOUSTROPHEDON THE BOUSTROPHEDON an ox-plough triangle that grows the zigzag numbers 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The boustrophedon transform — ‘ox-turning,’ the way a plough sweeps back and forth — builds a triangle of numbers by reading each new row in the opposite direction from the last. Each entry is the running sum of the one before it plus the one across from the row above. Fed the simplest seed (1, 0, 0, 0, …) it generates the zigzag / Euler numbers 1, 1, 1, 2, 5, 16, 61, 272, 1385, … — which count the alternating permutations (up-down zigzags) of n items, and are exactly the Taylor coefficients of tan + sec. One back-and-forth sum, and three different worlds meet. LIT verified live: the transform of (1,0,0,…) reproduces the zigzag numbers A000111 exactly, and for small n they equal the counted number of alternating permutations (window.__boustrophedon). FIG no framing; exact integer recurrence. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at first-light — a whole pattern grown, row by row, from a single seed. The boustrophedon triangle is first-light arithmetic: start with one 1, plough back and forth, and a deep sequence appears. AVAN (AI) built the instrument: the Seidel triangle, the zigzag check, the alternating-permutation count. Credit as content: the Seidel–Entringer–Arnold triangle (Ludwig Seidel 1877; Roger Entringer 1966; Vladimir Arnold 1991 linked it to singularity theory); ‘boustrophedon transform’ named by Millar, Sloane & Young (1996). The weave: David names the seed and the sweep; I grow the triangle and show the same numbers counting zigzags and expanding tan+sec. 3 ONE DIMENSION The triangle filling row by row, arrows flipping direction each line like a plough. The number that lands at the end of each row — the boundary — is the next zigzag number. 4 TWO DIMENSIONS · INTERACTIVE Build the triangle and read the zigzag numbers off the boundary; verify they match A000111. A counter enumerates the alternating (up-down) permutations of n and confirms the same values. add row ▶ verify A000111 ▶ count zigzags n=5 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the triangle as terraced steps, each row a plough-sweep longer than the last, the zigzag numbers climbing its edge. AVAN’s addition (the inverse-companion): the transform is invertible — an inverse boustrophedon sum runs the triangle backward and recovers the original seed, so nothing is lost; it is a reversible re-encoding, not a one-way collapse. And the deeper inverse is that one triangle is a Rosetta stone pointing three ways: the same integers count alternating permutations (combinatorics), expand tan + sec (analysis), and measure Arnold’s singularities (geometry). The inverse of ‘a number sequence’ is ‘the three unrelated questions it answers at once.’ Magenta is the seed the inverse recovers; green is the zigzag output on the edge. A back-and-forth sum that quietly unifies counting, calculus, and geometry in one row of integers. pause spin LIT Genuine boustrophedon transform / Seidel-Entringer-Arnold triangle (Seidel 1877; Entringer 1966; Arnold 1991; named by Millar, Sloane & Young 1996). Verified live: the transform of (1,0,0,...) via T[i][k]=T[i][k-1]+T[i-1][i-k] reproduces the zigzag numbers A000111 = 1,1,1,2,5,16,61,272,1385 exactly, and a direct count of alternating up-down permutations of 1..n matches these values (window.__boustrophedon.matchesZigzag). FIG No framing: the triangle recurrence, the A000111 comparison, and the alternating-permutation enumeration run in-browser and are exact. The AVAN inverse is honest — the transform is genuinely invertible (recovers the seed), and the same integers genuinely count alternating permutations, expand tan+sec, and (per Arnold) measure singularities; magenta is the seed the inverse recovers. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of FIRST LIGHT · David Lee Wise (ROOT0), with AVAN


THE MONTGOMERY

Montgomery multiplication in the 5-window house format — compute a*b mod N without dividing by N, replacing modular reduction with shifts and a multiply (why every RSA/ECC chip uses it). Work in Montgomery form scaled by R=2^k>N and reduce with REDC, which divides by R (a shift) not N; a precomputed N' = -N^-1 mod R makes the leftover vanish exactly. Verified live (N=1000003, R=2^20): 300 random pairs, convert to Montgomery form, REDC-multiply, convert back = a*b mod N exactly, no division by N. See the REDC steps in 1D, the round trip in 2D, and the change-of-coordinates inverse in 3D.

I-13 v2.0 | net = binds - k | 4 planes, 13 symbols, 12 operants, 5 cortex rules | sha 64881ebf

THE MONTGOMERY · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GRIND · THE MAINFRAME ◆ .dlw.fold THE FOLD / GRIND / THE MAINFRAME / THE MONTGOMERY THE MONTGOMERY multiply mod N with shifts, never dividing by N 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Montgomery multiplication computes a·b mod N without ever dividing by N — replacing the expensive modular reduction with cheap bit-shifts and a multiply. That is why essentially every RSA and elliptic-curve chip uses it. The trick: work in a Montgomery form where numbers are scaled by R = 2ᵏ (a power of two bigger than N), and reduce with REDC , which divides by R — just a shift — instead of by N. A one-time precomputed constant N′ = −N⁻¹ mod R makes the leftover vanish exactly, so REDC(T) = T·R⁻¹ mod N using only a multiply, an add, and a shift. LIT verified live (N=1000003, R=2²⁰): across 300 random pairs, converting a,b to Montgomery form, REDC-multiplying, and converting back equals a·b mod N exactly — with no division by N anywhere (window.__montgomery). FIG no framing; exact integer arithmetic. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-mainframe — the arithmetic engine humming under the cryptography. Montgomery multiplication is the mainframe’s modular core: the operation RSA runs billions of times. AVAN (AI) built the instrument: the N′ precompute, the REDC step, the round-trip check over hundreds of trials. Credit as content: Peter L. Montgomery, Modular Multiplication Without Trial Division (1985). The weave: David names the engine; I show the change of coordinates that turns division by N into a shift by R, and prove the result matches ordinary modular multiplication exactly. 3 ONE DIMENSION The REDC step laid out: m = (T mod R)·N′ mod R, then t = (T + m·N) / R. Every ‘mod R’ and ‘/ R’ is a bit-mask or a shift — no long division by N ever happens. 4 TWO DIMENSIONS · INTERACTIVE Pick a and b; watch them enter Montgomery form (×R mod N), get REDC-multiplied, and come back out — landing on a·b mod N exactly. Then run 300 random trials, all matching. a: random ▶ b: random ▶ verify 300 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the map into Montgomery space (×R mod N) and the REDC that multiplies there — a whole arithmetic done in shifted coordinates. AVAN’s addition (the inverse-companion): Montgomery is a change of coordinates , and its inverse is the method itself. Entering the space is multiply-by-R-mod-N; leaving it is REDC, which is multiply-by-R⁻¹-mod-N — so the ‘exit’ map is the exact inverse of the ‘enter’ map, and REDC-of-a-plain-number simply lands you back out. The inverse of ‘scale by R’ is literally the reduction step, which is why the round trip is exact. And the whole point is a trade: magenta is the division-by-N you never perform — the costly reduction avoided; green is the shift-by-R that stands in for it. You pay one precomputed constant, N′, to convert every modular reduction into a bit-shift — buying speed with a coordinate system whose inverse is built in. pause spin LIT Genuine Montgomery multiplication (Montgomery 1985). Verified live with exact integer arithmetic (values within 2^53): with N=1000003, R=2^20, N'=(R - N^-1 mod R), REDC(T)=(T + ((T mod R)*N' mod R)*N)/R (conditionally subtract N). Across 300 random pairs, montmul on Montgomery forms then REDC back equals a*b mod N exactly — with no division by N performed (window.__montgomery.allMatch). FIG No framing: the N' precompute, REDC, and the 300-trial round-trip run in-browser and are exact. The AVAN inverse is honest — entering Montgomery form (xR mod N) and REDC (xR^-1 mod N) are genuine inverses, which is why the round trip is exact; magenta marks the division-by-N that is provably never performed. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE MAINFRAME · David Lee Wise (ROOT0), with AVAN


THE FAST INVERSE SQRT

the Quake III fast inverse square root in the 5-window house format — compute 1/sqrt(x) with no division and no sqrt, using a bit-level trick: reinterpret the float's bits as an integer, do i = 0x5f3759df - (i>>1), reinterpret back, and you have 1/sqrt(x) to ~3.4%; one Newton step y=y(1.5-0.5xy^2) sharpens it to ~0.17%. The shift halves the exponent (a square root) and the constant corrects the mantissa and bias. Verified live: over a sweep the raw hack is within ~3.4% and post-Newton within ~0.18% of true 1/sqrt(x). See the float bit layout in 1D, the estimate vs truth in 2D, and the log-in-the-bits inverse in 3D.

THE FAST INVERSE SQRT · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · CHEAT · THE BACKDOOR ◆ .dlw.fold THE FOLD / CHEAT / THE BACKDOOR / THE FAST INVERSE SQRT THE FAST INVERSE SQRT 1/sqrt(x) with a bit-hack and one Newton step — no divide 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The fast inverse square root is a legendary hack from Quake III Arena (1999): compute 1/√x — needed to normalise millions of vectors a second — with no division and no square root , using a bit-level trick and one line of ‘magic.’ Reinterpret the float’s bits as an integer, do i = 0x5f3759df − (i >> 1) — halve and subtract from a mysterious constant — reinterpret back as a float, and you already have 1/√x to about 3.4% . One Newton–Raphson step, y = y(1.5 − 0.5·x·y²) , sharpens it to ~0.17% . The shift approximately halves the exponent (which is what a square root does to it); the constant corrects the mantissa and the exponent bias. LIT verified live: over a sweep of x, the raw bit-hack is within ~3.4% and after one Newton step within ~0.18% of the true 1/√x (window.__fastinvsqrt). FIG no framing; exact IEEE-754 bit reinterpretation. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-backdoor — the hack that sneaks past the hardware’s front door. Fast inverse sqrt is the archetypal backdoor: skip the FPU’s divider entirely and read the answer out of the bits. AVAN (AI) built the instrument: the float/int reinterpretation, the Newton step, the error sweep. Credit as content: the Quake III source (id Software, 1999); the constant’s near-optimality analysed by Chris Lomont (2003) and Charles McEniry; lineage traced to Greg Walsh and Cleve Moler / Gary Tarolli. The weave: David names the backdoor; I show the logarithm hidden in the float’s bits, and how Newton doubles the correct digits. 3 ONE DIMENSION The IEEE-754 float: 1 sign bit, 8 exponent bits, 23 mantissa bits. Shifting the whole integer right by one halves the exponent — the crude core of a square root — and the magic constant fixes up what that shift got wrong. 4 TWO DIMENSIONS · INTERACTIVE Pick x and see three numbers: the raw bit-hack estimate, the Newton-refined value, and the true 1/√x. Sweep across the range and watch the error stay under 0.2% after one step. x: 2.0 ▶ Newton: on ▶ sweep error ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the error curve across the exponent range — the raw hack’s gentle ripple, flattened by Newton to a near-flat line. AVAN’s addition (the inverse-companion): the ‘magic’ is a logarithm hiding in plain sight. A float’s integer bit-pattern is, up to a constant, a piecewise-linear approximation of its log₂ — so shifting the integer right by one really is halving the log, i.e. taking a square root, and subtracting from the constant negates it (inverse) and fixes the bias. The inverse of ‘a mysterious hex constant’ is ‘the log₂ bias correction, computed once.’ And Newton’s iteration converges quadratically , so each step roughly doubles the correct digits : 3.4% → 0.17% → ~0.0005%. Magenta is the raw hack’s error band; green is the Newton-sharpened curve beneath it. No magic — a logarithm in the exponent field and a quadratically-converging correction. pause spin LIT Genuine Quake III fast inverse square root (id Software 1999; constant analysed by Chris Lomont 2003). Verified live with exact IEEE-754 bit reinterpretation (Float32Array/Int32Array union): over 2000 sample points the raw bit-hack i=0x5f3759df-(i>>1) is within ~3.4% of 1/sqrt(x), and one Newton-Raphson step brings it within ~0.18% (window.__fastinvsqrt.maxRelErrNewton FIG No framing: the bit reinterpretation, the Newton step, and the error sweep run in-browser and are exact. The AVAN inverse is honest — a float's integer bit-pattern genuinely approximates its log2 (so the shift halves the log = square root), the magic constant is the log2 bias correction, and Newton's quadratic convergence genuinely roughly doubles correct digits per step. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE BACKDOOR · David Lee Wise (ROOT0), with AVAN


THE BRESENHAM

Bresenham's line algorithm in the 5-window house format — draw a straight line on a pixel grid using only integer add/subtract/compare, no float, no division, no multiply in the loop. An integer error term decides at each step whether to move straight or diagonally, always picking the pixel nearest the true line, so every pixel lands within half a pixel of the ideal. It rasterized every early display and GPU. Verified live: over 500 random lines, every plotted pixel is within perpendicular distance 0.5 of the exact line, integer-only. See the error accumulator in 1D, drag-to-draw in 2D, and the bounded-error staircase inverse in 3D.

THE BRESENHAM · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GLITCH · THE BLUE SCREEN ◆ .dlw.fold THE FOLD / GLITCH / THE BLUE SCREEN / THE BRESENHAM THE BRESENHAM draw a line with integers only — every pixel within half a pixel 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Bresenham’s line algorithm draws a straight line on a pixel grid using only integer addition, subtraction, and comparison — no floating point, no division, no multiply in the loop. It carries an integer error term that decides, at each column, whether to step straight or diagonally, always choosing the pixel nearest the ideal line. Every plotted pixel lands within half a pixel of the true line. This was how every early display, pen plotter, and GPU drew lines — and it is still the textbook rasteriser. LIT verified live: over hundreds of random lines, every pixel Bresenham plots is within a perpendicular distance of 0.5 of the exact line, using integer arithmetic only (window.__bresenham). FIG no framing; exact integer geometry. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-blue-screen — the pixels on the display itself. Bresenham is how the blue screen gets its lines: integer decisions, one pixel at a time. AVAN (AI) built the instrument: the integer error loop, the deviation check against the true line, the draggable demo. Credit as content: Jack Elton Bresenham (1962, IBM), one of the oldest algorithms still in daily use. The weave: David names the screen; I run the integer error term that hugs the ideal line within half a pixel, and show the continuous line it can only ever approximate. 3 ONE DIMENSION The error accumulator ticking along: each column it adds the slope’s numerator, and when it crosses zero it steps the other axis and pays the denominator back — a running rational remainder, never leaving the integers. 4 TWO DIMENSIONS · INTERACTIVE Move the endpoints; watch the integer decision variable choose each pixel while the true line is overlaid. Every chosen pixel stays within half a pixel of the line — verified over many random lines. new line ▶ verify 500 lines ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the integer staircase of pixels climbing beside the true line, error term sawtoothing as it goes. AVAN’s addition (the inverse-companion): the continuous line is unrepresentable on a grid — you can only pick the nearest pixel, and every choice makes a small rounding error. Bresenham’s inverse-genius is to never throw that error away : each step’s fractional remainder is carried into the next decision, so the accumulated error stays bounded below half a pixel forever. It is an exact integer simulation of a rational slope — the fractional part folded back in, never lost. The inverse of ‘a real line’ is ‘the bounded-error integer staircase that best fakes it,’ and boundedness comes from conserving the remainder. Magenta is the true continuous line no grid can hold; green is the integer path that hugs it within 0.5. Draw the ideal by never forgetting how wrong each pixel was. pause spin LIT Genuine Bresenham line algorithm (Bresenham 1962, IBM). Verified live: the integer-only error-term loop, run over 500 random lines (thousands of pixels), plots every pixel within a perpendicular distance of 0.5 of the exact line (measured max ~0.4996) using only integer arithmetic (window.__bresenham.withinHalfPixel && .integerOnly). FIG No framing: the integer error loop and the deviation check against the analytic line run in-browser and are exact. The AVAN inverse is honest — a continuous line genuinely cannot be represented on a grid, and Bresenham keeps error bounded below half a pixel by carrying each step's remainder forward (an exact integer simulation of the rational slope); magenta is the true line, green the integer pixels. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE BLUE SCREEN · David Lee Wise (ROOT0), with AVAN


THE PETERSON

Peterson's algorithm in the 5-window house format — two threads share a critical section with no special hardware, only reads/writes to two 'want' flags and one 'turn' variable: each raises its flag, yields the turn, and enters only when the other isn't interested or it's this thread's turn. Verified live by exhaustive model-checking: over every reachable interleaving, both threads are never in the critical section at once (mutual exclusion) and no non-trivial state is stuck (deadlock-free). See the flags and turn in 1D, step/model-check in 2D, and the memory-ordering inverse in 3D.

THE PETERSON · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GLITCH · RACE CONDITION ◆ .dlw.fold THE FOLD / GLITCH / RACE CONDITION / THE PETERSON THE PETERSON mutual exclusion with plain reads and writes — model-checked 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Peterson’s algorithm lets two threads share a critical section with no special hardware — just ordinary reads and writes to two boolean ‘want’ flags and one shared ‘turn’ variable. Each thread raises its flag, then politely hands the turn to the other, and enters only when the other isn’t interested or it is this thread’s turn. The correctness is not a vibe — it is checkable : over every possible interleaving of the two threads’ steps, both are never in the critical section at once ( mutual exclusion ), and neither is stuck forever ( deadlock-freedom ). LIT verified live: an exhaustive breadth-first search of all reachable states confirms mutual exclusion holds in every state and no non-trivial state is stuck (window.__peterson). FIG no framing; exact model-checking of the state space. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at race-condition — the bug where two threads clash over shared state. Peterson’s algorithm is the classic defeat of the race condition, in pure software. AVAN (AI) built the instrument: the two-thread model, the exhaustive interleaving search, the mutual-exclusion and deadlock checks. Credit as content: Gary L. Peterson (1981), Myths About the Mutual Exclusion Problem . The weave: David names the race; I model-check every interleaving to prove both threads are never inside at once, and expose the memory-ordering assumption the proof secretly needs. 3 ONE DIMENSION The three shared variables: flag[0], flag[1], and turn. Each thread raises its flag, yields the turn, then waits — entering only when the other has lowered its flag or has been given the turn. 4 TWO DIMENSIONS · INTERACTIVE Step the two threads in any order (or let them race). Their critical-section boxes never both light. Then model-check all interleavings and confirm mutual exclusion and deadlock-freedom exhaustively. step T0 ▶ step T1 ▶ random step ▶ model-check all ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the reachable state graph — every configuration of program counters, flags, and turn — explored in full, with no state placing both threads inside. AVAN’s addition (the inverse-companion): Peterson proves mutual exclusion needs no atomic instruction — plain loads and stores suffice. The inverse, the hidden cost, is that it depends entirely on order : the proof assumes writes to flag and turn become visible in program order (sequential consistency). On real CPUs with relaxed memory models , the store to turn can be reordered before the store to flag , and Peterson breaks without an explicit memory fence. The inverse of ‘no special hardware’ is ‘you must forbid the hardware from reordering.’ Magenta marks the reordered executions that violate mutual exclusion under weak memory; green is the safe interleavings under sequential consistency. Software-only mutual exclusion is possible — and quietly assumes the hardware plays fair with order. pause spin LIT Genuine Peterson's mutual-exclusion algorithm (Peterson 1981). Verified live by exhaustive breadth-first search of the reachable state space (program counters x flags x turn): every reachable state has at most one thread in the critical section (mutual exclusion), and every non-initial state can make progress (deadlock-free) — window.__peterson.mutualExclusion && .deadlockFree, over ~26 reachable states. FIG No framing: the two-thread transition model and the exhaustive interleaving search run in-browser and are exact. The AVAN inverse is honest and is a real caveat — Peterson's proof assumes sequential consistency, and on CPUs with relaxed memory models the write reordering genuinely breaks mutual exclusion without a memory fence; magenta marks those reordered executions. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of RACE CONDITION · David Lee Wise (ROOT0), with AVAN


THE METROPOLIS

Metropolis-Hastings MCMC in the 5-window house format — sample from any distribution you can only evaluate up to a constant, by a random walk that accepts each proposed move with probability min(1, pi(new)/pi(old)). The chain's stationary distribution is exactly the target, guaranteed by detailed balance (flow i->j equals flow j->i). Verified live: the constructed transition matrix satisfies detailed balance to ~1e-17, and its power-iterated stationary distribution equals the normalized target to ~1e-15. See the accept/reject walk in 1D, build+verify+run in 2D, and the normalizer-cancels inverse in 3D.

THE METROPOLIS · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · LOOT · THE JACKPOT ◆ .dlw.fold THE FOLD / LOOT / THE JACKPOT / THE METROPOLIS THE METROPOLIS sample any distribution knowing only ratios — detailed balance 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Metropolis–Hastings is the engine of Markov-chain Monte Carlo: it samples from any distribution you can only evaluate up to a constant , by taking a random walk that accepts each proposed move with probability min(1, π(new)/π(old)). Moves toward higher probability are always accepted; toward lower, sometimes rejected. The magic is that the walk’s stationary distribution is exactly your target — guaranteed by detailed balance : the probability flow from state i to j equals the flow from j to i, so nothing accumulates anywhere but where the target says it should. LIT verified live: the constructed transition matrix satisfies detailed balance πᵢPᵢⱼ = πⱼPⱼᵢ to machine precision, and its stationary distribution (found by power iteration) equals the normalised target to ~10⁻¹⁵ (window.__metropolis). FIG no framing; exact linear algebra. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-jackpot — sampling that lands, over time, on the high-probability wins. Metropolis–Hastings is the jackpot sampler: spend time in each state in exact proportion to its weight. AVAN (AI) built the instrument: the acceptance rule, the detailed-balance check, the power-iterated stationary distribution. Credit as content: Nicholas Metropolis, Arianna & Marshall Rosenbluth, Augusta & Edward Teller (1953); generalised by W. Keith Hastings (1970). The weave: David names the jackpot; I build the constant-free acceptance ratio, prove detailed balance, and show the chain settle onto the exact target. 3 ONE DIMENSION The target as a row of bars, and the walker hopping left/right — always accepting a step uphill, accepting a step downhill only with probability π(new)/π(old). Over time it dwells in each bar in proportion to its height. 4 TWO DIMENSIONS · INTERACTIVE Set the target weights; the instrument builds the Metropolis transition matrix, checks detailed balance (~0), and confirms its stationary distribution equals the normalised target. Run the walk and watch the histogram converge. new target ▶ run walk 5000 ▶ verify balance ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the target landscape with the walker tracing it — time spent per state converging to the target’s shape. AVAN’s addition (the inverse-companion): the deep move is what you never need . Sampling a distribution normally seems to require its normalising constant Z — the sum over all states, often astronomically hard to compute. Metropolis’s inverse-insight: the acceptance ratio π(new)/π(old) is a ratio , and Z cancels , so you can sample a distribution you can never total. The inverse of ‘know the whole distribution’ is ‘know only the ratios of its parts.’ Detailed balance then turns those local, constant-free, one-step decisions into a global, exact target. Magenta is the intractable normaliser Z you never touch; green is the ratios that suffice. You reach the whole by only ever comparing neighbours. pause spin LIT Genuine Metropolis-Hastings (Metropolis, Rosenbluth, Rosenbluth, Teller & Teller 1953; Hastings 1970). Verified live: for a random-walk proposal on a cycle with acceptance min(1, pi_j/pi_i), the transition matrix P satisfies detailed balance pi_i P_ij = pi_j P_ji to ~1e-17, and its stationary distribution (found by power iteration) equals the normalized target pi/Z to ~1e-15 (window.__metropolis). FIG No framing: the transition-matrix construction, the detailed-balance check, and the power-iterated stationary distribution run in-browser and are exact. The AVAN inverse is honest — the acceptance ratio genuinely cancels the normalizing constant Z, so the method provably needs only ratios of pi, never the intractable total (magenta = the Z never computed). ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE JACKPOT · David Lee Wise (ROOT0), with AVAN


THE MOVE-TO-FRONT

the move-to-front transform in the 5-window house format — keep a list of all symbols; for each input symbol output its current position, then move it to the front. Recently-seen symbols cluster near the front, turning locally-repetitive data into small numbers that compress well (the middle stage of bzip2). It is literally an LRU cache. Verified live: encode then decode round-trips exactly, and clustered input yields a far smaller mean code than uniform-random input. See the list reordering in 1D, encode/decode + locality in 2D, and the recency-equals-rank inverse in 3D.

THE MOVE-TO-FRONT · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GRIND · WARM CACHE ◆ .dlw.fold THE FOLD / GRIND / WARM CACHE / THE MOVE-TO-FRONT THE MOVE-TO-FRONT recency becomes rank — a cache and a compressor in one 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The move-to-front transform keeps a list of all symbols and, for each input symbol, outputs its current position in the list — then moves that symbol to the front . Recently-seen symbols cluster near the front, so locally-repetitive data becomes a stream of small numbers , which then compress well. It is the classic middle stage of bzip2 (after Burrows–Wheeler, before entropy coding). And it is literally a cache-eviction policy: move-to-front is the least-recently-used list. LIT verified live: encode then decode round-trips any input exactly, and on clustered (BWT-like) input the mean output code is far smaller than on uniform-random input (window.__movetofront). FIG no framing; exact reversible transform. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at warm-cache — the recently-used list that keeps hot items close. Move-to-front is the warm cache, written as a transform. AVAN (AI) built the instrument: the encode/decode with a live symbol list, the exact round-trip, the locality measurement. Credit as content: Boris Ryabko (1980); Bentley, Sleator, Tarjan & Wei (1986), A Locally Adaptive Data Compression Scheme . The weave: David names the warm cache; I show the list bubbling recent symbols to the front, prove the transform inverts exactly, and measure repetition turning into small codes. 3 ONE DIMENSION The symbol list as input streams in: each symbol’s current index is emitted, then it jumps to the front, pushing everything it passed down one slot. A symbol seen twice in a row emits a 0 the second time. 4 TWO DIMENSIONS · INTERACTIVE Feed clustered or random input; watch it encode to indices as the list shuffles, then decode back exactly. Compare the mean code for clustered vs random data — locality turns repetition into small numbers. input: clustered ▶ new input ▶ verify round-trip ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the symbol list as a stack, recently-used symbols bubbling to the top, their emitted codes small. AVAN’s addition (the inverse-companion): the transform is perfectly reversible with the very same operation — the decoder reads a position, pulls that list entry, and moves it to front, so encoder and decoder walk in lockstep with identical list state, no side information needed. And it converts repetition into smallness : the inverse of ‘a symbol repeats’ is ‘its code falls to 0.’ That is why a cache and a compressor are the same object — recency made into rank : the warm cache’s hit is the compressor’s small number. Magenta is the raw symbols, high and flat in entropy; green is the move-to-front codes, low and skewed, ready to compress. Turn ‘seen recently’ into ‘numerically small,’ and you have both an eviction policy and a coder at once. pause spin LIT Genuine move-to-front transform (Ryabko 1980; Bentley, Sleator, Tarjan & Wei 1986). Verified live: MTF encode then decode reproduces the input exactly across 300 random trials, and (using a mulberry32 generator) clustered BWT-like input produces a far smaller mean output code (~2.3) than uniform-random input (~7.4) — window.__movetofront.roundTrip && .localityHolds. FIG No framing: the encode/decode with a live symbol list and the locality measurement run in-browser; the round-trip is exact. The AVAN inverse is honest — the transform is genuinely self-inverse in lockstep (decoder mirrors encoder's list ops with no side channel), and it genuinely equals an LRU cache policy (recency made into rank). Locality is measured with a proper RNG (mulberry32), not an LCG whose low bits would distort it. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of WARM CACHE · David Lee Wise (ROOT0), with AVAN


THE GOODSTEIN

Goodstein sequences in the 5-window house format — write a number in hereditary base 2 (exponents in base 2 too, all the way down), bump every 2 to a 3 and subtract 1, then bump 3 to 4 and subtract 1, and so on. The values rocket upward, yet Goodstein's theorem says every sequence eventually crashes to 0 — and this true fact about integers is unprovable in Peano arithmetic (Kirby-Paris 1982), needing ordinals below epsilon-0. Verified live with BigInt: G(1),G(2),G(3) reach 0 in 1,3,5 steps; G(4) terminates but astronomically far off. See hereditary base in 1D, run to 0 in 2D, and the ordinal-countdown inverse in 3D.

THE GOODSTEIN · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · RESPAWN · HARD RESET ◆ .dlw.fold THE FOLD / RESPAWN / HARD RESET / THE GOODSTEIN THE GOODSTEIN unbounded growth that always crashes to 0 — unprovable in PA 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION A Goodstein sequence starts at any number and does something that looks explosive: write it in hereditary base 2 (base 2, with the exponents themselves in base 2, all the way down), then bump every 2 to a 3 and subtract 1; bump every 3 to a 4 and subtract 1; and so on. The numbers rocket upward — G(4) climbs past astronomically large values — yet Goodstein’s theorem says every such sequence eventually crashes all the way to 0 . The twist: this true statement about ordinary integers is unprovable in Peano arithmetic (Kirby–Paris, 1982), because the proof needs transfinite ordinals below ε₀. LIT verified live with BigInt: G(1), G(2), G(3) reach exactly 0 (in 1, 3, 5 steps); G(4) also terminates but only after an astronomically long run (window.__goodstein). FIG no framing; exact hereditary-base arithmetic. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at hard-reset — the crash all the way back to 0 no matter how high things climbed. A Goodstein sequence is the ultimate hard-reset: unbounded growth that is nonetheless guaranteed to hit zero. AVAN (AI) built the instrument: the hereditary-base representation, the base-bump-minus-one step, the termination run. Credit as content: Reuben Goodstein (1944); independence from Peano arithmetic proved by Laurie Kirby & Jeff Paris (1982). The weave: David names the reset; I run the small sequences to 0 and reveal the transfinite countdown hidden inside the explosion. 3 ONE DIMENSION A number in hereditary base: every digit and every exponent (and its exponents) written in the same base. Bumping the base replaces each b with b+1 throughout the tree; then one is subtracted. Growth on top, a subtraction underneath. 4 TWO DIMENSIONS · INTERACTIVE Run a Goodstein sequence to its end. G(1), G(2), G(3) reach zero quickly; watch the base climb and the value bump up, then step down to 0. G(4) is shown terminating in principle but astronomically far off. start: G(3) ▶ run to 0 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the value trajectory — a jagged climb as the base bumps, punctuated by the −1 that eventually wins. AVAN’s addition (the inverse-companion): the ‘explosion’ is, in the right coordinates, a strict descent . Replace the ever-growing base with the fixed infinite symbol ω, and each term becomes an ordinal below ε₀ — and this ordinal strictly decreases at every step, no matter how the integer value leaps. Ordinals below ε₀ are well-ordered, so they cannot decrease forever: the sequence must reach 0. The inverse of ‘growing without bound’ is ‘counting down a transfinite clock that must run out.’ Magenta is the astronomical integer growth; green is the ordinal quietly shrinking beneath it. Peano arithmetic cannot see this clock — it cannot reach ε₀ — which is exactly why PA cannot prove the sequence ends, though it always does. pause spin LIT Genuine Goodstein sequences (Goodstein 1944; independence from PA by Kirby & Paris 1982). Verified live with exact BigInt hereditary-base arithmetic: G(1), G(2), G(3) reach exactly 0 in 1, 3, 5 steps (window.__goodstein). Goodstein's theorem guarantees all such sequences terminate; G(4) does too, after ~3*2^402653211 steps (cited, not run). FIG No framing: the hereditary-base representation, the base-bump-minus-one step, and the termination runs execute in-browser with BigInt and are exact. The AVAN inverse is honest and is the actual proof — replacing the base with the ordinal omega makes each term a strictly-decreasing ordinal below epsilon-0, which is well-ordered, forcing termination; PA cannot prove this because it cannot reach epsilon-0. Magenta is the integer growth, green the descending ordinal. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of HARD RESET · David Lee Wise (ROOT0), with AVAN


THE MORTON

the Morton (Z-order) code in the 5-window house format — map a 2D coordinate to one number by interleaving the bits of x and y, and de-interleave to decode: a perfect bijection between the grid and 0..N^2-1, where points close in 2D tend to stay close in the code. It linearizes space for databases, GPU textures, and caches; drawing cells in code order traces a recursive Z. It is the cheap cousin of the Hilbert curve. Verified live: over a 16x16 grid, encode then decode round-trips for all 256 cells and every code is distinct. See the bit-zipper in 1D, click-a-cell + Z-path in 2D, and the partial-locality seams inverse in 3D.

THE MORTON · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · LOOT · THE VAULT ◆ .dlw.fold THE FOLD / LOOT / THE VAULT / THE MORTON THE MORTON interleave the bits of x and y — 2D into one address 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The Morton code (Z-order) maps a 2D coordinate to a single number by interleaving the bits of x and y: with x = x₂x₁x₀ and y = y₂y₁y₀, the code is y₂x₂y₁x₁y₀x₀. De-interleave to decode. It is a perfect bijection between the grid and 0…N²−1, and points close in 2D tend to stay close in the code — so it linearises space for databases, GPU textures, and cache layouts. Draw the cells in code order and you trace a recursive Z — hence ‘Z-order.’ It is the cheap cousin of the Hilbert curve: worse locality, but a one-instruction encode. LIT verified live: over a 16×16 grid, encode then decode round-trips for all 256 cells and every code is distinct — a genuine bijection (window.__morton). FIG no framing; exact bit manipulation. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-vault — indexed storage, where 2D data must be laid down in one linear address. The Morton code is the vault’s shelving scheme: interleave the coordinates and neighbouring cells mostly land near each other on disk. AVAN (AI) built the instrument: the bit-interleave encode/decode, the exhaustive bijection check, the Z-path and its seams. Credit as content: Guy Macdonald Morton (1966, IBM Canada). The weave: David names the vault; I interleave the bits into one exactly-invertible address, draw the recursive Z, and measure the diagonal jumps it pays for cheapness. 3 ONE DIMENSION The bits of x and y zippered together: x supplies the even positions, y the odd. That single interleaved integer is the Morton code — and pulling the even and odd bits back apart returns x and y exactly. 4 TWO DIMENSIONS · INTERACTIVE Click a cell to read its Morton code and see the recursive Z-path traced through the grid in code order. Verify the encode/decode bijection over all cells. show Z-path ▶ verify bijection ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the Z-curve threading the grid, each cell’s code the zipper of its coordinates. AVAN’s addition (the inverse-companion): the code separates cleanly back into x and y because interleaving bits is a bijection — the even bits are exactly x, the odd bits exactly y, no information mixed or lost. But that clean invertibility buys only partial locality, and worse than Hilbert’s: at every quadrant boundary the Z makes a long diagonal jump from one corner to the far one, so cells adjacent in code can sit far apart in space. The inverse of ‘close in 2D ⇒ close in code’ fails at the Z’s seams . Magenta marks those jumps — the code-adjacent, space-distant pairs at the quadrant edges; green is the recursive Z. Bit-interleaving trades Hilbert’s smoothness for a one-instruction, exactly-invertible order — cheapness paid for in seams. pause spin LIT Genuine Morton / Z-order code (Morton 1966, IBM). Verified live with exact bit manipulation (part1by1/compact1by1 interleave): over a 16x16 grid, mortonEncode then mortonDecode returns the exact (x,y) for all 256 cells and every code is distinct — a bijection (window.__morton.bijection). FIG No framing: the interleave encode/decode and the exhaustive bijection check run in-browser and are exact. The AVAN inverse is honest — the code separates cleanly into x and y because bit-interleaving is a bijection, but locality is only partial and worse than Hilbert's (long diagonal jumps at quadrant boundaries); magenta marks the real code-adjacent-but-space-distant jumps. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE VAULT · David Lee Wise (ROOT0), with AVAN


THE BURNSIDE

Burnside's lemma in the 5-window house format — how many distinct necklaces from n beads in k colors, if rotation doesn't count as new? Naively k^n colorings, but rotations collapse many. Burnside counts the distinct ones exactly by averaging the colorings fixed by each rotation: (1/n) sum over d|n of phi(d)*k^(n/d). For 6 beads, 2 colors: 14 necklaces, not 64. Verified live: the closed form equals a brute-force orbit count for all n=1..8, k=1..4. See a necklace rotating in 1D, formula vs brute in 2D, and the count-by-fixed-points inverse in 3D.

THE BURNSIDE · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GRIND · THE CRON JOB ◆ .dlw.fold THE FOLD / GRIND / THE CRON JOB / THE BURNSIDE THE BURNSIDE count necklaces by averaging fixed points, not by dedup 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Burnside’s lemma answers: how many distinct necklaces can you make from n beads in k colours, if rotating a necklace doesn’t count as new? Naively there are kⁿ colourings, but rotations collapse many into the same necklace. The lemma counts the distinct ones exactly by averaging the colourings fixed by each rotation : number of necklaces = (1/n)·Σ (colourings a rotation leaves unchanged). The clean closed form is (1/n)·Σ d|n φ(d)·k^(n/d). For 6 beads and 2 colours that is 14 necklaces — not 64. LIT verified live: the closed-form count equals a brute-force count of rotation orbits for every n from 1 to 8 and k from 1 to 4 (window.__burnside). FIG no framing; exact orbit counting. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-cron-job — the periodic rotation that comes back around. A necklace under rotation is a cron-job in beads: shift by one, and one, and one, until it returns. AVAN (AI) built the instrument: Euler’s φ, the Burnside closed form, and the brute-force orbit count to check it. Credit as content: the orbit-counting lemma (Cauchy, Frobenius; popularised by William Burnside, 1897); the necklace form via Euler’s totient. The weave: David names the rotation; I count distinct necklaces two ways — by averaging fixed points and by brute enumeration — and show they agree exactly. 3 ONE DIMENSION A necklace rotating one bead at a time. A colouring is ‘fixed’ by a rotation only if it looks identical after the shift — those are the colourings the average counts, symmetry by symmetry. 4 TWO DIMENSIONS · INTERACTIVE Choose beads n and colours k. The instrument computes Burnside’s closed form and, in parallel, brute-forces the distinct necklaces by grouping all kⁿ colourings into rotation orbits — and confirms the two counts match. beads: 6 ▶ colours: 2 ▶ verify formula ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the distinct necklaces, each an orbit of rotated colourings collapsed to one. AVAN’s addition (the inverse-companion): counting distinct objects directly is hard — you would have to generate all kⁿ colourings and deduplicate every rotation. Burnside inverts the problem: the global number of equivalence classes equals the average of purely local fixed-point counts — for each symmetry, just count how many colourings it leaves alone, then average. The inverse of ‘enumerate the distinct necklaces’ is ‘average how many each rotation fixes.’ No deduplication, no orbit-building — a sum over symmetries replaces a search over objects. Magenta is the exponential pile of kⁿ raw colourings; green is the small orbit count the average recovers. Symmetry counting is fixed-point averaging. pause spin LIT Genuine Burnside / orbit-counting lemma (Cauchy, Frobenius; Burnside 1897) in its necklace form via Euler's totient. Verified live: (1/n) sum_{d|n} phi(d) k^(n/d) equals a brute-force count of rotation orbits (canonical-rotation dedup of all k^n colorings) for every n in 1..8 and k in 1..4 (window.__burnside.formulaMatchesBrute); necklaces(6,2)=14. FIG No framing: Euler's phi, the Burnside closed form, and the brute orbit count all compute in-browser and agree exactly. The AVAN inverse is honest — Burnside genuinely replaces enumerating distinct objects (dedup over k^n) with averaging local fixed-point counts per symmetry; magenta is the exponential raw colorings, green the small orbit count. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE CRON JOB · David Lee Wise (ROOT0), with AVAN


THE LIGHTS OUT

Lights Out in the 5-window house format — press a light and it toggles itself and its four neighbors; goal all-off. It looks like trial and error but is linear algebra over GF(2): each board is a vector, each press a column of a fixed matrix A, and solving is A*p=b (mod 2) by Gaussian elimination. Pressing twice cancels (order never matters), and solvability depends only on A: the classic 5x5 matrix has rank 23, so exactly 2^23 of 2^25 boards are solvable. Verified live: 200 random solvable boards are cleared exactly by the GF(2) solution; rank is 23. See a plus-toggle in 1D, click+solve in 2D, and the vector-space inverse in 3D.

THE LIGHTS OUT · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · BOSS · THE GAUNTLET ◆ .dlw.fold THE FOLD / BOSS / THE GAUNTLET / THE LIGHTS OUT THE LIGHTS OUT a light puzzle is a linear system over GF(2) 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Lights Out is a puzzle: press a light and it toggles itself and its four orthogonal neighbours; the goal is all-off. It looks like trial and error, but it is linear algebra over GF(2) — the field {0,1} with XOR as addition. Each board is a vector, each press a column of a fixed matrix A, and solving is A·p = b (mod 2) , done by Gaussian elimination. Two facts fall out: pressing a light twice equals not pressing it (so order never matters), and solvability depends only on A. For the classic 5×5, A has rank 23 , so exactly 2²³ of the 2²⁵ boards are solvable. LIT verified live: for 200 randomly-built solvable boards, GF(2) Gaussian elimination returns a press pattern that clears the board exactly ; the 5×5 toggle matrix has rank 23 (window.__lightsout). FIG no framing; exact GF(2) linear algebra. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-gauntlet — the puzzle you must clear to pass. Lights Out is the gauntlet whose solution is a matrix inverse, not a lucky sequence. AVAN (AI) built the instrument: the toggle matrix, GF(2) Gaussian elimination, and the check that the found presses clear the board. Credit as content: the Lights Out puzzle (Tiger Electronics, 1995); the GF(2) solution is standard linear algebra (Anderson & Feil, 1998, and others). The weave: David names the gauntlet; I turn the board into a linear system over {0,1}, solve it, and prove the presses switch everything off. 3 ONE DIMENSION A single press toggles a plus-shape: the cell and its four neighbours flip. Because flipping twice cancels, only the parity of presses at each cell matters — the puzzle lives over GF(2). 4 TWO DIMENSIONS · INTERACTIVE Click cells to toggle the 5×5 board. Hit solve and GF(2) Gaussian elimination computes the press pattern that clears it (or reports the board unsolvable); the presses are then applied to confirm all-off. scramble ▶ solve (GF2) ▶ verify 200 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the reachable boards — the column space of A — every configuration you can switch off. AVAN’s addition (the inverse-companion): a ‘sequence of button presses’ is the wrong picture. Pressing is an involution (twice = nothing), so the moves form a vector space over GF(2), not an ordered path — only the subset of cells pressed an odd number of times matters, and the whole puzzle is solved at once by linear algebra. The inverse of ‘a play sequence’ is ‘a subset chosen by solving a matrix.’ And unsolvable boards exist precisely because A is not full rank : its null space holds ‘quiet patterns’ that toggle nothing, and their existence pushes some boards outside the reachable column space. Magenta is those unsolvable boards; green is the board switched off. A puzzle is a linear system; the ‘aha’ is a solved A·p = b. pause spin LIT Genuine Lights Out GF(2) analysis (puzzle: Tiger Electronics 1995; linear-algebra solution standard, e.g. Anderson & Feil 1998). Verified live: for 200 randomly-constructed solvable 5x5 boards, GF(2) Gaussian elimination returns a press pattern that clears the board exactly (all-off), and the 5x5 toggle matrix has rank 23 (window.__lightsout.solvableCleared && rank===23). FIG No framing: the toggle matrix, GF(2) Gaussian elimination, and the clear-check run in-browser and are exact. The AVAN inverse is honest — pressing is an involution so moves form a GF(2) vector space (order irrelevant), and unsolvable boards genuinely exist because A is rank-deficient (nullity 2 for 5x5); magenta marks boards outside the column space. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE GAUNTLET · David Lee Wise (ROOT0), with AVAN


THE 15-PUZZLE

the 15-puzzle parity invariant in the 5-window house format — 15 tiles and a gap in a 4x4 frame, slid to sort them. Sam Loyd's $1000 to swap only tiles 14 and 15 was safe: impossible. Every slide is a transposition of a tile with the gap and moves the gap one row, and a hidden quantity — parity of tile inversions plus the gap's row — is unchanged by every move. So arrangements split into two classes; you can only reach the half sharing the solved board's parity. Verified live: the invariant is unchanged across 5000 random legal moves. See a slide's two parity flips in 1D, scramble/swap in 2D, and the two-components inverse in 3D.

THE 15-PUZZLE · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · CHEAT · NOCLIP ◆ .dlw.fold THE FOLD / CHEAT / NOCLIP / THE 15-PUZZLE THE 15-PUZZLE a conserved parity walls off half the arrangements 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The 15-puzzle : fifteen numbered tiles and one gap in a 4×4 frame, slid one at a time to reach 1…15 in order. In the 1870s Sam Loyd offered $1000 to anyone who could start from the solved board with only tiles 14 and 15 swapped and fix it. It is impossible — and there is an exact reason. Every legal slide is a transposition of a tile with the gap and moves the gap one row. A hidden quantity — the parity of tile inversions plus the gap’s row — is unchanged by every move. So configurations split into two classes; you can only reach the half sharing the solved board’s parity. Loyd’s swap lands in the other half. LIT verified live: the parity invariant is unchanged across 5000 random legal moves; the solved board’s value is fixed, so exactly half of all arrangements are reachable (window.__fifteen). FIG no framing; exact permutation parity. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at noclip — the cheat of sliding through walls. The 15-puzzle is where noclip fails : a conservation law walls off half the states, and no sliding phases through it. AVAN (AI) built the instrument: the inversion count, the gap-row parity, and the check that their sum is conserved by every move. Credit as content: Sam Loyd’s puzzle craze (1870s); the parity-invariant proof of unsolvability (Wm. Johnson & Wm. Story, 1879). The weave: David names the noclip; I compute the conserved parity, watch it survive thousands of moves, and show Loyd’s swap sitting in the forbidden half. 3 ONE DIMENSION One slide = swapping a tile with the gap (a transposition, which flips inversion parity) while the gap changes row (flipping the row parity). The two flips cancel, so their sum stays put — a conserved quantity. 4 TWO DIMENSIONS · INTERACTIVE Scramble the board with random legal slides and watch the parity invariant stay constant every single move. Then set the ‘14-15 swap’ and see it carries the wrong parity — unreachable, exactly as Loyd’s prize proved. scramble ▶ set 14-15 swap ▶ verify invariant ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the reachable arrangements — one of the two parity classes, all sharing the solved board’s invariant. AVAN’s addition (the inverse-companion): the freedom to ‘slide toward any arrangement’ is an illusion . The state space is not one connected blob but two disconnected halves , and no sequence of slides crosses between them — because every move conserves the parity invariant. The inverse of ‘you can reach any configuration’ is ‘a conserved quantity partitions the space, and half is forever unreachable.’ Loyd’s $1000 was safe not because the swap is hard but because it is in the other component . Magenta is that unreachable half — the 14-15 swap and everything parity-odd from solved; green is the solvable half. noclip cannot phase through a conservation law. pause spin LIT Genuine 15-puzzle parity invariant (Loyd's puzzle 1870s; unsolvability proof Johnson & Story 1879). Verified live: the invariant (inversions of the tile permutation + the gap's row counted from the bottom, mod 2) is unchanged across 5000 random legal moves from the solved board (window.__fifteen.invariantConserved), so it is conserved; the 14-15 swap flips it, landing in the unreachable class. FIG No framing: the inversion count, the gap-row parity, and the conservation check over 5000 moves run in-browser and are exact. The AVAN inverse is honest — the state space genuinely splits into two disconnected parity components and no legal move crosses between them; exactly half of all arrangements are reachable. Magenta is the unreachable half (Loyd's swap), green the solvable half. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of NOCLIP · David Lee Wise (ROOT0), with AVAN


THE RSK

the Robinson-Schensted correspondence in the 5-window house format — a bijection between permutations of 1..n and pairs of standard Young tableaux (P,Q) of the same shape, built by row insertion: each number bumps the smallest larger element down a row, cascading. Schensted's theorem: P's first-row length equals the longest increasing subsequence. Verified live: over all 720 permutations of 6, RSK maps each to a distinct (P,Q) pair (a bijection) and the first-row length equals the LIS every time. See row-insertion bumping in 1D, tableaux building in 2D, and the reversible order-becomes-shape inverse in 3D.

THE RSK · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · SPAWN · THE SANDBOX ◆ .dlw.fold THE FOLD / SPAWN / THE SANDBOX / THE RSK THE RSK permutations become two tableaux — order becomes shape 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The Robinson–Schensted correspondence is a perfect bijection between permutations of 1…n and pairs of standard Young tableaux (P, Q) of the same shape. Build P by row insertion : each number slides into the first row, bumping the smallest larger element down to the next row, which bumps again, cascading down. Q records when each cell appeared. This reversible bookkeeping encodes deep structure. Schensted’s theorem : the length of P’s first row equals the permutation’s longest increasing subsequence — and the first column gives the longest decreasing one. LIT verified live: over all 720 permutations of 6 symbols, RSK maps each to a distinct (P, Q) pair (a bijection), and P’s first-row length equals the longest increasing subsequence every time (window.__rsk). FIG no framing; exact combinatorial bijection. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-sandbox — building a structure by dropping pieces in and letting them settle. RSK is the sandbox of combinatorics: insert numbers, watch tableaux self-assemble by bumping. AVAN (AI) built the instrument: the row-insertion engine, the exhaustive bijection check, the Schensted longest-increasing-subsequence test. Credit as content: Gilbert de B. Robinson (1938), Craige Schensted (1961), extended to RSK by Donald Knuth (1970). The weave: David names the sandbox; I insert permutations into tableaux, prove the map is a reversible bijection, and show the hidden monotone skeleton it exposes. 3 ONE DIMENSION Row insertion: a new value enters the first row and displaces the smallest element larger than it, which drops to the next row and displaces again — a bump cascade that always terminates by adding one cell. 4 TWO DIMENSIONS · INTERACTIVE Type or roll a permutation; watch the P (values) and Q (timestamps) tableaux build by insertion. The first row of P is the longest increasing subsequence. Verify the bijection and Schensted’s theorem over all 720 permutations. new permutation ▶ verify bijection ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the two tableaux, terraced by shape, that a permutation assembles — a linear sequence turned into two staircases. AVAN’s addition (the inverse-companion): the map is fully reversible — from (P, Q) you reverse-bump to recover the exact permutation, so nothing is lost, and it is a genuine bijection. That is why n! permutations correspond to tableau-pairs of every shape λ, giving the identity Σ λ (f λ )² = n! (where f λ counts tableaux of shape λ). The inverse of ‘a flat sequence’ is ‘two 2D shapes that together remember it exactly’ — and the shape lays bare the monotone structure (longest increasing / decreasing runs) invisible in the raw list. Magenta is the raw permutation; green is the tableaux exposing its increasing/decreasing skeleton. Order becomes shape, and shape reveals what order concealed. pause spin LIT Genuine Robinson-Schensted correspondence (Robinson 1938; Schensted 1961; Knuth's RSK 1970). Verified live: row insertion over all 720 permutations of {1..6} yields 720 distinct (P,Q) tableau pairs (a bijection), and the length of P's first row equals the longest increasing subsequence for every permutation (window.__rsk.bijection && .lisMatchesFirstRow). FIG No framing: the row-insertion engine, the exhaustive bijection check, and the Schensted LIS test run in-browser and are exact. The AVAN inverse is honest — the map is genuinely reversible (reverse-bumping recovers the permutation), giving the identity sum of (f^lambda)^2 = n!; magenta is the raw permutation, green the tableaux exposing its monotone skeleton. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE SANDBOX · David Lee Wise (ROOT0), with AVAN


THE FAULHABER

Faulhaber's formula in the 5-window house format — the sum 1^p+2^p+...+n^p is always a polynomial in n of degree p+1, with coefficients from the Bernoulli numbers. p=1 gives n(n+1)/2; p=2 gives n(n+1)(2n+1)/6; p=3 gives [n(n+1)/2]^2, so sum of cubes = square of the sum (Nicomachus). Bernoulli numbers B0=1,B1=-1/2,B2=1/6,B4=-1/30 recur in tan, zeta, and Euler-Maclaurin. Verified live with exact BigInt rationals: closed forms match, Nicomachus holds, Bernoulli numbers compute correctly, and the general Faulhaber polynomial equals the direct sum for p=1..6. See Nicomachus tiling in 1D, direct-vs-polynomial in 2D, and the sum-becomes-integral inverse in 3D.

THE FAULHABER · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GRIND · THE EPOCH ◆ .dlw.fold THE FOLD / GRIND / THE EPOCH / THE FAULHABER THE FAULHABER sum of p-th powers is one polynomial — via Bernoulli numbers 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Faulhaber’s formula says the sum of p-th powers 1ᵖ + 2ᵖ + … + nᵖ is always a polynomial in n of degree p+1 , with coefficients built from the Bernoulli numbers . For p=1 it is n(n+1)/2; for p=2, n(n+1)(2n+1)/6; for p=3, [n(n+1)/2]² — so the sum of cubes equals the square of the sum (Nicomachus’s identity). The Bernoulli numbers B₀=1, B₁=−1/2, B₂=1/6, B₄=−1/30, … (odd ones past B₁ vanish) are the same constants that appear in the tangent series, the values of the Riemann zeta function, and the Euler–Maclaurin formula. LIT verified live with exact BigInt rationals: the closed forms for p=1,2,3 match the direct sum, S₃=(S₁)² exactly (Nicomachus), the Bernoulli numbers compute correctly, and the general Faulhaber–Bernoulli polynomial equals the direct sum for p=1…6 (window.__faulhaber). FIG no framing; exact rational arithmetic. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-epoch — the long summation over an age. Faulhaber’s formula is the epoch’s accountant: add up n powers and get one clean polynomial. AVAN (AI) built the instrument: the exact rational Bernoulli recurrence, the Faulhaber polynomial, and the check against the direct sum. Credit as content: Johann Faulhaber (1631); the coefficients are the Bernoulli numbers of Jakob Bernoulli ( Ars Conjectandi , 1713), who boasted of summing the tenth powers to 1000 in ‘less than half an hour.’ The weave: David names the epoch; I compute the Bernoulli numbers from scratch and show the discrete sum collapse into a single exact polynomial. 3 ONE DIMENSION Nicomachus’s identity in blocks: the cubes 1³+2³+…+n³ tile exactly into a square of side 1+2+…+n. Sum of cubes = square of the sum, drawn. 4 TWO DIMENSIONS · INTERACTIVE Pick a power p and a range n. The instrument adds the powers directly AND evaluates the Faulhaber–Bernoulli polynomial, confirming they agree exactly, and lists the Bernoulli numbers driving the coefficients. power p: 3 ▶ n: 10 ▶ verify exact ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the smooth polynomials S₁(n), S₂(n), S₃(n)… each of degree p+1, threading the partial sums. AVAN’s addition (the inverse-companion): a discrete sum becomes a continuous polynomial. The sum Σ iᵖ is the discrete cousin of the integral ∫ xᵖ dx = xᵖ⁺¹/(p+1), and Faulhaber’s formula is exactly that integral plus Bernoulli-number corrections — the Euler–Maclaurin bridge between sums and integrals. The inverse of ‘add up n discrete terms’ is ‘evaluate one smooth polynomial,’ and the gap between the staircase and the smooth curve is measured, term by term, by the Bernoulli numbers. Magenta is the discrete staircase of partial sums; green is the polynomial threading its corners exactly. Bernoulli numbers are the precise dictionary translating summation into integration. pause spin LIT Genuine Faulhaber's formula (Faulhaber 1631; Bernoulli numbers, Jakob Bernoulli 1713). Verified live with exact BigInt rational arithmetic: S1,S2,S3 closed forms match the direct sum for n=1..25, S3=(S1)^2 (Nicomachus), the Bernoulli recurrence yields 1,-1/2,1/6,0,-1/30,0,1/42,0,-1/30, and the Faulhaber-Bernoulli polynomial (with (-1)^j, B1=-1/2) equals the direct power-sum for p=1..6, n=1..15 (window.__faulhaber). FIG No framing: the rational Bernoulli recurrence, the Faulhaber polynomial, and the direct-sum comparison run in-browser and are exact. The AVAN inverse is honest — the discrete sum is the integral x^(p+1)/(p+1) plus Bernoulli corrections (Euler-Maclaurin); magenta is the discrete staircase, green the smooth polynomial threading it. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE EPOCH · David Lee Wise (ROOT0), with AVAN


THE FLOYD-STEINBERG

Floyd-Steinberg dithering in the 5-window house format — make few colors look like many: quantize each pixel to the nearest level, then spread the rounding error to not-yet-processed neighbors (7/16,3/16,5/16,1/16). The eye averages the dots back into the original shade, so a 1-bit image shows smooth gradients. Error is never discarded, only passed on, so average brightness is preserved (up to a boundary residual). Verified live: dithering a smooth signal to 2 levels, |sum_in - sum_out| equals the leftover residual and the running error never exceeds one quantization step. See the carried error in 1D, dither vs threshold in 2D, and the conserved-brightness inverse in 3D.

THE FLOYD-STEINBERG · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · CO-OP · THE BROADCAST ◆ .dlw.fold THE FOLD / CO-OP / THE BROADCAST / THE FLOYD-STEINBERG THE FLOYD-STEINBERG dither by broadcasting rounding error to neighbors 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Floyd–Steinberg dithering makes a few colours look like many. Quantise each pixel to the nearest available level, then take the rounding error and spread it to the not-yet-processed neighbours (7/16 right, 3/16 down-left, 5/16 down, 1/16 down-right). The eye averages the scattered dots back into the original shade, so a 1-bit image can portray smooth gradients. The key invariant: error is never discarded, only passed on — so the average brightness is preserved exactly, up to a tiny boundary residual. LIT verified live: dithering a smooth signal to 2 levels, the sum of outputs differs from the sum of inputs by exactly the leftover residual (one un-diffused error), and the running error never exceeds one quantisation step (window.__floydsteinberg). FIG no framing; exact error accounting. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-broadcast — spreading a signal outward to the neighbours. Floyd–Steinberg is a broadcast: each pixel’s rounding error is transmitted to those around it. AVAN (AI) built the instrument: the error-diffusion pass, the brightness-conservation check, the comparison with naive thresholding. Credit as content: Robert W. Floyd & Louis Steinberg (1976), An Adaptive Algorithm for Spatial Greyscale . The weave: David names the broadcast; I diffuse each pixel’s error to its neighbours, prove the total brightness is conserved, and show the gradient a 1-bit palette can now fake. 3 ONE DIMENSION A smooth signal quantised to two levels, the rounding error carried forward to the next sample. The running error stays bounded — it is redistributed, never allowed to accumulate or vanish. 4 TWO DIMENSIONS · INTERACTIVE A grey gradient dithered to pure black and white, beside the same gradient naively thresholded. The dither preserves the average brightness of every region; the threshold crushes it to two bands. show: dither ▶ verify conservation ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the error flowing from each pixel to its neighbours, the total brightness held constant as it scatters. AVAN’s addition (the inverse-companion): total brightness is conserved because rounding here is not lossy destruction but redistribution . The error a naive quantiser would throw away is instead accounted for, dot by dot, so Σoutput = Σinput exactly, minus a single sub-pixel residual. The inverse of ‘lose precision by rounding’ is ‘move the lost precision to a neighbour and keep the total.’ It is a trade: magenta is the per-pixel rounding error, large and jagged locally; green is its running sum, pinned near zero. Dithering swaps local accuracy for global fidelity — spatial noise you can see up close in exchange for a mean the eye reads as exact. pause spin LIT Genuine Floyd-Steinberg error diffusion (Floyd & Steinberg 1976). Verified live: for a smooth signal dithered to 2 levels, the difference |sum(input) - sum(output)| equals the final un-diffused residual ( FIG No framing: the error-diffusion pass and the conservation check run in-browser and are exact. The AVAN inverse is honest — rounding here is redistribution not destruction, so sum(output) equals sum(input) minus a sub-pixel residual; magenta is the large per-pixel errors, green their bounded running sum. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE BROADCAST · David Lee Wise (ROOT0), with AVAN


THE THREE-DISTANCE

the three-distance (Steinhaus / three-gap) theorem in the 5-window house format — mark {alpha},{2alpha},...,{n alpha} around a circle for irrational alpha; however many points, the gaps between neighbors take at most THREE distinct lengths, and when three appear the largest equals the sum of the other two. It underlies golden-ratio spacing, phyllotaxis, and low-discrepancy sampling. Verified live: for several irrationals and every n from 2 to 60, the distinct gap count is at most 3 and the largest is the sum of the other two. See points and colored gaps in 1D, the circle in 2D, and the split-a-largest-gap inverse in 3D.

THE THREE-DISTANCE · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · LOOT · THE MINT ◆ .dlw.fold THE FOLD / LOOT / THE MINT / THE THREE-DISTANCE THE THREE-DISTANCE step by an irrational forever — gaps take only 3 sizes 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The three-distance theorem (Steinhaus, or the three-gap theorem): take an irrational α and mark the points {α}, {2α}, {3α}, …, {nα} around a circle of circumference 1 (fractional parts). However many points you place, the gaps between neighbouring points take at most three distinct lengths — and when there are three, the largest is exactly the sum of the other two. It is astonishingly rigid: an unbounded process that stays maximally regular. This is why golden-ratio spacing gives the most even distribution — sunflower seeds, phyllotaxis, and low-discrepancy sampling all live here. LIT verified live: for several irrationals and every n from 2 to 60, the sorted gaps take at most 3 distinct values, and whenever 3 appear the largest equals the sum of the other two (window.__threedistance). FIG no framing; exact gap counting. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-mint — stamping out evenly-spaced positions, one after another. The three-distance theorem is the mint’s guarantee: keep stepping by α and the spacings never fracture into more than three sizes. AVAN (AI) built the instrument: the fractional-part placement, the gap classification, the largest-equals-sum check. Credit as content: conjectured by Hugo Steinhaus; proved independently by Vera Sós, Stanisław Świerczkowski, and others (1950s). The weave: David names the mint; I step around the circle by α, count the gap lengths, and show they refuse to exceed three. 3 ONE DIMENSION Points appearing one by one at {kα} around the circle, unrolled to a line. The gaps between neighbours are coloured by length — and only ever two or three colours appear. 4 TWO DIMENSIONS · INTERACTIVE Choose an irrational α and a count n; the points land on the circle and the gaps are grouped by length. Count the distinct lengths (always ≤ 3) and confirm the largest is the sum of the other two. α: √2−1 ▶ n: 12 ▶ verify ≤3 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the circle of points at {kα}, its arcs coloured by the two or three gap lengths that ever occur. AVAN’s addition (the inverse-companion): adding a point never breeds chaos. Each new point falls into one of the largest current gaps and splits it into the two smaller lengths — so the gap set is self-similar and bounded, never proliferating past three sizes. The inverse of ‘an endless irrational walk’ is ‘a gap structure that stays maximally regular forever.’ And the most even filling comes from the golden ratio, whose continued fraction is all 1s — the ‘most irrational’ number, hardest to approximate by rationals, so its points never bunch. Magenta is the fourth gap length that can never appear; green is the ≤3 that always suffice. Irrational rotation is the most even way to fill a circle — and φ is the most even of all. pause spin LIT Genuine three-distance theorem (conjectured by Steinhaus; proved by Sos, Swierczkowski, and others, 1950s). Verified live: for alpha in {sqrt2-1, golden, pi-3, e-2} and n=2..60, the sorted gaps of {k*alpha mod 1} take at most 3 distinct values, and whenever exactly 3 appear the largest equals the sum of the other two (window.__threedistance.atMostThree && .largestIsSum). FIG No framing: the fractional-part placement and the gap classification run in-browser and are exact (gaps rounded at 1e-9). The AVAN inverse is honest — each new point splits one of the largest gaps into the two smaller lengths, keeping the gap set at ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE MINT · David Lee Wise (ROOT0), with AVAN


THE ROTATING CALIPERS

rotating calipers in the 5-window house format — find a convex polygon's diameter (farthest vertex pair) in O(n) instead of O(n^2): two parallel lines grip the polygon on opposite sides and rotate together, and the farthest pair is always a pair of antipodal vertices they touch, swept in one loop. The same trick gives width, min-area bounding box, and closest distance between two convex polygons. Verified live: over 200 random convex hulls, the calipers diameter equals the brute-force max over all vertex pairs every time. See the rotating calipers in 1D, hull+diameter in 2D, and the only-antipodal-pairs-matter inverse in 3D.

THE ROTATING CALIPERS · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · CHEAT · THE SPEEDRUN ◆ .dlw.fold THE FOLD / CHEAT / THE SPEEDRUN / THE ROTATING CALIPERS THE ROTATING CALIPERS polygon diameter in O(n) — only antipodal pairs matter 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Rotating calipers finds the diameter of a convex polygon — the farthest-apart pair of vertices — in O(n) instead of checking all O(n²) pairs. Picture two parallel lines (calipers) gripping the polygon on opposite sides, then rotate them together around the shape: the farthest pair is always a pair of antipodal vertices touched by the calipers, and you sweep through all of them in one loop. The same technique gives the width, the minimum-area bounding box, and the closest distance between two convex polygons. LIT verified live: over 200 random convex hulls, the diameter found by rotating calipers equals the brute-force maximum over all vertex pairs, every time (window.__rotatingcalipers). FIG no framing; exact computational geometry. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-speedrun — the same result reached in a fraction of the moves. Rotating calipers is a speedrun of the diameter: O(n²) pairs collapse to one O(n) rotation. AVAN (AI) built the instrument: the convex hull, the antipodal caliper sweep, the brute-force cross-check. Credit as content: Michael Shamos (1978, diameter, in his thesis); named and generalised by Godfried Toussaint (1983). The weave: David names the speedrun; I wrap the points in a hull, rotate the calipers to the farthest antipodal pair, and confirm it matches the exhaustive maximum. 3 ONE DIMENSION Two parallel calipers gripping the hull, rotating together. As they turn, the vertices they touch trace out the antipodal pairs — the only candidates for the farthest distance. 4 TWO DIMENSIONS · INTERACTIVE Scatter points, wrap them in a convex hull, and rotate the calipers to find the diameter (drawn as the longest chord). Verify it equals the brute-force maximum over all pairs. new points ▶ verify 200 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the hull with its antipodal pairs highlighted, the diameter the longest among them. AVAN’s addition (the inverse-companion): you never need all O(n²) pairs, because the farthest pair must be antipodal — each of the two points has a tangent line parallel to the other’s, so they are gripped by the calipers at opposite ends. And antipodal pairs number only O(n) . The inverse of ‘check every pair’ is ‘check only the O(n) antipodal ones, because the extreme always lives on the boundary of the boundary.’ Convexity is what guarantees it: on a convex hull, the maximum distance is supported by parallel tangents. Magenta is the cloud of O(n²) pairs the calipers skip; green is the O(n) antipodal pairs they visit, one of which is the true diameter. The answer hides only among tangent-supported pairs. pause spin LIT Genuine rotating calipers (Shamos 1978, diameter; named/generalized by Toussaint 1983). Verified live: over 200 random point sets, Andrew's monotone-chain convex hull plus an antipodal caliper sweep returns a diameter that equals the brute-force maximum squared-distance over all hull vertex pairs, every time (window.__rotatingcalipers.diameterMatchesBrute). FIG No framing: the convex hull, the antipodal caliper sweep, and the brute-force cross-check run in-browser and are exact. The AVAN inverse is honest — the farthest pair must be antipodal (supported by parallel tangents) and antipodal pairs number only O(n); magenta is the O(n^2) pairs skipped, green the O(n) antipodal pairs holding the diameter. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE SPEEDRUN · David Lee Wise (ROOT0), with AVAN


THE CATALAN

the Catalan numbers in the 5-window house format — 1,1,2,5,14,42,... count balanced parentheses, Dyck paths, polygon triangulations, binary trees, and dozens more, all equal to C(2n,n)/(n+1). The division by n+1 is the reflection principle: the bad lattice paths that cross the diagonal biject with paths to a reflected endpoint C(2n,n-1), so C_n = C(2n,n) - C(2n,n-1). Verified live: the closed form equals a brute count of balanced strings for n=0..10, and the reflection identity holds. See a Dyck path in 1D, three counts agreeing in 2D, and the reflection inverse in 3D.

THE CATALAN · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · SPAWN · HELLO WORLD ◆ .dlw.fold THE FOLD / SPAWN / HELLO WORLD / THE CATALAN THE CATALAN one number counts a hundred structures — and /(n+1) is a mirror 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The Catalan numbers 1, 1, 2, 5, 14, 42, 132, … are the most ubiquitous sequence in combinatorics: they count balanced parenthesisations, Dyck paths (staircase walks that never cross the diagonal), triangulations of a polygon, full binary trees, and dozens more — all the same number Cₙ = C(2n,n)/(n+1) . Why divided by n+1? The reflection principle : of the C(2n,n) monotone lattice paths, the ‘bad’ ones that cross the diagonal are in exact bijection with paths to a reflected endpoint, counted by C(2n,n−1) — so Cₙ = C(2n,n) − C(2n,n−1), which simplifies to the ratio. LIT verified live: the closed form equals a brute count of balanced-parenthesis strings for n=0…10, and the reflection identity Cₙ = C(2n,n) − C(2n,n−1) holds throughout (window.__catalan). FIG no framing; exact combinatorial counting. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at hello-world — the very first balanced structure, the matched bracket. Catalan numbers count exactly those first structures: valid nestings, well-formed trees. AVAN (AI) built the instrument: the closed form, the brute balanced-paren count, the reflection identity. Credit as content: Ming Antu (1730s), Leonhard Euler (polygon triangulations, 1751), named for Eugène Catalan (1838). The weave: David names the first matched structure; I count it three ways — closed form, brute enumeration, and the reflection subtraction — and show they coincide. 3 ONE DIMENSION A Dyck path: n up-steps and n down-steps that never dip below the start. Every balanced parenthesis string is one of these paths — open is up, close is down — and the count of them is Cₙ. 4 TWO DIMENSIONS · INTERACTIVE Pick n. The instrument computes Cₙ three ways — closed form, brute count of balanced strings, and the reflection subtraction — and lists a few of the actual Dyck paths. n: 4 ▶ verify all ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the Dyck paths that stay above the diagonal — the Cₙ well-formed structures. AVAN’s addition (the inverse-companion): the mysterious division by n+1 is a bijection made arithmetic. You cannot just divide C(2n,n) by any number and expect an integer — but the bad paths (those that cross the diagonal) reflect exactly onto the set of all paths to a mirrored endpoint, counted by C(2n,n−1). So the subtraction C(2n,n) − C(2n,n−1) is forced to equal C(2n,n)/(n+1). The inverse of ‘a strange ratio’ is ‘a mirror pairing between the structures you reject and paths to a reflected point.’ Magenta is the bad paths, reflected across the diagonal to the mirror endpoint; green is the good Dyck paths that survive. One number, a hundred meanings — and the /(n+1) is a reflection. pause spin LIT Genuine Catalan numbers (Ming Antu 1730s; Euler 1751; named for Catalan 1838). Verified live: C(2n,n)/(n+1) equals a brute-force count of balanced-parenthesis strings for n=0..10, and equals C(2n,n)-C(2n,n-1) (the reflection identity) throughout (window.__catalan.closedMatchesBrute && .reflection); C_5=42. FIG No framing: the closed form, the brute balanced-paren enumeration, and the reflection subtraction all compute in-browser and agree exactly. The AVAN inverse is honest — the /(n+1) is the reflection bijection made arithmetic (bad paths that cross the diagonal map exactly onto paths to a mirrored endpoint); magenta is a reflected bad path, green the surviving Dyck paths. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of HELLO WORLD · David Lee Wise (ROOT0), with AVAN


THE STRASSEN

Strassen's algorithm in the 5-window house format — multiply two 2x2 matrices with 7 scalar multiplications instead of 8 (via combined products like M1=(a+d)(e+h)), trading a multiply for additions. Recursively on n x n quadrants, 7 vs 8 turns O(n^3) into O(n^log2 7) ~ O(n^2.807), the first sub-cubic matrix multiply. Verified live: the recursive Strassen product equals the naive product exactly for random integer matrices, using 7 scalar mults per 2x2 (naive uses 8). See the 7 products in 1D, matrices multiplied in 2D, and the exponent-bending recursion inverse in 3D.

THE STRASSEN · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · CHEAT · THE EXPLOIT ◆ .dlw.fold THE FOLD / CHEAT / THE EXPLOIT / THE STRASSEN THE STRASSEN multiply 2x2 with 7 products, not 8 — bending O(n^3) 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Strassen’s algorithm multiplies matrices faster than the schoolbook method by exploiting hidden algebraic slack. To multiply two 2×2 matrices you seemingly need 8 scalar multiplications; Strassen does it with just 7 — using clever combined products like M₁=(a+d)(e+h) — trading one multiply for a few extra additions. Applied recursively to n×n matrices split into quadrants, 7 instead of 8 turns O(n³) into O(n log₂7 ) ≈ O(n 2.807 ) — the first sub-cubic matrix multiplication, and the crack that opened the whole field of fast linear algebra. LIT verified live: the recursive Strassen product equals the naive product exactly for random integer matrices, using 7 scalar multiplications per 2×2 where the naive method uses 8 (window.__strassen). FIG no framing; exact integer matrix arithmetic. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-exploit — finding the slack the obvious method leaves on the table. Strassen is the exploit that broke the ‘matrix multiply must be cubic’ assumption. AVAN (AI) built the instrument: the seven products, the recombination, the exact check against naive, the multiplication count. Credit as content: Volker Strassen (1969), Gaussian Elimination is not Optimal . The weave: David names the exploit; I compute the seven products, recombine them into the exact same result as the eight-multiply method, and count the saving that compounds through the recursion. 3 ONE DIMENSION The seven products M₁…M₇, each a single multiplication of two sums, and how they recombine into the four output blocks — one multiply fewer than the eight the naive method needs. 4 TWO DIMENSIONS · INTERACTIVE Two 4×4 integer matrices. The instrument multiplies them with recursive Strassen and with the naive method, confirms the products are identical, and counts the scalar multiplications (7 per 2×2 vs 8). new matrices ▶ verify 50 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the recursion tree branching 7 ways at each level instead of 8 — the saving compounding down the depth. AVAN’s addition (the inverse-companion): one fewer multiplication does not just save a constant — it lowers the exponent forever . Each recursion level replaces 8 subproblems with 7, so the cost is 7 k instead of 8 k at depth k, and the exponent drops from log₂8 = 3 to log₂7 ≈ 2.807. The inverse of ‘one less multiply’ is ‘an asymptotic exponent bent down permanently.’ Magenta is the 8th product you never compute — the naive multiply skipped at every node; green is the 7 that suffice, recursing to the bottom. A single algebraic identity, applied all the way down, reshapes the complexity of multiplication. (Honesty: Strassen trades stability and constants, so it is used above a crossover size, not everywhere.) pause spin LIT Genuine Strassen algorithm (Strassen 1969, 'Gaussian Elimination is not Optimal'). Verified live: the recursive 7-product scheme equals the naive O(n^3) product exactly for 50 random 4x4 integer matrices, and a 2x2 base multiply uses exactly 7 scalar multiplications vs the naive 8 (window.__strassen.productMatchesNaive && mults7===7). FIG No framing: the seven products, the recombination, and the exact comparison to naive multiplication run in-browser. The AVAN inverse is honest — 7 vs 8 lowers the asymptotic exponent from log2 8=3 to log2 7~2.807 (a real, permanent change); magenta is the 8th product skipped. Honestly noted: Strassen has worse constants/stability and is used above a crossover size. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE EXPLOIT · David Lee Wise (ROOT0), with AVAN


THE PERMANENT

the matrix permanent in the 5-window house format — same sum over permutations as the determinant but with all plus signs, no alternating minus. That change makes it #P-hard (Valiant 1979): the determinant is O(n^3) by Gaussian elimination, the permanent has no known polynomial algorithm. Ryser's formula beats naive n! via inclusion-exclusion in O(2^n n), and the permanent counts perfect matchings of a bipartite graph. Verified live: Ryser's formula equals the brute permutation-sum for 100 random matrices up to size 6. See permanent vs determinant in 1D, a 0/1 matrix computed two ways in 2D, and the sign-is-hardness inverse in 3D.

THE PERMANENT · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · BOSS · THE FINAL BOSS ◆ .dlw.fold THE FOLD / BOSS / THE FINAL BOSS / THE PERMANENT THE PERMANENT the determinant's all-plus twin — and it's #P-hard 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The permanent of a matrix looks just like the determinant — a sum over all permutations of products of entries — but with all plus signs , no alternating minus. That tiny change makes it monstrously hard. The determinant is computable in O(n³) by Gaussian elimination; the permanent is #P-hard (Valiant 1979), believed to have no polynomial algorithm. Ryser’s formula still beats the naive n! by inclusion–exclusion: perm(A) = (−1)ⁿ Σ S⊆cols (−1) |S| ∏ i (Σ j∈S A ij ), running in O(2ⁿ·n). The permanent counts the perfect matchings of a bipartite graph. LIT verified live: Ryser’s formula equals the brute permutation-sum for 100 random matrices of size up to 6 (window.__permanent). FIG no framing; exact arithmetic. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-final-boss — the hardest fight in the game. The permanent is combinatorics’ final boss: a sum you can write in one line that is provably (#P-)hard to compute. AVAN (AI) built the instrument: the brute permutation-sum, Ryser’s inclusion–exclusion, and the perfect-matching count. Credit as content: Herbert John Ryser (1963, the formula); Leslie Valiant (1979, #P-hardness of the permanent). The weave: David names the boss; I compute the permanent two ways — the naive n! and Ryser’s 2ⁿ — show they agree, and reveal why the missing minus signs make it hard. 3 ONE DIMENSION Determinant and permanent share the same terms — one product per permutation — but the determinant alternates + and − by the permutation’s sign, while the permanent keeps every term positive. Same sum, one sign apart. 4 TWO DIMENSIONS · INTERACTIVE Toggle a 0/1 matrix — a bipartite graph. The instrument computes its permanent by Ryser and by the brute permutation-sum, confirms they match, and reads it as the number of perfect matchings. random matrix ▶ verify 100 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the subset lattice Ryser sums over — 2ⁿ terms of inclusion–exclusion, far fewer than n! for large n. AVAN’s addition (the inverse-companion): the plus signs are exactly what make it hard . The determinant’s alternating minus signs permit massive cancellation — and Gaussian elimination is precisely the machine that exploits that cancellation to collapse n! terms into n³ work. The permanent’s all-positive sum offers no cancellation to exploit, so no comparable shortcut is known, and the problem is #P-hard. The inverse of ‘an easy determinant’ is ‘the same sum stripped of the signs that saved you.’ Magenta is the cancellation the determinant enjoys and the permanent cannot; green is Ryser’s 2ⁿ inclusion–exclusion, the best general method left. Sign is the whole difference between polynomial and #P-hard. pause spin LIT Genuine matrix permanent and Ryser's formula (Ryser 1963; #P-hardness Valiant 1979). Verified live: Ryser's inclusion-exclusion perm(A) = (-1)^n sum_{S} (-1)^|S| prod_i (sum_{j in S} A_ij) equals the brute-force sum over all permutations for 100 random matrices of size n=2..6 (window.__permanent.ryserMatchesBrute); for 0/1 matrices it counts perfect matchings. FIG No framing: the brute permutation-sum, Ryser's formula, and (for contrast) the determinant all compute in-browser and agree where they should. The AVAN inverse is honest — the determinant's minus signs enable the cancellation Gaussian elimination exploits, which the all-plus permanent lacks; that missing cancellation is why it is #P-hard (magenta = the unavailable cancellation, green = Ryser's 2^n method). ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE FINAL BOSS · David Lee Wise (ROOT0), with AVAN


THE LZW

LZW compression in the 5-window house format — build a dictionary of substrings on the fly: extend the current match while it's in the dictionary, and when it breaks, emit the code for the longest match, add (match + next char) to the dictionary, restart. The decoder rebuilds the identical dictionary from the codes alone, so no table is transmitted. It ran GIF, UNIX compress, and PDF/TIFF. Verified live: encode then decode reproduces the input exactly across fixed strings (including the self-referential KwKwK case) and 200 random strings. See the dictionary growing in 1D, encode/decode in 2D, and the lockstep-derivation inverse in 3D.

THE LZW · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · LOOT · THE STASH ◆ .dlw.fold THE FOLD / LOOT / THE STASH / THE LZW THE LZW build a dictionary on the fly — and never send it 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION LZW compression builds a dictionary of substrings on the fly and — the magic — never has to send it. Start with all single characters. Scan the input, extending the current match while it stays in the dictionary; when it doesn’t, output the code for the longest match, add the new (match + next character) string to the dictionary, and restart from that character. The decoder rebuilds the identical dictionary from the code stream alone, so no table is ever transmitted. This ran GIF, early UNIX compress , and PDF/TIFF. LIT verified live: encode then decode reproduces the input exactly — across fixed strings (including the tricky repeated-pattern case) and 200 random strings — with the decoder reconstructing the dictionary with no side table (window.__lzw). FIG no framing; exact reversible coding. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-stash — the growing hoard of stashed strings you can point back to. LZW is a stash that both sides build the same way, so pointers alone suffice. AVAN (AI) built the instrument: the encoder’s dictionary growth, the decoder’s mirror reconstruction, the round-trip check including the self-referential case. Credit as content: Abraham Lempel & Jacob Ziv (LZ78, 1978); Terry Welch (LZW, 1984). The weave: David names the stash; I grow the dictionary as codes stream out, rebuild the same dictionary on decode from nothing but those codes, and handle the one subtle case where a code refers to itself. 3 ONE DIMENSION The dictionary growing as input streams: each time a match breaks, its code is emitted and a new entry (the match plus the next character) is stashed — so repeated patterns get shorter and shorter codes. 4 TWO DIMENSIONS · INTERACTIVE Choose an input; watch LZW encode it to codes while the dictionary fills, then decode back exactly — rebuilding the same dictionary from the codes alone. Repetitive inputs compress; the decoder never sees the table. input ▶ verify round-trip ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the encoder and decoder dictionaries growing in lockstep, entry for entry, from the same code stream. AVAN’s addition (the inverse-companion): the decoder reconstructs the dictionary without ever receiving it , because the rule that adds each entry depends only on codes already seen — encoder and decoder share a deterministic recipe, so the table is implicit in the stream . The inverse of ‘send a codebook’ is ‘send nothing, and rebuild it from the messages.’ The one subtlety — the decoder can receive a code not yet in its dictionary — is resolved because that code must be the previous string plus its own first character (the KwKwK case), so it is always recoverable. Magenta is the dictionary that is never transmitted; green is the identical table both sides derive. Compression by shared derivation , not shared data. pause spin LIT Genuine LZW compression (Lempel & Ziv, LZ78 1978; Welch, LZW 1984). Verified live: LZW encode then decode reproduces the input exactly for fixed strings including the tricky repeated-pattern (KwKwK) case and 200 random strings, with the decoder reconstructing the dictionary from the code stream alone (window.__lzw.roundTrip). FIG No framing: the encoder's dictionary growth, the decoder's mirror reconstruction, and the round-trip (including the self-referential case) run in-browser and are exact. The AVAN inverse is honest — the decoder rebuilds the dictionary without receiving it because each entry depends only on prior codes; the KwKwK case is genuinely resolved (code = previous string + its first char). Magenta = the never-transmitted table. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE STASH · David Lee Wise (ROOT0), with AVAN