THE PLAIN CHANGES

plain changes (Steinhaus-Johnson-Trotter) in the 5-window house format — list all n! permutations so each differs from the last by a single adjacent swap, the minimal change: track a direction per element and repeatedly move the largest mobile element, flipping directions. English change-ringers have rung bells in this order for centuries; it is a Gray code for permutations. Verified live: for n=1..7 the algorithm produces all n! permutations, every one distinct, each consecutive pair differing by exactly one adjacent transposition. See the changes in 1D, stepping the sequence in 2D, and the Hamiltonian-path inverse in 3D.

THE PLAIN CHANGES · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · RESPAWN · THE CONTINUE ◆ .dlw.fold THE FOLD / RESPAWN / THE CONTINUE / THE PLAIN CHANGES THE PLAIN CHANGES all n! permutations, each one adjacent swap apart 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Plain changes (the Steinhaus–Johnson–Trotter algorithm) lists all n! permutations so that each one differs from the last by a single adjacent swap — the minimal possible change. It tracks a ‘direction’ for each element and repeatedly moves the largest ‘mobile’ element, flipping directions as it goes. English change-ringers have rung bells in exactly this order for centuries; it is also a Gray code for permutations. LIT verified live: for n=1…7 the algorithm produces all n! permutations, every one distinct, and each consecutive pair differs by exactly one adjacent transposition (window.__plainchanges). FIG no framing; exact minimal-change enumeration. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-continue — each arrangement continues from the previous by the smallest possible move, one neighbour-swap, on and on through every order. Plain changes is that continuous walk. AVAN (AI) built the instrument: the mobile-element rule, the direction flips, the distinctness and adjacent-swap checks. Credit as content: Hugh Steinhaus, Selmer Johnson & Hale Trotter (1962–63); the bell-ringing method is centuries older. The weave: David names the continue; I move the largest mobile element each step and confirm every permutation appears once, each a single swap from the last. 3 ONE DIMENSION Each row is one permutation; the two swapped positions are marked. Every step moves exactly one pair of adjacent elements — the bell-ringers’ ‘change’. 4 TWO DIMENSIONS · INTERACTIVE Step through the plain-changes sequence for n elements; the single adjacent swap between consecutive permutations is highlighted. n: 4 ▶ next ▶ verify n≤7 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the path threading all n! permutations, one swap at a time. AVAN’s addition (the inverse-companion): consecutive permutations differ by one adjacent swap , so the whole list is a Hamiltonian path through the permutation graph — vertices are permutations, edges join those one adjacent transposition apart, and the sequence visits all n! exactly once with minimal change. The inverse of ‘enumerate permutations independently’ is ‘walk from each to the next by a single neighbouring swap.’ Magenta is the permutations as scattered points; green is the single path threading them all. A Gray code for orderings — how every change is rung. pause spin LIT Genuine Steinhaus-Johnson-Trotter / plain changes (Steinhaus, Johnson & Trotter 1962-63; bell-ringing centuries older). Verified live: for n=1..7 the algorithm yields exactly n! distinct permutations and every consecutive pair differs by exactly one adjacent transposition (window.__plainchanges.allDistinct && .adjacentSwaps). FIG No framing: the mobile-element rule, the direction flips, and the distinctness + adjacent-swap checks run in-browser and hold exactly. The AVAN inverse is honest — consecutive permutations differ by one adjacent swap, so the list is a Hamiltonian path through the permutation graph (edges = adjacent transpositions), visiting all n! once; magenta is the permutations as scattered points, green the single threading path. A Gray code for orderings. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE CONTINUE · David Lee Wise (ROOT0), with AVAN


THE BITONIC

bitonic sort in the 5-window house format — a sorting network: a fixed sequence of compare-and-swap operations that sorts any input of n=2^m elements, building a bitonic (up-then-down) sequence then merging halves. Which positions are compared never depends on the data, so it is data-oblivious — ideal for GPUs and hardware, and the antidote to race conditions (no data-dependent decisions). Verified live: the network sorts all 2^8 binary inputs (the 0-1 principle, which guarantees it sorts every input) and matches a reference sort on random arrays. See a comparator in 1D, an 8-element sort in 2D, and the data-oblivious-no-races inverse in 3D.

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

THE BITONIC · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GLITCH · RACE CONDITION ◆ .dlw.fold THE FOLD / GLITCH / RACE CONDITION / THE BITONIC THE BITONIC a fixed, data-oblivious sorting network 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Balanced ternary is base 3 with the unusual digit set {−1, 0, +1} (often written T, 0, 1) instead of {0,1,2}. Every integer — positive or negative — has a unique representation with no sign bit at all, because the negative digit carries the sign internally. Negating a number is just flipping every digit’s sign ; rounding to the nearest integer is truncation; and it is the most efficient integer base by radix economy. Knuth called it “perhaps the prettiest number system.” LIT verified live: every integer from −40 to 40 has a unique balanced-ternary string over {−1,0,1} that evaluates back exactly, and negation equals flipping every digit (window.__balternary). FIG no framing; exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-grindstone — the base-conversion loop, here grinding an integer into three-way digits that need no sign. Balanced ternary is that grind. AVAN (AI) built the instrument: the carry-aware conversion, the exact reconstruction, and the negate-equals-flip check. Credit as content: used in the Setun computer (Moscow State University, 1958); championed by Donald Knuth. The weave: David names the grindstone; I convert with a carry when the digit would be 2, and confirm every integer maps to a unique signless string whose negation is a digit-flip. 3 ONE DIMENSION Each place is a power of 3, weighted −1, 0, or +1. A digit of 2 becomes −1 with a carry into the next place. The three-way digit balances the value around zero — like a pan balance with weights 1, 3, 9, 27… 4 TWO DIMENSIONS · INTERACTIVE Any integer in balanced ternary; the string evaluates back to the number, and its negation is shown as a pure digit-flip. new n ▶ verify −40..40 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: every integer as a signless three-way string. AVAN’s addition (the inverse-companion): represent every integer — positive or negative — with no sign bit by using a digit that can itself be negative ({−1,0,+1}); the negative digit carries the sign internally, so negation is a digit-flip . The inverse of ‘a base needs a separate sign for negatives’ is ‘let the digits go negative — sign dissolves into the number.’ Magenta is the sign bit an ordinary base needs; green is the signless balanced string. Symmetry around zero, built in. pause spin LIT Genuine bitonic sorting network (Batcher 1968). Verified live: the fixed compare-exchange network sorts all 256 binary inputs of length 8 (the 0-1 principle) and matches a reference comparison sort on 300 random arrays of sizes 2,4,8,16 (window.__bitonic.sortsBinary && .sortsRandom). FIG No framing: the recursive compare-exchange network, the 0-1-principle check over all binaries, and the reference cross-check run in-browser and are exact. The AVAN inverse is honest — which positions are compared is fixed in advance, independent of values, so the network is data-oblivious with no branches and no races; magenta is the data-dependent branches of ordinary sorts, green the fixed network. The 0-1 principle proves one wiring sorts all inputs. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of RACE CONDITION · David Lee Wise (ROOT0), with AVAN


THE BABY-STEP GIANT-STEP

baby-step giant-step in the 5-window house format — solve the discrete logarithm g^x = h (mod p) by meeting in the middle: write x = im + j with m = ceil(sqrt(n)), tabulate the baby steps g^0..g^(m-1), then take giant steps h*(g^-m)^i until one lands in the table; O(sqrt n) time and space instead of O(n). It is the classic generic attack on discrete-log crypto. Verified live: over 300 random (p,g,x) the recovered exponent satisfies g^x = h mod p; 2^x=9 mod 23 gives x=5. See the split exponent in 1D, a solved instance in 2D, and the meet-in-the-middle inverse in 3D.

THE BABY-STEP GIANT-STEP · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · CHEAT · THE EXPLOIT ◆ .dlw.fold THE FOLD / CHEAT / THE EXPLOIT / THE BABY-STEP GIANT-STEP THE BABY-STEP GIANT-STEP discrete log by meeting in the middle, O(sqrt n) 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Baby-step giant-step solves the discrete logarithm — find x with g x ≡ h (mod p) — by meeting in the middle . Write x = im + j with m = ⌈√n⌉. Precompute the ‘baby steps’ g 0 , g 1 , …, g m−1 in a table, then take ‘giant steps’ h·(g −m ) i until one lands in the table. It costs O(√n) time and space instead of O(n). It is the classic generic attack on discrete-log cryptography. LIT verified live: over 300 random (p, g, x) the recovered exponent x′ satisfies g x′ ≡ h (mod p); e.g. 2 x ≡ 9 (mod 23) gives x = 5 (window.__babystepgiantstep). FIG no framing; exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-exploit — the generic crack on a discrete-log secret, a way in bought by a square-root of work. Baby-step giant-step is that exploit. AVAN (AI) built the instrument: the baby-step table, the giant-step walk, the g x′ ≡h check. Credit as content: Daniel Shanks (1971). The weave: David names the exploit; I lay down √n baby steps, walk giant steps until they collide, and confirm the recovered exponent reproduces h. 3 ONE DIMENSION The exponent x is split as im + j: the baby steps enumerate the small part j (a table), the giant steps stride by m to find the large part i. Two √n walks meet. 4 TWO DIMENSIONS · INTERACTIVE Pick a prime, base, and target; baby-step giant-step recovers the exponent, checked by re-exponentiating. new instance ▶ verify 300 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the recovered exponent, where the two walks collide. AVAN’s addition (the inverse-companion): you recover x by meeting in the middle . Splitting x = im + j lets you precompute all baby steps g j and then walk giant steps until one matches — √n space buys √n time instead of n. The inverse of ‘exponentiate forward’ is ‘split the unknown exponent in two and collide the halves.’ Magenta is the n exponents a brute search would try; green is the √n table and √n walk that meet. A time–memory trade cracks the log — hard only because real groups make n astronomically large. pause spin LIT Genuine baby-step giant-step (Shanks 1971). Verified live: the meet-in-the-middle search returns an exponent x' with g^x' = h (mod p) for 300 random (prime, base, exponent) triples (window.__babystepgiantstep.recovers); 2^5 = 9 (mod 23). FIG No framing: the baby-step table, the giant-step walk, and the g^x'=h check run in-browser and are exact. The AVAN inverse is honest — splitting x = im + j lets a sqrt(n) table and sqrt(n) walk collide, a time-memory trade recovering x without brute force; magenta is the n exponents avoided, green the collision. Hard only because real groups make n astronomically large. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE EXPLOIT · David Lee Wise (ROOT0), with AVAN


