THE BEATTY

Beatty sequences in the 5-window house format — for irrational alpha>1 and its conjugate beta with 1/alpha+1/beta=1, the floor-sequences floor(n*alpha) and floor(n*beta) together contain every positive integer exactly once (Rayleigh-Beatty theorem). For alpha=golden ratio these are the Wythoff sequences behind Wythoff Nim. Verified live: for five irrationals, the two sequences partition 1..2000 exactly (no gaps, no overlaps). See the colored integer line in 1D, the partition in 2D, and the densities-sum-to-one inverse in 3D.

THE BEATTY · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · LOOT · THE MINT ◆ .dlw.fold THE FOLD / LOOT / THE MINT / THE BEATTY THE BEATTY two irrational sequences tile the integers exactly once 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Beatty sequences : take any irrational α > 1 and its conjugate β defined by 1/α + 1/β = 1 . The sequences ⌊α⌋, ⌊2α⌋, ⌊3α⌋, … and ⌊β⌋, ⌊2β⌋, ⌊3β⌋, … together contain every positive integer exactly once — they partition the naturals with no gaps and no overlaps. For α = the golden ratio φ, these are the lower and upper Wythoff sequences behind the game of Wythoff Nim. Two irrational-slope arithmetic progressions tile the integers perfectly. LIT verified live: for five irrationals α (with β = α/(α−1)), the two floor-sequences together hit each integer in 1…2000 exactly once (window.__beatty). FIG no framing; exact integer partition. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-mint — stamping out each integer exactly once, none twice, none missed. Beatty’s theorem is the mint’s guarantee from two irrational dies. AVAN (AI) built the instrument: the conjugate β, the two floor-sequences, the exactly-once coverage check. Credit as content: Lord Rayleigh (1894); rediscovered and popularised by Samuel Beatty (1926, as a famous problem in the American Mathematical Monthly ). The weave: David names the mint; I lay down two irrational-slope sequences and prove they cover every integer once with no collision. 3 ONE DIMENSION The integer line, each number coloured by which sequence claims it — ⌊nα⌋ or ⌊nβ⌋. Every integer gets exactly one colour: no gaps, no overlaps. 4 TWO DIMENSIONS · INTERACTIVE Choose α. The two Beatty sequences ⌊nα⌋ and ⌊nβ⌋ are laid over the integers; each integer is covered exactly once, verified across a long range. α: φ ▶ verify to 2000 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: two irrational-slope rays whose floors interleave to cover the integers. AVAN’s addition (the inverse-companion): the partition works precisely because 1/α + 1/β = 1. The sequence ⌊nα⌋ has density 1/α (that fraction of the integers), ⌊nβ⌋ has density 1/β , and they sum to exactly 1 — while irrationality forbids any ⌊nα⌋ from equalling any ⌊mβ⌋, so there is no overlap. The inverse of ‘cover everything once’ is ‘the two densities sum to exactly one.’ Shift β off the conjugate and you get gaps or collisions; the condition is a knife-edge. Magenta is the density-1/β sequence; green is the density-1/α sequence — together, exactly one. Two irrational rhythms sum to a single perfect beat. pause spin LIT Genuine Beatty/Rayleigh theorem (Rayleigh 1894; Beatty 1926). Verified live: for alpha in {phi, sqrt2, sqrt3, e-1} with beta=alpha/(alpha-1), the sequences floor(n*alpha) and floor(n*beta) together cover each integer in 1..2000 exactly once (window.__beatty.partitionsExactly). FIG No framing: the conjugate beta, the two floor-sequences, and the exactly-once coverage check run in-browser and are exact. The AVAN inverse is honest — the partition holds precisely because the densities 1/alpha and 1/beta sum to 1 and irrationality forbids any collision between the two sequences; magenta is the density-1/beta sequence, green the density-1/alpha sequence. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE MINT · David Lee Wise (ROOT0), with AVAN


THE ENIGMA

the Enigma machine in the 5-window house format — a rotor cipher whose reflector makes it reciprocal (if A encrypts to K, K encrypts to A), so one machine and setting both encrypt and decrypt. But the reflector also guaranteed no letter ever encrypts to itself, and that constraint was Enigma's fatal weakness (the foothold the Bombe exploited). Verified live: on a simplified 3-rotor + reflector machine, encrypting the ciphertext with the same start settings returns the plaintext, and no character ever equals its plaintext letter, across 200 random settings. See the signal path in 1D, encrypt-twice in 2D, and the symmetry-was-the-crack inverse in 3D.

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

THE ENIGMA · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · BOSS · THE GATEKEEPER ◆ .dlw.fold THE FOLD / BOSS / THE GATEKEEPER / THE ENIGMA THE ENIGMA a cipher that is its own inverse — and could never encrypt a letter to itself 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The Enigma machine was a rotor cipher: a letter’s electrical signal passes through stepping rotors, hits a reflector , and returns through the rotors backward to light a different letter. The reflector makes Enigma reciprocal — if A encrypts to K at a setting, then K encrypts to A — so one machine and setting both encrypt and decrypt. But the reflector also guaranteed no letter ever encrypts to itself (a fixed-point-free pairing), and that self-imposed constraint was Enigma’s fatal weakness: a guessed word could never align with matching letters, a foothold the Bombe exploited. LIT verified live: on a simplified 3-rotor + reflector machine, encrypting the ciphertext with the same start settings returns the plaintext (reciprocal), and no character ever equals its plaintext letter, across 200 random settings (window.__enigma). FIG no framing; exact permutation cipher. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-gatekeeper — the cipher guarding every message at the gate. Enigma was that gatekeeper for a war — and its own symmetry undid it. AVAN (AI) built the instrument: the rotors, the fixed-point-free reflector, the stepping, the reciprocal and no-self-map checks. Credit as content: Arthur Scherbius (patented 1918); broken by Marian Rejewski and the Polish Cipher Bureau, then Alan Turing and Bletchley Park. The weave: David names the gatekeeper; I route signals through rotors and a reflector, show encryption is its own inverse, and expose the missing fixed point that leaked the key. 3 ONE DIMENSION A letter’s path: forward through the three rotors, bounced by the reflector, back through the rotors in reverse. The reflector’s bounce is what makes the whole trip its own inverse. 4 TWO DIMENSIONS · INTERACTIVE Set the rotors and type a message. Encrypt it, then encrypt the ciphertext with the same start settings — the plaintext returns. Notice no letter ever encrypts to itself. new settings ▶ new message ▶ verify 200 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the reciprocal pairing — each setting maps letters in swapped pairs, so encryption equals decryption. AVAN’s addition (the inverse-companion): encryption is decryption. The reflector makes each position’s transform an involution (its own inverse), so decrypting is just encrypting again from the same start settings — no separate decrypt mode. That symmetry was a convenience and a curse: the inverse of ‘a cipher that is its own inverse’ is ‘a cipher that can never map a letter to itself,’ and that missing fixed point leaked information — a crib could be slid along the ciphertext and rejected wherever a letter matched. Magenta is the forbidden diagonal (no letter to itself), the crack Turing pried open; green is the reciprocal pairing that made enc = dec. The very symmetry that made it usable made it breakable. pause spin LIT Genuine Enigma rotor cipher (Scherbius, patented 1918; broken by Rejewski and Turing). Verified live: a simplified 3-rotor + fixed-point-free reflector machine with rotor stepping is reciprocal (encrypting the ciphertext from the same start settings returns the plaintext) and never maps any letter to itself, across 200 random settings and messages (window.__enigma.reciprocal && .noFixedPoint). FIG No framing: the rotors, the fixed-point-free reflector, the stepping, and the reciprocal + no-self-map checks run in-browser and are exact. The AVAN inverse is honest and historical — the reflector makes each position an involution (enc = dec) but forbids any fixed point, and that missing self-map genuinely leaked information to codebreakers; magenta marks the forbidden self-map diagonal, green the reciprocal pairing. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE GATEKEEPER · David Lee Wise (ROOT0), with AVAN


THE BOYER-MOORE

Boyer-Moore string search in the 5-window house format — match the pattern right-to-left and, on a mismatch, skip ahead (often by the whole pattern length) using the bad-character rule: if the mismatched text character is absent from the pattern, jump entirely past it; else align its last occurrence. This can be sublinear, examining fewer characters than the text length. Verified live: over 500 random texts/patterns, the bad-character (Horspool) search returns exactly the same match positions as a naive scan. See a skip in 1D, the leaping search in 2D, and the mismatch-informs-most inverse in 3D.

THE BOYER-MOORE · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GLITCH · OFF BY ONE ◆ .dlw.fold THE FOLD / GLITCH / OFF BY ONE / THE BOYER-MOORE THE BOYER-MOORE search by skipping — learn most from a mismatch 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Boyer–Moore string search is counter-intuitively fast because it matches the pattern right to left and, on a mismatch, skips ahead — often by the whole pattern length. The bad-character rule: if the text character that caused the mismatch does not occur in the pattern, jump the pattern entirely past it; if it does, align the pattern’s last occurrence of that character. This can make the search sublinear — examining fewer characters than the text length — the only common exact-match algorithm that routinely does. It runs grep -F and editors’ find. LIT verified live: over 500 random texts and patterns, the bad-character (Horspool) search returns exactly the same match positions as a naive scan (window.__boyermoore). FIG no framing; exact string matching. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at off-by-one — the skip-table index arithmetic where one miscounted shift breaks everything. Boyer–Moore lives or dies by getting those jumps exactly right. AVAN (AI) built the instrument: the bad-character skip table, the right-to-left compare, the exact check against a naive scan. Credit as content: Robert S. Boyer & J Strother Moore (1977); the simpler bad-character-only variant is Nigel Horspool (1980). The weave: David names the off-by-one; I precompute the skip table, compare from the right, and prove the leaping search finds exactly the matches a full scan does. 3 ONE DIMENSION A mismatch at the right end: the offending text character is looked up in the skip table, and the pattern jumps ahead so its last occurrence of that character lines up — or leaps clear past if it is absent. 4 TWO DIMENSIONS · INTERACTIVE A text and a pattern. Step the search and watch the pattern leap ahead on mismatches. All occurrences are found, and checked against a naive scan. new text ▶ step ▶ verify 500 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the alignments the search actually tests, sparse across the text as the pattern leaps. AVAN’s addition (the inverse-companion): knowing where the pattern is not lets you skip. A mismatch carries more information than a match — it proves a whole range of alignments impossible at once, because comparing from the right and precomputing each character’s last position means one failed comparison can leap the pattern’s full width. The inverse of ‘check every position’ is ‘use each failure to rule out many positions.’ Magenta is the alignments never tested — leapt over on the strength of a single mismatch; green is the few the algorithm actually checks. Search faster by learning the most from what does not match — the rare algorithm that reads less than its input. pause spin LIT Genuine Boyer-Moore string search (Boyer & Moore 1977; bad-character variant Horspool 1980). Verified live: the bad-character skip-table search, comparing right-to-left, returns exactly the same set of match positions as a naive O(nm) scan for 500 random texts and patterns (window.__boyermoore.matchesNaive); 'abr' in 'abracadabra' -> 0,7. FIG No framing: the skip table, the right-to-left compare, and the exact check against naive search run in-browser and agree. The AVAN inverse is honest — a mismatch rules out many alignments at once, so comparing from the right with a precomputed last-occurrence table lets one failure leap the pattern's full width; magenta is the alignments skipped, green the few actually tested. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of OFF BY ONE · David Lee Wise (ROOT0), with AVAN


