THE BLOOM FILTER

the Bloom filter in the 5-window house format — test set membership with a bit array and k hash functions in tiny memory, without storing the elements: add sets k bits, a query passes iff all k are 1; any 0 means definitely absent, all 1 means probably present. The only error is a false POSITIVE, never a false negative. It is everywhere: databases, caches, spell-checkers, crypto clients. Verified live: over 200 filters every inserted element queries positive (zero false negatives, one-sided error); the false-positive rate is measured live against the ideal (1-e^-kn/m)^k. See the k-bit set in 1D, insert+query in 2D, and the one-sided-error inverse in 3D.

THE BLOOM FILTER · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GLITCH · HEISENBUG ◆ .dlw.fold THE FOLD / GLITCH / HEISENBUG / THE BLOOM FILTER THE BLOOM FILTER probabilistic membership with one-sided error 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The Bloom filter tests set membership using a bit array and k hash functions, in tiny memory — without storing the elements at all. To add an item, set the k bits its hashes point to; to query, check those k bits. If any is 0 the item is definitely absent ; if all are 1 it is probably present . The only possible error is a false positive — never a false negative. It is everywhere: databases, caches, spell-checkers, cryptocurrency clients. LIT verified live: over 200 filters every inserted element queries positive ( zero false negatives), so all error is one-sided; the false-positive rate is measured live against the ideal (1−e −kn/m ) k (window.__bloomfilter). FIG honest: with simple double-hashing the measured FP runs a little above the ideal-independent-hash bound. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at heisenbug — a false positive is exactly that intermittent phantom: the filter says ‘maybe present’ for something that was never added, an error that only ever points one way. AVAN (AI) built the instrument: the bit array, the k hashes, the no-false-negative check, the live FP-rate measurement. Credit as content: Burton Howard Bloom (1970). The weave: David names the heisenbug; I set k bits per item and show that a zero bit proves absence while the only mistakes are one-sided false positives. 3 ONE DIMENSION Adding an item sets the k bits its hashes select. A query passes only if all k are already 1 — so a single 0 among them is a certain ‘not in the set’. 4 TWO DIMENSIONS · INTERACTIVE Insert items, then query members and non-members; members always pass, and the measured false-positive rate is shown against the ideal. insert a batch ▶ verify 200 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the bit pattern that can answer ‘definitely absent’ with certainty. AVAN’s addition (the inverse-companion): you can answer ‘definitely NOT in the set’ with certainty while never storing the elements — k hash bits per item, and an unset bit proves absence; the only error is a false positive , never a false negative. The inverse of ‘keep the members to test them’ is ‘keep only bits, and let a zero bit prove non-membership.’ Magenta is the elements never stored; green is the bit pattern that can only err toward ‘maybe’. One-sided error, tiny memory. pause spin LIT Genuine Bloom filter (Bloom 1970). Verified live: over 200 filters every inserted element queries positive (zero false negatives, error is strictly one-sided) (window.__bloomfilter.noFalseNegatives && .oneSidedError); the measured false-positive rate is reported. FIG No framing on the guarantee: the no-false-negative / one-sided-error property is exact and verified. HONEST caveat: the interactive measures the false-positive rate against the ideal-independent-hash bound (1-e^-kn/m)^k, and with simple double-hashing the measured FP runs modestly (2-5x) above that ideal — a real property of double hashing, reported not hidden. Magenta is the elements never stored, green the bit pattern that only errs toward 'maybe'. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of HEISENBUG · David Lee Wise (ROOT0), with AVAN


THE HALLEY

Halley's method in the 5-window house format — find a root even faster than Newton by using the second derivative (curvature): the step x - 2ff'/(2f'^2 - ff'') fits a better local model, so the error cubes each iteration instead of squaring, roughly 3x the correct digits per step versus Newton's 2x. Verified live: over 200 cases Halley converges to the true cube root and reaches tolerance in no more iterations than Newton (usually fewer) - e.g. cbrt(50) in 3 Halley steps vs 4 Newton. See tangent vs curve in 1D, iterates in 2D, and the curvature-triples-the-digits inverse in 3D.

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

THE HALLEY · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · CHEAT · THE SPEEDRUN ◆ .dlw.fold THE FOLD / CHEAT / THE SPEEDRUN / THE HALLEY THE HALLEY cubic-convergence root finding via the second derivative 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The Hilbert curve is a space-filling curve: a single continuous line that visits every cell of a 2 k ×2 k grid exactly once, and — crucially — consecutive cells on the line are always grid-neighbors (one step apart). That locality means points close along the 1-D curve are usually close in 2-D, which is why databases and image formats use the Hilbert index for spatial locality. The map index ↔ (x,y) is a pure bit-twiddle with rotations. LIT verified live: for grids up to 64×64 the index↔(x,y) map is a bijection , and every pair of consecutive indices lands on cells at Manhattan distance 1 (window.__hilbert). FIG no framing; exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-inventory — the flat index over a 2-D grid that keeps neighbors near, the way a well-ordered inventory keeps like beside like. The Hilbert curve is that locality-preserving index. AVAN (AI) built the instrument: the d→(x,y) and (x,y)→d bit-rotations, the bijection check, and the adjacency check. Credit as content: David Hilbert (1891). The weave: David names the inventory; I fold the 1-D index into 2-D with quadrant rotations and confirm it visits every cell once, with each step landing on a neighbor. 3 ONE DIMENSION The order-1 U-shape is copied into each quadrant, two copies rotated, and joined end to end — recursively. The result is one unbroken path where every step moves to an adjacent cell. 4 TWO DIMENSIONS · INTERACTIVE The Hilbert curve at a chosen order; the index↔(x,y) bijection and the step-1 adjacency are checked over the whole grid. order ▶ verify ≤64 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: a 1-D order that preserves 2-D locality. AVAN’s addition (the inverse-companion): lay a single line through a 2-D grid so that consecutive points stay grid-neighbors — fold the index into (x,y) with recursive quadrant rotations. The inverse of ‘scan row by row, where the end of one row jumps far from the next’ is ‘a Hilbert fold, where every step stays adjacent.’ Magenta is the long row-end jumps of raster order; green is the always-adjacent Hilbert path. Nearby on the line, nearby in the plane. pause spin LIT Genuine Halley's method (Halley 1694). Verified live: the curvature-aware iteration converges to the true cube root (|x^3-a| FIG No framing: the Halley iteration, the Newton comparison, and the root + iteration-count checks run in-browser and hold. The AVAN inverse is honest — incorporating the second derivative fits a better local model so the error cubes each step (cubic vs Newton's quadratic convergence), tripling the digit yield; magenta is Newton's quadratic path, green Halley's cubic. Second-order information for fewer steps. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE SPEEDRUN · David Lee Wise (ROOT0), with AVAN


THE BLUESTEIN

Bluestein's algorithm in the 5-window house format — compute the DFT of ANY length N (not just a power of two) by turning it into a convolution with a chirp: the identity kn = (k^2+n^2-(k-n)^2)/2 makes the transform a convolution of the chirp-premultiplied signal with a chirp kernel, which can be padded to a power of two and done by FFT, so a prime-length DFT runs at FFT speed. Verified live: for arbitrary lengths (5,7,11,13 and non-powers 6,9,15) Bluestein's chirp transform equals the direct DFT to ~1e-14. See the chirp in 1D, an arbitrary-N spectrum in 2D, and the chirp-frees-the-length inverse in 3D.

THE BLUESTEIN · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · SPAWN · FIRST LIGHT ◆ .dlw.fold THE FOLD / SPAWN / FIRST LIGHT / THE BLUESTEIN THE BLUESTEIN the DFT of any length via a chirp convolution 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Bluestein’s algorithm computes the discrete Fourier transform of any length N — not just a power of two — by turning the DFT into a convolution with a ‘chirp’. Using the identity kn = ½(k² + n² − (k−n)²), the transform becomes a convolution of the signal (pre-multiplied by a chirp) with a fixed chirp kernel — and that convolution can be padded to a power of two and done by a fast FFT. So a prime-length DFT runs at FFT speed. LIT verified live: for arbitrary lengths (5, 7, 11, 13, and non-powers like 6, 9, 15) Bluestein’s chirp transform equals the direct DFT to ~10⁻¹⁴ (window.__bluestein). FIG no framing; exact for any N. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at first-light — the first look at a signal’s frequency content, freed from the power-of-two straitjacket. Bluestein is that unconstrained first light. AVAN (AI) built the instrument: the chirp pre-multiply, the chirp-kernel convolution, the chirp post-multiply, the direct-DFT cross-check. Credit as content: Leo Bluestein (1968); the chirp-z transform of Rabiner, Schafer & Rader. The weave: David names first light; I rewrite the DFT as a chirp convolution and confirm it reproduces the transform for lengths no power-of-two FFT could take directly. 3 ONE DIMENSION The chirp e ±iπn²/N is a signal whose frequency sweeps upward. Multiplying by it turns the DFT’s kn product into a difference of squares — and a difference of squares is a convolution. 4 TWO DIMENSIONS · INTERACTIVE A signal of arbitrary length N; its Bluestein spectrum is shown against the direct DFT magnitudes. new N ▶ verify ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the chirp that turns any-length DFT into a convolution. AVAN’s addition (the inverse-companion): any length N can be transformed by turning the DFT into a chirp convolution (kn = ½(k²+n²−(k−n)²)), and that convolution can be padded to a power of two — so a prime-length DFT runs at FFT speed. The inverse of ‘restrict N to a power of two’ is ‘rewrite the transform as a chirp convolution of any length.’ Magenta is the power-of-two restriction; green is the chirp that frees N. The z-transform on a spiral — any size, FFT speed. pause spin LIT Genuine Bluestein / chirp-z algorithm (Bluestein 1968; Rabiner-Schafer-Rader). Verified live: the chirp premultiply + chirp-kernel convolution + chirp postmultiply reproduces the direct DFT to max error ~1e-14 for arbitrary lengths including primes and non-powers-of-two (window.__bluestein.matchesDFT). FIG No framing: the chirp pre/post multiply, the chirp-kernel convolution, and the direct-DFT cross-check run in-browser and agree to ~1e-14. The AVAN inverse is honest — the identity kn=(k^2+n^2-(k-n)^2)/2 rewrites the DFT as a chirp convolution that can be padded to a power of two, so any-length N runs at FFT speed; magenta is the power-of-two restriction, green the chirp that lifts it. The z-transform on a spiral. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of FIRST LIGHT · David Lee Wise (ROOT0), with AVAN


THE NTT

the number-theoretic transform in the 5-window house format — the FFT done over a finite field (integers mod a prime with a root of unity of the right order, here 998244353, generator 3): the same butterfly structure computes exact convolutions of integer sequences with NO floating-point error. Transform, multiply pointwise, inverse-transform, and the product is exact. It is how huge polynomials and integers are multiplied exactly. Verified live: over 200 random integer polynomial pairs the NTT convolution equals the exact naive convolution. See field butterflies in 1D, exact product in 2D, and the transform-in-a-finite-field inverse in 3D.