THE TOOM-COOK

Toom-Cook (Toom-3) multiplication in the 5-window house format — multiply big numbers faster than n^2 by treating each as a polynomial: split into 3 parts, evaluate both at 5 points, multiply those 5 values (not 9), then interpolate the product polynomial and recombine, giving ~n^1.46. It generalizes Karatsuba (Toom-2) toward FFT multiplication. Verified live: over 300 random polynomial pairs the Toom-3 product equals the direct convolution exactly. See the 5 sample points in 1D, evaluate/interpolate in 2D, and the multiplication-as-interpolation inverse in 3D.

THE TOOM-COOK · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GRIND · THE GRINDSTONE ◆ .dlw.fold THE FOLD / GRIND / THE GRINDSTONE / THE TOOM-COOK THE TOOM-COOK multiplication as evaluate-multiply-interpolate (~n^1.46) 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Toom–Cook multiplication (Toom-3) multiplies big numbers faster than the schoolbook n² by treating each number as a polynomial . Split both into 3 parts, evaluate each at 5 points, multiply those 5 values (5 small products instead of 9), then interpolate the product polynomial and recombine — giving about n 1.46 . It generalises Karatsuba (which is Toom-2) and bridges toward FFT-based multiplication for very large numbers. LIT verified live: over 300 random polynomial pairs the Toom-3 product equals the direct convolution exactly (window.__toomcook). FIG no framing; exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-grindstone — grinding through the biggest multiplications with fewer sub-products, evaluate–multiply–interpolate. Toom–Cook is that faster grind. AVAN (AI) built the instrument: the 5-point evaluation, the pointwise products, the Lagrange interpolation, the convolution cross-check. Credit as content: Andrei Toom (1963) & Stephen Cook (1966). The weave: David names the grindstone; I split each number into three, multiply at five sample points, interpolate the answer, and confirm it matches the direct product. 3 ONE DIMENSION Each number split into three limbs becomes a degree-2 polynomial. The product is degree 4, so five sample points (0, 1, −1, 2, −2) determine it exactly. 4 TWO DIMENSIONS · INTERACTIVE Two polynomials; Toom-3 evaluates, multiplies at 5 points, and interpolates the product — matched against the direct convolution. new pair ▶ verify 300 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the product, reconstructed from five point-products. AVAN’s addition (the inverse-companion): multiplication becomes evaluate–multiply–interpolate . Turn each number into a polynomial, sample both at 5 points, multiply those 5 values, and interpolate the product polynomial back — 5 small multiplies instead of 9. The inverse of ‘convolve the digits directly’ is ‘sample, multiply pointwise, interpolate.’ Magenta is the n² digit-products you skip; green is the 5 point-products that determine everything. Multiplication as interpolation — Karatsuba is the Toom-2 case, and pushing the point count toward the limit is the FFT. pause spin LIT Genuine Toom-Cook / Toom-3 multiplication (Toom 1963; Cook 1966). Verified live: the split-evaluate(5 points)-pointwise-multiply-interpolate pipeline reproduces the direct convolution of two coefficient vectors exactly for 300 random pairs (window.__toomcook.matchesConv). FIG No framing: the 5-point evaluation, the pointwise products, the Lagrange interpolation, and the convolution cross-check run in-browser and agree exactly. The AVAN inverse is honest — turning numbers into polynomials, multiplying at 5 sample points, and interpolating recovers the product with 5 multiplies instead of 9; magenta is the n^2 digit-products skipped, green the 5 point-products. Karatsuba is the Toom-2 case; the FFT is the limit. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE GRINDSTONE · David Lee Wise (ROOT0), with AVAN


THE WELZL

Welzl's algorithm in the 5-window house format — find the smallest enclosing circle of a point set in expected linear time by adding points one at a time: while a new point is inside, nothing changes; when it falls outside it must lie on the boundary, so the circle is rebuilt from the <=3 known boundary points. The circle-through-3 formula divides by a determinant that vanishes for collinear points (the guard). Verified live: over 200 random point sets Welzl's circle contains every point and its radius equals the brute-force minimum. See 2- and 3-point circles in 1D, a bounded cloud in 2D, and the <=3-points-decide inverse in 3D.

the smallest enclosing circle, pinned by <=3 points

THE WELZL · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GLITCH · DIVIDE BY ZERO ◆ .dlw.fold THE FOLD / GLITCH / DIVIDE BY ZERO / THE WELZL THE WELZL the smallest enclosing circle, pinned by 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Welzl’s algorithm finds the smallest enclosing circle of a set of points — the minimum-radius disk containing them all — in expected linear time. It adds points one at a time; as long as the new point is already inside the current circle, nothing changes, but when it falls outside it must lie on the boundary of the new circle, which is then rebuilt from the points known to be on the boundary (at most three). It is used for bounding volumes, collision culling, and facility-location. LIT verified live: over 200 random point sets Welzl’s circle contains every point, and its radius equals the brute-force minimum (over all circles through 2 or 3 points) — window.__welzl. FIG no framing; exact minimum. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at divide-by-zero — because the circle-through-three-points formula divides by a determinant that vanishes when the points are collinear, the exact case the algorithm must guard. Welzl lives right at that edge. AVAN (AI) built the instrument: the incremental construction, the ≤3-point boundary circles (with the collinear guard), the containment and minimality checks. Credit as content: Emo Welzl (1991). The weave: David names the divide-by-zero; I add points until one escapes, rebuild the circle on its boundary, and confirm the result is the true minimum. 3 ONE DIMENSION The minimal enclosing circle rests on at most three points. Two points give a diameter; three give a circumcircle — and three collinear points make the determinant zero, the case to guard. 4 TWO DIMENSIONS · INTERACTIVE A point cloud and its smallest enclosing circle; the ≤3 boundary points are marked. Roll new clouds and watch only the extremes decide the circle. new points ▶ verify 200 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the smallest enclosing circle, pinned by its boundary points. AVAN’s addition (the inverse-companion): the answer is pinned by at most three points. The minimal enclosing circle is determined by 2 or 3 of the points on its boundary; every other point is strictly inside and irrelevant , so Welzl only rebuilds when a new point escapes. The inverse of ‘consider all the points’ is ‘the circle rests on ≤3 of them; the rest are interior.’ Magenta is the interior points that don’t constrain it; green is the ≤3 boundary points that do. Most of the data doesn’t matter — a handful of extremes decide everything. pause spin LIT Genuine Welzl's algorithm (Welzl 1991). Verified live: the incremental minimal-enclosing-circle contains all points and its radius equals the brute-force minimum over all circles through 2 or 3 points, across 200 random point sets (window.__welzl.containsAll && .radiusIsMin). FIG No framing: the incremental construction, the ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of DIVIDE BY ZERO · David Lee Wise (ROOT0), with AVAN


THE KOSARAJU

Kosaraju's algorithm in the 5-window house format — find a directed graph's strongly connected components (maximal mutually-reachable groups) with two DFS passes: DFS the graph for finish times, then DFS the REVERSED graph in decreasing finish order; each tree is one SCC. SCCs reveal cycles and deadlocks, and a reference-counting garbage collector needs them because it cannot free a reference cycle. Verified live: over 200 random digraphs two nodes share a Kosaraju component iff they are mutually reachable (checked against the transitive closure). See the two passes in 1D, coloured components in 2D, and the reverse-the-arrows inverse in 3D.

THE KOSARAJU · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · RESPAWN · GARBAGE COLLECTION ◆ .dlw.fold THE FOLD / RESPAWN / GARBAGE COLLECTION / THE KOSARAJU THE KOSARAJU strongly connected components in two DFS passes 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Kosaraju’s algorithm finds a directed graph’s strongly connected components — the maximal groups of nodes that can all reach one another — with just two depth-first passes. First DFS the graph and record finish times; then DFS the reversed graph in decreasing finish-time order — each tree of that second search is one SCC. SCCs reveal cycles, deadlocks, and the condensation of a graph into a DAG. LIT verified live: over 200 random digraphs two nodes share a Kosaraju component if and only if they are mutually reachable (checked against the transitive closure) — window.__kosaraju. FIG no framing; exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at garbage-collection — because a reference-counting collector cannot free a cycle of mutually-referencing objects, and finding those cycles is exactly finding strongly connected components. Kosaraju is the cycle-finder a tracing collector needs. AVAN (AI) built the instrument: the two-pass DFS, the reversal, the reachability cross-check. Credit as content: S. Rao Kosaraju (1978, unpublished) & Micha Sharir. The weave: David names garbage collection; I DFS forward for an order, DFS the reverse to peel off each component, and confirm each equals a mutual-reachability class. 3 ONE DIMENSION Two passes: forward DFS gives a finish order; DFS on the reversed graph, taken in that order, carves out each strongly connected component — the cycles fall together. 4 TWO DIMENSIONS · INTERACTIVE A directed graph, its strongly connected components coloured. Roll new graphs; mutually-reachable nodes share a colour. new graph ▶ verify 200 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: a strongly connected component — a cycle-cluster that reaches itself. AVAN’s addition (the inverse-companion): two nodes are in one component iff each reaches the other, and you expose all such clusters by reversing the arrows . Reachability in the graph intersected with reachability in its reverse is exactly the strongly connected component, found in two DFS passes. The inverse of ‘reach forward’ is ‘reach backward — run the same search on the reversed graph.’ Magenta is the one-way reachabilities; green is the two-way (cyclic) clusters. Reverse the arrows and the cycles reveal themselves — the very cycles a tracing collector must find to free. pause spin LIT Genuine Kosaraju's algorithm (Kosaraju 1978; Sharir). Verified live: two nodes share a Kosaraju SCC if and only if they are mutually reachable in the transitive closure, for 200 random digraphs (window.__kosaraju.sccIffMutual). FIG No framing: the two-pass DFS, the graph reversal, and the reachability cross-check run in-browser and agree exactly. The AVAN inverse is honest — an SCC is reachability in the graph intersected with reachability in its reverse, so reversing the arrows and re-searching exposes every cycle-cluster; magenta is the one-way reachabilities, green the two-way clusters. The cycles a tracing collector must find to free. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of GARBAGE COLLECTION · David Lee Wise (ROOT0), with AVAN