THE AITKEN

Aitken's delta-squared process in the 5-window house format — accelerate a slowly-converging sequence: from x_n -> L form x'_n = x_n - (dx_n)^2 / d^2 x_n, which homes in on L far faster. If the sequence converges geometrically (x_n = L + c*r^n), Aitken returns L exactly in one step by cancelling the error term. Verified live: Aitken returns L to ~1e-13 for a geometric sequence, and on the x=cos(x) fixed-point iteration reaches 1e-8 accuracy in 17 accelerated terms versus 43 raw. See three-terms-to-one in 1D, raw vs accelerated in 2D, and the model-the-error inverse in 3D.

THE AITKEN · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GRIND · THE HOT LOOP ◆ .dlw.fold THE FOLD / GRIND / THE HOT LOOP / THE AITKEN THE AITKEN accelerate convergence by cancelling the error's shape 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Aitken’s Δ² process accelerates a slowly-converging sequence. Given xₙ approaching a limit L, it forms a new sequence x′ₙ = xₙ − (Δxₙ)² / Δ²xₙ that homes in on L far faster. The magic case: if the sequence converges geometrically (xₙ = L + c·rⁿ, the common pattern for linearly-convergent iterations), Aitken’s formula returns L exactly in a single step — it algebraically cancels the error term. On real sequences it sharply cuts the iterations needed, which matters when each one is expensive. LIT verified live: Aitken returns L to ~10⁻¹³ for a purely geometric sequence, and on the x=cos(x) fixed-point iteration it reaches 10⁻⁸ accuracy in 17 accelerated terms versus 43 raw (window.__aitken). FIG no framing; exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-hot-loop — the expensive iteration you want to run as few times as possible. Aitken is the hot-loop’s accelerant: model the tail, jump ahead, stop early. AVAN (AI) built the instrument: the Δ² transform, the geometric-exactness check, the term-count speedup on a real fixed point. Credit as content: Alexander Aitken (1926); the vector form underlies Steffensen’s method and the ε-algorithm. The weave: David names the hot-loop; I take three consecutive terms, cancel the geometric error algebraically, and show the accelerated sequence reach the limit in a fraction of the steps. 3 ONE DIMENSION Three consecutive terms xₙ, xₙ₊₁, xₙ₊₂ feed one accelerated value. If the tail is geometric (error ≈ c·rⁿ), the formula solves for what L must be — and lands on it. 4 TWO DIMENSIONS · INTERACTIVE The slow fixed-point iteration x = cos(x) versus its Aitken-accelerated version. Watch the accelerated curve reach the limit in far fewer terms; a geometric test sequence lands on L exactly. show: cos(x) ▶ verify ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the accelerated sequence, modelling the error and leaping to the limit; the raw sequence crawls beneath it. AVAN’s addition (the inverse-companion): acceleration works by assuming and then cancelling the error’s shape. Aitken presumes the tail behaves geometrically — error ≈ c·rⁿ — and solves three consecutive terms for what L must be if that is true, algebraically removing the dominant error. The inverse of ‘wait for convergence’ is ‘model the error and subtract it.’ When the assumption holds exactly (pure geometric), the answer is exact; when it holds approximately, you gain many digits per step. Magenta is the raw sequence still crawling toward L; green is the accelerated one that models the crawl and jumps ahead. Extrapolate the error away instead of waiting it out. pause spin LIT Genuine Aitken delta-squared acceleration (Aitken 1926). Verified live: for a purely geometric sequence x_n = L + c*r^n, Aitken's formula returns L to max error ~1.5e-13 (exact cancellation); on the linearly-convergent x=cos(x) fixed point, the accelerated sequence reaches 1e-8 of the limit in 17 terms versus 43 for the raw sequence (window.__aitken.geometricExact && .speedup). FIG No framing: the delta-squared transform, the geometric-exactness check, and the term-count comparison on a real fixed point run in-browser and are exact. The AVAN inverse is honest — Aitken assumes a geometric error tail and algebraically solves three terms for L, removing the dominant error; exact when the tail is truly geometric, strong acceleration otherwise; magenta is the raw crawl, green the accelerated jump. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE HOT LOOP · David Lee Wise (ROOT0), with AVAN


THE VAN DER CORPUT

the van der Corput sequence in the 5-window house format — fill [0,1) far more evenly than random by reversing the binary digits of n around the radix point: 1->0.5, 2->0.25, 3->0.75, 4->0.125. The first 2^m points are exactly the dyadic rationals {j/2^m} scrambled, so its discrepancy shrinks like log(N)/N versus random's 1/sqrt(N). It underlies quasi-Monte Carlo integration. Verified live: the first 2^6 points equal the dyadic grid and the star discrepancy is far below matched random points. See bit-reversal in 1D, vdc vs random in 2D, and the bisection inverse in 3D.

THE VAN DER CORPUT · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · LOOT · THE MINT ◆ .dlw.fold THE FOLD / LOOT / THE MINT / THE VAN DER CORPUT THE VAN DER CORPUT reverse the bits of n — points that fill the interval evenly 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The van der Corput sequence fills [0,1) far more evenly than random points, using a beautiful trick: to get the n-th point, write n in binary and reverse the digits around the radix point . So 1→ .1 =0.5, 2→ .01 =0.25, 3→ .11 =0.75, 4→ .001 =0.125, … The first 2ᵐ points are exactly the dyadic rationals {0, 1/2ᵐ, 2/2ᵐ, …} in scrambled order — perfectly equidistributed. Its discrepancy (deviation from uniform) shrinks like log(N)/N versus random points’ 1/√N, so it is the foundation of quasi-Monte Carlo integration and low-discrepancy sampling. LIT verified live: the first 2ᵐ van der Corput points are exactly {j/2ᵐ}, and the star discrepancy is far below a matched set of random points (window.__vandercorput). FIG no framing; exact bit-reversal. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-mint — minting points spaced as evenly as possible, none clumping. The van der Corput sequence is the mint’s low-discrepancy die. AVAN (AI) built the instrument: the radical-inverse (bit-reversal) generator, the dyadic-grid check, the discrepancy comparison with random. Credit as content: Johannes van der Corput (1935), the first and simplest low-discrepancy sequence. The weave: David names the mint; I reverse the bits of the counter to place each point, prove the first 2ᵐ land on the dyadic grid, and show the fill beats random uniformity by an order of magnitude. 3 ONE DIMENSION Counting in binary, then reversing the digits: n = 1,2,3,4,… becomes 0.5, 0.25, 0.75, 0.125, … — each new point drops into the largest current gap, bisecting the interval hierarchically. 4 TWO DIMENSIONS · INTERACTIVE Generate N van der Corput points beside N random points. The van der Corput fill has small, even gaps; random clumps and leaves holes. The star discrepancy is measured for both. N: 16 ▶ verify ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the van der Corput points bisecting the interval, each landing in a largest gap. AVAN’s addition (the inverse-companion): the digit reversal is why each new point lands in the largest gap. Reversing bits sends the most-significant output bit — the coarsest halving — to advance fastest , so the sequence bisects [0,1), then bisects each half, then each quarter, hierarchically. The inverse of ‘a random-looking fill’ is ‘a deterministic binary bisection.’ Magenta is random points, clumpy with big gaps; green is van der Corput, each point splitting a largest gap in half. Bit-reversal turns plain counting into balanced bisection — an order-of-magnitude better uniformity from a two-line trick. pause spin LIT Genuine van der Corput sequence (van der Corput 1935, the first low-discrepancy sequence). Verified live: the radical-inverse (base-2 bit reversal) generator produces first 2^6 points exactly equal to {j/2^6} (perfectly equidistributed), and its measured star discrepancy is far smaller than a matched set of pseudo-random points (window.__vandercorput.dyadicExact && .betterThanRandom). FIG No framing: the bit-reversal generator, the dyadic-grid check, and the discrepancy comparison run in-browser and are exact. The AVAN inverse is honest — reversing digits makes the coarsest halving advance fastest, so the sequence bisects [0,1) then each half then each quarter (each point lands in a largest gap); magenta is clumpy random, green the bisecting van der Corput. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE MINT · David Lee Wise (ROOT0), with AVAN


THE FLOYD-WARSHALL

Floyd-Warshall in the 5-window house format — shortest path between every pair of vertices in one triple loop: dist[i][j] = min(dist[i][j], dist[i][k]+dist[k][j]), sweeping k over all vertices as intermediate stops. O(V^3), handles negative edges, flags negative cycles. Verified live: over 200 random weighted graphs, the Floyd-Warshall distance matrix matches shortest paths from an independent per-source Bellman-Ford. See the relaxation in 1D, the evolving matrix in 2D, and the DP-over-waypoint-sets inverse in 3D.

THE FLOYD-WARSHALL · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · CO-OP · THE BROADCAST ◆ .dlw.fold THE FOLD / CO-OP / THE BROADCAST / THE FLOYD-WARSHALL THE FLOYD-WARSHALL all-pairs shortest paths by admitting one waypoint at a time 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Floyd–Warshall computes the shortest path between every pair of vertices in a weighted graph with one triple loop and a single idea: consider each vertex as a possible intermediate stop , one at a time. The update dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]) — after trying all k as waypoints, dist holds every shortest path. It is O(V³), handles negative edges (and flags negative cycles), and its three-nested-loops terseness makes it the go-to for dense all-pairs shortest paths and transitive closure. LIT verified live: over 200 random weighted graphs, the Floyd–Warshall distance matrix matches shortest paths computed independently by Bellman–Ford from each source (window.__floydwarshall). FIG no framing; exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-broadcast — shortest routes from everyone to everyone, the whole network’s reach at once. Floyd–Warshall is that broadcast computed in three loops. AVAN (AI) built the instrument: the waypoint relaxation, the distance matrix, the per-source Bellman–Ford cross-check. Credit as content: Robert Floyd (1962), on Stephen Warshall’s transitive-closure algorithm (1962) and Bernard Roy (1959). The weave: David names the broadcast; I grow the set of allowed intermediate stops one vertex at a time and prove the resulting all-pairs distances match a source-by-source shortest-path solver. 3 ONE DIMENSION One relaxation: the route from i to j is improved if going i→k→j (through the current waypoint k) is shorter. Sweep k over all vertices and every shortest path emerges. 4 TWO DIMENSIONS · INTERACTIVE A small weighted graph and its evolving distance matrix. Advance the waypoint index k and watch distances tighten; the final matrix matches a per-source shortest-path solver. new graph ▶ waypoint k+ ▶ verify 200 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the distance matrix tightening as each waypoint is admitted. AVAN’s addition (the inverse-companion): the k-loop is a dynamic program over the set of allowed intermediates . After the k-th pass, dist[i][j] is the shortest path using only vertices {0…k} as stops — so the outer loop grows the permitted-waypoint set one vertex at a time until all are allowed. The inverse of ‘find all shortest paths’ is ‘grow the set of usable intermediate stops.’ Magenta is the paths still forbidden at each stage (waypoints not yet unlocked); green is the shortest paths as the intermediate set completes. A global optimum built by admitting one waypoint at a time — dynamic programming over subsets of vertices, hidden inside three innocent loops. pause spin LIT Genuine Floyd-Warshall all-pairs shortest paths (Floyd 1962; Warshall transitive closure 1962; Roy 1959). Verified live: the triple-loop with waypoint relaxation produces a distance matrix equal to per-source Bellman-Ford shortest paths for 200 random weighted graphs (window.__floydwarshall.matchesBellmanFord). FIG No framing: the waypoint relaxation and the per-source Bellman-Ford cross-check run in-browser and agree exactly. The AVAN inverse is honest — after the k-th pass dist[i][j] is the shortest path using only vertices {0..k} as intermediates, so the k-loop is a DP growing the allowed-waypoint set one vertex at a time; magenta is the still-forbidden routes, green the completed shortest paths. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE BROADCAST · David Lee Wise (ROOT0), with AVAN