THE NTT · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GRIND · THE GRINDSTONE ◆ .dlw.fold THE FOLD / GRIND / THE GRINDSTONE / THE NTT THE NTT the FFT over a finite field — exact, no rounding 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The number-theoretic transform (NTT) is the FFT done over a finite field instead of the complex numbers. Working modulo a prime that has a root of unity of the right order (here 998244353, with generator 3), the same butterfly structure computes exact convolutions of integer sequences — with no floating-point error at all . Transform, multiply pointwise, inverse-transform, and the product is exact. It is how competitive programmers and cryptographers multiply huge polynomials and integers exactly. LIT verified live: over 200 random integer polynomial pairs the NTT convolution equals the exact naive convolution (window.__ntt). FIG no framing; exact integer arithmetic. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-grindstone — grinding out big exact multiplications with the transform, no rounding to creep in. NTT is that exact fast grind. AVAN (AI) built the instrument: the modular butterfly transform, the pointwise product, the inverse transform, the exact-convolution cross-check. Credit as content: the finite-field DFT (Pollard 1971; the modern NTT). The weave: David names the grindstone; I run the FFT’s butterflies in a prime field and confirm the convolution is bit-for-bit exact against the direct product. 3 ONE DIMENSION The same divide-and-conquer butterflies as an FFT — but the ‘twiddle’ is a power of a root of unity in ℤ/p, so every value is an exact integer mod p. No sines, no rounding. 4 TWO DIMENSIONS · INTERACTIVE Two integer polynomials; their NTT convolution is shown against the exact direct product — identical, to the digit. new polynomials ▶ verify 200 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the exact convolution, computed by field butterflies. AVAN’s addition (the inverse-companion): do the transform over a finite field — integers mod a prime with a root of unity — so there is no floating-point error ; the convolution is exact and rounding vanishes. The inverse of ‘transform in the continuous complex plane (with rounding)’ is ‘transform in a finite field (exact integers).’ Magenta is the floating-point roundoff of a complex FFT; green is the exact modular arithmetic. Same butterfly structure, zero error — the FFT made exact. (Kin to the-fourier and the-bluestein.) pause spin LIT Genuine number-theoretic transform (finite-field DFT; Pollard 1971). Verified live (BigInt modular arithmetic): the NTT-based convolution (forward transform, pointwise product, inverse transform, mod 998244353) equals the exact naive integer convolution for 200 random polynomial pairs (window.__ntt.matchesExact). FIG No framing: the modular butterfly transform, the pointwise product, the inverse transform, and the exact-convolution cross-check run in-browser and agree bit-for-bit. The AVAN inverse is honest — doing the transform over a finite field (a root of unity in Z/p) removes all floating-point error, so the convolution is exact; magenta is the roundoff a complex FFT carries, green the exact modular arithmetic. The FFT made exact. Kin to the-fourier and the-bluestein. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE GRINDSTONE · David Lee Wise (ROOT0), with AVAN


THE RUNGE-KUTTA

the Runge-Kutta method (RK4) in the 5-window house format — advance a differential equation one step by sampling the slope four times (start, two midpoints, end) and taking a weighted average (1,2,2,1)/6; the sampling errors cancel to fourth order, so halving the step cuts the error ~16x. One clever RK4 step is as accurate as thousands of Euler steps. It is the default workhorse for simulating physical systems. Verified live: RK4 solves y'=y to reproduce e to ~1e-5, its error shrinks ~16x when the step halves (fourth order), and y'=cos t reproduces sin t. See the four slopes in 1D, RK4 vs Euler in 2D, and the four-slope-errors-cancel inverse in 3D.

THE RUNGE-KUTTA · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GRIND · THE HOT LOOP ◆ .dlw.fold THE FOLD / GRIND / THE HOT LOOP / THE RUNGE-KUTTA THE RUNGE-KUTTA fourth-order ODE steps by four slope samples 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The Runge–Kutta method (classic RK4) advances a differential equation one step by sampling the slope four times within the step — at the start, twice at the midpoint, and at the end — then taking a weighted average (1, 2, 2, 1)/6. The sampling errors cancel to fourth order , so halving the step size cuts the error roughly 16× . One clever RK4 step is as accurate as thousands of crude Euler steps. It is the default workhorse for simulating physical systems. LIT verified live: RK4 solves y′=y to reproduce e to ~10⁻⁵, its error shrinks ~16× when the step halves (fourth-order), and y′=cos t reproduces sin t (window.__rungekutta). FIG no framing; genuine fourth-order accuracy. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-hot-loop — the tight step-loop that advances a simulation, each iteration nudging the state forward accurately. RK4 is that hot loop’s heart. AVAN (AI) built the instrument: the four-slope step, the weighted average, the exact-solution and convergence-order checks. Credit as content: Carl Runge (1895) & Wilhelm Kutta (1901). The weave: David names the hot loop; I probe the slope four times per step and confirm the error falls at fourth order against known solutions. 3 ONE DIMENSION Within one step: k₁ is the slope at the start, k₂ and k₃ at the midpoint (each using the last), k₄ at the end. Their weighted average 1·2·2·1 fits the curve to fourth order. 4 TWO DIMENSIONS · INTERACTIVE RK4 (green) versus Euler (magenta) integrating an ODE against the exact curve; RK4 tracks it where Euler drifts. switch ODE ▶ verify order ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the four-slope step that tracks the true trajectory. AVAN’s addition (the inverse-companion): sample the slope at four points within the step and take a weighted average — the errors of the samples cancel to fourth order, so one clever step is as accurate as thousands of Euler steps. The inverse of ‘trust the initial slope’ is ‘probe the slope four times and let the errors cancel.’ Magenta is Euler’s crude single-slope drift; green is the four-slope weighted step. A Simpson’s rule for trajectories — fourth-order accuracy from one step. pause spin LIT Genuine classic RK4 (Runge 1895; Kutta 1901). Verified live: RK4 solves y'=y to reproduce e to FIG No framing: the four-slope step, the weighted average, and the exact-solution + convergence-order checks run in-browser and confirm fourth-order accuracy. The AVAN inverse is honest — sampling the slope at four points and averaging makes the errors cancel to fourth order, so one step rivals thousands of Euler steps; magenta is Euler's single-slope drift, green the four-slope step. A Simpson's rule for trajectories. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE HOT LOOP · David Lee Wise (ROOT0), with AVAN


THE EAR CLIPPING

ear clipping in the 5-window house format — triangulate a simple polygon by repeatedly snipping an ear (a convex corner whose triangle contains no other vertex); each snip removes one triangle and one vertex until a triangle remains. The Two Ears Theorem guarantees an ear always exists, so it never gets stuck and yields exactly n-2 triangles. It is the standard way to turn a polygon into renderable triangles. Verified live: for 300 convex polygons and a set of non-convex reflex test shapes, ear clipping produces n-2 triangles whose areas sum to the polygon. See an ear in 1D, a triangulation in 2D, and the snip-one-safe-corner inverse in 3D.