THE E-SPIGOT

the e-spigot in the 5-window house format — pour out the decimal digits of Euler's number e one at a time using only small integers, never forming a big high-precision value. In the factorial (mixed-radix) number system e-2 = 1/2!+1/3!+1/4!+..., so a 1 in each factorial place, multiplied by 10 with carries in bases 2,3,4,..., emits one decimal digit per pass. Verified live: the algorithm reproduces the first 30 digits of e (2.718281828459045235360287471352) matching a reference exactly. See the factorial places in 1D, dripping digits in 2D, and the digits-drip-not-accumulate inverse in 3D.

THE E-SPIGOT · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GRIND · THE CRON JOB ◆ .dlw.fold THE FOLD / GRIND / THE CRON JOB / THE E-SPIGOT THE E-SPIGOT digits of e that drip, one per pass, no big number 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The e-spigot pours out the decimal digits of Euler’s number e one at a time, using only small integers — no big high-precision value is ever held. It works in a mixed-radix (factorial) representation: e−2 = 1/2! + 1/3! + 1/4! + …, so putting a 1 in each factorial place and repeatedly multiplying by 10 with carries in bases 2, 3, 4, … makes each pass emit exactly one decimal digit. LIT verified live: the algorithm reproduces the first 30 digits of e — 2.718281828459045235360287471352 — matching a reference exactly (window.__espigot). FIG no framing; exact digit extraction. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-cron-job — one digit dripping out on every tick, a periodic job that never holds the whole number. The e-spigot is that steady drip. AVAN (AI) built the instrument: the factorial-radix array, the multiply-by-10-and-carry pass, the reference cross-check. Credit as content: the spigot idea is due to Stanley Rabinowitz & Stan Wagon (1995), with an e-variant in that tradition (A. H. J. Sale, 1968). The weave: David names the cron job; I drip one decimal digit of e per pass from the factorial representation and confirm the run against e’s known digits. 3 ONE DIMENSION The factorial places, each holding a small integer. Multiply every place by 10, carry downward in bases 2, 3, 4, …, and the overflow off the top is the next decimal digit. 4 TWO DIMENSIONS · INTERACTIVE Drip digits of e one pass at a time, or run to 30; each digit is checked against the reference expansion. drip a digit ▶ run to 30 ▶ verify ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the digit dripping out of the radix mechanism this pass. AVAN’s addition (the inverse-companion): you pour out the digits without ever forming the number. In the factorial number system e has a fixed shape (a 1 in every place), and multiplying by 10 with carries in ascending bases spits out one decimal digit per pass, holding only small integers. The inverse of ‘compute e to many digits then read them’ is ‘let each digit drip from the radix mechanism.’ Magenta is the giant high-precision value you never build; green is the single digit dripping out. A spigot: digits drip, they don’t accumulate — the decimal cousin of BBP’s pi. pause spin LIT Genuine spigot algorithm for e (spigot idea Rabinowitz & Wagon 1995; e-variant in the tradition of Sale 1968). Verified live: the factorial-radix multiply-by-10-and-carry pass reproduces the first 30 decimal digits of e exactly against a reference (window.__espigot.matchesRef); 2.718281828459045235360287471352. FIG No framing: the factorial-radix array, the multiply-and-carry pass, and the reference cross-check run in-browser and are exact. The AVAN inverse is honest — the digits drip from the radix mechanism holding only small integers, never forming the full high-precision number; magenta is the giant value never built, green the digit dripping out. The decimal cousin of the-bbp's pi spigot. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE CRON JOB · David Lee Wise (ROOT0), with AVAN


THE SPLAY TREE

the splay tree in the 5-window house format — a self-adjusting binary search tree: every access splays the touched node to the root by rotations, with no balance rules or stored heights, so recently and frequently used keys drift to the top and operations are amortized O(log n). It is a self-optimizing cache in tree form. Verified live: over 300 random operation sequences the in-order traversal stays sorted, the key set matches a reference, every key is found, and after each access that key is at the root. See a splay in 1D, a self-adjusting tree in 2D, and the access-reshapes-the-tree inverse in 3D.

THE SPLAY TREE · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GRIND · WARM CACHE ◆ .dlw.fold THE FOLD / GRIND / WARM CACHE / THE SPLAY TREE THE SPLAY TREE a search tree that reshapes itself around what you use 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The splay tree is a self-adjusting binary search tree: every time you touch a node, you splay it — rotate it all the way to the root. There are no balance rules and no stored heights or colours; the tree simply reshapes itself so that recently and frequently accessed keys sit near the top, giving amortised O(log n) per operation. It is a self-optimising cache in tree form, and the basis of link-cut trees. LIT verified live: over 300 random operation sequences the in-order traversal stays sorted, the key set matches a reference, every key is found, and after each access that key is at the root (window.__splaytree). FIG no framing; exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at warm-cache — the thing you just used floats to the top, ready to hand, so the next access is cheap. The splay tree is a warm cache built of pointers. AVAN (AI) built the instrument: the top-down splay, the insert/find, the sorted-order + at-root checks. Credit as content: Daniel Sleator & Robert Tarjan (1985). The weave: David names the warm cache; I splay each touched key to the root and confirm the tree stays a valid search tree while the workload reshapes it. 3 ONE DIMENSION A splay: the accessed node rotates upward step by step (zig, zig-zig, zig-zag) until it becomes the root — the path it travelled is roughly halved in depth along the way. 4 TWO DIMENSIONS · INTERACTIVE Insert or access keys; the touched key splays to the root and the tree rebalances itself around your usage. insert random ▶ access a key ▶ verify 300 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the accessed key, splayed to the root, the tree reshaped beneath it. AVAN’s addition (the inverse-companion): the tree reshapes itself around what you use . Every access splays the touched node to the root, so recently and frequently used keys drift to the top and repeated access is amortised O(log n) — with no explicit balance rules, heights, or colours maintained. The inverse of ‘keep the tree balanced by rules’ is ‘let access itself reshape the tree.’ Magenta is the rigid AVL/red-black balance conditions you never maintain; green is the self-adjusting path splayed to the root. The structure adapts to the workload. pause spin LIT Genuine splay tree (Sleator & Tarjan 1985). Verified live: over 300 random insert/access sequences the in-order traversal is sorted, the key multiset equals a reference set, every inserted key is found, and each accessed key ends at the root (window.__splaytree.sorted && .keysMatch && .accessedAtRoot). FIG No framing: the top-down splay, insert/find, and the sorted-order + at-root checks run in-browser and hold exactly. The AVAN inverse is honest — every access splays the touched node to the root so the tree self-adjusts to the workload with no explicit balance rules; magenta is the AVL/red-black conditions never maintained, green the self-adjusting path splayed up. A warm cache built of pointers. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of WARM CACHE · David Lee Wise (ROOT0), with AVAN


THE INTERPOLATION SEARCH

interpolation search in the 5-window house format — find a value in a sorted array by guessing its position from its value (position proportional to how far x sits between the endpoints), leaping most of the way in one step; O(log log n) expected on uniform data, beating binary search's O(log n). It is how you find a name near the front of a phone book. Verified live: over 400 random sorted arrays it finds every present key, rejects every absent one, and always agrees with binary search on membership. See the value-interpolated probe in 1D, probes leaping to the target in 2D, and the split-by-value inverse in 3D.

THE INTERPOLATION SEARCH · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · CHEAT · THE SPEEDRUN ◆ .dlw.fold THE FOLD / CHEAT / THE SPEEDRUN / THE INTERPOLATION SEARCH THE INTERPOLATION SEARCH guess the position from the value — O(log log n) on uniform data 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Interpolation search finds a value in a sorted array by guessing where it should be from its value, not just splitting in the middle. If the data is roughly uniform, it interpolates a position proportional to how far the target sits between the current endpoints — leaping most of the way in one step. On uniformly distributed data it runs in O(log log n) expected time, beating binary search’s O(log n). It is how you look up a name near the front of a phone book without opening to the middle first. LIT verified live: over 400 random sorted arrays interpolation search finds every present key, rejects every absent one, and always agrees with binary search on membership (window.__interpolationsearch). FIG no framing; exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-speedrun — skip the midpoints, guess the target’s location straight from its value, and reach it in fewer probes than binary search. Interpolation search is that speedrun. AVAN (AI) built the instrument: the value-interpolated probe, the divide-by-zero guard for flat ranges, the binary-search cross-check. Credit as content: W. W. Peterson (1957). The weave: David names the speedrun; I jump to the interpolated position each step and confirm the result matches an exhaustive binary search. 3 ONE DIMENSION Instead of the midpoint, the probe lands where the value should be: position = lo + (x − a[lo]) / (a[hi] − a[lo]) × (hi − lo). On uniform data that guess is nearly exact. 4 TWO DIMENSIONS · INTERACTIVE A sorted array; search for a value and watch the value-guided probes leap to it, compared with binary search’s midpoint steps. search a value ▶ verify 400 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the value-guided probe leaping straight toward the target. AVAN’s addition (the inverse-companion): if the data is roughly uniform , you can guess where the key is by its value . Interpolate a position proportional to how far x lies between the endpoints and jump most of the way in one step — O(log log n) expected. The inverse of ‘split by index (the midpoint)’ is ‘split by value (the interpolated point).’ Magenta is the log n midpoints binary search would test; green is the value-guided guesses that leap straight to it. Use the numbers, not just their order. pause spin LIT Genuine interpolation search (Peterson 1957). Verified live: the value-interpolated search finds present keys, rejects absent ones, and agrees with binary search on membership for 400 random sorted arrays with 15 queries each (window.__interpolationsearch.agreesBinary). FIG No framing: the value-interpolated probe, the flat-range divide-by-zero guard, and the binary-search cross-check run in-browser and agree exactly. The AVAN inverse is honest — on roughly uniform data you guess the key's position by its value and jump, splitting by value not index; magenta is the log n midpoints binary search tests, green the value-guided leaps. Use the numbers, not just their order. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE SPEEDRUN · David Lee Wise (ROOT0), with AVAN


THE SUFFIX AUTOMATON