THE DURAND-KERNER

the Durand-Kerner (Weierstrass) method in the 5-window house format — find ALL n roots of a degree-n polynomial simultaneously by iterating each estimate z_i <- z_i - p(z_i)/prod_{j!=i}(z_i - z_j); the denominator divides out the other roots so estimates repel toward distinct roots. From evenly-spread complex guesses it converges to all roots at once, no deflation. Verified live: over 100 polynomials from known integer roots, it converges so |p(z)| < 1e-4 at every returned root. See the repulsion in 1D, complex convergence in 2D, and the coupled-fixed-point inverse in 3D.

THE DURAND-KERNER · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · CHEAT · THE SPEEDRUN ◆ .dlw.fold THE FOLD / CHEAT / THE SPEEDRUN / THE DURAND-KERNER THE DURAND-KERNER all polynomial roots at once — estimates that repel into place 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Newton’s method finds one root at a time. Durand–Kerner (Weierstrass) finds all n roots of a degree-n polynomial simultaneously , iterating each estimate zᵢ by zᵢ ← zᵢ − p(zᵢ) / ∏ j≠i (zᵢ − zⱼ). The denominator divides out the influence of the other roots, so the estimates repel each other toward distinct roots. Started from evenly-spread complex guesses, it converges (usually quadratically) to all roots at once — no deflation, no root-by-root sequencing. LIT verified live: over 100 polynomials built from known integer roots, Durand–Kerner converges so that |p(z)| < 10⁻⁴ at every returned root (window.__durandkerner). FIG no framing; exact complex iteration to machine precision. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-speedrun — all the roots in one parallel sweep instead of one-at-a-time. Durand–Kerner is the root-finding speedrun. AVAN (AI) built the instrument: the complex-arithmetic iteration, the mutual-repulsion update, the residual check at every root. Credit as content: Karl Weierstrass (1891); rediscovered by Émile Durand (1960) and Immo Kerner (1966). The weave: David names the speedrun; I let n complex estimates repel one another through the polynomial, converging to all roots at once, and confirm each makes the polynomial vanish. 3 ONE DIMENSION Each estimate is nudged by the polynomial’s value divided by its distance to all the others — so the estimates push apart, each sliding toward its own root, none colliding. 4 TWO DIMENSIONS · INTERACTIVE A polynomial’s roots in the complex plane. Iterate and watch the estimates spiral in from a circle to all roots at once; the residual |p(z)| at each drops to zero. new polynomial ▶ iterate ▶ verify 100 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the n estimates converging in parallel across the complex plane, repelling into their roots. AVAN’s addition (the inverse-companion): the method treats the roots as mutually defining . Each estimate’s update divides by its distance to all the others, so the n estimates form a coupled system that self-organises — you cannot find one without implicitly accounting for all. The inverse of ‘a single root’ is ‘the whole root-set as one coupled fixed point,’ reached exactly when every numerator p(zᵢ) hits zero at once. Magenta is the one-at-a-time Newton path (deflate, repeat); green is the n estimates converging together, repelling into place. Solve the system as a whole and the roots find each other — a polynomial’s factorisation emerging all at once. pause spin LIT Genuine Durand-Kerner / Weierstrass method (Weierstrass 1891; Durand 1960; Kerner 1966). Verified live: iterating n complex estimates by z_i -= p(z_i)/prod_{j!=i}(z_i-z_j) from spread initial guesses converges so that the residual |p(z)| FIG No framing: the complex iteration, the mutual-repulsion update, and the residual check at every root run in-browser. The AVAN inverse is honest — each update divides by distance to all other estimates, making the roots a coupled system that self-organizes to a joint fixed point (all p(z_i)->0 together); magenta is the one-at-a-time Newton path, green the parallel convergence. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE SPEEDRUN · David Lee Wise (ROOT0), with AVAN


THE CAYLEY-HAMILTON

the Cayley-Hamilton theorem in the 5-window house format — every square matrix satisfies its own characteristic polynomial: compute p(lambda)=det(lambda*I - A), substitute the matrix A for lambda, and get the zero matrix p(A)=0. A consequence: any power of A, and A^-1, is a polynomial in A of degree < n, so a matrix's whole behavior is n coefficients. Verified live: for 200 random integer matrices (2x2, 3x3), substituting A into its characteristic polynomial (via Faddeev-LeVerrier) yields the zero matrix. See char-poly-to-zero in 1D, p(A) computed in 2D, and the finite-basis inverse in 3D.