THE EAR CLIPPING · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · SPAWN · THE SANDBOX ◆ .dlw.fold THE FOLD / SPAWN / THE SANDBOX / THE EAR CLIPPING THE EAR CLIPPING triangulate a polygon by snipping one ear at a time 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Ear clipping triangulates a simple polygon by repeatedly snipping off an ear — a convex corner whose triangle contains no other vertex of the polygon. Removing an ear cuts off one triangle and one vertex; repeat until only a triangle remains. The Two Ears Theorem guarantees every simple polygon with more than three vertices has at least two ears, so the process never gets stuck, and it always yields exactly n−2 triangles. It is the standard way to turn a polygon into renderable triangles. LIT verified live: for convex polygons (300 random) and a set of non-convex reflex test shapes, ear clipping produces exactly n−2 triangles whose areas sum to the polygon’s area (window.__earclipping). FIG no framing; a valid triangulation. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-sandbox — the geometry playground where a shape is broken into the triangles a renderer can draw. Ear clipping is that meshing. AVAN (AI) built the instrument: the convex-corner test, the point-in-triangle ear check, the snip-and-repeat loop, the triangle-count and area cross-checks. Credit as content: the ear-clipping method (Meisters’ Two Ears Theorem, 1975). The weave: David names the sandbox; I snip one safe ear at a time and confirm the result is a valid triangulation of exactly n−2 triangles. 3 ONE DIMENSION An ear is a convex vertex whose triangle (its two neighbours) holds no other vertex. Snip it: one triangle comes off, the polygon loses a vertex, and the search repeats. 4 TWO DIMENSIONS · INTERACTIVE A polygon triangulated by ear clipping; the n−2 triangles are shown, and their areas sum to the polygon’s. new polygon ▶ non-convex ▶ verify ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the triangulation, one ear snipped at a time. AVAN’s addition (the inverse-companion): repeatedly snip off a single ear — a convex corner whose triangle contains no other vertex — reducing the polygon by one vertex each time, until only a triangle remains. The inverse of ‘decompose the shape globally’ is ‘remove one safe corner at a time.’ The Two Ears Theorem guarantees an ear always exists, so the greedy snip never fails. Magenta is the whole polygon; green is the ear being clipped. n−2 triangles fall out, one snip each. pause spin LIT Genuine ear-clipping triangulation (Meisters' Two Ears Theorem, 1975). Verified live: for 300 random convex polygons and 5 hardcoded non-convex reflex polygons (L-shape, arrowhead, U-comb, dart, plus), ear clipping produces exactly n-2 triangles whose absolute areas sum to the polygon's area (window.__earclipping.convexOK && .nonConvexOK). FIG No framing: the convex-corner test, the point-in-triangle ear check, the snip-and-repeat loop, and the count + area cross-checks run in-browser and hold. HONEST scope: random simple polygons are hard to generate robustly, so verification uses convex polygons (exhaustively) plus hardcoded non-convex reflex cases (which genuinely exercise reflex vertices). The AVAN inverse is honest — snip one safe ear at a time; the Two Ears Theorem guarantees one exists. Magenta is the whole polygon, green the ear. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE SANDBOX · David Lee Wise (ROOT0), with AVAN


THE BINARY LIFTING

binary lifting in the 5-window house format — jump to any ancestor in a tree in logarithmic time: precompute each node's 2^k-th ancestor for every k, then a jump of d steps follows the binary digits of d (O(log depth) hops instead of d). The same table answers lowest-common-ancestor queries: level the two nodes, then jump both up in decreasing powers of two until they meet. It is the standard ancestor/LCA tool. Verified live: over 200 random trees the binary-lifting LCA equals a brute parent-walk for every query. See a binary jump in 1D, an LCA on a tree in 2D, and the leap-in-powers-of-two inverse in 3D.

THE BINARY LIFTING · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · CHEAT · NOCLIP ◆ .dlw.fold THE FOLD / CHEAT / NOCLIP / THE BINARY LIFTING THE BINARY LIFTING ancestor and LCA queries in log time by doubling 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Binary lifting lets you jump to any ancestor in a tree in logarithmic time. Precompute, for every node, its 2 k -th ancestor for each k; then a jump of d steps is done by following the binary digits of d — O(log depth) hops instead of d. The same table answers lowest common ancestor queries: level the two nodes, then jump both upward in decreasing powers of two until they meet. It is the standard tool for ancestor and LCA queries on trees. LIT verified live: over 200 random trees the binary-lifting LCA equals a brute parent-walk for every query pair (window.__binarylifting). FIG no framing; exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at noclip — clip straight up through the tree, skipping whole runs of ancestors in single power-of-two leaps. Binary lifting is that no-clip ascent. AVAN (AI) built the instrument: the doubling ancestor table, the level-and-meet LCA, the brute-walk cross-check. Credit as content: the doubling technique (Bender & Farach-Colton; folklore). The weave: David names the no-clip; I precompute power-of-two ancestors and leap to any ancestor or LCA in log time, confirmed against a parent-by-parent walk. 3 ONE DIMENSION A jump of 13 = 1101₂ is done in three leaps: up 8, up 4, up 1 — reading the exponent in binary, instead of thirteen single steps. 4 TWO DIMENSIONS · INTERACTIVE A tree; pick two nodes and their lowest common ancestor is found by binary lifting, checked against a parent-walk. new tree ▶ random LCA ▶ verify 200 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the power-of-two leaps up the tree to an ancestor or LCA. AVAN’s addition (the inverse-companion): precompute the 2 k -th ancestor of every node, so any jump of d steps follows the binary digits of d — O(log depth) hops instead of d. The inverse of ‘walk up parent by parent’ is ‘leap in powers of two, reading d in binary.’ Magenta is the step-by-step climb; green is the doubling jumps. Ancestors and LCA in log time — the very same doubling trick as fast exponentiation, applied to a tree. pause spin LIT Genuine binary lifting / ancestor doubling. Verified live: the 2^k-ancestor table plus level-and-meet LCA returns the same lowest common ancestor as a brute parent-by-parent walk for every query pair across 200 random trees (window.__binarylifting.matchesBrute). FIG No framing: the doubling ancestor table, the level-and-meet LCA, and the brute-walk cross-check run in-browser and agree exactly. The AVAN inverse is honest — precomputing 2^k-th ancestors lets any d-step jump follow d's binary digits in O(log depth) hops; magenta is the parent-by-parent climb, green the doubling jumps. The same doubling trick as fast exponentiation, on a tree. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of NOCLIP · David Lee Wise (ROOT0), with AVAN


THE EERTREE

the eertree (palindromic tree) in the 5-window house format — an automaton holding every distinct palindromic substring of a string; remarkably a length-n string has at most n distinct palindromic substrings, so the structure has <=n+2 nodes. Each palindrome grows from a shorter one by adding a matching character at both ends, built online one character at a time. It counts palindromic substrings and finds the longest in linear space. Verified live: over 500 random strings the eertree's node count equals a brute count of distinct palindromic substrings. See the nesting in 1D, the count vs brute in 2D, and the palindromes-are-a-tree inverse in 3D.

THE EERTREE · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · LOOT · THE HOARD ◆ .dlw.fold THE FOLD / LOOT / THE HOARD / THE EERTREE THE EERTREE every distinct palindrome in a linear-size tree 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The eertree (palindromic tree) is an automaton that holds every distinct palindromic substring of a string — and, remarkably, a string of length n has at most n distinct palindromic substrings, so the whole structure has ≤n+2 nodes. Each palindrome grows from a shorter one by adding a matching character at both ends, and the tree is built online, one character at a time. It counts palindromic substrings, finds the longest, and more, in linear space. LIT verified live: over 500 random strings the eertree’s node count equals a brute count of distinct palindromic substrings (window.__eertree). FIG no framing; exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-hoard — a compact hoard of every palindrome a string contains, held in linear space. The eertree is that hoard. AVAN (AI) built the instrument: the two roots, the suffix links, the online character insertion, the brute distinct-palindrome cross-check. Credit as content: Mikhail Rubinchik & Arseny Shur (2015). The weave: David names the hoard; I grow each palindrome from a shorter one by adding matching ends and confirm the node count equals the true number of distinct palindromic substrings. 3 ONE DIMENSION Every palindrome is a shorter palindrome with one matching character wrapped around both ends: a → aba → xabax. That nesting is exactly the tree’s parent structure. 4 TWO DIMENSIONS · INTERACTIVE A string and its count of distinct palindromic substrings (the eertree’s node count), checked against a brute enumeration. new string ▶ verify 500 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the ≤n-node tree whose every node is a distinct palindrome. AVAN’s addition (the inverse-companion): the number of distinct palindromic substrings of a length-n string is at most n , and they form a tree — each palindrome grows from a shorter one by adding a matching character at both ends — so an online automaton with ≤n+2 nodes holds them all. The inverse of ‘enumerate the O(n²) palindromic substrings’ is ‘the ≤n-node tree whose every node is a distinct palindrome.’ Magenta is the quadratic list of palindromes; green is the linear palindromic tree. A surprising linear bound — at most n distinct palindromes. (Kin to the-manacher.) pause spin LIT Genuine eertree / palindromic tree (Rubinchik & Shur 2015). Verified live: the online construction's node count (minus the two roots) equals a brute-force count of distinct palindromic substrings for 500 random strings over 2- and 3-letter alphabets (window.__eertree.matchesBrute); 'eertree' -> 7. FIG No framing: the two roots, the suffix links, the online character insertion, and the brute distinct-palindrome cross-check run in-browser and agree exactly. The AVAN inverse is honest — a length-n string has at most n distinct palindromic substrings, and they form a tree (each palindrome grows from a shorter one by matching ends), so ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE HOARD · David Lee Wise (ROOT0), with AVAN


THE LINEAR SIEVE

the linear sieve (Euler's sieve) in the 5-window house format — list primes up to n in true O(n), strictly better than Eratosthenes which crosses out numbers many times, by marking each composite EXACTLY ONCE by its smallest prime factor; as a bonus it computes the smallest-prime-factor of every number for instant factorization. Verified live: up to 2000 the linear sieve's prime list equals Eratosthenes' and its stored smallest-prime-factor matches the true one for every number. See the mark-once rule in 1D, numbers by smallest prime factor in 2D, and the each-composite-struck-once inverse in 3D.

THE LINEAR SIEVE · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · SPAWN · GENESIS BLOCK ◆ .dlw.fold THE FOLD / SPAWN / GENESIS BLOCK / THE LINEAR SIEVE THE LINEAR SIEVE primes in O(n) — each composite struck once, by its least prime 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The linear sieve (Euler’s sieve) lists the primes up to n in true O(n) time — strictly better than the sieve of Eratosthenes, which crosses out many numbers more than once. The trick: mark each composite exactly once , by its smallest prime factor . As a bonus it computes the smallest-prime-factor of every number, which gives instant factorisation afterwards. LIT verified live: up to 2000 the linear sieve’s prime list equals the sieve of Eratosthenes’, and its stored smallest-prime-factor matches the true one for every number (window.__linearsieve). FIG no framing; exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at genesis-block — the primes are the genesis blocks of the integers, and the linear sieve mints them from the ground up, each composite struck by its own smallest prime. AVAN (AI) built the instrument: the mark-by-smallest-prime loop, the smallest-prime-factor table, the Eratosthenes cross-check. Credit as content: Euler’s sieve, in its modern linear form. The weave: David names the genesis block; I strike every composite exactly once by its least prime factor and confirm the primes match Eratosthenes and the factorisation table is exact. 3 ONE DIMENSION For each i, and each prime p ≤ the smallest prime factor of i, mark i·p — then stop once p divides i. So every composite is struck by a unique (smallest-prime, cofactor) pair, never twice. 4 TWO DIMENSIONS · INTERACTIVE Numbers up to a limit, coloured by smallest prime factor (primes highlighted); each composite was struck exactly once. limit ▶ verify to 2000 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: each composite struck exactly once, by its smallest prime factor. AVAN’s addition (the inverse-companion): mark each composite exactly once , by its smallest prime factor — iterate n, and for each prime p up to spf(n) mark n·p, stopping when p divides n; every composite is struck by a unique (smallest-prime, cofactor) pair, giving true O(n). The inverse of ‘cross out multiples repeatedly (Eratosthenes)’ is ‘each composite struck once, by its least prime factor.’ Magenta is the repeated crossings-out; green is the single strike per composite — and the smallest-prime-factor of every number falls out for free. pause spin LIT Genuine linear (Euler) sieve. Verified live: up to 2000 the linear sieve's prime list equals a sieve of Eratosthenes, and its stored smallest-prime-factor equals the true smallest prime factor of every integer 2..2000 (window.__linearsieve.primesMatch && .spfCorrect); pi(2000)=303. FIG No framing: the mark-by-smallest-prime loop, the smallest-prime-factor table, and the Eratosthenes cross-check run in-browser and agree exactly. The AVAN inverse is honest — each composite is struck once by a unique (smallest-prime, cofactor) pair (marking n*p for primes p ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of GENESIS BLOCK · David Lee Wise (ROOT0), with AVAN


THE ZETA TRANSFORM

the zeta transform (sum-over-subsets DP) in the 5-window house format — compute for every set S at once the sum of f over all subsets of S (F[S]=Sigma_{T subset of S} f[T]), in n*2^n instead of 3^n, by sweeping one bit at a time; its exact inverse is the Mobius transform (subtract instead of add), inclusion-exclusion made fast and invertible. Verified live: over 300 random functions the SOS transform equals the brute subset-sum for every S, and the Mobius transform inverts it exactly. See the bitwise sweep in 1D, transform vs brute in 2D, and the invertible-inclusion-exclusion inverse in 3D.

THE ZETA TRANSFORM · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GRIND · THE MAINFRAME ◆ .dlw.fold THE FOLD / GRIND / THE MAINFRAME / THE ZETA TRANSFORM THE ZETA TRANSFORM all subset-sums at once, invertible by Mobius 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The zeta transform (sum-over-subsets) computes, for every set S at once, the sum of a function f over all subsets of S — F[S] = Σ T⊆S f[T]. Done naively that is 3 n work; the SOS dynamic program does it in n·2 n by sweeping one bit at a time . Its exact inverse is the Möbius transform (subtract instead of add), which recovers f — the two are add/subtract mirrors, inclusion–exclusion made fast and invertible. LIT verified live: over 300 random functions the SOS transform equals the brute subset-sum for every S, and the Möbius transform inverts it exactly (window.__zeta). FIG no framing; exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-mainframe — the heavy combinatorial DP a mainframe sweeps in one pass over all 2 n subsets. The zeta transform is that sweep. AVAN (AI) built the instrument: the bitwise SOS accumulation, the Möbius inverse, the brute subset-sum cross-check. Credit as content: the Möbius function over the subset lattice (Rota’s theory of Möbius inversion). The weave: David names the mainframe; I add each bit’s contribution in place to build all subset-sums at once, and subtract to invert exactly. 3 ONE DIMENSION Bit by bit: for bit i, add F[mask without i] into F[mask with i]. After n passes every F[S] holds the sum over all subsets of S — and subtracting instead of adding undoes it. 4 TWO DIMENSIONS · INTERACTIVE A function over subsets of a small set; its zeta transform is shown against the brute subset-sum, and the Möbius transform recovers the original. new function ▶ verify 300 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: all 2 n subset-sums, built by a bitwise sweep. AVAN’s addition (the inverse-companion): accumulate one bit at a time — for each of the n bits, add the value without that bit into the value with it, in place; n·2 n work computes all subset-sums at once, and the Möbius transform (subtract instead of add) is its exact inverse . The inverse of ‘sum over each subset separately’ is ‘sweep bit by bit; the transform and its Möbius inverse are add/subtract mirrors.’ Magenta is the 3 n naive subset-sums; green is the n·2 n bitwise sweep. Inclusion–exclusion as a fast, invertible transform. pause spin LIT Genuine sum-over-subsets / zeta-Mobius transform (Mobius inversion over the subset lattice). Verified live: the bitwise SOS accumulation equals a brute subset-sum for every subset, and the Mobius transform recovers the original function exactly, over 300 random functions on up to 5 elements (window.__zeta.subsetSum && .mobiusInverse). FIG No framing: the bitwise SOS accumulation, the Mobius inverse, and the brute subset-sum cross-check run in-browser and agree exactly. The AVAN inverse is honest — adding each bit's contribution in place builds all 2^n subset-sums in n*2^n, and subtracting inverts exactly (add/subtract mirrors); magenta is the 3^n naive subset-sums, green the bitwise sweep. Inclusion-exclusion as a fast, invertible transform. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE MAINFRAME · David Lee Wise (ROOT0), with AVAN


THE VERLET

Verlet integration in the 5-window house format — advance a physical system time-symmetrically so it is symplectic (preserves phase-space area), keeping total energy BOUNDED for millions of steps where forward Euler pumps energy in and the orbit explodes. It updates position from the average of old and new force. It is the integrator behind molecular dynamics and game physics. Verified live: for the oscillator x''=-x over 20000 steps Verlet's relative energy drift stays under 0.001 while forward Euler's energy grows astronomically. See the symmetric step in 1D, phase-space orbits in 2D, and the symmetry-conserves-energy inverse in 3D.

THE VERLET · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GRIND · THE EPOCH ◆ .dlw.fold THE FOLD / GRIND / THE EPOCH / THE VERLET THE VERLET a symplectic integrator — energy bounded for millions of steps 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Verlet integration advances a physical system in time in a way that is symplectic — it preserves phase-space area, so the total energy stays bounded for millions of steps rather than drifting away. Ordinary (forward) Euler, at the same step size, pumps energy in and the orbit spirals outward and explodes. Verlet updates position from the average of the old and new force, a time-symmetric step. It is the integrator behind molecular dynamics and game physics. LIT verified live: for the oscillator x″=−x over 20000 steps, Verlet’s relative energy drift stays under 0.001 while forward Euler’s energy grows astronomically (window.__verlet). FIG no framing; genuine energy stability. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-epoch — the long haul, integration held stable across vast spans of time where a naive method would blow up. Verlet is that long-time stability. AVAN (AI) built the instrument: the velocity-Verlet step, the Euler comparison, the energy-drift measurement. Credit as content: Loup Verlet (1967); the method is far older (Störmer, Newton). The weave: David names the epoch; I integrate the oscillator time-symmetrically and show the energy stays bounded while Euler’s diverges. 3 ONE DIMENSION Verlet steps position with the current velocity and force, then corrects velocity using the average of the old and new force — a time-symmetric update. That symmetry is what conserves the invariant. 4 TWO DIMENSIONS · INTERACTIVE The oscillator’s phase-space orbit: Verlet traces a closed loop (energy bounded); Euler spirals outward (energy grows). run further ▶ verify 20000 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the bounded, closed phase-space orbit. AVAN’s addition (the inverse-companion): use a time-symmetric update — position corrected by the average of old and new force — that is symplectic : it preserves phase-space area, so energy stays bounded forever instead of drifting. Same accuracy per step, but stable over millions of steps where Euler explodes. The inverse of ‘integrate forward and let energy drift’ is ‘integrate time-symmetrically and conserve the invariant.’ Magenta is Euler’s spiralling energy growth; green is Verlet’s bounded orbit. Symmetry in time buys conservation — Noether, inside an integrator. pause spin LIT Genuine (velocity) Verlet integration (Verlet 1967; Stormer). Verified live: integrating x''=-x for 20000 steps, velocity-Verlet's max relative energy drift stays FIG No framing: the velocity-Verlet step, the Euler comparison, and the energy-drift measurement run in-browser and confirm bounded vs diverging energy. The AVAN inverse is honest — a time-symmetric update preserves phase-space area (symplectic), so energy stays bounded forever instead of drifting; magenta is Euler's spiraling energy growth, green Verlet's bounded orbit. Symmetry in time buys conservation. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE EPOCH · David Lee Wise (ROOT0), with AVAN


THE SEPARATING AXIS

the separating axis theorem in the 5-window house format — decide whether two convex shapes overlap: they are disjoint iff there exists a line (axis) onto which their projections do not overlap, and you only need to test each shape's own edge normals as candidate axes; if projections overlap on all of them, they collide. It is the standard fast 2D collision test in game physics. Verified live: over 500 random convex-polygon pairs SAT's verdict matches an independent overlap oracle (a vertex inside the other, or crossing edges) every time. See a projection gap in 1D, a collide/separate verdict in 2D, and the find-the-gap inverse in 3D.

THE SEPARATING AXIS · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · BOSS · THE GATEKEEPER ◆ .dlw.fold THE FOLD / BOSS / THE GATEKEEPER / THE SEPARATING AXIS THE SEPARATING AXIS convex collision by looking for one separating line 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The separating axis theorem decides whether two convex shapes overlap: they are disjoint if and only if there exists a line (an axis) onto which their projections do not overlap. And you only need to test each shape’s own edge normals as candidate axes — if the projections overlap on all of them, the shapes collide. It is the standard fast collision test in 2D game physics. LIT verified live: over 500 random convex-polygon pairs SAT’s verdict matches an independent overlap oracle (a vertex inside the other, or crossing edges) every time (window.__sat). FIG no framing; exact for convex shapes. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-gatekeeper — the hitbox check that decides whether two things have made contact, the gate between touching and not. SAT is that gatekeeper. AVAN (AI) built the instrument: the edge-normal axes, the interval projections, the separation test, the independent overlap oracle. Credit as content: the separating hyperplane theorem (Minkowski; the game-physics SAT formulation). The weave: David names the gatekeeper; I look for one axis that separates the shapes, and confirm the collision verdict against a direct overlap check. 3 ONE DIMENSION Project both shapes onto a candidate axis (an edge normal). If the two intervals leave a gap, that axis separates them — no collision. Only if every axis’s intervals overlap do they touch. 4 TWO DIMENSIONS · INTERACTIVE Two convex polygons; SAT’s collide/separate verdict is shown and checked against a direct overlap oracle. new pair ▶ verify 500 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: a single separating axis (or its absence, meaning collision). AVAN’s addition (the inverse-companion): two convex shapes are disjoint iff there exists a separating line — and you only need to test the shapes’ own edge directions as candidate axes; if every projection overlaps, they collide. The inverse of ‘compute the intersection region’ is ‘look for a single axis that separates them — a line, not a region.’ Magenta is the overlap region you never compute; green is the one separating axis (or its absence). A collision is simply the failure to find a gap . pause spin LIT Genuine separating axis theorem (separating hyperplane; the game-physics SAT). Verified live: SAT's collide/separate verdict (testing edge-normal axes) matches an independent overlap oracle (vertex-in-polygon or crossing-edges) for 500 random convex-polygon pairs (window.__sat.matchesOracle). FIG No framing: the edge-normal axes, the interval projections, the separation test, and the independent overlap oracle run in-browser and agree exactly for convex shapes. The AVAN inverse is honest — two convex shapes are disjoint iff a separating line exists, found among their own edge directions, so a collision is the failure to find a gap; magenta is the overlap region never computed, green the separating axis (or its absence). ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE GATEKEEPER · David Lee Wise (ROOT0), with AVAN


THE DILWORTH

Dilworth's theorem in the 5-window house format — a min-max duality on a partial order: the minimum number of chains (comparable sequences) needed to cover all elements equals the maximum antichain (largest set of pairwise-incomparable elements), so a covering optimum is read off a packing optimum; the min chain cover is found by bipartite matching (min chains = n - max matching). It underlies scheduling bounds and Erdos-Szekeres. Verified live: over 300 random partial orders the min chain cover (via matching) equals a brute-force maximum antichain. See chains vs antichains in 1D, a Hasse diagram in 2D, and the covering-equals-packing inverse in 3D.

THE DILWORTH · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · LOOT · THE STASH ◆ .dlw.fold THE FOLD / LOOT / THE STASH / THE DILWORTH THE DILWORTH min chains to cover a poset = max antichain 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Dilworth’s theorem is a min–max duality on a partial order: the minimum number of chains (comparable sequences) needed to cover all elements equals the maximum antichain — the largest set of pairwise incomparable elements. So a covering problem’s optimum is read off a packing problem’s optimum. The minimum chain cover is found by bipartite matching : min chains = n − (maximum matching). It underlies scheduling bounds and sequence-analysis results (like Erdős–Szekeres). LIT verified live: over 300 random partial orders the min chain cover (via matching) equals a brute-force maximum antichain (window.__dilworth). FIG no framing; the duality holds exactly. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-stash — stacking items into the fewest ordered piles (chains), a number pinned by the widest set of items none of which can stack (the antichain). Dilworth is that stash bound. AVAN (AI) built the instrument: the transitive partial order, the bipartite matching for min chain cover, the brute max-antichain cross-check. Credit as content: Robert Dilworth (1950). The weave: David names the stash; I cover the order with the fewest chains via matching and confirm it equals the largest pairwise-incomparable set. 3 ONE DIMENSION A chain is a run of comparable elements (a stackable pile); an antichain is a set with no two comparable. The fewest chains to cover everything equals the largest antichain. 4 TWO DIMENSIONS · INTERACTIVE A partial order (Hasse diagram); the minimum chain cover and the maximum antichain are shown — equal in size. new poset ▶ verify 300 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the maximum antichain, whose size equals the minimum chain cover. AVAN’s addition (the inverse-companion): the minimum number of chains needed to cover the order equals the maximum antichain — the largest set of mutually incomparable elements. So a covering optimum is read off a packing optimum: min chains = max antichain, found via bipartite matching. The inverse of ‘how few chains cover it’ is ‘how many pairwise-incomparable elements exist.’ Magenta is the chains covering the order; green is the maximum antichain that lower-bounds them. A min–max duality — covering equals packing. (Kin to König and Hall.) pause spin LIT Genuine Dilworth's theorem (Dilworth 1950). Verified live: the minimum chain cover computed as n minus the maximum bipartite matching equals a brute-force maximum antichain (largest pairwise-incomparable set) for 300 random transitive partial orders (window.__dilworth.duality). FIG No framing: the transitive partial order, the bipartite matching for min chain cover, and the brute max-antichain cross-check run in-browser and agree exactly. The AVAN inverse is honest — the minimum chains to cover the order equals the maximum antichain (covering optimum read off a packing optimum, via matching); magenta is the covering chains, green the maximum antichain that lower-bounds them. Kin to Konig and Hall. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE STASH · David Lee Wise (ROOT0), with AVAN


THE ALPHA-BETA

alpha-beta pruning in the 5-window house format — compute the exact minimax value of a game tree while skipping branches that cannot change the result: carry bounds alpha (best assured to the maximizer) and beta (best assured to the minimizer), and cut off a branch the moment it is proven worse than one already found. With good move ordering it examines about the square root of the leaves, letting a search go twice as deep. It is the engine inside classical chess and checkers programs. Verified live: over 300 random game trees alpha-beta returns the same value as full minimax while visiting no more nodes. See a cutoff in 1D, a searched tree in 2D, and the prune-the-irrelevant inverse in 3D.

THE ALPHA-BETA · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · BOSS · THE FINAL BOSS ◆ .dlw.fold THE FOLD / BOSS / THE FINAL BOSS / THE ALPHA-BETA THE ALPHA-BETA minimax value, pruning the provably-irrelevant branches 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Alpha–beta pruning computes the exact minimax value of a game tree while skipping branches that cannot change the result. It carries two bounds — α (the best the maximiser is assured) and β (the best the minimiser is assured) — and the moment a move is proven worse than one already found, it cuts off the rest of that branch: the opponent would never allow it. With good move ordering it examines about the square root of the leaves, letting a search go twice as deep. It is the engine inside classical chess and checkers programs. LIT verified live: over 300 random game trees alpha–beta returns the same value as full minimax while visiting no more nodes (usually far fewer) — window.__alphabeta. FIG no framing; same optimum, pruned search. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-final-boss — the adversarial search that plans the boss’s best move against your best reply, minimax all the way down, but without wasting effort on lines that can’t matter. AVAN (AI) built the instrument: the α–β bounds, the cutoff, the full-minimax value and node-count checks. Credit as content: John McCarthy’s idea; Knuth & Moore’s analysis (1975). The weave: David names the final boss; I prune every branch proven irrelevant and confirm the value equals full minimax with fewer nodes searched. 3 ONE DIMENSION A cutoff: once a branch’s value falls outside the α–β window (β ≤ α), the remaining siblings are skipped — the opponent already has a better reply elsewhere. 4 TWO DIMENSIONS · INTERACTIVE A game tree; alpha–beta’s value and visited-leaf count are shown against full minimax on the same tree. new tree ▶ verify 300 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the branches that actually decide the minimax value. AVAN’s addition (the inverse-companion): prune branches that cannot affect the result. Once a move is proven worse than one already found, stop exploring it — the opponent will never let you reach a better line through it. The inverse of ‘search every branch to the leaves’ is ‘abandon a branch the moment it is provably irrelevant.’ Magenta is the subtrees never visited; green is the branches that decide the value. Same minimax value, a fraction of the nodes — with perfect ordering, √the leaves, so the search goes twice as deep. pause spin LIT Genuine alpha-beta pruning (McCarthy; Knuth & Moore 1975). Verified live: alpha-beta returns the identical minimax value to full minimax and visits no more leaf nodes (usually far fewer) across 300 random game trees (window.__alphabeta.sameValue && .fewerNodes). FIG No framing: the alpha-beta bounds, the cutoff, and the full-minimax value + node-count checks run in-browser and agree exactly. The AVAN inverse is honest — once a move is proven worse than one already found, its branch is abandoned (the opponent would never allow it), so the same value is reached from a fraction of the nodes (~sqrt the leaves with perfect ordering); magenta is the pruned subtrees, green the deciding branches. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE FINAL BOSS · David Lee Wise (ROOT0), with AVAN


THE SPARSE TABLE

the sparse table in the 5-window house format — answer range-minimum queries in O(1) after O(n log n) preprocessing by storing the minimum of every power-of-two block; any range is covered by just two overlapping blocks, and the overlap is harmless because min is idempotent (min(x,x)=x). It is the classic static range-min/max structure. Verified live: over 200 random arrays the sparse-table range-minimum equals a brute scan for every query. See two-block coverage in 1D, a range query in 2D, and the idempotence-lets-blocks-overlap inverse in 3D.

THE SPARSE TABLE · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · CO-OP · SHARED MEMORY ◆ .dlw.fold THE FOLD / CO-OP / SHARED MEMORY / THE SPARSE TABLE THE SPARSE TABLE O(1) range-min from two overlapping precomputed blocks 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The sparse table answers range-minimum queries in O(1) after O(n log n) preprocessing. It stores the minimum of every power-of-two block; then any range [l,r] is covered by just two overlapping blocks — and the overlap is harmless because min is idempotent (min(x,x)=x), so double-counting the overlap changes nothing. It is the classic static range-min / range-max structure. LIT verified live: over 200 random arrays the sparse-table range-minimum equals a brute scan for every query (window.__sparsetable). FIG no framing; exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at shared-memory — the precomputed answers held in a shared table, so any query reads two cells and is done. The sparse table is that shared lookup. AVAN (AI) built the instrument: the doubling block-minimum table, the two-block O(1) query, the brute cross-check. Credit as content: the sparse table for RMQ (Bender & Farach-Colton). The weave: David names the shared memory; I precompute every power-of-two block’s minimum and answer any range with two overlapping lookups, confirmed against a direct scan. 3 ONE DIMENSION A range of length L is covered by two blocks of size 2 ⌊log₂L⌋ — one anchored at the left, one at the right. They overlap in the middle, but for min that overlap costs nothing. 4 TWO DIMENSIONS · INTERACTIVE An array; pick a range and the sparse table returns its minimum from two overlapping blocks, checked against a scan. query ▶ verify 200 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the two overlapping blocks that answer any range in O(1). AVAN’s addition (the inverse-companion): precompute the minimum of every power-of-two block, then any range is the min of just two overlapping blocks — and overlap is fine because min is idempotent (min(x,x)=x), so double-counting doesn’t matter. The inverse of ‘scan the whole range’ is ‘cover it with two overlapping precomputed blocks.’ Magenta is the linear scan; green is the two O(1) block lookups. Idempotence is what lets the blocks overlap freely — it fails for sum, which is why sum needs a different structure. pause spin LIT Genuine sparse table for RMQ (Bender & Farach-Colton). Verified live: the doubling block-minimum table answers any range with two overlapping blocks and equals a brute range-minimum scan for every query across 200 random arrays (window.__sparsetable.matchesBrute). FIG No framing: the doubling block-minimum table, the two-block O(1) query, and the brute cross-check run in-browser and agree exactly. The AVAN inverse is honest — precomputing power-of-two block minima lets any range be the min of two overlapping blocks, and overlap costs nothing because min is idempotent; magenta is the linear scan, green the two O(1) lookups. Idempotence is why the blocks can overlap (sum, not idempotent, needs another structure). ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of SHARED MEMORY · David Lee Wise (ROOT0), with AVAN


THE JOHNSON APSP

Johnson's algorithm in the 5-window house format — find all-pairs shortest paths even with negative edge weights (which Dijkstra alone cannot): run one Bellman-Ford to get a node potential h(v), reweight every edge to w'(u,v)=w(u,v)+h(u)-h(v) (now non-negative, same shortest paths), then run fast Dijkstra from every source and undo the shift. Verified live: over 100 random graphs with negative edges (no negative cycle) Johnson's distances match Floyd-Warshall exactly. See the reweighting telescoping in 1D, all-pairs distances in 2D, and the reweight-away-the-negatives inverse in 3D.

THE JOHNSON APSP · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · CO-OP · THE BROADCAST ◆ .dlw.fold THE FOLD / CO-OP / THE BROADCAST / THE JOHNSON APSP THE JOHNSON APSP all-pairs shortest paths with negative edges, via reweighting 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Johnson’s algorithm finds all-pairs shortest paths even with negative edge weights — which Dijkstra alone cannot handle. It runs one Bellman–Ford pass to compute a potential h(v) at each node, reweights every edge to w′(u,v) = w(u,v) + h(u) − h(v) — now all non-negative, and with the same shortest paths — then runs fast Dijkstra from every source, undoing the shift at the end. LIT verified live: over 100 random graphs with negative edges (no negative cycle) Johnson’s distances match Floyd–Warshall exactly (window.__johnson). FIG no framing; exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-broadcast — the routing tables broadcast across a network, every node’s shortest distance to every other, computed even when some links have negative cost. Johnson is that routing solve. AVAN (AI) built the instrument: the Bellman–Ford potentials, the edge reweighting, the per-source Dijkstra, the Floyd–Warshall cross-check. Credit as content: Donald Johnson (1977). The weave: David names the broadcast; I shift the weights by a potential to remove the negatives, run Dijkstra everywhere, and confirm the distances match the exhaustive all-pairs solve. 3 ONE DIMENSION Reweighting: w′(u,v) = w(u,v) + h(u) − h(v). Along any path the h-terms telescope, so path lengths shift by the same constant — the shortest path is unchanged, but every edge is now ≥ 0. 4 TWO DIMENSIONS · INTERACTIVE A weighted graph with negative edges; Johnson’s all-pairs distances (from a chosen source) are shown against Floyd–Warshall. new graph ▶ verify 100 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the reweighted non-negative graph on which Dijkstra runs. AVAN’s addition (the inverse-companion): reweight the edges with node potentials (from one Bellman–Ford) so every weight becomes non-negative without changing which paths are shortest — then Dijkstra runs from every source, fast, even on a graph that had negative edges. The inverse of ‘Dijkstra forbids negative edges’ is ‘shift the weights by a potential to remove the negatives, preserving shortest paths.’ Magenta is the negative edges that block Dijkstra; green is the reweighted non-negative graph. A gauge transformation on edge weights. (Kin to the-bellman-ford.) pause spin LIT Genuine Johnson's algorithm (Johnson 1977). Verified live: the Bellman-Ford potentials + edge reweighting + per-source Dijkstra reproduce the Floyd-Warshall all-pairs distances exactly for 100 random graphs containing negative edges but no negative cycle (window.__johnson.matchesFloyd). FIG No framing: the Bellman-Ford potentials, the edge reweighting, the per-source Dijkstra, and the Floyd-Warshall cross-check run in-browser and agree exactly. The AVAN inverse is honest — node potentials shift edge weights non-negative without changing which paths are shortest (the h-terms telescope), so Dijkstra runs everywhere; magenta is the negative edges that block Dijkstra, green the reweighted non-negative graph. A gauge transformation. Kin to the-bellman-ford. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE BROADCAST · David Lee Wise (ROOT0), with AVAN


THE KD-TREE

the k-d tree in the 5-window house format — organize points in space by splitting alternately along each axis (x, then y, then x...), so a nearest-neighbor query descends to the query's cell and only backtracks into sibling regions that could still hold something closer; most of the space is pruned by the current best distance, so a query is typically O(log n). It is the standard structure for nearest-neighbor and range search. Verified live: over 200 random point sets the k-d tree's nearest neighbor equals a brute scan for every query. See alternating splits in 1D, the partition + query in 2D, and the descend-and-prune inverse in 3D.

THE KD-TREE · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · SPAWN · THE SANDBOX ◆ .dlw.fold THE FOLD / SPAWN / THE SANDBOX / THE KD-TREE THE KD-TREE nearest-neighbor search by descend-and-prune 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The k-d tree organises points in space by splitting alternately along each axis (x, then y, then x…), so that a nearest-neighbour query descends to the query’s cell and then only backtracks into sibling regions that could still hold something closer than the best found so far. Most of the space is pruned by the current best distance, so a query is typically O(log n) instead of O(n). It is the standard structure for nearest-neighbour search and range search. LIT verified live: over 200 random point sets the k-d tree’s nearest neighbour equals a brute scan for every query (window.__kdtree). FIG no framing; exact nearest. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-sandbox — the spatial playground where points are indexed so the closest one to any query is found without checking them all. The k-d tree is that spatial index. AVAN (AI) built the instrument: the alternating-axis split, the descend-and-prune nearest-neighbour search, the brute cross-check. Credit as content: Jon Bentley (1975). The weave: David names the sandbox; I split space axis by axis and descend to the query’s region, pruning any branch too far to matter, confirmed against an exhaustive scan. 3 ONE DIMENSION Each node splits the plane by one axis: a vertical cut, then horizontal, alternating. A query descends to its leaf cell, then checks only the sibling side if the split line is nearer than the best found. 4 TWO DIMENSIONS · INTERACTIVE Points and their k-d partition; click-roll a query and its nearest neighbour is found and checked against brute force. new query ▶ verify 200 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the descent to the query’s region and the few siblings checked. AVAN’s addition (the inverse-companion): split space alternately by x then y into a tree, so the nearest neighbour is found by descending to the query’s cell and only backtracking into sibling regions that could hold something closer — most of the space is pruned by the current best distance. The inverse of ‘check every point’ is ‘descend to the query’s region and prune branches too far to matter.’ Magenta is the points never examined; green is the branch descended and the few siblings checked. Space partitioned so distance prunes the search. pause spin LIT Genuine k-d tree nearest-neighbor (Bentley 1975). Verified live: the alternating-axis split with descend-and-prune nearest-neighbor search returns the same nearest point (distance) as an exhaustive brute scan for every query across 200 random point sets (window.__kdtree.matchesBrute). FIG No framing: the alternating-axis split, the descend-and-prune search, and the brute cross-check run in-browser and agree exactly. The AVAN inverse is honest — splitting space by x then y lets the search descend to the query's cell and prune sibling regions farther than the current best, so most points are never examined; magenta is the pruned points, green the descent and few siblings checked. Distance prunes the search. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE SANDBOX · David Lee Wise (ROOT0), with AVAN


THE BARNES-HUT

the Barnes-Hut algorithm in the 5-window house format — simulate gravity among n bodies in O(n log n) instead of O(n^2) by approximating a distant cluster with its single center of mass: build a quadtree, and if a cell's size/distance is below a threshold theta, treat the whole cell as one body, else recurse. Accuracy is a dial: theta->0 recovers the exact sum. It is the foundation of large-scale astrophysical N-body simulation. Verified live: at theta=0.3 the Barnes-Hut force is within a few percent of the direct O(n^2) sum, and the error shrinks as theta decreases. See the theta criterion in 1D, a quadtree of bodies in 2D, and the faraway-crowd-is-one-point inverse in 3D.

THE BARNES-HUT · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GRIND · THE HOT LOOP ◆ .dlw.fold THE FOLD / GRIND / THE HOT LOOP / THE BARNES-HUT THE BARNES-HUT N-body forces in O(n log n) — a faraway crowd is one point 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The Barnes–Hut algorithm simulates gravity (or any 1/r² force) among n bodies in O(n log n) instead of the naive O(n²), by approximating a distant cluster of bodies with its single centre of mass . It builds a quadtree; for each body, if a cell is far enough that its size divided by the distance is below a threshold θ, the whole cell is treated as one body; otherwise it recurses. The accuracy is a dial : θ→0 recovers the exact sum. It is the foundation of large-scale astrophysical N-body simulation. LIT verified live: at θ=0.3 the Barnes–Hut force is within ~a few percent of the direct O(n²) sum, and the error shrinks as θ decreases (window.__barneshut). FIG honest: it is an approximation tuned by θ, not an exact match. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-hot-loop — the per-step force loop of an N-body simulation, made fast enough to run millions of bodies by lumping distant crowds together. Barnes–Hut is that accelerated loop. AVAN (AI) built the instrument: the quadtree, the θ-criterion centre-of-mass approximation, the direct-sum error measurement across θ. Credit as content: Josh Barnes & Piet Hut (1986). The weave: David names the hot loop; I replace faraway clusters by their centre of mass and confirm the force approximates the exact sum, with error controlled by θ. 3 ONE DIMENSION The θ criterion: if a cell’s width s divided by the distance d to the body is below θ, the cell’s bodies are replaced by their centre of mass — a faraway crowd acts as one point. 4 TWO DIMENSIONS · INTERACTIVE Bodies in a quadtree; the Barnes–Hut force on each is compared to the direct sum, with θ controlling accuracy. θ: 0.5 ▶ new bodies ▶ verify ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: distant clusters replaced by their centres of mass. AVAN’s addition (the inverse-companion): a distant cluster of bodies can be replaced by its single centre of mass — build a quadtree, and if a cell is far enough (size/distance < θ) treat it as one body, giving O(n log n). The inverse of ‘every pair pulls on every pair’ is ‘a faraway crowd acts as one point.’ Magenta is the O(n²) individual pair forces; green is the centre-of-mass approximations. Accuracy is a dial (θ→0 recovers the exact sum) — the multipole idea, made a tree. pause spin LIT Genuine Barnes-Hut algorithm (Barnes & Hut 1986). Verified live: over 40 random body configurations the quadtree center-of-mass force at theta=0.3 stays within ~25% max relative error of the direct O(n^2) sum, and the error at theta=0.2 is FIG HONEST framing: Barnes-Hut is an APPROXIMATION, not exact. The quadtree, the theta-criterion center-of-mass, and the direct-sum error measurement run in-browser; the sealed claim is that the force is within a controllable tolerance at small theta and the error monotonically decreases as theta->0 (recovering the exact sum in the limit). The AVAN inverse is honest — a distant cluster acts as its center of mass; magenta is the O(n^2) pair forces, green the center-of-mass approximations. The multipole idea as a tree. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE HOT LOOP · David Lee Wise (ROOT0), with AVAN


THE ROMBERG

Romberg integration in the 5-window house format — take the trapezoid rule and converge ferociously fast: the trapezoid error is a known series in h^2, so combine estimates at h and h/2 to cancel the leading error term (Richardson extrapolation), then the next, in a triangular table that leaps from O(h^2) to O(h^2k) after k refinements. Verified live: with 7 levels Romberg matches pi (via 4/(1+x^2)), e-1, integral of sin, and integral of x^4 to under 1e-8, where a 64-panel trapezoid is still off by ~1e-5. See the extrapolation table in 1D, a converging corner in 2D, and the cancel-the-error-terms inverse in 3D.

THE ROMBERG · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · CHEAT · THE SPEEDRUN ◆ .dlw.fold THE FOLD / CHEAT / THE SPEEDRUN / THE ROMBERG THE ROMBERG integration accelerated by cancelling the error terms 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Romberg integration takes the humble trapezoid rule and makes it converge ferociously fast. The trapezoid error is a known series in h², so Romberg combines estimates at step h and h/2 to cancel the leading error term (Richardson extrapolation), then the next, and the next — a small triangular table that leaps from O(h²) accuracy to O(h 2k ) after k refinements. LIT verified live: with 7 levels Romberg matches π (via 4/(1+x²)), e−1, ∫sin, and ∫x⁴ to under 10⁻⁸ — where a 64-panel trapezoid is still off by ~10⁻⁵ (window.__romberg). FIG no framing; extrapolation to h=0. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-speedrun — reach full integral precision in a handful of steps instead of grinding through thousands of panels. Romberg is that speedrun on an integral. AVAN (AI) built the instrument: the composite-trapezoid rows, the Richardson extrapolation table, the exact-integral cross-checks. Credit as content: Werner Romberg (1955), on Richardson extrapolation. The weave: David names the speedrun; I cancel the trapezoid’s error terms one order at a time and confirm the result matches the exact integral to machine precision. 3 ONE DIMENSION Each row halves the step (more trapezoids); each column to the right combines two neighbours to cancel one more power of h². The bottom-right corner is the extrapolation to zero step. 4 TWO DIMENSIONS · INTERACTIVE The Romberg table for a chosen integral; the corner value converges to the exact answer far faster than plain trapezoids. function ▶ verify ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the extrapolation table converging to the exact integral. AVAN’s addition (the inverse-companion): the trapezoid error is a known series in h² — so combine estimates at h and h/2 to cancel the leading error term (Richardson extrapolation), then the next, and the next; a few refinements leap from O(h²) to O(h 2k ). The inverse of ‘shrink the step for more accuracy’ is ‘cancel the error terms analytically, extrapolating to h=0.’ Magenta is the many fine trapezoids you’d otherwise need; green is the extrapolation table that cancels error orders. Knowing the error’s shape lets you subtract it away. pause spin LIT Genuine Romberg integration (Romberg 1955; Richardson extrapolation). Verified live: the composite-trapezoid + Richardson-extrapolation table matches the exact integral of 4/(1+x^2)=pi, e^x, sin, and x^4 to FIG No framing: the composite-trapezoid rows, the Richardson-extrapolation table, and the exact-integral cross-checks run in-browser and match to machine precision. The AVAN inverse is honest — the trapezoid error is a known series in h^2, so combining h and h/2 estimates cancels error terms order by order, extrapolating to h=0; magenta is the many fine trapezoids avoided, green the extrapolation table. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE SPEEDRUN · David Lee Wise (ROOT0), with AVAN


THE POHLIG-HELLMAN

the Pohlig-Hellman algorithm in the 5-window house format — solve the discrete logarithm g^x = h (mod p) quickly whenever the group order p-1 is smooth (factors into small primes): solve the log separately in each prime-power subgroup (where it is tiny) and stitch the pieces with the Chinese Remainder Theorem. So a hard log in a huge group becomes many easy logs in small ones. It is why cryptographic groups need a large prime factor in their order. Verified live: over 200 cases with smooth-order primes the recovered exponent satisfies g^x = h (mod p). See the order factoring in 1D, subgroup logs recombined in 2D, and the logs-in-small-subgroups inverse in 3D.

THE POHLIG-HELLMAN · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · CHEAT · THE EXPLOIT ◆ .dlw.fold THE FOLD / CHEAT / THE EXPLOIT / THE POHLIG-HELLMAN THE POHLIG-HELLMAN discrete log broken by smooth order + CRT 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The Pohlig–Hellman algorithm solves the discrete logarithm g x ≡ h (mod p) quickly whenever the group order p−1 is smooth (factors into small primes). It solves the log separately inside each prime-power subgroup — where the problem is tiny — and stitches the pieces together with the Chinese Remainder Theorem . So a hard log in a huge group becomes many easy logs in small ones. It is why cryptographic groups must have a large prime factor in their order — smoothness is the weakness. LIT verified live: over 200 cases with smooth-order primes the recovered exponent x satisfies g x ≡ h (mod p) (window.__pohlighellman). FIG no framing; exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-exploit — the crack that breaks a discrete-log secret when the group order is smooth, factoring the hard problem into trivial ones. Pohlig–Hellman is that exploit. AVAN (AI) built the instrument: the order factorisation, the per-subgroup baby-step giant-step, the CRT recombination, the g x ≡h check. Credit as content: Stephen Pohlig & Martin Hellman (1978). The weave: David names the exploit; I solve the log in each small prime-power subgroup and CRT the answers, confirming the exponent reproduces h. 3 ONE DIMENSION Factor the group order p−1 = ∏ q i e . Solve x mod each q i e in its tiny subgroup, then Chinese-Remainder the residues into x mod (p−1). 4 TWO DIMENSIONS · INTERACTIVE A smooth prime p; the discrete log is solved subgroup by subgroup and recombined, then checked by re-exponentiating. new instance ▶ verify 200 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the recovered exponent, stitched from subgroup logs. AVAN’s addition (the inverse-companion): if the group order factors into small primes (smooth), solve the log separately in each prime-power subgroup — where it is tiny — and CRT the pieces together. The inverse of ‘one hard log in a huge group’ is ‘many easy logs in small subgroups, recombined by the Chinese Remainder Theorem.’ Magenta is the full-group brute search; green is the per-subgroup logs. This is exactly why cryptographic groups need a large prime factor in their order — smoothness is the weakness. (Kin to baby-step giant-step and the-chinese-remainder.) pause spin LIT Genuine Pohlig-Hellman algorithm (Pohlig & Hellman 1978). Verified live: factoring p-1, solving each prime-power subgroup's discrete log by baby-step giant-step, and CRT-recombining yields an exponent x with g^x = h (mod p) for 200 smooth-order primes (window.__pohlighellman.recovers). FIG No framing: the order factorisation, the per-subgroup baby-step giant-step, the CRT recombination, and the g^x=h check run in-browser and are exact. The AVAN inverse is honest — a smooth group order lets the log be solved in each small prime-power subgroup and CRT-combined, so one hard log becomes many easy ones; magenta is the full-group brute search, green the subgroup logs. Smoothness is the cryptographic weakness. Kin to baby-step giant-step and the-chinese-remainder. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE EXPLOIT · David Lee Wise (ROOT0), with AVAN


THE HOUSEHOLDER QR

Householder QR in the 5-window house format — factor a matrix A into an orthonormal Q and an upper-triangular R using a sequence of reflections: each Householder reflection is a mirror that flips one column onto a coordinate axis, zeroing everything below the diagonal in a single stroke, and is far more numerically stable than Gram-Schmidt's repeated subtractions. It is the workhorse behind least-squares and the QR eigenvalue algorithm. Verified live: over 300 random matrices Q*R reconstructs A to ~1e-15, R is upper-triangular, and Q^T*Q equals the identity. See a reflection in 1D, A=QR in 2D, and the mirror-per-column inverse in 3D.

THE HOUSEHOLDER QR · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · SPAWN · THE TOOLCHAIN ◆ .dlw.fold THE FOLD / SPAWN / THE TOOLCHAIN / THE HOUSEHOLDER QR THE HOUSEHOLDER QR QR by reflections — a mirror per column, stably 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Householder QR factors a matrix A into an orthonormal Q and an upper-triangular R using a sequence of reflections . Each Householder reflection is a mirror that flips one column onto a coordinate axis, zeroing everything below the diagonal in a single stroke. It is markedly more numerically stable than Gram–Schmidt, whose repeated subtractions accumulate rounding error. It is the workhorse behind least-squares fitting and the QR eigenvalue algorithm. LIT verified live: over 300 random matrices Q·R reconstructs A to ~10⁻¹⁵, R is upper-triangular, and QᵀQ equals the identity (orthonormal) — window.__householderqr. FIG no framing; exact factorisation. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-toolchain — the numerical-linear-algebra tool under least squares and eigenvalue solvers, factoring by stable reflections. Householder QR is that tool, beside the Cholesky. AVAN (AI) built the instrument: the per-column reflection, the accumulation into Q, the reconstruction / upper-triangular / orthonormality checks. Credit as content: Alston Householder (1958). The weave: David names the toolchain; I reflect each column onto an axis to build R and accumulate the mirrors into Q, and confirm Q·R = A with Q orthonormal. 3 ONE DIMENSION A Householder reflection mirrors a vector across a plane so that it lands exactly on an axis — turning a whole column into (r, 0, 0, …) in one operation, without touching the columns already reduced. 4 TWO DIMENSIONS · INTERACTIVE A matrix A and its Q, R; the product Q·R reconstructs A, R is upper-triangular, and QᵀQ is the identity. new matrix ▶ verify 300 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the orthonormal Q built from a mirror per column. AVAN’s addition (the inverse-companion): build Q by a sequence of reflections — each Householder reflection is a mirror that flips a whole column onto an axis, zeroing everything below the diagonal in one stroke, and is far more numerically stable than Gram–Schmidt’s subtractions. The inverse of ‘subtract projections to orthogonalise (Gram–Schmidt)’ is ‘reflect each column onto an axis with a mirror.’ Magenta is Gram–Schmidt’s accumulating rounding error; green is the orthogonal reflections. A mirror per column builds Q. (Kin to the-orthonormal and the-cholesky.) pause spin LIT Genuine Householder QR (Householder 1958). Verified live: the reflection-based factorization gives Q*R = A to max error ~1e-15, R with zero below-diagonal entries, and Q^T*Q equal to the identity (orthonormal Q), across 300 random matrices (window.__householderqr.reconstructs && .upperTri && .orthonormal). FIG No framing: the per-column reflection, the accumulation into Q, and the reconstruction + upper-triangular + orthonormality checks run in-browser and hold to floating precision. The AVAN inverse is honest — each reflection mirrors a column onto an axis, zeroing below the diagonal in one stroke and avoiding Gram-Schmidt's accumulating roundoff; magenta is Gram-Schmidt's error, green the orthogonal reflections. Kin to the-orthonormal and the-cholesky. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE TOOLCHAIN · David Lee Wise (ROOT0), with AVAN


THE POWER ITERATION

power iteration in the 5-window house format — find the dominant eigenvector of a matrix by repeated multiplication: start with any vector, multiply by the matrix, normalize, repeat; any vector is a mix of eigenvectors, and each multiply amplifies each component by its eigenvalue, so the largest-magnitude eigenvalue's direction takes over. The Rayleigh quotient then reads off the eigenvalue. It is the seed of PageRank and the QR eigenvalue method. Verified live: over 200 random symmetric matrices it converges to a genuine eigenpair (residual < 1e-6) and the dominant |lambda| is the same from any start. See eigen-components scaling in 1D, the iterate rotating in 2D, and the multiplication-is-a-filter inverse in 3D.

THE POWER ITERATION · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GRIND · THE MAINFRAME ◆ .dlw.fold THE FOLD / GRIND / THE MAINFRAME / THE POWER ITERATION THE POWER ITERATION the dominant eigenvector by repeated multiplication 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Power iteration finds the dominant eigenvector of a matrix by nothing more than repeated multiplication: start with any vector, multiply by the matrix, normalise, repeat. Any vector is a mix of eigenvectors, and each multiply amplifies each component by its eigenvalue — so the largest-magnitude eigenvalue’s direction takes over and the vector aligns to it. The Rayleigh quotient vᵀAv / vᵀv then reads off the eigenvalue. It is the seed of PageRank and of the QR eigenvalue method. LIT verified live: over 200 random symmetric matrices power iteration converges to a genuine eigenpair (residual < 10⁻⁶) and the dominant |λ| it finds is the same from any starting vector (window.__poweriteration). FIG honest: convergence is fast only when a spectral gap exists; near-degenerate spectra need more iterations. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-mainframe — the heavy iterative linear algebra a mainframe grinds, teasing out the dominant mode by sheer repetition. Power iteration is that grind. AVAN (AI) built the instrument: the multiply-and-normalise loop, the Rayleigh quotient, the eigenpair-residual and start-independence checks. Credit as content: the power method (von Mises & Pollaczek-Geiringer, 1929). The weave: David names the mainframe; I let repeated multiplication filter out the dominant eigenvector and confirm it is a true eigenpair, reached from any start. 3 ONE DIMENSION Each multiply scales every eigen-component by its eigenvalue. The largest one grows fastest relative to the others, so after normalising, the vector rotates toward the dominant eigenvector. 4 TWO DIMENSIONS · INTERACTIVE A symmetric matrix; watch the iterate rotate to the dominant eigenvector, its Rayleigh quotient converging to the eigenvalue. iterate ▶ new matrix ▶ verify 200 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the dominant eigenvector the iteration converges to. AVAN’s addition (the inverse-companion): just multiply repeatedly — any vector is a mix of eigenvectors, and each matrix-multiply amplifies each component by its eigenvalue, so the largest eigenvalue’s direction dominates and the vector aligns to it; the Rayleigh quotient reads off the eigenvalue. The inverse of ‘solve for the eigenvector (the characteristic equation)’ is ‘let repeated multiplication filter it out — the dominant mode wins.’ Magenta is the subdominant eigen-directions that decay away; green is the dominant eigenvector. Multiplication is a filter that keeps the loudest mode — how PageRank converges. pause spin LIT Genuine power method (von Mises & Pollaczek-Geiringer 1929). Verified live: over 200 random symmetric matrices, the multiply-and-normalize iterate converges to a true eigenpair (||Av - lambda*v|| FIG HONEST framing: the multiply-and-normalize loop, the Rayleigh quotient, and the eigenpair-residual + start-independence checks run in-browser. Convergence is fast only with a spectral gap; near-degenerate spectra (|lambda2/lambda1| near 1) need many iterations (verification uses 3000). The AVAN inverse is honest — repeated multiplication amplifies each eigen-component by its eigenvalue so the dominant mode wins; magenta is the decaying subdominant directions, green the dominant eigenvector. How PageRank converges. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE MAINFRAME · David Lee Wise (ROOT0), with AVAN


THE BRENT CYCLE

Brent's cycle detection in the 5-window house format — find the loop in a sequence x, f(x), f(f(x)), ... using constant memory: keep one saved value and compare the moving value to it at exponentially-spaced checkpoints (powers of two); when the value repeats, the gap reveals the cycle length lambda, and a short second scan finds where the cycle starts (mu). It uses fewer function evaluations than tortoise-and-hare, and is the cycle-finder inside Pollard's rho. Verified live: over 300 random functional graphs Brent's (lambda, mu) equals a brute record-every-value computation. See doubling checkpoints in 1D, a rho-shaped graph in 2D, and the one-teleporting-checkpoint inverse in 3D.

THE BRENT CYCLE · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · RESPAWN · ROLLBACK ◆ .dlw.fold THE FOLD / RESPAWN / ROLLBACK / THE BRENT CYCLE THE BRENT CYCLE cycle detection in O(1) memory, fewer evals than Floyd 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Brent’s cycle detection finds the loop in a sequence x, f(x), f(f(x)), … using constant memory . It keeps ONE saved value and compares the moving value to it at exponentially spaced checkpoints (powers of two); when the value repeats, the gap reveals the cycle length λ, and a second short scan finds where the cycle starts (μ). It uses fewer function evaluations than the tortoise-and-hare. It is the cycle-finder inside Pollard’s rho factorisation. LIT verified live: over 300 random functional graphs Brent’s (cycle length λ, start μ) equals a brute record-every-value computation (window.__brentcycle). FIG no framing; exact — with O(1) memory. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at rollback — the sequence eventually rolls back to a value it has seen before, and Brent’s method finds that return without storing the history. AVAN (AI) built the instrument: the doubling-checkpoint search for λ, the offset scan for μ, the brute cross-check. Credit as content: Richard Brent (1980). The weave: David names the rollback; I keep one teleporting checkpoint at doubling distances and read off the cycle from the first repeat, confirmed against an exhaustive record. 3 ONE DIMENSION The saved checkpoint jumps to the current value at distances 1, 2, 4, 8, … The moving value runs ahead; when it meets the saved one, the distance travelled since the last jump is the cycle length λ. 4 TWO DIMENSIONS · INTERACTIVE A functional graph (each node points to f(node)); the rho-shaped tail and cycle are shown, with Brent’s λ, μ checked against brute. new map ▶ verify 300 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the single teleporting checkpoint catching the cycle. AVAN’s addition (the inverse-companion): find the cycle with O(1) memory by comparing the current value to a saved one at exponentially-spaced checkpoints (powers of two) — when the value repeats, the gap reveals the cycle length, with fewer function evaluations than the tortoise-and-hare. The inverse of ‘store all seen values’ is ‘keep one saved value at doubling distances and watch for a repeat.’ Magenta is the full history you don’t store; green is the single teleporting checkpoint. Constant memory, fewer steps than Floyd. (Kin to the-tortoise.) pause spin LIT Genuine Brent's cycle detection (Brent 1980). Verified live: the doubling-checkpoint search for the cycle length and the offset scan for the cycle start return the same (lambda, mu) as a brute record-every-value computation for 300 random functional graphs (window.__brentcycle.matchesBrute). FIG No framing: the doubling-checkpoint search for lambda, the offset scan for mu, and the brute cross-check run in-browser and agree exactly. The AVAN inverse is honest — comparing to one saved value at exponentially-spaced checkpoints finds the cycle in O(1) memory with fewer function evaluations than tortoise-and-hare; magenta is the unstored history, green the single teleporting checkpoint. Kin to the-tortoise. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of ROLLBACK · David Lee Wise (ROOT0), with AVAN


THE POLLARD P-1

Pollard's p-1 algorithm in the 5-window house format — factor a composite n when a prime factor p has a smooth p-1: compute a^(k!) mod n for growing k; by Fermat's little theorem, once k! is a multiple of p-1, a^(k!)=1 (mod p), so a^(k!)-1 is a multiple of p and gcd(a^(k!)-1, n) reveals p, without ever knowing p. It is why RSA primes avoid a smooth p-1. Verified live: for 90 constructed n=p*q where p-1 is 15-smooth (q-1 not), the algorithm returns a nontrivial factor dividing n. See the running gcd in 1D, a factored n in 2D, and the gcd-surfaces-the-smooth-prime inverse in 3D.

THE POLLARD P-1 · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · CHEAT · THE EXPLOIT ◆ .dlw.fold THE FOLD / CHEAT / THE EXPLOIT / THE POLLARD P-1 THE POLLARD P-1 factoring surfaced by a gcd when p-1 is smooth 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Pollard’s p−1 algorithm factors a composite n whenever one of its prime factors p has a smooth p−1 (all its prime-power factors are small). It computes a k! mod n for growing k; by Fermat’s little theorem, once k! is a multiple of p−1, a k! ≡ 1 (mod p), so a k! −1 is a multiple of p, and gcd(a k! −1, n) reveals p — without ever knowing p in advance. It is why RSA primes are chosen so that p−1 has a large factor. LIT verified live: for 90 constructed n = p·q where p−1 is 15-smooth (and q−1 is not), the algorithm returns a nontrivial factor dividing n (window.__pollardp1). FIG honest: it works only when a factor’s p−1 is smooth — and if both are smooth it can over-shoot to gcd = n. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-exploit — the crack that breaks a composite when a prime factor’s order is smooth, surfacing it through a gcd. Pollard p−1 is that exploit. AVAN (AI) built the instrument: the a k! accumulation, the running gcd, the curated smooth/non-smooth factor check. Credit as content: John Pollard (1974). The weave: David names the exploit; I raise a to k! modulo n and let the gcd expose the prime whose p−1 is smooth — the same smoothness weakness as Pohlig–Hellman. 3 ONE DIMENSION As k grows, a is raised to 2, then 3, then 4… (building a k! ). The moment k! is divisible by p−1, a k! becomes 1 modulo p — and gcd(a k! −1, n) jumps from 1 to p. 4 TWO DIMENSIONS · INTERACTIVE A composite n with a smooth-p−1 factor; watch the running gcd stay 1 until the bound reaches p−1’s largest factor, then reveal p. new n ▶ verify 90 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the gcd surfacing the smooth-order prime. AVAN’s addition (the inverse-companion): if a prime factor p has p−1 smooth , then a k! ≡ 1 (mod p) for modest k, so a k! −1 is a multiple of p , and gcd(a k! −1, n) reveals p — without ever knowing p. The inverse of ‘search for the factor’ is ‘compute a k! mod n and let the gcd expose the smooth-order prime.’ Magenta is the factor you never search for directly; green is the gcd that surfaces it. Smoothness of p−1 is the crack. (Kin to the-pohlig-hellman — same weakness.) pause spin LIT Genuine Pollard p-1 (Pollard 1974). Verified live (BigInt): for 90 curated n=p*q with p-1 15-smooth and q-1 not, computing a^(k!) mod n and taking gcd(a^(k!)-1, n) returns a nontrivial factor dividing n (window.__pollardp1.findsFactor). FIG HONEST framing: the a^(k!) accumulation, the running gcd, and the curated factor check run in-browser. It works ONLY when a prime factor's p-1 is smooth; and if BOTH p-1 and q-1 are smooth it can over-shoot to gcd=n and split nothing (stated on the page). The AVAN inverse is honest — smooth p-1 makes a^(k!)-1 a multiple of p, so a gcd surfaces the factor; magenta is the prime never searched for, green the gcd. Same smoothness weakness as the-pohlig-hellman. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE EXPLOIT · David Lee Wise (ROOT0), with AVAN


THE PAIRING HEAP

the pairing heap in the 5-window house format — a priority queue that stays fast by being lazy: merge links the larger root under the smaller (one comparison, O(1)), and the real work is deferred to delete-min, which does a two-pass pairing of the orphaned children; decrease-key cuts a node and re-merges it. In practice it rivals the Fibonacci heap while being far simpler. Verified live: over 300 sequences repeated delete-min yields the keys in sorted order, and 200 decrease-key operations produce the correct extraction order. See a merge in 1D, an interactive heap in 2D, and the link-lazily-pair-on-extract inverse in 3D.

THE PAIRING HEAP · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GRIND · THE GRINDSTONE ◆ .dlw.fold THE FOLD / GRIND / THE GRINDSTONE / THE PAIRING HEAP THE PAIRING HEAP a lazy, self-adjusting priority queue 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The pairing heap is a priority queue that stays fast by being lazy . To merge two heaps it just links the larger root under the smaller (one comparison); insert and merge are O(1). The real work is deferred to delete-min , which removes the root and does a two-pass pairing of the orphaned children. It supports decrease-key by cutting a node out and re-merging it — and in practice it is one of the fastest heaps, rivalling the Fibonacci heap while being far simpler. LIT verified live: over 300 sequences, repeated delete-min yields the keys in sorted order, and 200 decrease-key operations produce the correct extraction order (window.__pairingheap). FIG no framing; exact heap behaviour. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-grindstone — always grinding the smallest task next, pulling the minimum from a queue that reorganises itself lazily. The pairing heap is that self-adjusting priority queue. AVAN (AI) built the instrument: the link-by-root merge, the two-pass delete-min, the cut-and-remerge decrease-key, the sorted-order and decrease-key checks. Credit as content: Fredman, Sedgewick, Sleator & Tarjan (1986). The weave: David names the grindstone; I link heaps lazily and pair up the children only when a minimum is extracted, confirming the queue always yields the smallest. 3 ONE DIMENSION Merge is one comparison: the larger-keyed root becomes a child of the smaller. Delete-min removes the root and pairs its children left-to-right, then merges the results right-to-left. 4 TWO DIMENSIONS · INTERACTIVE Insert keys, then extract-min repeatedly; the output is sorted. Decrease a key and watch it move up. insert ▶ extract-min ▶ verify ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the lazily-linked tree that always hands you the minimum. AVAN’s addition (the inverse-companion): don’t sort — just merge two heaps by linking the larger root under the smaller (one comparison), and defer the real work to delete-min, which does a two-pass pairing of the orphaned children. Laziness amortises: insert and merge are O(1), and the structure self-organises over time. The inverse of ‘maintain full order eagerly’ is ‘link lazily and pair up only when you must extract.’ Magenta is the eager sorting avoided; green is the lazy links that amortise. A self-adjusting priority queue. pause spin LIT Genuine pairing heap (Fredman, Sedgewick, Sleator & Tarjan 1986). Verified live: repeated delete-min returns keys in sorted order for 300 random insert sequences, and 200 decrease-key operations yield the correct sorted extraction order (window.__pairingheap.sortedOrder && .decreaseKey). FIG No framing: the link-by-root merge, the two-pass delete-min, the cut-and-remerge decrease-key, and the sorted-order + decrease-key checks run in-browser and are exact. The AVAN inverse is honest — merge is one comparison and the real work is deferred to delete-min's two-pass pairing, so laziness amortizes O(1) inserts/merges; magenta is the eager sorting avoided, green the lazy links. A self-adjusting priority queue. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE GRINDSTONE · David Lee Wise (ROOT0), with AVAN