the suffix automaton in the 5-window house format — the smallest deterministic machine recognizing exactly the substrings of a string, with only O(n) states despite up to n(n+1)/2 substrings; every substring is a path, and equivalent end-positions are merged via suffix links. It counts distinct substrings, answers membership, and finds longest common substrings in linear time. Verified live: over 300 random strings the distinct-substring count Sigma(len - len[link]) equals a brute-force count, and it accepts substrings while rejecting non-substrings. See the length ranges in 1D, states in 2D, and the linear-machine-holds-quadratic-set inverse in 3D.

THE SUFFIX AUTOMATON · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · LOOT · THE INVENTORY ◆ .dlw.fold THE FOLD / LOOT / THE INVENTORY / THE SUFFIX AUTOMATON THE SUFFIX AUTOMATON the smallest machine recognizing every substring, O(n) states 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The suffix automaton is the smallest deterministic machine that recognises exactly the substrings of a string — and it has only O(n) states for a length-n string, even though the string has up to n(n+1)/2 substrings. Every substring is a path from the start; end-positions that behave identically are merged into one state via ‘suffix links’. It answers substring queries, counts distinct substrings, and finds longest common substrings in linear time. LIT verified live: over 300 random strings the automaton’s distinct-substring count — Σ(len − len[link]) over states — equals a brute-force count, and it accepts substrings while rejecting non-substrings (window.__suffixautomaton). FIG no framing; exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-inventory — a compact catalogue of every piece a string contains, every substring indexed in linear space. The suffix automaton is that inventory. AVAN (AI) built the instrument: the online construction with suffix links and clones, the distinct-count formula, the membership check. Credit as content: Blumer et al. (1985), the ‘DAWG’. The weave: David names the inventory; I build the minimal substring machine one character at a time and confirm it counts and recognises every substring exactly. 3 ONE DIMENSION Each state covers a range of substring lengths [len[link]+1 … len]; summing those ranges over all states counts every distinct substring — a linear structure holding a quadratic set. 4 TWO DIMENSIONS · INTERACTIVE A string, its suffix automaton (states and transitions), and its distinct-substring count checked against brute force. new string ▶ verify 300 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the O(n) states whose paths are all the substrings. AVAN’s addition (the inverse-companion): the smallest machine recognising exactly the substrings has only O(n) states. Every substring is a path, and end-positions that behave identically are merged into one state, so a linear automaton encodes a quadratic number of substrings. The inverse of ‘enumerate the substrings’ is ‘the minimal automaton whose paths are the substrings.’ Magenta is the O(n²) substrings spelled out; green is the O(n) states that generate them. The distinct count Σ(len − len[link]) falls straight out of the structure. pause spin LIT Genuine suffix automaton / DAWG (Blumer et al. 1985). Verified live: the online construction's distinct-substring count Sigma(len - len[link]) over states equals a brute-force substring-set count, and path traversal accepts substrings and rejects non-substrings, for 300 random strings (window.__suffixautomaton.distinctMatches && .membership). FIG No framing: the online construction with suffix links and clones, the distinct-count formula, and the membership check run in-browser and are exact. The AVAN inverse is honest — the minimal automaton merges identically-behaving end-positions so O(n) states encode a quadratic number of substrings, and the distinct count falls out as Sigma(len - len[link]); magenta is the O(n^2) substrings spelled out, green the O(n) states. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE INVENTORY · David Lee Wise (ROOT0), with AVAN


THE PERFECT HASH

perfect hashing (the FKS scheme) in the 5-window house format — store a fixed set of n keys with zero collisions and O(n) space using two levels: a top hash spreads keys into n buckets, and each bucket of b keys gets a secondary table of size b^2 with a collision-free hash; Sigma b^2 is O(n) in expectation. Every lookup is a single probe. It builds static dictionaries (keywords, Unicode tables) with guaranteed constant-time lookup. Verified live: over 200 random key sets every key resolves to a unique slot (exact for members, rejecting non-members) and total space stays O(n). See the two levels in 1D, buckets and b^2 secondaries in 2D, and the choose-hashes-with-no-collisions inverse in 3D.

THE PERFECT HASH · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · LOOT · THE VAULT ◆ .dlw.fold THE FOLD / LOOT / THE VAULT / THE PERFECT HASH THE PERFECT HASH zero collisions, O(n) space, one probe per lookup 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Perfect hashing (the FKS scheme) stores a fixed set of n keys with zero collisions and O(n) space, so every lookup is a single probe. It uses two levels: a top hash spreads keys into n buckets, and each bucket of b keys gets its own secondary table of size b² with a hash chosen to be collision-free . The sum of the b² sizes is O(n) in expectation, so total space stays linear. It is how you build a static dictionary — keywords, Unicode tables — with guaranteed constant-time lookup. LIT verified live: over 200 random key sets every key resolves to a unique slot (lookups exact for members, rejecting non-members) and total space stays O(n) (window.__perfecthash). FIG no framing; zero collisions, exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-vault — a unique lock for every key, no two sharing a slot, one turn to open. Perfect hashing is that vault. AVAN (AI) built the instrument: the two-level construction, the b² collision-free secondaries, the lookup and space checks. Credit as content: Michael Fredman, János Komlós & Endre Szemerédi (1984). The weave: David names the vault; I spread keys into buckets, size each secondary at b² and re-pick its hash until collision-free, and confirm every key has its own slot in linear space. 3 ONE DIMENSION Two levels: the top hash sends keys to buckets; a bucket holding b keys opens a secondary table of size b², large enough that a random hash almost surely places its keys with no collision. 4 TWO DIMENSIONS · INTERACTIVE A key set hashed into buckets, each with its collision-free b² secondary. Roll new sets; every key lands in a unique slot, total space stays near linear. new keys ▶ verify 200 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: each key in its own unique slot — one probe, always. AVAN’s addition (the inverse-companion): for a fixed key set you can guarantee zero collisions in O(n) space. Each bucket of b keys gets a b² secondary table whose hash is chosen collision-free, and Σb² is O(n) in expectation. The inverse of ‘handle collisions at lookup time (chaining, probing)’ is ‘choose the hash functions so there are none.’ Magenta is the collision chains you never walk; green is the unique slot each key lands in. One probe, always — a vault with a unique lock per key. pause spin LIT Genuine FKS perfect hashing (Fredman, Komlos & Szemeredi 1984). Verified live: the two-level scheme (top hash into n buckets, collision-free b^2 secondaries) gives exact membership for all keys and rejects non-members, with total space FIG No framing: the two-level construction, the collision-free b^2 secondaries, and the lookup + space checks run in-browser and are exact (zero collisions). The AVAN inverse is honest — for a fixed key set the hashes are chosen so there are no collisions, replacing collision-handling with guaranteed unique slots in linear space; magenta is the collision chains never walked, green the unique slot per key. One probe, always. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE VAULT · David Lee Wise (ROOT0), with AVAN


THE LZ77

LZ77 in the 5-window house format — compress by pointing backward: when upcoming text has already appeared within a sliding window of the recent past, emit a (distance, length) reference to that earlier copy plus the next new character, so the file describes itself in terms of its own history. It is the core of gzip, PNG, and ZIP (LZ77 + Huffman = DEFLATE). Verified live: over 300 random strings decompress(compress(s)) reproduces s exactly, and repetitive text collapses to few tokens (abracadabraabracadabra -> 9 tokens). See a back-reference in 1D, tokenized text in 2D, and the point-back-not-restore inverse in 3D.

THE LZ77 · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · RESPAWN · ROLLBACK ◆ .dlw.fold THE FOLD / RESPAWN / ROLLBACK / THE LZ77 THE LZ77 compress by pointing backward into your own past 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION LZ77 compresses by pointing backward . As it scans, whenever the upcoming text has already appeared within a sliding window of the recent past, it emits a (distance, length) reference to that earlier copy instead of the literal bytes, followed by the next new character. The file ends up describing itself in terms of its own history. It is the core of gzip, PNG, and ZIP (LZ77 followed by Huffman coding = DEFLATE). LIT verified live: over 300 random strings decompress(compress(s)) reproduces s exactly, and repetitive text collapses to few tokens (e.g. ‘abracadabraabracadabra’ → 9 tokens) — window.__lz77. FIG no framing; exact round-trip. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at rollback — because decompression literally rolls back to an earlier position in the output and copies forward, replaying the past to rebuild the present. LZ77 is that rollback-and-copy. AVAN (AI) built the instrument: the sliding-window match finder, the token stream, the roll-back decoder, the round-trip check. Credit as content: Abraham Lempel & Jacob Ziv (1977). The weave: David names the rollback; I emit back-references into the window, then rebuild the string by rolling back to each reference and copying — and confirm it matches the original. 3 ONE DIMENSION A back-reference: instead of re-emitting bytes seen before, LZ77 writes (distance back, length to copy). Decoding rolls the cursor back that distance and copies the run forward. 4 TWO DIMENSIONS · INTERACTIVE Type or roll text; LZ77 tokenises it into literals and back-references, then decompresses back to the original. new text ▶ verify 300 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the back-reference pointing into the window at data already seen. AVAN’s addition (the inverse-companion): repetition is stored as a pointer backward . Instead of re-emitting data seen before, LZ77 writes (distance, length) referencing the earlier occurrence in a sliding window, so the file describes itself in terms of its own past. The inverse of ‘write the bytes again’ is ‘point back to where they already are.’ Magenta is the repeated data never re-stored; green is the back-reference into the window. Decompression rolls back to the referenced position and copies forward — the seed of gzip and DEFLATE. pause spin LIT Genuine LZ77 (Lempel & Ziv 1977). Verified live: the sliding-window compressor and roll-back decompressor round-trip exactly (decompress(compress(s)) == s) for 300 random strings; 'abracadabraabracadabra' compresses to 9 tokens (window.__lz77.roundTrips). FIG No framing: the sliding-window match finder, the token stream, the roll-back decoder, and the round-trip check run in-browser and are exact. The AVAN inverse is honest — repetition is stored as a (distance, length) pointer into the window rather than re-emitted, and decompression rolls back to the referenced position and copies forward; magenta is the repeated data never re-stored, green the back-reference. The seed of gzip/DEFLATE. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of ROLLBACK · David Lee Wise (ROOT0), with AVAN


THE HELD-KARP