THE CAYLEY-HAMILTON · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GRIND · THE GRINDSTONE ◆ .dlw.fold THE FOLD / GRIND / THE GRINDSTONE / THE CAYLEY-HAMILTON THE CAYLEY-HAMILTON every matrix satisfies its own characteristic polynomial 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The Cayley–Hamilton theorem is one of linear algebra’s most surprising facts: every square matrix satisfies its own characteristic polynomial . Compute p(λ) = det(λI − A) — a scalar polynomial — then substitute the matrix A for λ (constant term times the identity), and you get the zero matrix : p(A) = 0. A consequence: any power of A, and even A⁻¹, can be written as a polynomial in A of degree < n — so a matrix’s entire behaviour is captured by just n coefficients. LIT verified live: for 200 random integer matrices (2×2 and 3×3), substituting A into its characteristic polynomial yields the zero matrix to machine precision (window.__cayleyhamilton). FIG no framing; exact matrix algebra. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-grindstone — grinding a matrix through its own equation until it vanishes. Cayley–Hamilton is that grind: a matrix annihilated by the very polynomial it defines. AVAN (AI) built the instrument: the Faddeev–LeVerrier characteristic-polynomial computation, the substitution p(A), the zero-matrix check. Credit as content: Arthur Cayley (1858, stated for 2×2/3×3); William Rowan Hamilton (quaternion case); general proof by Ferdinand Frobenius (1878). The weave: David names the grindstone; I compute a matrix’s characteristic polynomial, feed the matrix back into it, and show the result is exactly zero. 3 ONE DIMENSION The characteristic polynomial p(λ) = λⁿ + c₁λⁿ⁻¹ + … + cₙ, then the same expression with the matrix A in place of λ — every term a matrix power — summing to the zero matrix. 4 TWO DIMENSIONS · INTERACTIVE A matrix A, its characteristic polynomial, and the matrix p(A) — shown to be all zeros. The theorem also rewrites A⁻¹ as a polynomial in A, displayed alongside. new matrix ▶ size: 2×2 ▶ verify 200 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the powers of A collapsing onto the zero matrix through the characteristic polynomial. AVAN’s addition (the inverse-companion): the theorem collapses infinitely many matrix powers into a finite basis . Because p(A) = 0 rewrites Aⁿ as a combination of I, A, …, Aⁿ⁻¹, every higher power — and the inverse — reduces to that n-term basis, so the entire algebra generated by A is at most n-dimensional. The inverse of ‘a matrix has arbitrarily high powers’ is ‘all its powers live in an n-dimensional space.’ Magenta is the higher powers Aⁿ, Aⁿ⁺¹, … (redundant); green is the finite basis I, A, …, Aⁿ⁻¹ they all reduce to. A matrix is, in its own algebra, no more than n numbers deep — and its characteristic coefficients are exactly the elementary symmetric functions of its eigenvalues. pause spin LIT Genuine Cayley-Hamilton theorem (Cayley 1858; Hamilton quaternion case; Frobenius general proof 1878). Verified live: computing the characteristic polynomial by Faddeev-LeVerrier and substituting the matrix yields the zero matrix (all entries FIG No framing: the Faddeev-LeVerrier char-poly, the substitution p(A), and the zero-matrix check run in-browser and are exact. The AVAN inverse is honest — p(A)=0 rewrites A^n and all higher powers (and A^-1) in the finite basis I,A,...,A^(n-1), so the algebra generated by A is ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE GRINDSTONE · David Lee Wise (ROOT0), with AVAN


THE HOPCROFT-KARP

Hopcroft-Karp in the 5-window house format — find a maximum matching in a bipartite graph (largest set of edges sharing no endpoint) in O(E sqrt V) by repeatedly finding augmenting paths (alternating unmatched/matched, free at both ends) and flipping them to grow the matching by one. By Konig's theorem the max matching size equals the min vertex cover. Verified live: over 300 random bipartite graphs, the augmenting-path matching size equals a brute-force maximum matching. See an augmenting path in 1D, the matching in 2D, and the max-matching-equals-min-cover inverse in 3D.

THE HOPCROFT-KARP · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · SPAWN · CHECKPOINT ZERO ◆ .dlw.fold THE FOLD / SPAWN / CHECKPOINT ZERO / THE HOPCROFT-KARP THE HOPCROFT-KARP maximum bipartite matching = minimum vertex cover 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Hopcroft–Karp finds a maximum matching in a bipartite graph — the largest set of edges with no shared endpoints (jobs to workers, students to schools) — in O(E√V), faster than the naive O(VE). It repeatedly finds augmenting paths (paths that alternate unmatched and matched edges, starting and ending free) and flips them to grow the matching by one; its speed comes from finding many shortest augmenting paths per phase. And by König’s theorem , the maximum matching size equals the minimum vertex cover — a max and a min coincide. LIT verified live: over 300 random bipartite graphs, the augmenting-path matching size equals a brute-force maximum matching (window.__hopcroftkarp). FIG no framing; exact matching. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at checkpoint-zero — pairing up cleanly from a fresh start, as many as can be matched. Hopcroft–Karp is that maximal pairing. AVAN (AI) built the instrument: the augmenting-path search, the matching growth, the brute-force cross-check (and the König duality). Credit as content: John Hopcroft & Richard Karp (1973); Dénes König’s theorem (1931). The weave: David names the checkpoint; I grow a matching by flipping augmenting paths and confirm its size equals the true maximum — which, by König, is also the minimum vertex cover. 3 ONE DIMENSION An augmenting path: it starts and ends at unmatched vertices and alternates non-matching / matching edges. Flip every edge along it — unmatched become matched and vice versa — and the matching grows by exactly one. 4 TWO DIMENSIONS · INTERACTIVE A bipartite graph, left and right. Find the maximum matching (highlighted edges); verify its size equals a brute-force maximum, which by König equals the minimum vertex cover. new graph ▶ verify 300 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the maximum matching — the most disjoint pairs the graph allows. AVAN’s addition (the inverse-companion): a matching is maximum exactly when no augmenting path remains (Berge’s lemma) — so the algorithm’s stopping condition is a certificate of optimality . And the alternating-reachable / unreachable split from the free vertices yields a minimum vertex cover of the same size (König). The inverse of ‘the most edges you can match’ is ‘the fewest vertices that touch every edge,’ and the two numbers are equal . Magenta is the minimum vertex cover — the fewest guards covering all edges; green is the maximum matching — the most disjoint pairs; same count, dual views. Maximising pairs and minimising guards are one problem, exactly as max-flow equals min-cut. pause spin LIT Genuine Hopcroft-Karp bipartite matching (Hopcroft & Karp 1973; Konig's theorem 1931). Verified live: the augmenting-path matching (Kuhn/Hungarian-style augmentation, the core Hopcroft-Karp grows) returns a matching whose size equals a brute-force maximum matching for 300 random bipartite graphs (window.__hopcroftkarp.matchesBrute). FIG No framing: the augmenting-path search and the brute-force cross-check run in-browser and agree exactly. The AVAN inverse is honest — a matching is maximum exactly when no augmenting path remains (Berge), a certificate of optimality, and the alternating-reachable split yields a minimum vertex cover of the same size (Konig), exactly as max-flow equals min-cut; magenta is the min vertex cover, green the max matching. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of CHECKPOINT ZERO · David Lee Wise (ROOT0), with AVAN


THE STIRLING CYCLES

the unsigned Stirling numbers of the first kind in the 5-window house format — c(n,k) counts permutations of n items with exactly k cycles (mirror of the second kind, which counts set partitions), via c(n,k)=(n-1)c(n-1,k)+c(n-1,k-1). Rows sum to n!, and they are the rising-factorial coefficients: x(x+1)...(x+n-1)=sum_k c(n,k) x^k. Verified live: the recurrence matches a brute cycle count for n=1..7, rows sum to n!, and the rising-factorial identity holds. See a permutation's cycles in 1D, recurrence vs brute in 2D, and the two-kinds-are-inverse-matrices inverse in 3D.

THE STIRLING CYCLES · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GRIND · THE EPOCH ◆ .dlw.fold THE FOLD / GRIND / THE EPOCH / THE STIRLING CYCLES THE STIRLING CYCLES count permutations by cycles — the inverse of set partitions 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The unsigned Stirling numbers of the first kind c(n,k) count the permutations of n items with exactly k cycles — the mirror of the second kind, which counts set partitions into k blocks. The recurrence c(n,k) = (n−1)·c(n−1,k) + c(n−1,k−1): a new item joins an existing cycle in n−1 ways, or forms its own new cycle. Rows sum to n! (every permutation has some number of cycles), and they are the coefficients of the rising factorial : x(x+1)(x+2)…(x+n−1) = Σ k c(n,k)·xᵏ — the exact dual of the second kind’s falling-factorial identity. LIT verified live: the recurrence matches a brute count of permutations by cycle number for n=1…7, each row sums to n!, and the rising-factorial identity holds exactly (window.__stirlingcycles). FIG no framing; exact counting. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-epoch — beside its companion, the Stirling numbers of the second kind. Where the second kind groups a set into blocks, the first kind cycles a permutation; two ways to shatter n! into pieces. AVAN (AI) built the instrument: the recurrence, the brute cycle count, the rising-factorial identity. Credit as content: James Stirling ( Methodus Differentialis , 1730). The weave: David names the epoch; I count permutations by their cycles two ways and show the numbers are exactly the rising-factorial coefficients — the inverse table to the second kind. 3 ONE DIMENSION A permutation drawn as its cycle diagram: follow each element to where it maps, and the arrows close into loops. The number of loops is the cycle count that c(n,k) tallies. 4 TWO DIMENSIONS · INTERACTIVE Pick n. The instrument computes the first-kind row by recurrence and by brute-counting permutations by cycle number, confirms they agree, and checks the row sums to n! and the rising-factorial identity. n: 5 ▶ verify n=1..7 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the first-kind triangle, each entry a count of permutations with k cycles. AVAN’s addition (the inverse-companion): the two kinds of Stirling numbers are literally inverse matrices . The second kind converts ordinary powers to falling factorials; the (signed) first kind converts rising/falling factorials back to powers — and stacked as triangular matrices, they multiply to the identity . So ‘group a set into blocks’ and ‘cycle a permutation’ are not just parallel counts; as changes of basis between the power and factorial bases, each undoes the other. The inverse of the second kind’s table is the first kind’s. Magenta is the second-kind (set partitions); green is the first-kind (cycles) — two triangles that annihilate to I. The most natural ways to break n! apart are mutual inverses. pause spin LIT Genuine unsigned Stirling numbers of the first kind (Stirling 1730). Verified live: c(n,k)=(n-1)c(n-1,k)+c(n-1,k-1) matches a brute count of permutations by cycle number for n=1..7, rows sum to n!, and x(x+1)...(x+n-1)=sum_k c(n,k) x^k holds for integer x (window.__stirlingcycles); c(5,k)=24,50,35,10,1. FIG No framing: the recurrence, the brute cycle enumeration, the n! row sum, and the rising-factorial identity all compute in-browser and agree exactly. The AVAN inverse is honest — the first and second kind, as triangular change-of-basis matrices between the power and factorial bases, are genuine inverses (their product is the identity); magenta is second-kind (partitions), green first-kind (cycles). ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE EPOCH · David Lee Wise (ROOT0), with AVAN


THE INVERSIONS

inversion counting in the 5-window house format — an inversion is a pair out of order (a[i]>a[j], i<j); the count measures distance from sorted and equals the minimum adjacent swaps to sort. Naively O(n^2), but a modified merge sort counts them in O(n log n): each time a right-half element is taken before the left is exhausted, it inverts with every remaining left element. Verified live: over 500 random arrays, the merge-sort count equals a brute O(n^2) count. See a merge counting crossings in 1D, an array's inversions in 2D, and the additive-across-a-divide inverse in 3D.

THE INVERSIONS · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · CHEAT · THE SPEEDRUN ◆ .dlw.fold THE FOLD / CHEAT / THE SPEEDRUN / THE INVERSIONS THE INVERSIONS count disorder in O(n log n) — additive across a divide 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION An inversion is a pair of elements out of order — a[i] > a[j] with i < j. The number of inversions measures how far a sequence is from sorted (0 = sorted, n(n−1)/2 = reversed), and it is exactly the minimum number of adjacent swaps (bubble-sort steps) needed to sort it. Counting them naively is O(n²), but a modified merge sort counts them in O(n log n): when merging, each time you take an element from the right half before the left is exhausted, it forms an inversion with every remaining left element. LIT verified live: over 500 random arrays, the merge-sort inversion count equals a brute O(n²) count (window.__inversions). FIG no framing; exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-speedrun — the same disorder measure in O(n log n) instead of O(n²). Counting inversions is the sortedness speedrun, riding a merge sort. AVAN (AI) built the instrument: the merge with cross-inversion counting, the brute cross-check, the min-adjacent-swaps interpretation. Credit as content: the merge-sort counting technique is classic (Knuth, The Art of Computer Programming ). The weave: David names the speedrun; I count inversions during the merge for free and prove the total matches an exhaustive pairwise count. 3 ONE DIMENSION Merging two sorted halves: whenever a right-half element is taken before the left half is empty, it jumps ahead of every left element still waiting — each of those is one crossing inversion, counted in a single subtraction. 4 TWO DIMENSIONS · INTERACTIVE An array with its inversions (crossing lines between out-of-order pairs). Count them by merge sort and verify against the brute count; the total equals the minimum adjacent swaps to sort. new array ▶ verify 500 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the recursive splits and merges, crossing inversions counted as each merge runs. AVAN’s addition (the inverse-companion): the total inversion count splits cleanly into three additive pieces — inversions within the left half, within the right half, and crossing between them. Divide-and-conquer works because the measure is additive over the split : the two within-counts come from the recursion, and the crossing count falls out of the merge you are doing anyway, for free. The inverse of ‘compare all O(n²) pairs’ is ‘count within-halves recursively, plus crossings during the merge.’ Magenta is the quadratic field of all pairs; green is the recursive splits with their free crossing-counts. Disorder is additive across a divide — that additivity is the entire speedup, the same lever as divide-and-conquer closest-pair. pause spin LIT Genuine merge-sort inversion counting (classic, Knuth TAOCP). Verified live: counting crossing inversions during merge (adding l.length-i for each right-before-left pull) yields a total equal to the brute-force O(n^2) inversion count for 500 random arrays (window.__inversions.matchesBrute); [3,1,4,1,5] has 3 inversions. FIG No framing: the merge with cross-inversion counting and the brute cross-check run in-browser and agree exactly. The AVAN inverse is honest — inversions split additively into within-left, within-right, and crossing counts, so divide-and-conquer works because the measure is additive and the crossing count is free from the merge; magenta is the O(n^2) pairs, green the recursive splits. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE SPEEDRUN · David Lee Wise (ROOT0), with AVAN


THE SHOELACE

the shoelace formula in the 5-window house format — the area of any simple polygon from its vertices: A = (1/2)|sum (x_i y_{i+1} - x_{i+1} y_i)|, the criss-cross pattern like lacing a shoe. The signed sum also gives orientation (CCW positive, CW negative). It works for convex or non-convex simple polygons and drops out of Green's theorem. Verified live: for 200 polygons the shoelace area equals a triangle-fan sum, and for lattice polygons it matches Pick's theorem (A = I + B/2 - 1). See the criss-cross in 1D, a lattice polygon in 2D, and the signed-triangles-cancel inverse in 3D.

THE SHOELACE · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · SPAWN · FIRST LIGHT ◆ .dlw.fold THE FOLD / SPAWN / FIRST LIGHT / THE SHOELACE THE SHOELACE polygon area from vertex coordinates — signs cancel the outside 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The shoelace formula computes the area of any simple polygon from just its vertex coordinates: A = ½|Σ (xᵢ·yᵢ₊₁ − xᵢ₊₁·yᵢ)| — the name comes from the criss-cross pattern of multiplications, like lacing a shoe. The signed sum, before the absolute value, also gives the orientation : positive for counter-clockwise, negative for clockwise. It works for any simple polygon, convex or not, and drops out of Green’s theorem. LIT verified live: for 200 polygons, the shoelace area equals a triangle-fan sum, and for lattice polygons it matches Pick’s theorem (A = I + B/2 − 1) exactly (window.__shoelace). FIG no framing; exact area. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at first-light — a shape born the moment its vertices are placed, its area readable at once. The shoelace formula is that first measure of a new shape. AVAN (AI) built the instrument: the criss-cross cross-products, the triangle-fan cross-check, the orientation sign, the Pick’s-theorem tie. Credit as content: attributed to Albrecht Ludwig Friedrich Meister (1769) and Carl Friedrich Gauss (hence ‘Gauss’s area formula’). The weave: David names first-light; I lace the vertex coordinates into a signed sum, read off area and orientation, and confirm it against triangulation and Pick’s lattice count. 3 ONE DIMENSION The criss-cross: for each edge, multiply xᵢ·yᵢ₊₁ and subtract xᵢ₊₁·yᵢ — the shoelace pattern. Sum them, halve, and take the magnitude for the area. 4 TWO DIMENSIONS · INTERACTIVE A polygon on a lattice. The shoelace area is shown, checked against a triangle-fan sum, with the orientation sign, and verified against Pick’s theorem (interior + boundary lattice points). new polygon ▶ verify ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the signed triangles from the origin to each edge, summing to the enclosed area. AVAN’s addition (the inverse-companion): the formula sums signed triangle areas — each edge with the origin — and the signs make the parts outside the polygon cancel . A triangle to an edge on the far side contributes negatively and erases the overshoot of a near-side triangle. The inverse of ‘the enclosed area’ is ‘a sum of signed triangles whose exterior parts annihilate.’ You never clip or triangulate the actual polygon; you sum blindly over all edges and let the orientation signs sort inside from outside. Magenta is the exterior triangle parts, added then cancelled; green is the net enclosed area that survives. A global area computed by a blind, signed, edge-by-edge tally — geometry from bookkeeping. pause spin LIT Genuine shoelace / Gauss area formula (Meister 1769; Gauss). Verified live: A=(1/2)|sum x_i y_{i+1} - x_{i+1} y_i| equals a triangle-fan area for 200 polygons, and for a lattice polygon matches Pick's theorem A=I+B/2-1 exactly (window.__shoelace.matchesFan && .picksTheorem); a 4x4 square gives A=16=I(9)+B(16)/2-1. FIG No framing: the criss-cross sum, the triangle-fan cross-check, the orientation sign, and the Pick's-theorem tie run in-browser and are exact. The AVAN inverse is honest — the formula sums signed triangles (origin to each edge) and the orientation signs make exterior parts cancel, so no clipping or triangulation is needed; magenta is the cancelled exterior parts, green the net area (ties to the-pick). ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of FIRST LIGHT · David Lee Wise (ROOT0), with AVAN


THE HORNER

Horner's method in the 5-window house format — evaluate a degree-n polynomial in n multiplications (vs naive ~2n) by nesting: a_n x^n+...+a_0 = (...((a_n)x+a_{n-1})x+...)x+a_0. The same nesting is synthetic division: intermediate values are the quotient coefficients dividing by (x-r), and the final value is the remainder = p(r) (remainder theorem). Verified live: over 500 cases Horner equals naive evaluation, and synthetic division gives q,rem with q(x)(x-r)+rem=p(x) and rem=p(r). See the nested eval in 1D, eval+division in 2D, and the evaluating-is-dividing inverse in 3D.

THE HORNER · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · LOOT · THE VAULT ◆ .dlw.fold THE FOLD / LOOT / THE VAULT / THE HORNER THE HORNER evaluate in n multiplications — and it's synthetic division 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Horner’s method evaluates a degree-n polynomial in just n multiplications (versus the naive ~2n) by rewriting it as nested multiplication: aₙxⁿ + … + a₀ = (…((aₙ)x + aₙ₋₁)x + …)x + a₀. The same nesting is synthetic division : the intermediate values are the coefficients of the quotient when you divide by (x−r), and the final value is the remainder — which, by the remainder theorem, equals p(r). One elegant scheme both evaluates a polynomial and factors out a root. LIT verified live: over 500 cases, Horner’s value equals the naive evaluation, and synthetic division gives quotient q and remainder rem with q(x)(x−r)+rem = p(x) and rem = p(r) exactly (window.__horner). FIG no framing; exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-vault — the stored coefficients, unlocked in the fewest operations. Horner’s method is the vault’s efficient key. AVAN (AI) built the instrument: the nested evaluation, the synthetic-division quotient/remainder, the reconstruction check. Credit as content: William George Horner (1819), though the scheme was known to Qin Jiushao (1247) and used by Newton. The weave: David names the vault; I nest the multiplications to evaluate in n steps and show the same nesting is division by (x−r), giving quotient and remainder at once. 3 ONE DIMENSION The nested evaluation from the top coefficient down: start with aₙ, multiply by x, add the next coefficient, repeat. Each step is one multiply and one add — n of each for the whole polynomial. 4 TWO DIMENSIONS · INTERACTIVE A polynomial evaluated at x by Horner (the running nested value shown), checked against the naive sum. Then synthetic division by (x−r): the quotient and remainder, with p reconstructed exactly. new polynomial ▶ verify 500 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the nested accumulator sweeping the coefficients from the top down to the final value. AVAN’s addition (the inverse-companion): evaluation and division are the same computation . Horner’s running accumulator is synthetic division, so evaluating p at r simultaneously produces the quotient p(x)/(x−r) and the remainder p(r). The inverse of ‘compute the value p(r)’ is ‘factor out the root: p(x) = q(x)(x−r) + p(r).’ One pass gives both, because a polynomial’s value at r and its divisibility by (x−r) are two faces of the remainder theorem — p(r) = 0 exactly when (x−r) divides p. Magenta is the quotient coefficients, the division falling out; green is the final value p(r). Evaluating is dividing — the same nested loop, read two ways. pause spin LIT Genuine Horner's method (Horner 1819; earlier Qin Jiushao 1247, Newton). Verified live: the nested evaluation equals the naive sum for 500 random polynomials/points, and synthetic division by (x-r) yields quotient q and remainder rem satisfying q(x)(x-r)+rem == p(x) (coefficient-exact) with rem == p(r) (window.__horner.evalMatchesNaive && .syntheticDivision). FIG No framing: the nested evaluation, the synthetic-division quotient/remainder, and the exact reconstruction run in-browser and agree. The AVAN inverse is honest — Horner's accumulator IS synthetic division, so evaluating p at r produces both the quotient p(x)/(x-r) and the remainder p(r); value and divisibility are two faces of the remainder theorem. Magenta is the quotient, green the value. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE VAULT · David Lee Wise (ROOT0), with AVAN


THE JACOBI SYMBOL

the Jacobi symbol in the 5-window house format — the Legendre symbol (a/p) says if a is a quadratic residue mod prime p (+1) or not (-1); the Jacobi symbol extends it to odd n as the product of Legendre symbols over n's prime factors, (a/n)=prod (a/p_i)^{e_i}. It is computed fast by quadratic reciprocity WITHOUT factoring n (the engine of Solovay-Strassen primality). Caveat: for composite n, (a/n)=+1 does not guarantee a is a residue. Verified live: the reciprocity value equals the Legendre product over the factorization for odd n, and equals Legendre (predicting residues) for primes. See the reciprocity ladder in 1D, symbol vs product in 2D, and the answer-without-factoring inverse in 3D.

THE JACOBI SYMBOL · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · BOSS · THE GATEKEEPER ◆ .dlw.fold THE FOLD / BOSS / THE GATEKEEPER / THE JACOBI SYMBOL THE JACOBI SYMBOL a residue test computed by reciprocity — without factoring 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The Legendre symbol (a/p) tells whether a is a quadratic residue mod a prime p (a perfect square, +1) or not (−1). The Jacobi symbol extends it to any odd modulus n by multiplying the Legendre symbols over n’s prime factors: (a/n) = ∏(a/pᵢ) eᵢ . Its power: it can be computed fast via quadratic reciprocity and the supplementary laws — without factoring n — making it the workhorse of primality tests (Solovay–Strassen) and modular square-root algorithms. A subtlety: for composite n, (a/n)=+1 does not guarantee a is a residue — which is exactly what makes it useful for detecting composites. LIT verified live: the reciprocity-computed Jacobi symbol equals the product of Legendre symbols over the factorisation for odd n, and equals the Legendre symbol (correctly predicting residues) for primes (window.__jacobisymbol). FIG no framing; exact number theory. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-gatekeeper — deciding, at the gate, which numbers are squares modulo n. The Jacobi symbol is that residue gatekeeper, computed without ever opening the factorisation. AVAN (AI) built the instrument: the reciprocity ladder, the Legendre-product cross-check, the prime-residue prediction. Credit as content: Adrien-Marie Legendre (1798); generalised by Carl Gustav Jacob Jacobi (1837); reciprocity by Gauss. The weave: David names the gatekeeper; I compute (a/n) by swap-and-reduce reciprocity and confirm it matches the product of Legendre symbols over the primes — without ever finding them. 3 ONE DIMENSION Computing (a/n) by reciprocity: pull out factors of 2 (a sign rule on n mod 8), then flip (a/n) ↔ (n/a) with a sign from n,a mod 4, and reduce — a gcd-like ladder that never factors n. 4 TWO DIMENSIONS · INTERACTIVE Choose a and an odd n. The Jacobi symbol is computed by reciprocity and checked against the product of Legendre symbols over n’s factorisation. For prime n, it correctly flags quadratic residues. a: 5 ▶ n: 21 ▶ verify ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the residue map mod n — which values are squares — and the Jacobi symbol reading it via reciprocity. AVAN’s addition (the inverse-companion): the Jacobi symbol computes a factorisation-dependent quantity without the factorisation . Reciprocity lets you swap and reduce (a/n) ↔ (n/a) like a gcd, so you reach the product-over-primes value without ever finding the primes. The inverse of ‘multiply Legendre symbols over prime factors’ is ‘reciprocity’s swap-and-reduce, blind to the factors.’ And the catch — a Jacobi +1 need not mean a residue — is the other inverse: the fast symbol loses the residue guarantee that only the true Legendre (with known primes) keeps, and that lost guarantee is exactly the gap that catches composite ‘liars.’ Magenta is the hidden factorisation, never computed; green is the reciprocity ladder. Answer a factoring-flavoured question without factoring. pause spin LIT Genuine Jacobi/Legendre symbols and quadratic reciprocity (Legendre 1798; Jacobi 1837; Gauss). Verified live: the reciprocity-computed Jacobi symbol equals the product of Legendre symbols (via Euler's criterion) over n's factorization for odd n in {3,5,7,9,15,21,35,45,63,105}, and equals the Legendre symbol correctly predicting quadratic residues for primes 3,5,7,11,13 (window.__jacobisymbol.matchesLegendreProduct && .primesPredictQR). FIG No framing: the reciprocity ladder, the Legendre-product cross-check, and the prime-residue prediction run in-browser and are exact. The AVAN inverse is honest — reciprocity computes the product-over-primes value without finding the primes (swap-and-reduce like a gcd), and the lost residue guarantee for composites is exactly what catches composite liars in Solovay-Strassen; magenta is the uncomputed factorization, green the reciprocity ladder. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE GATEKEEPER · David Lee Wise (ROOT0), with AVAN


THE LUCAS THEOREM

Lucas' theorem in the 5-window house format — compute C(m,n) mod a prime p using only the base-p digits: C(m,n) mod p equals the product of C(m_i,n_i) mod p over corresponding digits. So C(1000,500) mod 7 comes from a handful of tiny binomials. Corollary: C(m,n) is odd exactly when n's binary digits are a subset of m's, which is why Pascal mod 2 is the Sierpinski triangle. Verified live: the digit-product equals a direct C(m,n) mod p across 300 cases for primes 2,3,5,7,11. See base-p digits align in 1D, digit-product vs direct in 2D, and the local-digits-decide-the-global inverse in 3D.

THE LUCAS THEOREM · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GRIND · THE MAINFRAME ◆ .dlw.fold THE FOLD / GRIND / THE MAINFRAME / THE LUCAS THEOREM THE LUCAS THEOREM a giant binomial mod p from base-p digits alone 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Lucas’ theorem computes a giant binomial coefficient mod a prime p using only the digits of the numbers in base p. Write m and n in base p; then C(m,n) mod p equals the product of C(mᵢ, nᵢ) mod p over corresponding digits. So C(1000, 500) mod 7 — a number with hundreds of digits — is found by multiplying a handful of tiny binomials. A striking corollary: C(m,n) is odd (nonzero mod 2) exactly when n’s binary digits are a subset of m’s — which is why Pascal’s triangle mod 2 is the Sierpiński triangle. LIT verified live: the digit-product formula equals a direct computation of C(m,n) mod p across 300 cases for primes 2,3,5,7,11 (window.__lucastheorem). FIG no framing; exact modular arithmetic. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-mainframe — the arithmetic engine crunching astronomically large binomials down to a residue. Lucas’ theorem is the mainframe’s shortcut: skip the giant number, read the digits. AVAN (AI) built the instrument: the base-p digit decomposition, the digit-product, the direct-computation cross-check, the Pascal-mod-2 fractal. Credit as content: Édouard Lucas (1878). The weave: David names the mainframe; I split m and n into base-p digits, multiply the tiny per-digit binomials, and confirm the result matches the full coefficient reduced mod p. 3 ONE DIMENSION m and n written in base p, digit above digit. Each column contributes a small binomial C(mᵢ, nᵢ) mod p, and their product is the whole coefficient mod p — no carrying between columns. 4 TWO DIMENSIONS · INTERACTIVE Choose m, n, and a prime p. See the base-p digits, the per-digit binomials, and their product — checked against a direct C(m,n) mod p. Below, Pascal’s triangle mod 2 draws the Sierpiński fractal. m,n ▶ p: 7 ▶ verify 300 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: Pascal’s triangle mod p, its self-similar pattern of nonzero residues. AVAN’s addition (the inverse-companion): a global quantity — a huge combinatorial number — is determined by local digit data. The whole coefficient mod p factors into independent per-digit pieces, with no carrying between them . The inverse of ‘compute C(m,n) then reduce’ is ‘reduce each digit independently and multiply.’ That digit-locality is exactly why Pascal’s triangle mod p is self-similar : the pattern at scale pᵏ is p copies of the pattern at scale pᵏ⁻¹ — a fractal. Magenta is the full uncomputed binomial; green is the tiny digit binomials whose product is the answer. And Kummer extends it: the power of p dividing C(m,n) counts the carries when adding n and m−n in base p. Digits decide the whole. pause spin LIT Genuine Lucas' theorem (Lucas 1878). Verified live: writing m,n in base p and multiplying the per-digit binomials C(m_i,n_i) mod p equals a direct Pascal-computed C(m,n) mod p for 300 random cases across primes 2,3,5,7,11 (window.__lucastheorem.digitProductMatches); C(1000,500) mod 7 = 4. FIG No framing: the base-p digit decomposition, the digit-product, the direct cross-check, and the Pascal-mod-2 Sierpinski render run in-browser and are exact. The AVAN inverse is honest — the coefficient mod p factors into independent per-digit pieces with no carrying, which is exactly why Pascal mod p is self-similar (fractal); Kummer's extension counts carries. Ties to chaos-game/Sierpinski. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE MAINFRAME · David Lee Wise (ROOT0), with AVAN


THE QUICKSELECT

quickselect in the 5-window house format — find the k-th smallest element without fully sorting by partitioning around a pivot and recursing into only the side containing the k-th (expected O(n)). Median-of-medians (Blum-Floyd-Pratt-Rivest-Tarjan) guarantees O(n) worst case: split into groups of 5, take each median, recursively find the median of medians as pivot. It computes a median in guaranteed linear time. Verified live: over 300 random arrays, median-of-medians quickselect returns exactly sorted[k] for every k. See partition-and-recurse in 1D, select-the-k-th in 2D, and the answer-without-order inverse in 3D.

THE QUICKSELECT · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · CHEAT · THE SPEEDRUN ◆ .dlw.fold THE FOLD / CHEAT / THE SPEEDRUN / THE QUICKSELECT THE QUICKSELECT the k-th smallest in O(n) — median of medians 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Quickselect finds the k-th smallest element without fully sorting: partition around a pivot and recurse into only the side that holds the k-th element — expected O(n). The refinement median of medians (Blum–Floyd–Pratt–Rivest–Tarjan) guarantees O(n) worst case : split into groups of 5, take each group’s median, recursively find the median of those medians , and use it as pivot — a provably good pivot that shrinks the problem by a constant fraction each time. It is how you compute a median in guaranteed linear time. LIT verified live: over 300 random arrays, median-of-medians quickselect returns exactly sorted[k] for every k (window.__quickselect). FIG no framing; exact selection. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-speedrun — the k-th element in O(n) instead of an O(n log n) sort. Quickselect is the order-statistic speedrun. AVAN (AI) built the instrument: the median-of-medians pivot, the one-sided recursion, the check against a full sort. Credit as content: Tony Hoare (quickselect, 1961); Blum, Floyd, Pratt, Rivest & Tarjan (median-of-medians, 1973). The weave: David names the speedrun; I pick a provably-good pivot by finding a median of medians, recurse into a single side, and confirm the returned element is exactly the k-th smallest. 3 ONE DIMENSION Partition around a pivot: smaller elements left, larger right. The k-th element lies in exactly one side, so recurse there and discard the other — half or more of the work thrown away each step. 4 TWO DIMENSIONS · INTERACTIVE An array and a target rank k. Median-of-medians selects the k-th smallest, shown against the sorted array; only the containing side is recursed, far fewer comparisons than a full sort. new array ▶ k ▶ verify 300 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the recursion shrinking to the side that contains the k-th element, converging on one value. AVAN’s addition (the inverse-companion): you get the answer without the order . Quickselect delivers exactly one order statistic while leaving the rest of the array only partially arranged — because you never need the full sort, just the position of one element. The inverse of ‘sort then index’ is ‘index without sorting.’ And median-of-medians’ worst-case guarantee is self-referential : to pick a good pivot it finds a median (of medians) — a smaller instance of the very problem being solved — so the algorithm uses recursion to guarantee its own efficiency. Magenta is the full sorted order you never compute; green is the single k-th element and the partial partition around it. The whole is unnecessary for the part. pause spin LIT Genuine quickselect + median-of-medians (Hoare 1961; Blum, Floyd, Pratt, Rivest & Tarjan 1973). Verified live: the median-of-medians pivot with one-sided recursion returns exactly sorted[k] for every k across 300 random arrays (window.__quickselect.matchesSorted). FIG No framing: the median-of-medians pivot, the one-sided recursion, and the check against a full sort run in-browser and agree exactly. The AVAN inverse is honest — you get one order statistic without the full order, and median-of-medians' worst-case guarantee is self-referential (it finds a median of medians, a smaller instance of the same problem); magenta is the never-computed full sort, green the single k-th element. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE SPEEDRUN · David Lee Wise (ROOT0), with AVAN


THE SUFFIX ARRAY

the suffix array in the 5-window house format — the starting positions of all suffixes of a string, sorted lexicographically (banana -> [5,3,1,0,4,2]). With the LCP array (longest common prefix of adjacent suffixes) it answers 'does pattern P occur?' by binary search in O(m log n), finds longest repeats, and does much of a suffix tree's job in far less memory. Verified live: over 300 strings the doubling-built suffix array matches a brute lexicographic sort and the LCP array is correct. See suffixes sorted in 1D, SA+LCP+search in 2D, and the every-substring-is-a-suffix-prefix inverse in 3D.

THE SUFFIX ARRAY · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · BOSS · THE FIREWALL ◆ .dlw.fold THE FOLD / BOSS / THE FIREWALL / THE SUFFIX ARRAY THE SUFFIX ARRAY sort every suffix — index every substring in O(n) space 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION A suffix array lists the starting positions of all suffixes of a string, sorted lexicographically. For ‘banana’ the suffixes sort to a < ana < anana < banana < na < nana, giving indices [5, 3, 1, 0, 4, 2] . Paired with the LCP array (longest common prefix of adjacent suffixes), it answers ‘does pattern P occur?’ by binary search in O(m log n), finds the longest repeated substring, and does much of what a suffix tree does in a fraction of the memory. The doubling method sorts by 1-, 2-, 4-, … character prefixes. LIT verified live: over 300 strings, the doubling-built suffix array matches a brute lexicographic sort of the suffixes, and the LCP array is correct (window.__suffixarray). FIG no framing; exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-firewall — the pattern-matching guard, now with an index. A suffix array lets the firewall answer ‘is this substring present?’ in log time. AVAN (AI) built the instrument: the prefix-doubling sort, the LCP construction, the brute cross-check, the binary-search lookup. Credit as content: Udi Manber & Gene Myers (1990), who introduced suffix arrays as a compact alternative to suffix trees. The weave: David names the firewall; I sort the suffixes by doubling prefixes, build the LCP array, and confirm the order matches a direct suffix sort. 3 ONE DIMENSION The suffixes of ‘banana’ listed and sorted: a, ana, anana, banana, na, nana — their starting indices form the suffix array. Adjacent suffixes share a prefix; its length is the LCP. 4 TWO DIMENSIONS · INTERACTIVE Type a string; its suffix array and LCP array are built. Search a pattern by binary search over the sorted suffixes; the array is checked against a brute suffix sort. new string ▶ verify 300 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the n sorted suffixes, a searchable index of the string. AVAN’s addition (the inverse-companion): the array is a compressed index of every substring . Because every substring is a prefix of some suffix , sorting the n suffixes implicitly organises all O(n²) substrings into a searchable structure using only O(n) space. The inverse of ‘store every substring’ is ‘sort every suffix.’ And the LCP array recovers the suffix tree’s branching structure from the flat array — so a linear list holds a tree’s information. Magenta is the O(n²) substrings never explicitly stored; green is the n sorted suffixes that index them all. A whole substring universe folded into one sorted list — the suffix tree, flattened. pause spin LIT Genuine suffix array (Manber & Myers 1990). Verified live: the prefix-doubling construction matches a brute lexicographic sort of all suffixes for 300 random strings, and the Kasai LCP array equals directly-computed longest common prefixes of adjacent suffixes (window.__suffixarray.matchesBrute && .lcpCorrect); banana -> 5,3,1,0,4,2. FIG No framing: the doubling sort, the LCP construction, and the brute cross-check run in-browser and agree exactly. The AVAN inverse is honest — every substring is a prefix of some suffix, so sorting the n suffixes indexes all O(n^2) substrings in O(n) space, and the LCP array recovers the suffix tree's branching from the flat array; magenta is the uncomputed substrings, green the sorted suffixes. Ties to the-oracle-of-echoes and the-block-sort. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE FIREWALL · David Lee Wise (ROOT0), with AVAN


THE POINT IN POLYGON

point-in-polygon (ray casting) in the 5-window house format — shoot a ray from the point and count polygon-edge crossings: odd = inside, even = outside. It works for any simple polygon (convex or concave) as a consequence of the Jordan curve theorem, and the winding-number method agrees. Verified live: over 500 points and polygons, ray-casting parity, the winding number, and a convex ground-truth test all agree. See crossings flip inside/outside in 1D, a movable point in 2D, and the direction-independent-parity inverse in 3D.

THE POINT IN POLYGON · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · SPAWN · THE SANDBOX ◆ .dlw.fold THE FOLD / SPAWN / THE SANDBOX / THE POINT IN POLYGON THE POINT IN POLYGON inside or outside decided by ray-crossing parity 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Point in polygon : to decide whether a point is inside a polygon, shoot a ray from the point in any direction and count how many polygon edges it crosses. Odd crossings = inside, even = outside. This ray-casting rule works for any simple polygon — convex or wildly concave — and is a direct consequence of the Jordan curve theorem : a closed curve splits the plane into inside and outside, and each edge crossing flips which one you are in. The winding-number method gives the same answer by summing signed angle turns. LIT verified live: over 500 points and polygons, ray-casting parity, the winding number, and a convex ground-truth test all agree (window.__pointinpolygon). FIG no framing; exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-sandbox — testing a point against a shape, the primitive behind hit-testing and fill. Ray-casting is that inside/outside test. AVAN (AI) built the instrument: the even-odd ray count, the winding-number cross-check, the convex ground-truth comparison. Credit as content: the even-odd rule is classical; formalised through the Jordan curve theorem (Camille Jordan, 1887). The weave: David names the sandbox; I cast a ray, tally its edge crossings, and confirm the parity matches the winding number and a direct half-plane test. 3 ONE DIMENSION A horizontal ray from the point: every time it crosses an edge, the inside/outside state flips. Start outside; an odd number of flips leaves you inside, an even number leaves you out. 4 TWO DIMENSIONS · INTERACTIVE A polygon and a movable query point with its ray. The crossings are counted and coloured; inside/outside is reported and checked against the winding number. move point ▶ new polygon ▶ verify 500 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the ray and its edge-crossings, parity deciding inside from outside. AVAN’s addition (the inverse-companion): a global topological property — inside vs outside — is decided by a local parity count along an arbitrary ray. And the direction of the ray does not matter: any ray from an interior point crosses the boundary an odd number of times, from an exterior point an even number (Jordan). The inverse of ‘is the point enclosed?’ is ‘is the crossing count odd?’ — a question about a whole region reduced to a tally along a single line. Magenta is the polygon’s interior region, the global fact; green is the ray’s edge-crossings, the local tally. Topology from counting — the boundary’s parity decides enclosure, whichever way you look. pause spin LIT Genuine ray-casting point-in-polygon test (even-odd rule; Jordan curve theorem, Jordan 1887). Verified live: for 500 random points and convex polygons, the even-odd ray-crossing count, the winding number, and a direct half-plane (convex) inside test all agree (window.__pointinpolygon.rayEqualsWinding). FIG No framing: the even-odd ray count, the winding-number cross-check, and the convex ground-truth comparison run in-browser and agree exactly. The AVAN inverse is honest — a global inside/outside property is decided by a local parity along an arbitrary ray whose direction does not matter (any interior ray crosses the boundary an odd number of times, Jordan); magenta is the interior region, green the ray crossings. Ties to shoelace orientation. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE SANDBOX · David Lee Wise (ROOT0), with AVAN


THE THOMAS

the Thomas algorithm in the 5-window house format — solve a tridiagonal linear system (each equation touches a variable and its two neighbours) in O(n) instead of O(n^3): a forward sweep eliminates the sub-diagonal, then back-substitution reads off the answers. Tridiagonal systems drive cubic splines, the 1D heat equation, and Crank-Nicolson. Verified live: over 300 random tridiagonal systems, the Thomas solution recovers the true x with max error ~1e-16. See the forward sweep in 1D, a solved system with zero residual in 2D, and the sparsity-conserved inverse in 3D.

THE THOMAS · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · LOOT · THE VAULT ◆ .dlw.fold THE FOLD / LOOT / THE VAULT / THE THOMAS THE THOMAS solve a tridiagonal system in O(n) — sparsity conserved 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The Thomas algorithm solves a tridiagonal linear system — where each equation involves only a variable and its two neighbours — in O(n) time, versus O(n³) for general Gaussian elimination. A forward sweep eliminates the sub-diagonal (each row absorbs the one above), then back-substitution reads off the answers from the bottom up. Tridiagonal systems are everywhere: cubic spline interpolation, the 1D heat/diffusion equation by implicit finite differences, and the Crank–Nicolson method all reduce to one. LIT verified live: over 300 random tridiagonal systems, the Thomas solution recovers the true x with maximum error ~10⁻¹⁶ (window.__thomas). FIG no framing; exact banded elimination. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-vault — the banded matrix, its non-zeros locked in a narrow diagonal strip and unlocked in one linear sweep. The Thomas algorithm is the vault’s efficient key. AVAN (AI) built the instrument: the forward elimination, the back-substitution, the residual check against the true solution. Credit as content: Llewellyn Thomas (1949); it is Gaussian elimination specialised to a tridiagonal band. The weave: David names the vault; I sweep forward to clear the sub-diagonal, substitute backward, and confirm the recovered solution satisfies the system exactly. 3 ONE DIMENSION The forward sweep: each row subtracts a multiple of the row above to kill its sub-diagonal entry, leaving an upper-bidiagonal system. Then back-substitution solves it bottom to top. 4 TWO DIMENSIONS · INTERACTIVE A tridiagonal system (three diagonals). Run the Thomas algorithm to get the solution x, and see the residual Ax − b is zero — the answer satisfies every equation. new system ▶ verify 300 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the narrow band of non-zeros, swept clean in a single linear pass. AVAN’s addition (the inverse-companion): the O(n³) elimination collapses to O(n) because the matrix’s sparsity is preserved . General Gaussian elimination creates fill-in — zeros become non-zero as rows combine — but a tridiagonal matrix stays tridiagonal under elimination, so each step touches only O(1) entries. The inverse of ‘eliminate over a full matrix’ is ‘eliminate along a band that never widens.’ The very structure that defines the problem is the structure that makes it cheap . Magenta is the fill-in a general solver would spray across the matrix — which never happens here; green is the band that stays a band. Sparsity conserved is linear time earned. pause spin LIT Genuine Thomas algorithm (Thomas 1949), Gaussian elimination specialized to a tridiagonal band. Verified live: over 300 random tridiagonal systems built with a known solution, the forward-elimination + back-substitution recovers x with maximum error ~1e-16 (window.__thomas.solvesExactly). FIG No framing: the forward elimination, the back-substitution, and the residual check against the true solution run in-browser and are exact to floating precision. The AVAN inverse is honest — a tridiagonal matrix stays tridiagonal under elimination (no fill-in), so each step touches O(1) entries and the O(n^3) elimination collapses to O(n); magenta is the fill-in a general solver would create, green the band that stays a band. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE VAULT · David Lee Wise (ROOT0), with AVAN


THE SPRAGUE-GRUNDY

the Sprague-Grundy theorem in the 5-window house format — every impartial game position equals a single Nim heap, its Grundy number (nimber), computed as the mex (minimum excludant) of the successors' Grundy numbers. A position is losing for the mover iff Grundy=0, and the Grundy of a sum of games is the XOR of the parts. Verified live: a subtraction game's Grundy values equal n mod 4, and a Nim position is losing iff the XOR of heap sizes is 0 (matching brute minimax over 300 positions). See mex in 1D, Nim XOR win/loss in 2D, and the composition-becomes-XOR inverse in 3D.

THE SPRAGUE-GRUNDY · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · BOSS · THE FINAL BOSS ◆ .dlw.fold THE FOLD / BOSS / THE FINAL BOSS / THE SPRAGUE-GRUNDY THE SPRAGUE-GRUNDY every impartial game is secretly a Nim heap 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The Sprague–Grundy theorem is the master key to impartial games (both players share the same moves, like Nim): every position is equivalent to a single Nim heap of some size — its Grundy number (nimber). The Grundy number is the mex (minimum excludant: smallest non-negative integer not among) of the Grundy numbers of positions you can move to. A position is a loss for the player to move iff its Grundy number is 0 . And the crown jewel: the Grundy number of a sum of independent games is the XOR of the parts’ Grundy numbers — so complex games are solved by XOR-ing simple ones. LIT verified live: a subtraction game’s Grundy values equal n mod 4, and a Nim position is losing iff the XOR of heap sizes is 0 — matching a brute-force minimax over 300 positions (window.__spraguegrundy). FIG no framing; exact game theory. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-final-boss — the fight you win by knowing the position is already lost or won. Sprague–Grundy is the boss-fight solver: reduce any game to a number. AVAN (AI) built the instrument: the mex, the Grundy recurrence, the XOR game-sum, the brute-minimax cross-check. Credit as content: Roland Sprague (1935) and Patrick Michael Grundy (1939), independently. The weave: David names the boss; I compute Grundy numbers by mex, combine games by XOR, and confirm the win/loss verdict against exhaustive minimax. 3 ONE DIMENSION A position’s Grundy number is the mex of its successors’ Grundy numbers — the smallest non-negative integer none of the moves lead to. Grundy 0 means every move hands the opponent a winning position. 4 TWO DIMENSIONS · INTERACTIVE A Nim position of heaps. The XOR of heap sizes is the Grundy number; zero means the player to move loses. Checked against a brute-force minimax; a subtraction game’s Grundy sequence is shown too. new heaps ▶ verify 300 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: each game reduced to a single nimber, their XOR deciding the combined game. AVAN’s addition (the inverse-companion): composition becomes XOR . A sum of games is not analysed by exploring the exponential product of their move-trees — instead each game is reduced to one number and the numbers are XOR-ed. The inverse of ‘a complex combined game’ is ‘the XOR of its parts’ nimbers.’ So game addition (played in parallel) corresponds to nimber addition (XOR), turning a search problem into arithmetic . Magenta is the exponential product game-tree you never explore; green is the XOR of small nimbers that decides it. Every impartial game is secretly Nim — and nimber addition is exactly the carry-less XOR of the nimber field. pause spin LIT Genuine Sprague-Grundy theorem (Sprague 1935; Grundy 1939). Verified live: the mex-based Grundy recurrence gives n mod 4 for the {1,2,3} subtraction game, and for Nim the XOR of heap sizes equals 0 exactly when the position is losing under a brute-force memoized minimax, across 300 random positions (window.__spraguegrundy.subtractionGrundy && .nimXorMatchesBrute). FIG No framing: the mex, the Grundy recurrence, the XOR game-sum, and the brute-minimax cross-check run in-browser and agree exactly. The AVAN inverse is honest — a sum of games reduces to the XOR of their nimbers rather than the exponential product of move-trees, so game addition equals nimber addition (XOR); magenta is the product game-tree, green the XOR. Ties to the-carryless-field nimbers and the-nim. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE FINAL BOSS · David Lee Wise (ROOT0), with AVAN


THE GAME OF LIFE

Conway's Game of Life in the 5-window house format — a grid cellular automaton with two rules (B3/S23): a dead cell is born with exactly 3 live neighbours, a live cell survives with 2 or 3. From these emerge the blinker (period 2), the block (still), and the glider that crawls diagonally, returning to its shape shifted by (1,1) every 4 generations. Life is Turing-complete. Verified live: blinker period 2, block stationary, glider translates (1,1) per 4 gens under B3/S23. See the rule in 1D, the glider stepping in 2D, and the undecidable-future inverse in 3D.

THE GAME OF LIFE · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · SPAWN · THE SANDBOX ◆ .dlw.fold THE FOLD / SPAWN / THE SANDBOX / THE GAME OF LIFE THE GAME OF LIFE two rules, a glider crawling (1,1) every 4 generations 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Conway’s Game of Life is a cellular automaton on a grid where each cell is alive or dead, updating in lockstep by two rules ( B3/S23 ): a dead cell is born with exactly 3 live neighbours; a live cell survives with 2 or 3 neighbours, else dies. From these two rules emerge astonishing structures — the blinker oscillates with period 2, the block sits still, and the glider crawls diagonally, returning to its own shape shifted by (1,1) every 4 generations. Life is Turing-complete : logic gates, memory, even a full computer can be built inside it. LIT verified live: the blinker has period 2, the block is stationary, and the glider reproduces its shape translated by exactly (1,1) after 4 generations under the B3/S23 rule (window.__gameoflife). FIG no framing; exact cellular simulation. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-sandbox — the emergent playground where structure grows from nothing but rules. Life is the archetypal sandbox: two rules, a universe of behaviour. AVAN (AI) built the instrument: the B3/S23 step, the pattern library, the period and translation checks. Credit as content: John Horton Conway (1970), popularised by Martin Gardner in Scientific American . The weave: David names the sandbox; I run the two-rule step and confirm the blinker’s period, the block’s stillness, and the glider’s exact diagonal march. 3 ONE DIMENSION The two rules in a picture: count a cell’s 8 neighbours — born at exactly 3, survives at 2 or 3, dies otherwise. Everything Life does grows from just this local count. 4 TWO DIMENSIONS · INTERACTIVE A glider on the grid. Step the generations and watch it crawl, returning to its shape one cell down and one cell right every 4 steps. The blinker and block patterns are checked too. pattern: glider ▶ step ▶ verify ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the glider tracing its diagonal path across generations. AVAN’s addition (the inverse-companion): simple local rules produce undecidable global behaviour. Because Life is Turing-complete, the question ‘will this pattern ever die out?’ is undecidable in general — there is no formula for generation N and no shortcut to the far future. The inverse of ‘two-line rules’ is ‘no closed form for the outcome’: the only way to know the future is to run it, cell by cell. Magenta is the undecidable long-term fate, forever without a formula; green is the deterministic local step you must iterate to learn it. Determinism without predictability — the signature of computation, the same wall the busy beaver marks. pause spin LIT Genuine Conway's Game of Life (Conway 1970). Verified live: the B3/S23 step yields a blinker of period 2 (not period 1), a stationary block, and a glider that reproduces its shape translated by exactly (1,1) after 4 generations (window.__gameoflife.blinkerPeriod2 && .blockStill && .gliderTranslates). FIG No framing: the two-rule step and the pattern checks run in-browser and are exact. The AVAN inverse is honest and is a real theorem — Life is Turing-complete, so predicting its far future (e.g. whether a pattern ever dies) is undecidable in general, with no closed form for generation N; magenta is that undecidable fate, green the local step. Ties to the busy-beaver undecidability. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE SANDBOX · David Lee Wise (ROOT0), with AVAN


THE HOOK LENGTH

the hook length formula in the 5-window house format — the number of standard Young tableaux of a shape (fillings of a Young diagram with 1..n increasing along rows and down columns) equals n! divided by the product of hook lengths, where a cell's hook is 1 + its arm (cells right) + its leg (cells below). A global count of intricate fillings collapses to one product; these counts are the dimensions of the symmetric group's irreducible representations. Verified live: n!/prod(hooks) equals a brute count of standard Young tableaux for every partition of n=1..7. See a cell's hook in 1D, a diagram's hooks + count in 2D, and the global-count-from-local-geometry inverse in 3D.

THE HOOK LENGTH · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · LOOT · THE HOARD ◆ .dlw.fold THE FOLD / LOOT / THE HOARD / THE HOOK LENGTH THE HOOK LENGTH count Young tableaux as n! over a product of hooks 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The hook length formula counts the standard Young tableaux of a shape λ — the ways to fill the cells of a Young diagram with 1…n so numbers increase along every row and down every column. Astonishingly, the count is just n! divided by the product of the hook lengths . Each cell’s hook is itself, plus the cells to its right (the arm), plus the cells below it (the leg); multiply all these hooks and divide n! by the product. A global count of intricate fillings collapses to one clean product — and these counts are the dimensions of the irreducible representations of the symmetric group. LIT verified live: n! / (product of hook lengths) equals a brute count of standard Young tableaux for every partition of n=1…7 (window.__hooklength). FIG no framing; exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-hoard — counting the arrangements of a treasure without laying every one out. The hook length formula is that count, in one product. AVAN (AI) built the instrument: the hook-length computation, the factorial-over-product formula, the brute standard-tableau count. Credit as content: J. S. Frame, Gilbert de B. Robinson & Robert M. Thrall (1954). The weave: David names the hoard; I compute each cell’s hook, form n! over their product, and confirm it equals a direct enumeration of the valid tableaux. 3 ONE DIMENSION A cell’s hook: the cell itself (1), plus its arm (cells to the right), plus its leg (cells below). The hook length is 1 + arm + leg — a purely local quantity per cell. 4 TWO DIMENSIONS · INTERACTIVE A Young diagram with each cell’s hook length shown. The instrument forms n! / (product of hooks) and checks it against a brute count of standard Young tableaux of that shape. new shape ▶ verify n=1..7 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the diagram’s hooks, whose product divides n! to count all tableaux. AVAN’s addition (the inverse-companion): an intractable-looking count — all valid fillings — becomes a simple product because the tableaux carry deep symmetry. The formula is exact and reveals that the number of tableaux is n! divided by a purely local geometric quantity: one hook per cell . The inverse of ‘enumerate every valid tableau’ is ‘multiply one number per cell.’ And these counts f λ satisfy Σ λ (f λ )² = n! — tying the hooks to the RSK bijection between permutations and tableau-pairs. Magenta is the exponentially-many tableaux never enumerated; green is the product of hooks that counts them. Global counting from local geometry. pause spin LIT Genuine hook length formula (Frame, Robinson & Thrall 1954). Verified live: n! / (product of hook lengths) equals a brute-force count of standard Young tableaux for every partition of n=1..7 (window.__hooklength.formulaMatchesBrute); shape [3,2] gives 5 tableaux. FIG No framing: the hook computation, the factorial-over-product formula, and the brute standard-tableau count run in-browser and agree exactly. The AVAN inverse is honest — a global count of tableaux becomes a product of one local hook per cell, and these counts f^lambda satisfy sum(f^lambda)^2 = n! (the RSK identity); magenta is the un-enumerated tableaux, green the hooks. Ties to the-rsk. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE HOARD · David Lee Wise (ROOT0), with AVAN


THE MIDPOINT CIRCLE

the midpoint circle algorithm in the 5-window house format — draw a circle on a pixel grid with only integer arithmetic (no float, trig, or sqrt) via a decision variable that picks the pixel nearest the true circle, exploiting 8-fold symmetry to plot 8 pixels per octant step. It is the integer companion to the Bresenham line. Verified live: over radii 3..40, every plotted pixel is within 0.5 of the true radius (measured max ~0.49), integer-only. See the decision variable in 1D, a drawn circle in 2D, and the octant-mirrored-8-ways inverse in 3D.

THE MIDPOINT CIRCLE · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GLITCH · THE BLUE SCREEN ◆ .dlw.fold THE FOLD / GLITCH / THE BLUE SCREEN / THE MIDPOINT CIRCLE THE MIDPOINT CIRCLE draw a circle with integers and 8-fold symmetry 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The midpoint circle algorithm draws a circle on a pixel grid using only integer arithmetic — no floating point, no trigonometry, no square roots — by tracking a decision variable that chooses, at each step, whether to move straight or diagonally inward, always picking the pixel nearest the true circle. It exploits the circle’s 8-fold symmetry : compute one 45° octant and mirror it into all eight, plotting 8 pixels per step. It is the integer-only companion to Bresenham’s line, and how every early display drew circles. LIT verified live: over radii 3…40, every plotted pixel lies within 0.5 of the true radius (measured max ~0.49), using integer arithmetic only (window.__midpointcircle). FIG no framing; exact integer geometry. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-blue-screen — the pixels on the display, beside its sibling the Bresenham line. The midpoint circle is how the screen draws a ring. AVAN (AI) built the instrument: the integer decision variable, the 8-way symmetric plotting, the radial-deviation check. Credit as content: developed alongside Bresenham’s line work (Jack Bresenham; Michael Pitteway), 1960s–70s. The weave: David names the blue-screen; I walk one octant with an integer decision variable, mirror it eight ways, and confirm every pixel hugs the true circle within half a pixel. 3 ONE DIMENSION The decision variable d: start at 1−r, and at each step either move straight (x−1... no, y+1) or step inward (y+1 and x−1), whichever keeps the pixel nearest the circle — all in integers, no roots. 4 TWO DIMENSIONS · INTERACTIVE A circle drawn by the algorithm. One octant is walked and mirrored into eight; every pixel stays within half a pixel of the true radius, verified across many radii. radius: 10 ▶ verify r=3..40 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the single octant actually walked, before mirroring. AVAN’s addition (the inverse-companion): you compute only one eighth of the circle and get the whole for free. The 8-fold symmetry means one octant’s pixels, reflected across the axes and diagonals, reconstruct the entire ring — so the algorithm does 1/8 the work. The inverse of ‘draw all 360°’ is ‘draw 45° and mirror.’ And the decision variable carries the exact rounding error forward (just like Bresenham’s line), so the pixels never drift from the true circle. Magenta is the 7 octants never computed — mirrored for free; green is the single octant actually walked. Symmetry is 8× less work; error-carrying keeps it exact — the same twin virtues as the Bresenham line. pause spin LIT Genuine midpoint/Bresenham circle algorithm (Bresenham, Pitteway, 1960s-70s). Verified live: the integer decision-variable circle (d=1-r, stepping x++/y-- with integer updates) plots 8-way symmetric pixels each within a radial distance of 0.5 of the true radius across r=3..40 (measured max ~0.4894), using integer arithmetic only (window.__midpointcircle.withinHalfPixel). FIG No framing: the integer decision variable, the 8-way plotting, and the radial-deviation check run in-browser and are exact. The AVAN inverse is honest — only one octant is walked and reflected into eight (1/8 the work), and the decision variable carries the rounding error forward so pixels never drift; magenta is the 7 free-mirrored octants, green the one walked. Ties to the-bresenham. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE BLUE SCREEN · David Lee Wise (ROOT0), with AVAN