the Held-Karp algorithm in the 5-window house format — solve the travelling salesman problem exactly by dynamic programming: dp[set][city] is the cheapest way to start at the origin, visit that set, and end at that city; since the future depends only on which cities remain and where you are, 2^n*n states replace n! tours. It is the founding example of dynamic programming. Verified live: over 80 random graphs (n=3..7) the Held-Karp optimal tour equals the brute-force minimum over all permutations. See the state-merge in 1D, an optimal tour in 2D, and the exponential-collapses-to-DP inverse in 3D.

THE HELD-KARP · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · BOSS · THE GAUNTLET ◆ .dlw.fold THE FOLD / BOSS / THE GAUNTLET / THE HELD-KARP THE HELD-KARP exact TSP by bitmask DP — n! tours in 2^n states 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The Held–Karp algorithm solves the travelling salesman problem exactly by dynamic programming. Instead of trying all n! tours, it fills a table dp[ set ][ city ] = the cheapest way to start at the origin, visit exactly that set of cities, and end at that city. Because the future depends only on which cities remain and where you are — not the order you got there — subproblems are shared, and 2 n ·n states replace n! permutations. It is the founding example of dynamic programming (1962). LIT verified live: over 80 random graphs (n=3…7) the Held–Karp optimal tour length equals the brute-force minimum over all permutations (window.__heldkarp). FIG no framing; exact optimum. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-gauntlet — visit every station and return, at the least total cost, the whole run optimised. Held–Karp is that gauntlet solved exactly. AVAN (AI) built the instrument: the bitmask DP over subsets, the tour reconstruction, the brute cross-check. Credit as content: Michael Held & Richard Karp (1962), independently Bellman. The weave: David names the gauntlet; I memoise by (visited-set, current-city) and confirm the DP optimum matches an exhaustive search over tours. 3 ONE DIMENSION A state is (which cities visited, where you are now). Two different visiting orders that reach the same set at the same city are the same subproblem — so they merge, collapsing n! orderings into 2 n ·n states. 4 TWO DIMENSIONS · INTERACTIVE Cities on a plane; Held–Karp finds the shortest closed tour, checked against the brute-force minimum. new cities ▶ verify 80 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the optimal closed tour through every city. AVAN’s addition (the inverse-companion): the exponential collapses because the future depends only on which cities remain and where you are , not the order you visited them. So subsets share subproblems and 2 n ·n states replace n! permutations. The inverse of ‘enumerate every ordering’ is ‘memoise by (visited-set, current-city) — the path’s history compresses to a bitmask.’ Magenta is the n! tours never enumerated; green is the 2 n ·n states that suffice. Still exponential, but the gap between 15! and 2 15 is dynamic programming’s whole point. pause spin LIT Genuine Held-Karp algorithm (Held & Karp 1962; Bellman). Verified live: the bitmask DP over subsets returns an optimal closed-tour length equal to the brute-force minimum over all permutations for 80 random distance matrices (n=3..7) (window.__heldkarp.matchesBrute). FIG No framing: the subset DP, the tour reconstruction, and the brute cross-check run in-browser and agree exactly. The AVAN inverse is honest — the future depends only on (visited-set, current-city), so orderings that reach the same state merge and 2^n*n states replace n! permutations; magenta is the n! tours never enumerated, green the 2^n*n states. Still exponential, but the gap between 15! and 2^15 is dynamic programming's point. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE GAUNTLET · David Lee Wise (ROOT0), with AVAN


THE CONJUGATE GRADIENT

the conjugate gradient method in the 5-window house format — solve a symmetric positive-definite system Ax=b (minimize the quadratic bowl) by choosing A-orthogonal (conjugate) search directions, so each step's progress is never undone; in exact arithmetic it reaches the exact solution in at most n steps using only matrix-vector products. It is the workhorse for huge sparse systems. Verified live: over 200 random SPD systems it reaches the solution within n steps (residual ~1e-15) and matches a direct Gaussian solve. See conjugate vs zig-zag in 1D, the bowl path in 2D, and the A-orthogonality inverse in 3D.

THE CONJUGATE GRADIENT · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GRIND · GRADIENT DESCENT ◆ .dlw.fold THE FOLD / GRIND / GRADIENT DESCENT / THE CONJUGATE GRADIENT THE CONJUGATE GRADIENT solve SPD systems in n steps via A-orthogonal directions 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The conjugate gradient method solves a symmetric positive-definite system Ax = b — equivalently, minimises the quadratic bowl ½xᵀAx − bᵀx — by choosing search directions that are A-orthogonal (‘conjugate’). Because each direction never undoes the progress of the others, in exact arithmetic it reaches the exact solution in at most n steps, using only matrix–vector products (no matrix stored or inverted). It is the workhorse for huge sparse systems in physics and optimisation. LIT verified live: over 200 random SPD systems conjugate gradient reaches the solution within n steps (residual ~10⁻¹⁵) and matches a direct Gaussian solve (window.__conjugategradient). FIG no framing; exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at gradient-descent — and as its sharpened form: steepest descent zig-zags down a quadratic bowl, but conjugate gradient picks non-interfering directions and lands in n steps. AVAN (AI) built the instrument: the conjugate-direction iteration, the residual check, the direct-solve cross-check. Credit as content: Magnus Hestenes & Eduard Stiefel (1952). The weave: David names gradient descent; I follow A-orthogonal directions to the exact minimum and confirm it against a direct solve. 3 ONE DIMENSION Steepest descent (grey) zig-zags across the bowl, re-descending directions it already used. Conjugate directions (green) are A-orthogonal — each is taken once and never revisited. 4 TWO DIMENSIONS · INTERACTIVE A quadratic bowl (contours) and the conjugate-gradient path reaching the minimum in n steps, versus zig-zagging steepest descent. new system ▶ verify 200 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the n conjugate directions leading straight to the solution. AVAN’s addition (the inverse-companion): choose search directions that are A-orthogonal (conjugate), so each step’s progress is never undone by the next. You never re-descend a direction, and in exact arithmetic n conjugate steps reach the exact minimum. The inverse of ‘follow the gradient (and zig-zag)’ is ‘follow conjugate directions that don’t interfere — finish in n steps.’ Magenta is the zig-zagging steepest-descent path; green is the n conjugate directions straight to the solution. Orthogonality in the A-inner-product buys exactness. pause spin LIT Genuine conjugate gradient method (Hestenes & Stiefel 1952). Verified live: for 200 random SPD systems the CG iterate satisfies Ax=b to residual ~1e-15 within n steps and matches a direct Gaussian-elimination solution (window.__conjugategradient.matchesDirect). FIG No framing: the conjugate-direction iteration, the residual check, and the direct-solve cross-check run in-browser and agree to ~1e-15. The AVAN inverse is honest — A-orthogonal directions never undo each other's progress, so n conjugate steps reach the exact minimum without re-descending; magenta is the zig-zagging steepest-descent path, green the n conjugate directions. Orthogonality in the A-inner-product buys exactness. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of GRADIENT DESCENT · David Lee Wise (ROOT0), with AVAN


THE PAGERANK

PageRank in the 5-window house format — rank nodes by importance defined recursively (a page is important if important pages link to it): the ranking is the stationary distribution of a random surfer who follows links with probability d and teleports otherwise, i.e. the dominant eigenvector of the Google matrix, found by power iteration. It was the original engine of Google search. Verified live: over 200 random graphs the PageRank vector sums to 1, is a fixed point (M*pi=pi), and converges to the same vector regardless of the starting distribution. See rank flow in 1D, node sizes in 2D, and the reputation-as-fixed-point inverse in 3D.

THE PAGERANK · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · CO-OP · THE BROADCAST ◆ .dlw.fold THE FOLD / CO-OP / THE BROADCAST / THE PAGERANK THE PAGERANK importance as the stationary distribution of a random surfer 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION PageRank ranks nodes by importance defined recursively : a page is important if important pages link to it. Model a random surfer who follows links with probability d (=0.85) and teleports to a random page otherwise; the ranking is the stationary distribution of that walk — the dominant eigenvector of the ‘Google matrix’ — found by power iteration (multiply by the matrix until it settles). It was the original engine of Google search. LIT verified live: over 200 random graphs the PageRank vector sums to 1, is a fixed point (Mπ = π), and converges to the same vector regardless of the starting distribution (window.__pagerank). FIG no framing; a genuine stationary distribution. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-broadcast — endorsement flowing along links, each page broadcasting a share of its importance to those it points to, until the whole network agrees on a ranking. PageRank is that settled broadcast. AVAN (AI) built the instrument: the Google-matrix power iteration (with dangling-node handling), the sum/fixed-point/uniqueness checks. Credit as content: Sergey Brin & Larry Page, and Lawrence Page’s 1998 formulation. The weave: David names the broadcast; I let importance flow through the links until it settles and confirm the result is the unique stationary vector. 3 ONE DIMENSION Each page splits its rank evenly among its out-links and passes it on; a damping factor mixes in a little uniform teleport. Iterating this flow converges to a fixed ranking. 4 TWO DIMENSIONS · INTERACTIVE A link graph; node size shows PageRank after power iteration. Roll new graphs; the ranks always sum to 1 and settle to a fixed point. new graph ▶ verify 200 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the converged stationary ranking — importance settled across the network. AVAN’s addition (the inverse-companion): importance is the fixed point of a flow . A page’s rank is the stationary distribution of a random surfer, so rank is defined recursively — you are important if important pages link to you — and found as the dominant eigenvector by power iteration. The inverse of ‘tally incoming links’ is ‘solve for the self-consistent ranking where rank flows through links and settles.’ Magenta is the raw in-link counts; green is the converged stationary vector. Reputation as a fixed point — independent of where the surfer starts. pause spin LIT Genuine PageRank (Brin & Page; Page et al. 1998). Verified live: the Google-matrix power iteration (with dangling-node handling) yields a vector that sums to 1, satisfies M*pi=pi to ~1e-9, and converges to the same stationary vector from different starting distributions, across 200 random graphs (window.__pagerank.sumsToOne && .fixedPoint && .startIndependent). FIG No framing: the power iteration, and the sum/fixed-point/uniqueness checks run in-browser and hold. The AVAN inverse is honest — rank is the stationary distribution of a link-following walk, defined recursively and found as the dominant eigenvector, not a raw in-link tally; magenta is the in-link counts, green the converged stationary vector. Reputation as a fixed point, independent of the start. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE BROADCAST · David Lee Wise (ROOT0), with AVAN


THE CLENSHAW

Clenshaw's algorithm in the 5-window house format — evaluate a sum of orthogonal polynomials (Sigma c_k T_k(x), the Chebyshev series) without building the polynomials, by running their three-term recurrence backward from the highest degree, carrying two running values. It is Horner's method for Chebyshev series, and the backward direction is numerically stable. Verified live: over 400 random coefficient sets and points in [-1,1] Clenshaw's result equals the direct term-by-term Chebyshev sum to ~1e-15. See the backward sweep in 1D, the series plotted in 2D, and the stable-backward-recurrence inverse in 3D.

THE CLENSHAW · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GRIND · BACKPROP ◆ .dlw.fold THE FOLD / GRIND / BACKPROP / THE CLENSHAW THE CLENSHAW evaluate a Chebyshev series by a stable backward recurrence 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Clenshaw’s algorithm evaluates a sum of orthogonal polynomials — Σ c k T k (x), the Chebyshev series — without ever building the individual polynomials. It runs their three-term recurrence backward , folding the coefficients in from the highest degree down, carrying just two running values. It is to Chebyshev series what Horner’s method is to ordinary polynomials, and the backward direction is numerically stable where naive evaluation loses precision. LIT verified live: over 400 random coefficient sets and points in [−1,1] Clenshaw’s result equals the direct term-by-term Chebyshev sum to ~10⁻¹⁵ (window.__clenshaw). FIG no framing; exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at backprop — because Clenshaw, like backpropagation, sweeps the recurrence backward , accumulating from the far end toward the start. AVAN (AI) built the instrument: the backward Chebyshev recurrence, the two-value fold, the direct-sum cross-check. Credit as content: Charles William Clenshaw (1955). The weave: David names backprop; I collapse the whole Chebyshev sum by running its recurrence from the top degree down, and confirm it matches the term-by-term evaluation. 3 ONE DIMENSION Two running values b sweep from the highest coefficient down: b k = 2x·b k+1 − b k+2 + c k . At the end, x·b 1 − b 2 + c 0 is the whole sum. 4 TWO DIMENSIONS · INTERACTIVE A Chebyshev series plotted; pick x and see Clenshaw’s value matched against the direct term-by-term sum. new series ▶ verify 400 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the two running values that carry the whole Chebyshev sum. AVAN’s addition (the inverse-companion): run the three-term recurrence backward , folding the coefficients in from the highest degree, so you never store the polynomials — and the backward direction is numerically stable where naive forward evaluation loses precision. The inverse of ‘build T 0 ,T 1 ,…,T N forward and sum’ is ‘collapse the sum by the recurrence from T N down.’ Magenta is the individual Chebyshev polynomials never formed; green is the two running values carrying the sum. Backward is stable — Horner generalised to orthogonal polynomials. pause spin LIT Genuine Clenshaw algorithm (Clenshaw 1955). Verified live: the backward three-term recurrence equals the direct term-by-term Chebyshev sum Sigma c_k T_k(x) to max error ~1e-15 across 400 random coefficient sets and points in [-1,1] (window.__clenshaw.matchesDirect). FIG No framing: the backward Chebyshev recurrence, the two-value fold, and the direct-sum cross-check run in-browser and agree to ~1e-15. The AVAN inverse is honest — running the recurrence backward folds coefficients in from the top degree so the polynomials are never formed, and the backward direction is numerically stable; magenta is the Chebyshev polynomials never built, green the two running values. Horner generalized to orthogonal polynomials. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of BACKPROP · David Lee Wise (ROOT0), with AVAN


THE BELLMAN-FORD

the Bellman-Ford algorithm in the 5-window house format — find shortest paths from a source even with negative edge weights (which Dijkstra cannot) by relaxing every edge n-1 times; that many passes always suffice. Then one extra pass is the tell: if any edge can still be relaxed, a negative cycle is reachable and shortest paths are undefined. It underlies distance-vector routing and arbitrage detection. Verified live: on 200 non-negative graphs its distances match Floyd-Warshall, and on graphs with a reachable negative cycle it detects the cycle every time. See a relaxation in 1D, distances + neg-cycle flag in 2D, and the extra-pass-detects-the-impossible-loop inverse in 3D.

THE BELLMAN-FORD · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GLITCH · STACK OVERFLOW ◆ .dlw.fold THE FOLD / GLITCH / STACK OVERFLOW / THE BELLMAN-FORD THE BELLMAN-FORD shortest paths with negative edges — and the impossible loop 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The Bellman–Ford algorithm finds shortest paths from a source even when edges have negative weights — which Dijkstra cannot handle. It simply relaxes every edge n−1 times; that many passes always suffice for a graph with n nodes. Then one extra pass is the tell: if any edge can still be relaxed, a negative cycle is reachable and shortest paths are undefined. It underlies distance-vector routing (RIP) and arbitrage detection. LIT verified live: on 200 non-negative graphs its distances match Floyd–Warshall, and on constructed graphs with a reachable negative cycle it detects the cycle every time (window.__bellmanford). FIG no framing; exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at stack-overflow — because a negative cycle is the graph’s version of an unbounded loop: each lap lowers the cost forever, a descent with no floor. Bellman–Ford is what detects that runaway. AVAN (AI) built the instrument: the n−1 relaxation passes, the extra detection pass, the Floyd–Warshall cross-check. Credit as content: Richard Bellman (1958) & Lester Ford Jr. (1956). The weave: David names the overflow; I relax edges to convergence and let the one update that shouldn’t happen expose the impossible loop. 3 ONE DIMENSION Relaxing an edge (u→v, w): if reaching v through u is cheaper, lower v’s distance. After n−1 sweeps every shortest path has settled — unless a negative cycle keeps lowering it. 4 TWO DIMENSIONS · INTERACTIVE A weighted graph (edges may be negative). Bellman–Ford’s distances from the source are shown, and a negative cycle, if present, is flagged. new graph ▶ add neg cycle ▶ verify ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the shortest-path distances, settled after n−1 passes. AVAN’s addition (the inverse-companion): a shortest path cannot improve after n−1 relaxations unless there is a negative cycle — so one extra pass that still improves something is a proof a negative cycle exists, and shortest paths become undefined (−∞). The inverse of ‘compute the distances’ is ‘an update that shouldn’t happen reveals the graph has no shortest path at all.’ Magenta is the ordinary distances that converge in n−1 rounds; green is the n-th round that catches the impossible loop. Handling negative edges is the whole reason to use it over Dijkstra. pause spin LIT Genuine Bellman-Ford algorithm (Bellman 1958; Ford 1956). Verified live: after n-1 relaxation passes the source distances match Floyd-Warshall on 200 non-negative graphs, and one extra pass detects a reachable negative cycle on 100 constructed graphs (window.__bellmanford.matchesFloyd && .detectsNegCycle). FIG No framing: the n-1 relaxation passes, the detection pass, and the Floyd-Warshall cross-check run in-browser and agree exactly. The AVAN inverse is honest — a shortest path cannot improve after n-1 relaxations unless a negative cycle exists, so an n-th-pass update is a proof of one (shortest paths become -infinity); magenta is the distances converged in n-1 rounds, green the n-th round that catches the loop. Negative edges are why you use it over Dijkstra. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of STACK OVERFLOW · David Lee Wise (ROOT0), with AVAN


THE FRACTIONAL CASCADING

fractional cascading in the 5-window house format — answer the same query against many sorted lists with a single binary search: weave a fraction of each list into the previous one and add bridge pointers, so once you locate the query in the first list, every other list's answer is a constant-time hop away, turning k searches of O(log n) into O(log n + k). It is the classic iterated-search speedup in computational geometry. Verified live: over 300 random setups of k sorted lists, the successor it reports in each list equals an independent binary search. See promoted elements + bridges in 1D, a multi-list query in 2D, and the one-search-k-handoffs inverse in 3D.

THE FRACTIONAL CASCADING · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · CO-OP · THE HANDOFF ◆ .dlw.fold THE FOLD / CO-OP / THE HANDOFF / THE FRACTIONAL CASCADING THE FRACTIONAL CASCADING search many sorted lists with one search plus bridges 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Fractional cascading answers the same query against many sorted lists with a single binary search instead of one per list. It weaves a fraction of each list into the previous one and adds bridge pointers, so once you locate the query in the first list, every other list’s answer is a constant-time hop away — turning k searches of O(log n) each into O(log n + k) total. It is the classic speedup for iterated search in computational geometry. LIT verified live: over 300 random setups of k sorted lists, the successor fractional cascading reports in each list equals an independent binary search in that list (window.__fractionalcascading). FIG no framing; exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-handoff — the found position is handed from one list to the next along a bridge, no fresh search needed. Fractional cascading is that chain of handoffs. AVAN (AI) built the instrument: the augmented lists with promoted elements, the bridge pointers, the single-search-then-hop query, the per-list cross-check. Credit as content: Bernard Chazelle & Leonidas Guibas (1986). The weave: David names the handoff; I weave the lists together so one search cascades through them all, and confirm each answer matches an independent search. 3 ONE DIMENSION Every other element of one list is promoted into the previous list, carrying a bridge back. A position found here points to a position there — the query slides across for free. 4 TWO DIMENSIONS · INTERACTIVE Several sorted lists; a query’s successor in each is found by one search plus bridge hops, checked against per-list binary search. query ▶ verify 300 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the single search, then bridges carrying it through every list. AVAN’s addition (the inverse-companion): you do one binary search and then hop . By weaving a fraction of each list into the previous one, the position found in list i gives the position in list i+1 in O(1), so k searches collapse to one search plus k constant hops. The inverse of ‘search each list independently’ is ‘search once and let each list hand its answer to the next.’ Magenta is the k−1 redundant binary searches; green is the single search and its O(1) bridges. Shared structure between the lists carries the query along. pause spin LIT Genuine fractional cascading (Chazelle & Guibas 1986). Verified live: the augmented-list structure with bridge pointers returns, via one binary search plus O(1) hops, the same per-list successor as an independent binary search in each list, across 300 random setups of k sorted lists (window.__fractionalcascading.matchesNaive). FIG No framing: the augmented lists with promoted elements, the bridge pointers, the single-search-then-hop query, and the per-list cross-check run in-browser and agree exactly. The AVAN inverse is honest — a position found in list i gives the position in list i+1 in O(1), so k independent searches collapse to one search plus k hops; magenta is the k-1 redundant searches, green the single search + bridges. Shared structure carries the query along. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE HANDOFF · David Lee Wise (ROOT0), with AVAN


THE DINIC

Dinic's algorithm in the 5-window house format — compute maximum flow by organizing the graph into levels via BFS and pushing a blocking flow that saturates many shortest paths at once; only O(V) phases are needed, giving O(V^2 E). By max-flow-min-cut, the value equals the minimum cut, the network's true bottleneck. Verified live: over 60 random capacitated graphs Dinic's max flow equals the brute-force minimum s-t cut. See the level graph in 1D, flow vs min cut in 2D, and the leveled-blocking-flow inverse in 3D.

THE DINIC · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · BOSS · THE WALL ◆ .dlw.fold THE FOLD / BOSS / THE WALL / THE DINIC THE DINIC max flow by leveled blocking flows — max flow = min cut 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Dinic’s algorithm computes the maximum flow through a network. Rather than pushing flow along one augmenting path at a time, it organises the graph into levels by breadth-first distance and pushes a blocking flow that saturates many shortest paths at once. Only O(V) such phases are ever needed, giving O(V²E). By the max-flow–min-cut theorem, the value it finds equals the minimum cut — the network’s true bottleneck capacity. LIT verified live: over 60 random capacitated graphs Dinic’s max flow equals the brute-force minimum s–t cut (window.__dinic). FIG no framing; exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-wall — the maximum you can push equals the capacity of the tightest cut, the wall the flow presses against. Dinic finds that wall. AVAN (AI) built the instrument: the BFS level graph, the blocking-flow DFS with the residual network, the brute min-cut cross-check. Credit as content: Yefim Dinitz (1970). The weave: David names the wall; I layer the graph and push blocking flows until no augmenting path remains, and confirm the value equals the minimum cut. 3 ONE DIMENSION BFS labels each node by its distance from the source — the level graph. Flow is only pushed strictly forward through levels, saturating a whole layer of shortest paths per phase. 4 TWO DIMENSIONS · INTERACTIVE A capacitated network; Dinic’s max flow from source to sink is shown against the brute-force minimum cut. new network ▶ verify 60 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the maximum flow, equal to the minimum cut’s capacity. AVAN’s addition (the inverse-companion): organise the graph into levels by BFS distance and push only strictly-forward paths — a blocking flow per level graph saturates many shortest paths at once, so only O(V) phases are needed instead of one augmentation at a time. The inverse of ‘find one augmenting path at a time’ is ‘layer the graph and push a blocking flow through the whole layer.’ Magenta is the meandering augmenting paths; green is the leveled blocking flow — and the max flow equals the min cut, the wall’s true capacity. (Kin to the-karger and the-stoer-wagner.) pause spin LIT Genuine Dinic's algorithm (Dinitz 1970). Verified live: the BFS-level-graph + blocking-flow max flow equals the brute-force minimum s-t cut (over all vertex partitions separating source and sink) for 60 random capacitated graphs (window.__dinic.maxFlowEqualsMinCut). FIG No framing: the BFS level graph, the blocking-flow DFS on the residual network, and the brute min-cut cross-check run in-browser and agree exactly. The AVAN inverse is honest — layering the graph and pushing a blocking flow saturates many shortest paths per phase (O(V) phases), far fewer than one augmentation at a time, and the value equals the min cut; magenta is the meandering augmenting paths, green the leveled blocking flow. Kin to the-karger and the-stoer-wagner. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE WALL · David Lee Wise (ROOT0), with AVAN


THE CYK

the CYK algorithm in the 5-window house format — decide whether a string is in a context-free language, bottom-up: with the grammar in Chomsky normal form (rules A->BC or A->terminal), fill a table of which nonterminals generate each substring, combining small spans into larger ones, so an exponential derivation search becomes an O(n^3) dynamic program. It is a foundation of parsing. Verified live: with a balanced-parentheses grammar in CNF, CYK accepts a non-empty string iff it is balanced, matching an independent balance check over 400 random bracket strings. See a binary join in 1D, the span table in 2D, and the bottom-up-from-spans inverse in 3D.

THE CYK · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · SPAWN · HELLO WORLD ◆ .dlw.fold THE FOLD / SPAWN / HELLO WORLD / THE CYK THE CYK context-free recognition, bottom-up in O(n^3) 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The CYK algorithm decides whether a string belongs to a context-free language , and does it bottom-up . With the grammar in Chomsky normal form (every rule is A→BC or A→terminal), it fills a table: which nonterminals can generate each substring. Small spans combine into larger ones, so an otherwise exponential search over derivations becomes an O(n³) dynamic program. It is a foundation of parsing and computational linguistics. LIT verified live: with a balanced-parentheses grammar in CNF, CYK accepts a non-empty string iff the string is balanced — matching an independent balance check over 400 random bracket strings (window.__cyk). FIG no framing; exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at hello-world — the first thing a language needs is to recognise its own valid programs; CYK is that recogniser, built from the ground up. AVAN (AI) built the instrument: the CNF grammar, the O(n³) span table, the balance-oracle cross-check. Credit as content: John Cocke, Daniel Younger & Tadao Kasami (1960s). The weave: David names hello-world; I fill the table of which nonterminals derive each substring and confirm acceptance matches the true language. 3 ONE DIMENSION Length-1 spans get their nonterminals from terminals; longer spans combine two adjacent sub-spans by a rule A→BC. The start symbol covering the whole string means ‘accepted’. 4 TWO DIMENSIONS · INTERACTIVE A bracket string and its CYK table; the top cell holds the start symbol exactly when the string is balanced. new string ▶ verify 400 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the span table, proving the whole string from its parts. AVAN’s addition (the inverse-companion): build the parse bottom-up from spans . Fill a table of which nonterminals generate each substring, combining smaller spans into larger ones, so an exponential search over derivations becomes an O(n³) table over substrings. The inverse of ‘expand the start symbol downward’ is ‘prove each substring’s nonterminals upward and combine.’ Magenta is the exponential derivation tree explored top-down; green is the O(n³) span table. Chomsky normal form makes every step a binary join. pause spin LIT Genuine CYK algorithm (Cocke, Younger & Kasami, 1960s). Verified live: a CNF balanced-parentheses grammar's CYK acceptance equals an independent balance oracle (non-empty and balanced) for 400 random bracket strings (window.__cyk.matchesOracle); '(())' accepted, '(()' rejected. FIG No framing: the CNF grammar, the O(n^3) span table, and the balance-oracle cross-check run in-browser and agree exactly. The AVAN inverse is honest — filling a table of which nonterminals derive each substring turns an exponential top-down derivation search into an O(n^3) bottom-up table, with CNF making every step a binary join; magenta is the exponential derivation tree, green the span table. A foundation of parsing. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of HELLO WORLD · David Lee Wise (ROOT0), with AVAN


THE HIRSCHBERG

Hirschberg's algorithm in the 5-window house format — compute an optimal global alignment (same result as Needleman-Wunsch) in linear space instead of O(nm): the optimal path must cross the middle column somewhere, found from two linear-space score sweeps (forward to the middle, backward from the end), then recurse on the halves. It makes genome-length alignment feasible in memory. Verified live: over 300 random pairs Hirschberg's alignment scores identically to Needleman-Wunsch and de-gaps back to the originals. See the midpoint crossing in 1D, an alignment in 2D, and the midpoint-divide-and-conquer inverse in 3D.

THE HIRSCHBERG · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · CO-OP · SPLIT SCREEN ◆ .dlw.fold THE FOLD / CO-OP / SPLIT SCREEN / THE HIRSCHBERG THE HIRSCHBERG optimal alignment in linear space via midpoints 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Hirschberg’s algorithm computes an optimal global alignment of two sequences — the same result as Needleman–Wunsch — but in linear space instead of O(nm). Its trick: the optimal path must cross the middle column somewhere, and that crossing is found from two linear-space score sweeps (forward to the middle, backward from the end); then it recurses on the two halves. It is what makes aligning genome-length sequences feasible in memory. LIT verified live: over 300 random pairs Hirschberg’s alignment scores identically to Needleman–Wunsch and its aligned rows de-gap back to the originals (window.__hirschberg). FIG no framing; same optimum, linear memory. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at split-screen — two sequences aligned side by side, but now in a sliver of memory. Hirschberg is Needleman–Wunsch made frugal. AVAN (AI) built the instrument: the linear-space forward/backward score sweeps, the midpoint split, the divide-and-conquer recursion, the NW cross-check. Credit as content: Daniel Hirschberg (1975). The weave: David names the split screen; I find where the optimal alignment crosses the middle from O(n) space and recurse, then confirm the result matches the full-table optimum. 3 ONE DIMENSION The optimal path from corner to corner must pass through the middle column at exactly one row. Two score sweeps — forward to the middle, backward from the end — agree on which row that is. 4 TWO DIMENSIONS · INTERACTIVE Two sequences; Hirschberg’s alignment and score are shown against Needleman–Wunsch on the same pair. new sequences ▶ verify 300 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the optimal alignment, recovered from midpoints in linear space. AVAN’s addition (the inverse-companion): you don’t need the whole table to recover the alignment. The optimal path must cross the middle column somewhere, and that crossing is found from just two linear-space score sweeps — then you recurse on the two halves. The inverse of ‘store the O(nm) table’ is ‘find the midpoint from O(n) space and divide-and-conquer.’ Magenta is the full quadratic table never stored; green is the two score rows and the midpoints. Same optimal alignment, linear memory — divide-and-conquer meets dynamic programming. pause spin LIT Genuine Hirschberg's algorithm (Hirschberg 1975). Verified live: the linear-space divide-and-conquer alignment scores identically to a Needleman-Wunsch score and its aligned rows de-gap to the input sequences, for 300 random pairs (window.__hirschberg.matchesNW). FIG No framing: the linear-space forward/backward score sweeps, the midpoint split, the recursion, and the NW cross-check run in-browser and agree exactly. The AVAN inverse is honest — the optimal path's crossing of the middle column is found from O(n) space and the problem divides into two halves, so the O(nm) table is never stored; magenta is the full quadratic table, green the two score rows + midpoints. Same optimum, linear memory. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of SPLIT SCREEN · David Lee Wise (ROOT0), with AVAN


THE KASAI

Kasai's algorithm in the 5-window house format — compute the LCP array (longest common prefix between adjacent suffixes in a suffix array) in linear time: process suffixes in TEXT order and reuse the previous answer, because dropping the first character shortens a suffix's LCP with its neighbor by at most one, so a running length falls by <=1 per step and rises at most n times total. The LCP array powers substring search and longest-repeated-substring. Verified live: over 300 random strings Kasai's O(n) LCP array equals a brute-force pairwise-prefix computation. See the running length in 1D, sorted suffixes + LCP in 2D, and the reuse-the-last-overlap inverse in 3D.

THE KASAI · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · LOOT · THE INVENTORY ◆ .dlw.fold THE FOLD / LOOT / THE INVENTORY / THE KASAI THE KASAI the LCP array in linear time by reusing the last overlap 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Kasai’s algorithm computes the LCP array — the longest common prefix between each pair of adjacent suffixes in a suffix array — in linear time. The insight: process suffixes in text order , not sorted order, and reuse the previous answer, because dropping the first character of a suffix shortens its LCP with its neighbour by at most one . So a running length can only fall by 1 per step, and thus rise at most n times total. The LCP array powers substring search, longest repeated substring, and more. LIT verified live: over 300 random strings Kasai’s O(n) LCP array equals a brute-force pairwise-prefix computation (window.__kasai). FIG no framing; exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-inventory — the LCP array is the catalogue of how much adjacent suffixes overlap, the string’s inventory of shared prefixes. Kasai builds it in one linear pass. AVAN (AI) built the instrument: the suffix array, the rank inverse, the running-length Kasai pass, the brute cross-check. Credit as content: Toru Kasai et al. (2001). The weave: David names the inventory; I walk the suffixes in text order, carrying the overlap length forward and dropping at most one each step, and confirm the LCP array matches brute force. 3 ONE DIMENSION Moving from suffix i to suffix i+1 drops one leading character; its overlap with the previous suffix in sorted order can shrink by at most one — so the running length h decreases by ≤1, and total work stays linear. 4 TWO DIMENSIONS · INTERACTIVE A string’s sorted suffixes and the LCP between each adjacent pair; Kasai’s linear result is checked against brute force. new string ▶ verify 300 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the running overlap length carried from suffix to suffix. AVAN’s addition (the inverse-companion): compute all longest-common-prefixes in O(n) total by processing suffixes in text order and reusing the previous answer — because dropping the first character shortens a suffix’s LCP with its neighbour by at most one, the running length h falls by ≤1 each step, so it can only rise n times total. The inverse of ‘recompute each LCP from scratch (n² total)’ is ‘reuse the previous suffix’s LCP, losing at most one character.’ Magenta is the redundant character comparisons; green is the running length carried forward. An amortised argument turns quadratic into linear. (Kin to the-suffix-array and the-suffix-automaton.) pause spin LIT Genuine Kasai's algorithm (Kasai et al. 2001). Verified live: the text-order running-length LCP pass equals a brute-force pairwise longest-common-prefix computation over the suffix array for 300 random strings (window.__kasai.matchesBrute). FIG No framing: the suffix array, the rank inverse, the running-length Kasai pass, and the brute cross-check run in-browser and agree exactly. The AVAN inverse is honest — processing suffixes in text order and reusing the previous LCP (which can only drop by one when the leading character is removed) makes the total work linear by an amortized argument; magenta is the redundant character comparisons, green the running length carried forward. Kin to the-suffix-array and the-suffix-automaton. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE INVENTORY · David Lee Wise (ROOT0), with AVAN


THE GAUSSIAN QUADRATURE

Gaussian quadrature in the 5-window house format — approximate an integral by a weighted sum at cleverly-chosen points: n nodes at the roots of the Legendre polynomial, with matching weights, integrate every polynomial up to degree 2n-1 EXACTLY, twice what a fixed grid of n points could. The placement, not the count, buys the accuracy. It is the backbone of numerical integration. Verified live: for n=2..5 the n-point Gauss-Legendre rule reproduces the exact integral of random polynomials of degree <=2n-1 and is not exact at degree 2n. See the Legendre nodes in 1D, exact integration in 2D, and the optimal-placement inverse in 3D.

THE GAUSSIAN QUADRATURE · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GRIND · THE MAINFRAME ◆ .dlw.fold THE FOLD / GRIND / THE MAINFRAME / THE GAUSSIAN QUADRATURE THE GAUSSIAN QUADRATURE n sample points integrate degree 2n-1 exactly 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Gaussian quadrature approximates an integral by a weighted sum of the function at cleverly-chosen points — and n points, placed at the roots of the Legendre polynomial with matching weights, integrate every polynomial up to degree 2n−1 exactly . That is twice the degree a fixed grid of n points could ever manage: the placement, not just the count, buys the accuracy. It is the backbone of numerical integration in physics and engineering. LIT verified live: for n=2…5 the n-point Gauss–Legendre rule reproduces the exact integral of random polynomials of degree ≤2n−1, and is (generally) not exact at degree 2n (window.__gaussianquadrature). FIG no framing; exact to the claimed degree. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-mainframe — the heavy exact numerics a mainframe grinds through, integration done with the fewest evaluations possible. Gaussian quadrature is that frugal exactness. AVAN (AI) built the instrument: the Legendre nodes and weights, the weighted sum, the exact-integral cross-check. Credit as content: Carl Friedrich Gauss (1814), with Jacobi’s later Legendre-root formulation. The weave: David names the mainframe; I place n points at the Legendre roots and confirm they integrate every polynomial of degree ≤2n−1 exactly. 3 ONE DIMENSION The n sample points are not evenly spaced — they sit at the roots of the Legendre polynomial, clustered toward the ends. Each carries a weight; together they pin down 2n unknowns (n nodes + n weights), so 2n−1 degrees are exact. 4 TWO DIMENSIONS · INTERACTIVE A polynomial and its area on [−1,1]; the Gauss rule with n nodes matches the exact integral for degree ≤2n−1. n: 3 ▶ new polynomial ▶ verify ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the n optimal nodes that integrate degree 2n−1 exactly. AVAN’s addition (the inverse-companion): choose the sample points and weights optimally — nodes at the roots of the Legendre polynomial — so n points integrate polynomials up to degree 2n−1 exactly, twice what a fixed grid of n points manages. The inverse of ‘fix the grid and add points for accuracy’ is ‘place n points perfectly and get 2n−1 for free.’ Magenta is the evenly-spaced samples that waste the budget; green is the n optimal nodes. Where you sample matters more than how many. pause spin LIT Genuine Gauss-Legendre quadrature (Gauss 1814; Jacobi). Verified live: the n-point rule (nodes at Legendre roots, standard weights) reproduces the exact integral on [-1,1] of random polynomials of degree FIG No framing: the Legendre nodes/weights, the weighted sum, and the exact-integral cross-check run in-browser and are exact to the claimed degree. The AVAN inverse is honest — placing n points at the Legendre roots (choosing 2n unknowns: nodes + weights) makes degree 2n-1 exact, double a fixed grid; magenta is the even samples that waste the budget, green the optimal nodes. Where you sample beats how many. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE MAINFRAME · David Lee Wise (ROOT0), with AVAN


THE BORUVKA

Boruvka's algorithm in the 5-window house format — build a minimum spanning tree in parallel: every component simultaneously finds its cheapest outgoing edge, all are added at once, and components merge; each round at least halves the component count, finishing in O(log V) rounds. It is the oldest MST algorithm (1926) and the most naturally parallel. Verified live: over 200 random connected weighted graphs Boruvka's MST weight equals Kruskal's. See a parallel round in 1D, the MST on a graph in 2D, and the parallel-merge inverse in 3D.

THE BORUVKA · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · CO-OP · THE MERGE ◆ .dlw.fold THE FOLD / CO-OP / THE MERGE / THE BORUVKA THE BORUVKA the minimum spanning tree, built by parallel merges 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Borůvka’s algorithm builds a minimum spanning tree in a strikingly parallel way: every component simultaneously finds its own cheapest outgoing edge, and all of them are added at once, merging components. Each round at least halves the component count, so it finishes in O(log V) rounds. It is the oldest MST algorithm (1926) and, not coincidentally, the most naturally parallel. LIT verified live: over 200 random connected weighted graphs Borůvka’s MST weight equals Kruskal’s (window.__boruvka). FIG no framing; the same minimum tree, reached in parallel. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-merge — every fragment reaches out along its cheapest edge and they all fuse at once, round after round, until one tree remains. Borůvka is that parallel merge. AVAN (AI) built the instrument: the per-component cheapest-edge scan, the union-find merge, the Kruskal cross-check. Credit as content: Otakar Borůvka (1926), to electrify Moravia efficiently. The weave: David names the merge; I let every component grab its cheapest exit and fuse them all each round, and confirm the total weight equals Kruskal’s minimum. 3 ONE DIMENSION Each round: every component picks its single cheapest outgoing edge (arrows), all are added simultaneously, and the components they join merge into fewer, larger ones. 4 TWO DIMENSIONS · INTERACTIVE A weighted graph; Borůvka’s MST (highlighted) with its total weight, checked against Kruskal. new graph ▶ verify 200 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the minimum spanning tree, grown by parallel merges. AVAN’s addition (the inverse-companion): every component simultaneously grabs its own cheapest outgoing edge and they all merge at once — the MST is built in parallel , halving the component count each round, in O(log V) rounds. The inverse of ‘add edges one at a time in sorted order (Kruskal/Prim)’ is ‘every fragment picks its cheapest exit at once and they fuse.’ Magenta is the sequential sorted-edge scan; green is the parallel per-component merges. The oldest MST algorithm is also the most parallel. pause spin LIT Genuine Boruvka's algorithm (Boruvka 1926). Verified live: the per-component cheapest-edge + union-find merge produces a spanning tree whose total weight equals Kruskal's MST weight for 200 random connected weighted graphs (window.__boruvka.matchesKruskal). FIG No framing: the per-component cheapest-edge scan, the union-find merge, and the Kruskal cross-check run in-browser and agree exactly. The AVAN inverse is honest — every component grabs its cheapest exit simultaneously and they all merge, halving components per round in O(log V) rounds, versus adding edges one at a time; magenta is the sequential sorted-edge scan, green the parallel merges. The oldest MST algorithm is the most parallel. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE MERGE · David Lee Wise (ROOT0), with AVAN