THE LEHMER CODE

The Lehmer code (factorial number system) in the 5-window house format — give every permutation a unique index 0..k!−1, and every index its permutation back, a perfect bijection. It records for each position how many smaller elements sit to its right, then reads those counts as digits in a mixed radix whose place values are factorials (…,3!,2!,1!,0!) instead of powers of ten — an odometer whose wheels have different sizes. Verified live: for every permutation of up to 7 elements, encode-then-decode returns the original, and the indices cover 0..k!−1 exactly once. See the factoradic odometer in 1D, a permutation ranked in 2D, and the ordering-as-index inverse in 3D.

THE LEHMER CODE · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · LOOT · THE INVENTORY ◆ .dlw.fold THE FOLD / LOOT / THE INVENTORY / THE LEHMER CODE THE LEHMER CODE number a permutation with a mixed-radix odometer 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The Lehmer code (via the factorial number system ) gives every permutation a unique index from 0 to k!−1, and every index its permutation back — a perfect bijection. It records, for each position, how many smaller elements sit to its right, then reads those counts as digits in a mixed radix where the place values are factorials (…, 3!, 2!, 1!, 0!) instead of powers of ten. It is an odometer whose wheels have different sizes. LIT verified live: for every permutation of up to 7 elements, encode-then-decode returns the original, and the indices cover 0…k!−1 exactly once (window.__lehmer). FIG no framing; exact integer arithmetic, exhaustive over all k! permutations. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-inventory — every arrangement of the items gets its own slot number, and every slot number unpacks to exactly one arrangement. The Lehmer code is that indexing. AVAN (AI) built the instrument: the inversion-count encoder, the factoradic mixed-radix decoder, and the round-trip + bijection checks. Credit as content: Derrick Henry Lehmer (the code); the factorial number system (Laisant, 1888). The weave: David names the-inventory; I count each element’s smaller-elements-to-the-right, read them as factorial-base digits, and confirm the map between permutations and 0…k!−1 is a perfect bijection both ways. 3 ONE DIMENSION Factoradic: digit dₕ may range 0…i, place value i!. So 3·3! + 1·2! + 0·1! + 0·0! = 20 — the odometer whose wheels grow. Each permutation is one reading. 4 TWO DIMENSIONS · INTERACTIVE A permutation, its Lehmer code, and its rank; the round-trip checked back to the permutation. new permutation ▶ verify k≤7 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: every ordering given one number. AVAN’s addition (the inverse-companion): address a permutation by a single integer in a mixed-radix where the wheels are factorials — count smaller-to-the-right, read as factoradic. The inverse of ‘store the permutation as a list’ is ‘store its rank — one number that unpacks to the exact ordering.’ Magenta is the explicit list; green is the single factoradic index. An ordering as an odometer reading. pause spin LIT Genuine Lehmer code / factorial number system (D. H. Lehmer; factorial base, Laisant 1888). Verified live exhaustively: for every permutation of k≤7 elements, the inversion-count encoder and factoradic decoder round-trip to the original permutation (window.__lehmer.roundTrip), and the ranks cover 0..k!−1 exactly once — a bijection (window.__lehmer.bijection). FIG No framing: the inversion-count encoder, the factoradic mixed-radix decoder, and the round-trip + bijection checks run in-browser with exact integers over all k! permutations and agree. The AVAN inverse is honest — addressing a permutation by one factoradic integer genuinely replaces storing the explicit list; magenta is the list, green the single index. An ordering as an odometer reading. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE INVENTORY · David Lee Wise (ROOT0), with AVAN


THE HAVEL-HAKIMI

The Havel–Hakimi algorithm in the 5-window house format — given a wish-list of vertex degrees, can a simple graph (no loops, no double edges) deliver it? Its move is greedy and exact: take the hungriest vertex, connect it to the next-hungriest, cross those off, repeat. Run out of partners or go negative → impossible; reach all zeros → graphical, and the same steps build a realizing graph. Verified live: over hundreds of random degree sequences the verdict matches the independent Erdős–Gallai criterion, and when graphical the construction yields a simple graph with exactly those degrees. See the reduction in 1D, a built graph in 2D, and the existence-by-construction inverse in 3D.

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

THE HAVEL-HAKIMI · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · SPAWN · THE SANDBOX ◆ .dlw.fold THE FOLD / SPAWN / THE SANDBOX / THE HAVEL-HAKIMI THE HAVEL-HAKIMI decide if a wiring diagram can exist, and build it 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The Havel–Hakimi algorithm answers: given a wish-list of vertex degrees — how many connections each node wants — can a simple graph (no loops, no double edges) actually deliver it? Its move is greedy and exact: take the hungriest vertex, connect it to the next-hungriest ones, cross those off, and repeat. If you ever run out of partners or go negative, the sequence is impossible; if everything reaches zero, it is graphical — and the same steps build a graph that realizes it. LIT verified live: over hundreds of random degree sequences the verdict matches the independent Erdős–Gallai criterion, and when graphical the construction yields a simple graph with exactly those degrees (window.__havelhakimi). FIG no framing; exact integer bookkeeping. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-sandbox — hand it a blueprint of how many wires each node wants, and it decides on the spot whether the wiring can exist, then builds it. Havel–Hakimi is that constructor. AVAN (AI) built the instrument: the connect-the-hungriest reduction, an independent Erdős–Gallai check, and the build-and-verify-degrees step. Credit as content: Václav Havel (1955) & S. L. Hakimi (1962); the Erdős–Gallai theorem (1960). The weave: David names the-sandbox; I connect the hungriest vertex to the next hungriest, reduce, and confirm the graphical verdict against Erdős–Gallai — then build a simple graph that hits every degree. 3 ONE DIMENSION Take the biggest demand d, connect it to the next d biggest (subtract 1 from each), drop it, re-sort. Reach all-zeros ⇒ graphical. Hit a negative or run short ⇒ impossible. 4 TWO DIMENSIONS · INTERACTIVE A random degree sequence, the verdict, and (if graphical) a graph realizing it; checked against Erdős–Gallai. new sequence ▶ verify 500 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: a wiring diagram proven possible, and built. AVAN’s addition (the inverse-companion): decide whether a set of degree demands is realizable not by searching all graphs but by a greedy reduction — satisfy the hungriest vertex first, and the problem shrinks to the same question on fewer vertices. The inverse of ‘try to build every graph and check’ is ‘connect the hungriest, reduce, recurse — zero means yes and shows how.’ Magenta is the graph search avoided; green is the greedy realization. Existence proven by construction. pause spin LIT Genuine Havel–Hakimi algorithm (Václav Havel 1955; S. L. Hakimi 1962), with the Erdős–Gallai theorem (1960) as an independent oracle. Verified live: over 500 random degree sequences, the Havel–Hakimi graphical verdict matches Erdős–Gallai (window.__havelhakimi.verdictMatchesEG), and when graphical the reduction builds a simple graph whose degree multiset equals the input exactly (window.__havelhakimi.buildsExactDegrees). FIG No framing: the connect-the-hungriest reduction, the independent Erdős–Gallai check, and the build-and-verify-degrees step run in-browser with exact integer bookkeeping and agree. The AVAN inverse is honest — deciding realizability by greedy reduction (satisfy the hungriest, recurse on fewer vertices) genuinely replaces searching all graphs, and construction proves existence; magenta is the graph search avoided, green the greedy realization. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE SANDBOX · David Lee Wise (ROOT0), with AVAN


THE POLLARD RHO

Pollard's rho algorithm in the 5-window house format — find a factor of a composite without trial-dividing to its square root. It iterates x ← x²+c (mod n) and watches for a collision modulo a hidden factor p: two iterates agreeing mod p (not mod n) reveal p as gcd(|x−y|, n). By the birthday paradox a mod-p collision appears after only ~√p steps, and Floyd's tortoise-and-hare finds it with no extra memory. Verified live: over hundreds of semiprimes n = p·q, the returned d satisfies 1 < d < n and divides n exactly. See the ρ-shaped cycle in 1D, a factorization in 2D, and the collide-mod-the-factor inverse in 3D.

THE POLLARD RHO · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · CHEAT · THE EXPLOIT ◆ .dlw.fold THE FOLD / CHEAT / THE EXPLOIT / THE POLLARD RHO THE POLLARD RHO crack a number open by walking a cycle 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Pollard’s rho algorithm finds a factor of a composite number without trial-dividing up to its square root. It iterates a simple pseudo-random map x ← x²+c (mod n) and watches for a collision modulo a hidden factor p : two iterates that agree mod p (though not mod n) reveal p as gcd(|x−y|, n). By the birthday paradox a collision mod p appears after only about √p steps — far faster than dividing by every prime. Floyd’s tortoise-and-hare finds it with no extra memory. LIT verified live: over hundreds of semiprimes n = p·q, the returned d satisfies 1 < d < n and divides n exactly (window.__pollard). FIG no framing; the divisor is checked by exact remainder. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-exploit — pull a factor out through a crack in the number, without brute-forcing every divisor. Pollard’s rho is that crack. AVAN (AI) built the instrument: the x²+c iteration, Floyd’s cycle detection, the gcd extraction, and the divides-n check. Credit as content: John Pollard (1975); Floyd’s cycle-finding. The weave: David names the-exploit; I walk the pseudo-random sequence with a tortoise and a hare until their gap shares a factor with n, then confirm the extracted divisor really divides n — a factor found by a cycle, not a search. 3 ONE DIMENSION The map x ← x²+c (mod n) eventually cycles — a “rho” shape. Two points colliding mod a hidden factor p (not mod n) make gcd(|x−y|, n) reveal p. A collision appears after ~√p steps. 4 TWO DIMENSIONS · INTERACTIVE Factor a semiprime; watch the iteration and the moment gcd reveals a divisor, checked to divide n. new semiprime ▶ verify 300 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: a factor pulled from a cycle. AVAN’s addition (the inverse-companion): find a factor by colliding modulo it , not by dividing — iterate x²+c and let the birthday paradox produce a match mod the hidden p after ~√p steps, exposed by a gcd. The inverse of ‘test every prime up to √n’ is ‘walk a pseudo-random cycle until its gap betrays a factor.’ Magenta is the √n trial division skipped; green is the ~√p cycle collision. Factoring by coincidence, made to happen. pause spin LIT Genuine Pollard's rho factorization (John Pollard 1975; Floyd cycle detection). Verified live: over 300 semiprimes n = p·q with p,q prime in [101,2000), the tortoise-and-hare iteration of x²+c returns a divisor d with 1 FIG No framing: the x²+c iteration, Floyd's cycle detection, the gcd extraction, and the divides-n check run in-browser and agree. Honest scope: rho is a heuristic (expected ~√p steps, retried with new c on failure), verified here by confirming the returned divisor genuinely divides n — not by claiming a worst-case bound. The AVAN inverse is honest — finding a factor via a collision modulo the hidden p replaces trial division to √n; magenta is that √n scan skipped, green the ~√p cycle collision. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE EXPLOIT · David Lee Wise (ROOT0), with AVAN


THE LAGRANGE FOUR-SQUARE

Lagrange's four-square theorem in the 5-window house format — every non-negative integer is a sum of four squares: n = a²+b²+c²+d². Three squares is not enough (7 and 15 cannot be written with three), but four always suffice, no exceptions. It is a startling completeness: the squares 0,1,4,9,16,… are sparse, yet four of them (with repeats) tune to hit every whole number exactly. Verified live: for every n from 0 to 3000 a representation is found and its sum checked to equal n exactly. See the decompositions in 1D, four-square tiles in 2D, and the universal-quaternary-basis inverse in 3D.

THE LAGRANGE FOUR-SQUARE · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · LOOT · THE DROP ◆ .dlw.fold THE FOLD / LOOT / THE DROP / THE LAGRANGE FOUR-SQUARE THE LAGRANGE FOUR-SQUARE every whole number is four squares 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Lagrange’s four-square theorem says every non-negative integer is the sum of four squares: n = a² + b² + c² + d². Three squares is not enough — 7 and 15 cannot be written with three — but four always suffice, no exceptions, forever. It is a startling completeness: the squares 0,1,4,9,16,… are sparse, yet any four of them (with repeats) can be tuned to hit every whole number exactly. LIT verified live: for every n from 0 to 3000 a representation a²+b²+c²+d² = n is found and its sum checked to equal n exactly (window.__lagrange). FIG no framing; exact integer search, no gaps. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-drop — whatever number you throw at it, four squares always fall out that rebuild it exactly. Lagrange’s theorem is that guaranteed drop. AVAN (AI) built the instrument: the nested-square search, the sum-of-two-squares inner step, and the a²+b²+c²+d²=n check across a full range. Credit as content: Joseph-Louis Lagrange (1770); Bachet conjectured it, Euler laid groundwork. The weave: David names the-drop; I search four squares for each n and confirm they rebuild it exactly — across every integer in the range, the four-square drop never fails. 3 ONE DIMENSION 7 = 4+1+1+1 = 2²+1²+1²+1² (needs all four). 2026 = 45²+1² (two suffice here). Every n has at least one four-square drop; many have several. 4 TWO DIMENSIONS · INTERACTIVE Pick a number; its four squares shown as tiles that sum back to it, checked exactly. new number ▶ verify 0..3000 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: any integer as four squares. AVAN’s addition (the inverse-companion): represent every whole number with a fixed budget of four squares — not three (which leaves gaps at 7, 15, …), but four, which always close them. The inverse of ‘numbers are indivisible atoms’ is ‘every number is four squares stacked — a universal quaternary basis.’ Magenta is the number as an opaque quantity; green is its four-square decomposition. Completeness from exactly four parts. pause spin LIT Genuine Lagrange four-square theorem (Joseph-Louis Lagrange 1770; conjectured by Bachet). Verified live: for every integer n in 0..3000, a four-square search finds a,b,c,d with a²+b²+c²+d² = n and the sum is checked to equal n exactly (window.__lagrange.allFour) — no gaps across the range. FIG No framing: the nested-square search, the sum-of-two-squares inner step, and the a²+b²+c²+d²=n check across the full range run in-browser with exact integers. Honest scope: this verifies existence over a finite range (Lagrange's theorem guarantees it for all n); it does not re-prove the theorem. The AVAN inverse is honest — representing every integer with a fixed budget of four squares (three leave gaps at 7,15,…) is a genuine universal basis; magenta is the number as an opaque quantity, green its four-square decomposition. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE DROP · David Lee Wise (ROOT0), with AVAN


THE CUCKOO HASHING

Cuckoo hashing in the 5-window house format — worst-case O(1) lookup: any key lives in one of just two possible slots, given by two hash functions in two tables, so membership always reads at most two cells, never a long probe chain. Insertion borrows the cuckoo's trick: if your slot is taken, kick the occupant out and re-home it in its other slot, which may kick the next; rarely the chain loops and the tables rebuild with fresh hashes. Verified live: after building many tables at moderate load, every inserted key is found in ≤2 probes, none lost. See the two-nest eviction in 1D, filling tables in 2D, and the constant-time-by-construction inverse in 3D.

THE CUCKOO HASHING · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · RESPAWN · THE RESURRECT ◆ .dlw.fold THE FOLD / RESPAWN / THE RESURRECT / THE CUCKOO HASHING THE CUCKOO HASHING a key kicks out its neighbour and lands safe 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Cuckoo hashing guarantees worst-case O(1) lookup : any key lives in one of just two possible slots, given by two hash functions in two tables. Checking membership always reads at most two cells — never a long probe chain. Insertion borrows the cuckoo bird’s trick: if your slot is taken, kick the occupant out and re-home it in its other slot, which may kick the next, and so on. Rarely the chain loops, and the tables rebuild with fresh hashes. LIT verified live: after building many tables at moderate load, every inserted key is found in ≤ 2 probes, none lost (window.__cuckoo). FIG no framing; the two-probe guarantee is structural — find() reads exactly the two candidate slots. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-resurrect — a key evicted from its nest doesn’t die; it respawns in its alternate slot, and whatever it displaces respawns in turn. Cuckoo hashing is that chain of resurrections. AVAN (AI) built the instrument: the two-table two-hash structure, the kick-and-relocate insert, the rehash-on-loop fallback, and the ≤2-probe lookup check. Credit as content: Rasmus Pagh & Flemming Friche Rodler (2001). The weave: David names the-resurrect; I place each key, evict and re-home whatever it displaces, and confirm every key is later found by reading only its two candidate slots — lookup that never chains. 3 ONE DIMENSION Each key has two nests (one per table). Insert into the first; if taken, evict the resident and send it to its other nest — which may evict again. Lookup checks just the two nests. 4 TWO DIMENSIONS · INTERACTIVE Two hash tables filling with keys; every key is shown findable in its two candidate slots, checked live. rebuild table ▶ verify 200 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: a key always in one of two known slots. AVAN’s addition (the inverse-companion): make lookup worst-case constant by giving each key exactly two homes and evicting to keep the invariant — so membership reads two cells, never a probe chain. The inverse of ‘probe forward until you find it or an empty slot’ is ‘guarantee two possible slots — check both, done.’ Magenta is the unbounded probe sequence; green is the pair of candidate nests. Constant-time lookup by construction. pause spin LIT Genuine cuckoo hashing (Rasmus Pagh & Flemming Friche Rodler 2001). Verified live: over 200 tables built at moderate load (40 keys into two size-64 tables, rehashing on eviction loops), every inserted key is found by reading only its two candidate slots — ≤2 probes, none lost (window.__cuckoo.everyKeyFound2Probes). FIG No framing: the two-table two-hash structure, the kick-and-relocate insert, the rehash-on-loop fallback, and the ≤2-probe lookup check run in-browser and agree; the two-probe bound is structural (find() reads exactly the two candidate slots). The AVAN inverse is honest — giving each key exactly two homes and evicting to keep the invariant makes lookup worst-case constant, replacing an unbounded probe chain; magenta is that probe sequence, green the pair of candidate nests. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE RESURRECT · David Lee Wise (ROOT0), with AVAN


THE KUMMER

Kummer's theorem in the 5-window house format — a hidden bridge between addition and divisibility: the number of times a prime p divides the binomial C(m+n, n) equals exactly the number of carries when adding m and n in base p. A divisibility question is answered by the schoolyard mechanics of carrying digits — no factorials needed, just add in base p and count carries. Verified live: over 20000 random (m,n,p), the p-adic valuation of C(m+n,n) by Legendre's formula equals the carry count of m+n in base p. See a base-p addition's carries in 1D, the count checked in 2D, and the divisibility-inside-addition inverse in 3D.

THE KUMMER · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GLITCH · DIVIDE BY ZERO ◆ .dlw.fold THE FOLD / GLITCH / DIVIDE BY ZERO / THE KUMMER THE KUMMER count the carries to know how many times p divides 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Kummer’s theorem reveals a hidden bridge between addition and divisibility : the number of times a prime p divides the binomial coefficient C(m+n, n) equals exactly the number of carries when you add m and n in base p. A dry counting question — how divisible is this binomial? — is answered by the schoolyard mechanics of carrying digits. No factorials need to be computed; just add in base p and count the carries. LIT verified live: over 20000 random (m, n, p), the p-adic valuation of C(m+n, n) — computed by Legendre’s formula — equals the carry count of m+n in base p (window.__kummer). FIG no framing; exact integer arithmetic, no big numbers. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at divide-by-zero — the domain of divisibility’s edge; Kummer says precisely how many times p goes into a binomial, and it does so by counting carries, not by dividing. AVAN (AI) built the instrument: Legendre’s valuation formula, the base-p carry counter, and the equality check. Credit as content: Ernst Kummer (1852). The weave: David names divide-by-zero; I compute how many times p divides C(m+n, n) two ways — by Legendre’s prime-power formula and by counting carries in base-p addition — and confirm they always agree, addition and divisibility revealed as one. 3 ONE DIMENSION Add m and n in base p; each place that overflows is a carry. The count of carries is exactly the power of p dividing C(m+n, n). Divisibility, read off an addition. 4 TWO DIMENSIONS · INTERACTIVE Pick m, n, p; see the base-p addition with its carries, and the p-adic valuation of the binomial, checked equal. new m,n,p ▶ verify 20000 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: divisibility counted as carries. AVAN’s addition (the inverse-companion): find how many times a prime divides a binomial not by factoring the factorials but by counting carries in one base-p addition. The inverse of ‘compute C(m+n,n) and factor out p’ is ‘add m and n in base p — the carries are the exponent.’ Magenta is the factorial factorization avoided; green is the carry count. Divisibility hiding inside addition. pause spin LIT Genuine Kummer's theorem (Ernst Kummer 1852). Verified live: over 20000 random (m,n,p) with p prime, the exponent of p in C(m+n,n) computed by Legendre's formula v_p(k!)=Σ⌊k/p^i⌋ equals the number of carries in the base-p addition of m and n (window.__kummer.kummerHolds) — exact integer arithmetic, no large numbers formed. FIG No framing: Legendre's valuation formula, the base-p carry counter, and the equality check run in-browser with exact integers and agree. The AVAN inverse is honest — finding how many times p divides a binomial by counting carries in one base-p addition genuinely replaces factoring the factorials; magenta is that factorization avoided, green the carry count. Divisibility hiding inside addition. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of DIVIDE BY ZERO · David Lee Wise (ROOT0), with AVAN


THE COMBINATORIAL NUMBER SYSTEM

The combinatorial number system in the 5-window house format — give every k-element subset of {0,…,n−1} a unique rank in 0..C(n,k)−1, and every rank its subset back, a bijection between combinations and integers. For a subset written descending c_k>…>c_1 the rank is C(c_k,k)+…+C(c_1,1); a 'factorial base for choosing.' Verified live: for every k-subset with n≤12, rank-then-unrank returns the original, and the ranks cover 0..C(n,k)−1 exactly once. See the descending-binomial rank in 1D, a subset ranked in 2D, and the selection-as-one-number inverse in 3D.

THE COMBINATORIAL NUMBER SYSTEM · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · LOOT · THE STASH ◆ .dlw.fold THE FOLD / LOOT / THE STASH / THE COMBINATORIAL NUMBER SYSTEM THE COMBINATORIAL NUMBER SYSTEM number a subset with a descending choice 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The combinatorial number system gives every k-element subset of {0,1,…,n−1} a unique rank from 0 to C(n,k)−1, and every rank its subset back — a bijection between combinations and integers. For a subset written in descending order c k >…>c 1 , the rank is C(c k ,k)+…+C(c 1 ,1). It is a “factorial base for choosing”: a way to address any combination by a single number, used to iterate or store subsets compactly. LIT verified live: for every k-subset with n ≤ 12, rank-then-unrank returns the original, and the ranks cover 0…C(n,k)−1 exactly once (window.__cns). FIG no framing; exact integer arithmetic, exhaustive over all subsets. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-stash — every possible selection of items you could squirrel away gets its own number, and every number unpacks to exactly one selection. The combinatorial number system is that addressing. AVAN (AI) built the instrument: the descending-binomial rank, the greedy unrank, and the round-trip + bijection checks. Credit as content: the combinatorial number system (Pascal’s identity; formalized by Lehmer and others). The weave: David names the-stash; I rank each subset by summing binomials of its descending elements, greedily invert the rank back to the subset, and confirm the correspondence is a perfect bijection. 3 ONE DIMENSION Subset {5,2,1} (descending) ranks as C(5,3)+C(2,2)+C(1,1) = 10+1+1 = 12. To unrank, greedily peel off the largest binomial that fits. Each combination, one number. 4 TWO DIMENSIONS · INTERACTIVE A k-subset, its rank, and the unrank back to the subset; the round-trip checked. new subset ▶ verify n≤12 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: every combination given one number. AVAN’s addition (the inverse-companion): address a combination by a single integer with a mixed radix of binomials — sum C(cᵢ,i) over the descending elements, and unrank greedily. The inverse of ‘store the subset as a list of members’ is ‘store its rank — one number that unpacks to the exact subset.’ Magenta is the explicit member list; green is the single binomial-base index. A selection as one number. pause spin LIT Genuine combinatorial number system (built on Pascal's identity; formalized by Lehmer and others). Verified live exhaustively: for every k-subset of {0..n−1} with n≤12, the descending-binomial rank and greedy unrank round-trip to the original subset (window.__cns.roundTrip), and the ranks cover 0..C(n,k)−1 exactly once — a bijection (window.__cns.bijection). FIG No framing: the descending-binomial rank, the greedy unrank, and the round-trip + bijection checks run in-browser with exact integers over all subsets and agree. The AVAN inverse is honest — addressing a combination by one integer in a binomial mixed radix genuinely replaces storing the explicit member list; magenta is the list, green the single index. A selection as one number. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE STASH · David Lee Wise (ROOT0), with AVAN


THE RODRIGUES

Rodrigues' rotation formula in the 5-window house format — rotate a vector v about a unit axis k by angle θ in one expression: v' = v cosθ + (k×v) sinθ + k(k·v)(1−cosθ). It splits v into the part along the axis (untouched) and the perpendicular part (spun in its plane), reassembling the rotated vector without forming a full matrix — the axis–angle rotation in closed form. Verified live: over 5000 random axes, angles, and vectors, Rodrigues equals the equivalent rotation matrix, preserves length, inverts under −θ, and fixes the axis. See the split-and-spin in 1D, a rotation checked in 2D, and the rotation-without-a-matrix inverse in 3D.

THE RODRIGUES · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · SPAWN · FIRST LIGHT ◆ .dlw.fold THE FOLD / SPAWN / FIRST LIGHT / THE RODRIGUES THE RODRIGUES spin a vector about an axis by one formula 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Rodrigues’ rotation formula rotates a vector v about a unit axis k by angle θ with a single expression: v′ = v cosθ + (k×v) sinθ + k(k·v)(1−cosθ) . It splits v into the part along the axis (untouched) and the part perpendicular (spun in its plane), reassembling the rotated vector without ever forming a full matrix. It is the axis–angle rotation in closed form — the exponential map of a rotation, written out. LIT verified live: over 5000 random axes, angles, and vectors, Rodrigues equals the equivalent rotation matrix, preserves length, inverts under −θ, and fixes the axis (window.__rodrigues, worst ~1e-15). FIG no framing; exact vector algebra to floating precision. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at first-light — the first frame a 3D scene draws needs vectors spun about arbitrary axes; Rodrigues does it in one line, no matrix assembled. AVAN (AI) built the instrument: the cross/dot decomposition, the equivalent rotation matrix, and the equality, length, inverse, and axis-fixed checks. Credit as content: Olinde Rodrigues (1840). The weave: David names first-light; I rotate vectors by the axis–angle formula and confirm it matches the rotation matrix, keeps every length, undoes itself at −θ, and leaves the axis untouched — rotation as one closed-form step. 3 ONE DIMENSION Split v into its component along k (fixed) and perpendicular (rotated in its plane by θ using k×v). Recombine: v cosθ + (k×v) sinθ + k(k·v)(1−cosθ). 4 TWO DIMENSIONS · INTERACTIVE A vector rotated about an axis; the formula’s result checked against the rotation matrix, with length and axis preserved. new rotation ▶ verify 5000 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: a vector spun about an axis by one formula. AVAN’s addition (the inverse-companion): rotate about an arbitrary axis without building a matrix — keep the along-axis part, spin the perpendicular part, recombine in closed form. The inverse of ‘assemble a 3×3 rotation matrix and multiply’ is ‘split, spin the perpendicular, reassemble — one vector expression.’ Magenta is the full matrix multiply; green is the axis–angle closed form. Rotation without a matrix. pause spin LIT Genuine Rodrigues' rotation formula (Olinde Rodrigues 1840). Verified live: over 5000 random unit axes, angles, and vectors, the formula equals the equivalent rotation matrix R = I + sinθ·K + (1−cosθ)·K² applied to v (window.__rodrigues.matchesMatrix, worst ~1e-15), preserves length (preservesLength), inverts under −θ (inverse), and fixes the rotation axis (axisFixed). FIG No framing: the cross/dot decomposition, the equivalent rotation matrix, and the equality/length/inverse/axis-fixed checks run in-browser and agree to floating precision. The AVAN inverse is honest — rotating about an arbitrary axis by keeping the along-axis part and spinning the perpendicular part in closed form genuinely avoids assembling and multiplying a 3×3 matrix; magenta is that matrix multiply, green the axis–angle closed form. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of FIRST LIGHT · David Lee Wise (ROOT0), with AVAN


THE LEFTIST HEAP

The leftist heap in the 5-window house format — a priority queue whose defining trick is a fast merge: two heaps combine in O(log n). Every node stores an s-value (distance to the nearest empty slot) and the heap keeps every node's left child at least as tall as its right (s(left) ≥ s(right)), so the right spine stays ≤ log n long. Merging walks two right spines and swaps children to restore the invariant; insert and extract-min are merges in disguise. Verified live: over hundreds of random heaps, extract-min yields fully sorted order, the leftist invariant holds at every node, and the heap property holds. See the right-spine merge in 1D, a heap tree in 2D, and the built-to-fuse inverse in 3D.

THE LEFTIST HEAP · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · CO-OP · THE MERGE ◆ .dlw.fold THE FOLD / CO-OP / THE MERGE / THE LEFTIST HEAP THE LEFTIST HEAP two heaps fuse in log time 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION A leftist heap is a priority queue whose defining trick is a fast merge : two heaps combine in O(log n). Every node stores an s-value (the distance to the nearest empty slot), and the heap keeps every node’s left child at least as “tall” as its right (s(left) ≥ s(right)). Because the right spine stays short (length ≤ log n), merging just walks two right spines and swaps children to restore the invariant. Insert and extract-min are merges in disguise. LIT verified live: over hundreds of random heaps, extract-min yields fully sorted order, the leftist invariant s(left) ≥ s(right) holds at every node, and the heap property holds (window.__leftist). FIG no framing; exact structural checks. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-merge — two priority queues become one in logarithmic time, the operation from which insert and extract are built. The leftist heap is that merge. AVAN (AI) built the instrument: the s-value bookkeeping, the right-spine merge with child-swap, and the sorted-extract + leftist + heap-property checks. Credit as content: Clark Allan Crane (1972); popularized in Knuth. The weave: David names the-merge; I merge two heaps by walking their right spines and swapping children to keep left taller than right, then confirm extract-min comes out sorted and the invariants hold everywhere. 3 ONE DIMENSION Merge walks the two right spines, taking the smaller root each step; then swaps children where s(left) < s(right). The right spine stays ≤ log n long, so merge is cheap. 4 TWO DIMENSIONS · INTERACTIVE A leftist heap drawn as a tree; extract-min repeatedly, and the sorted output + invariants checked. new heap ▶ extract-min ▶ verify 300 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: two heaps fused in log time. AVAN’s addition (the inverse-companion): make a priority queue mergeable by keeping the right spine short — store each node’s distance to an empty slot and always swap the shorter child right. The inverse of ‘rebuild a heap by inserting one element at a time’ is ‘merge two whole heaps along their short right spines in O(log n).’ Magenta is the element-by-element rebuild; green is the single spine-merge. A queue built to fuse. pause spin LIT Genuine leftist heap (Clark Allan Crane 1972; in Knuth vol. 3). Verified live: over 300 random heaps, extract-min produces fully sorted output (window.__leftist.sortedExtract), the leftist invariant s(left)≥s(right) with s(node)=s(right)+1 holds at every node (leftistProperty), and the min-heap property holds (heapProperty). FIG No framing: the s-value bookkeeping, the right-spine merge with child-swap, and the sorted-extract + leftist + heap-property checks run in-browser and agree. The AVAN inverse is honest — making a priority queue mergeable by keeping the right spine short (swap the shorter child right) genuinely lets two whole heaps fuse in O(log n) rather than rebuilding element-by-element; magenta is that rebuild, green the single spine-merge. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE MERGE · David Lee Wise (ROOT0), with AVAN


THE QUADRATIC RECIPROCITY

Quadratic reciprocity in the 5-window house format — Gauss's golden theorem links two questions that look independent: is p a square mod q, and is q a square mod p? With the Legendre symbol (a/p) = +1 if a is a nonzero square mod p else −1, the law says for distinct odd primes (p/q)·(q/p) = (−1)^((p−1)/2·(q−1)/2): the two answers agree unless both primes are ≡ 3 (mod 4), when they flip. Verified live: for every pair of distinct odd primes below 200 the reciprocity identity holds (Legendre symbols by Euler's criterion), and the −1 and 2 supplements hold too. See the flip rule in 1D, a Legendre grid in 2D, and the flip-the-question inverse in 3D.

THE QUADRATIC RECIPROCITY · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · BOSS · THE FINAL BOSS ◆ .dlw.fold THE FOLD / BOSS / THE FINAL BOSS / THE QUADRATIC RECIPROCITY THE QUADRATIC RECIPROCITY a golden law linking two primes' squares 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Quadratic reciprocity — Gauss’s aureum theorema , the golden theorem — links two questions that look independent: is p a square mod q, and is q a square mod p? The Legendre symbol (a/p) is +1 if a is a nonzero square mod p, else −1. The law says for distinct odd primes, (p/q)·(q/p) = (−1) ((p−1)/2)((q−1)/2) : the two answers agree unless both primes are ≡ 3 (mod 4), in which case they flip. Two far-apart primes secretly constrain each other. LIT verified live: for every pair of distinct odd primes below 200, the reciprocity identity holds (Legendre symbols by Euler’s criterion), and the supplements for −1 and 2 hold too (window.__reciprocity). FIG no framing; exact modular arithmetic. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-final-boss — Gauss called it the golden theorem and proved it many times over; it is the confrontation number theory trains you for. AVAN (AI) built the instrument: Euler’s criterion for the Legendre symbol, the reciprocity check across all odd-prime pairs, and the −1 and 2 supplements. Credit as content: Carl Friedrich Gauss (first proof 1796); conjectured by Euler and Legendre. The weave: David names the-final-boss; I compute each Legendre symbol by Euler’s criterion a (p−1)/2 mod p and confirm (p/q)(q/p) matches the sign the theorem predicts, for every odd-prime pair in range. 3 ONE DIMENSION (p/q)·(q/p) = +1 unless both p,q ≡ 3 (mod 4), when it is −1. So the squareness of p mod q and q mod p agree — except for two “3 mod 4” primes, which flip. 4 TWO DIMENSIONS · INTERACTIVE A grid of Legendre symbols (p/q); the reciprocity relation checked cell by cell against the theorem. new prime pair ▶ verify pairs 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: two primes constraining each other’s squares. AVAN’s addition (the inverse-companion): decide whether p is a square mod q by flipping the question to whether q is a square mod p — the reciprocity sign relates them, letting you reduce the modulus instead of testing directly. The inverse of ‘test a (q−1)/2 mod q head-on’ is ‘flip via reciprocity to a smaller modulus and recurse.’ Magenta is the head-on Euler test; green is the reciprocity flip. Squareness answered by its mirror. pause spin LIT Genuine law of quadratic reciprocity (Carl Friedrich Gauss, first proof 1796; conjectured by Euler and Legendre). Verified live: for every pair of distinct odd primes below 200, Legendre symbols computed by Euler's criterion a^((p−1)/2) mod p satisfy (p/q)(q/p) = (−1)^(((p−1)/2)((q−1)/2)) (window.__reciprocity.reciprocity), and the supplements (−1/p)=(−1)^((p−1)/2) and (2/p)=(−1)^((p²−1)/8) hold (supplements). FIG No framing: Euler's criterion for the Legendre symbol, the reciprocity check across all odd-prime pairs, and the two supplements run in-browser with exact modular arithmetic and agree. The AVAN inverse is honest — deciding whether p is a square mod q by flipping to whether q is a square mod p (reducing the modulus via the reciprocity sign) is the theorem's genuine computational use; magenta is the head-on Euler test, green the reciprocity flip. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE FINAL BOSS · David Lee Wise (ROOT0), with AVAN


THE DESCARTES CIRCLE

Descartes' circle theorem in the 5-window house format — four mutually tangent (kissing) circles are bound by one law on their curvatures k=1/r: (k₁+k₂+k₃+k₄)² = 2(k₁²+k₂²+k₃²+k₄²). Given three tangent circles the fourth's curvature is k₁+k₂+k₃ ± 2√(k₁k₂+k₂k₃+k₃k₁) — two solutions, an inner and outer kiss — and a complex version gives the fourth center too. Verified live: over thousands of tangent triples the fourth curvature satisfies the identity and the computed fourth circle is genuinely tangent to all three. See the kissing circles in 1D, a fourth circle solved in 2D, and the tangency-as-arithmetic inverse in 3D.

THE DESCARTES CIRCLE · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · CO-OP · THE SYNC ◆ .dlw.fold THE FOLD / CO-OP / THE SYNC / THE DESCARTES CIRCLE THE DESCARTES CIRCLE four kissing circles bound by one curvature law 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Descartes’ circle theorem binds four mutually tangent (“kissing”) circles by a single law on their curvatures k = 1/r: (k 1 +k 2 +k 3 +k 4 )² = 2(k 1 ²+k 2 ²+k 3 ²+k 4 ²) . Given three tangent circles, the fourth’s curvature is k 4 = k 1 +k 2 +k 3 ± 2√(k 1 k 2 +k 2 k 3 +k 3 k 1 ) — two solutions, an inner and an outer kiss. A complex version gives the fourth circle’s center too. LIT verified live: over thousands of tangent triples, the fourth curvature from the formula satisfies the identity, and the computed fourth circle is genuinely tangent to all three (window.__descartes). FIG no framing; exact algebra + geometric tangency to floating precision. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-sync — four circles brought into perfect mutual tangency, their sizes locked in sync by one equation. Descartes’ theorem is that synchronization. AVAN (AI) built the instrument: the curvature formula, the complex-Descartes center, and the identity + tangency checks. Credit as content: René Descartes (1643, to Princess Elisabeth); rediscovered by Frederick Soddy (1936, “The Kiss Precise”). The weave: David names the-sync; I compute the fourth kissing circle from three, verify the curvature identity, and confirm the new circle actually touches all three — sizes bound by one law. 3 ONE DIMENSION Curvature k = 1/r (negative for a circle enclosing the others). Four mutually tangent circles obey (Σk)² = 2Σk². Solve for k 4 : two kisses, inner (small) and outer (enclosing). 4 TWO DIMENSIONS · INTERACTIVE Three tangent circles and the fourth Descartes circle; the curvature law and tangency checked. new triple ▶ verify 2000 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the fourth kiss found from three circles. AVAN’s addition (the inverse-companion): find a circle tangent to three others not by solving tangency geometry but by a curvature equation — the four kissing curvatures satisfy one quadratic, so k 4 is two square-root solutions. The inverse of ‘construct the tangent circle geometrically’ is ‘solve (Σk)² = 2Σk² for the missing curvature.’ Magenta is the geometric construction; green is the curvature solve. Tangency as arithmetic. pause spin LIT Genuine Descartes circle theorem (René Descartes 1643; rediscovered by Frederick Soddy 1936). Verified live: over 2000 constructed mutually-tangent triples, the fourth curvature from k₁+k₂+k₃±2√(…) satisfies (Σk)²=2Σk² (window.__descartes.algebraHolds, worst ~1e-14), and the complex-Descartes fourth circle is tangent to all three (center distance == r_i+r₄ or |r_i−r₄|) (window.__descartes.tangent). FIG No framing: the curvature formula, the complex-Descartes center, and the identity + geometric-tangency checks run in-browser and agree to floating precision. The AVAN inverse is honest — finding a circle tangent to three others by solving the curvature quadratic (Σk)²=2Σk² genuinely replaces a geometric tangency construction; magenta is that construction, green the curvature solve. Tangency as arithmetic. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE SYNC · David Lee Wise (ROOT0), with AVAN


THE GOLOMB SEQUENCE

Golomb's self-describing sequence in the 5-window house format — the unique non-decreasing sequence of positive integers where a(n) is the number of times n appears in the sequence itself: 1,2,2,3,3,4,4,4,5,5,5,… The single 1 says '1 appears once'; the two 2s say '2 appears twice'; the three 4s say '4 appears three times' — and a(4)=3. It bootstraps itself via a(n) = 1 + a(n − a(a(n−1))). Verified live: the sequence is non-decreasing and for every value v (whose full run lies in range) the count of v equals a(v) exactly. See the self-narration in 1D, run-length counts in 2D, and the self-authoring inverse in 3D.

THE GOLOMB SEQUENCE · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GLITCH · HEISENBUG ◆ .dlw.fold THE FOLD / GLITCH / HEISENBUG / THE GOLOMB SEQUENCE THE GOLOMB SEQUENCE a sequence that counts its own values 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Golomb’s self-describing sequence is the unique non-decreasing sequence of positive integers where a(n) is the number of times n appears in the sequence itself : 1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 5, … The single 1 says “1 appears once”; the two 2s say “2 appears twice”; the three 4s say “4 appears… three times” — and indeed a(4)=3. It bootstraps itself into existence, each term constraining the counts of the others, and has a clean recurrence a(n) = 1 + a(n − a(a(n−1))). LIT verified live: the sequence is non-decreasing, and for every value v (whose full run lies in range) the number of times v appears equals a(v) exactly (window.__golomb). FIG no framing; exact integer self-reference. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at heisenbug — a sequence that describes its own multiplicities; look at how often a value occurs and that count is itself a term. Golomb’s sequence is that self-observation. AVAN (AI) built the instrument: the a(n)=1+a(n−a(a(n−1))) recurrence, the non-decreasing check, and the count-of-v-equals-a(v) self-description check. Credit as content: Solomon Golomb (1966); Colin Mallows gave the recurrence. The weave: David names heisenbug; I generate the sequence by its self-referential recurrence and confirm the defining property — each value appears exactly as many times as the sequence, at that value, says it should. 3 ONE DIMENSION 1, 2, 2, 3, 3, 4, 4, 4, … a(1)=1 (one 1); a(2)=2 (two 2s); a(3)=2; a(4)=3 (three 4s). Each term is a headcount of another value — the list narrates itself. 4 TWO DIMENSIONS · INTERACTIVE The sequence as run-lengths; pick a value and see its count equal a(value), checked live. shift window ▶ verify ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: a list that counts its own values. AVAN’s addition (the inverse-companion): define a sequence by a fixed point of self-description — demand a(n) equal the multiplicity of n, and a unique non-decreasing sequence emerges, computable by a(n)=1+a(n−a(a(n−1))). The inverse of ‘define terms by an external rule’ is ‘demand the sequence describe its own counts — it bootstraps itself.’ Magenta is an externally-specified sequence; green is the self-describing fixed point. A list that authors itself. pause spin LIT Genuine Golomb (Silverman) self-describing sequence (Solomon Golomb 1966; recurrence by Colin Mallows). Verified live: generated to 5000 terms by a(n)=1+a(n−a(a(n−1))), the sequence is non-decreasing (window.__golomb.nondecreasing) and self-describing — the number of occurrences of each value v equals a(v) (window.__golomb.selfDescribing) — exact integer self-reference. FIG No framing: the self-referential recurrence, the non-decreasing check, and the count-of-v-equals-a(v) check run in-browser with exact integers and agree. The AVAN inverse is honest — defining a sequence as the fixed point of self-description (a(n) equals the multiplicity of n) genuinely differs from an external rule; magenta is an externally-specified sequence, green the self-describing fixed point. A list that authors itself. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of HEISENBUG · David Lee Wise (ROOT0), with AVAN


THE PADOVAN

The Padovan sequence in the 5-window house format — Fibonacci's quieter cousin: P(n) = P(n−2) + P(n−3), starting 1,1,1,2,2,3,4,5,7,9,12,16,… Instead of summing the two previous terms it skips one, and its growth ratio converges not to the golden ratio but to the plastic number ρ ≈ 1.324718 — the unique real root of x³=x+1, the smallest Pisot number. It also satisfies the identity P(n)=P(n−1)+P(n−5). Verified live: the recurrence holds, the identity holds, and P(n)/P(n−1) converges to the plastic number, the exact root of x³−x−1. See the sequence in 1D, the triangle spiral in 2D, and the different-reach inverse in 3D.

THE PADOVAN · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · SPAWN · CHECKPOINT ZERO ◆ .dlw.fold THE FOLD / SPAWN / CHECKPOINT ZERO / THE PADOVAN THE PADOVAN numbers grown at the plastic ratio 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The Padovan sequence is Fibonacci’s quieter cousin: P(n) = P(n−2) + P(n−3), starting 1,1,1,2,2,3,4,5,7,9,12,16,… Instead of summing the two previous terms, it skips one. Its growth ratio converges not to the golden ratio but to the plastic number ρ ≈ 1.324718 — the unique real root of x³ = x + 1, the smallest Pisot number. The sequence also satisfies the surprising identity P(n) = P(n−1) + P(n−5). LIT verified live: the recurrence holds, the identity P(n)=P(n−1)+P(n−5) holds, and the ratio P(n)/P(n−1) converges to the plastic number — the exact root of x³−x−1 (window.__padovan). FIG no framing; exact integer recurrence, ratio matched to the algebraic root. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at checkpoint-zero — a growth built from earlier save points, each term reaching two and three steps back, settling toward the plastic ratio. The Padovan sequence is that growth. AVAN (AI) built the instrument: the skip-one recurrence, the P(n)=P(n−1)+P(n−5) identity, and the ratio→plastic-number check against x³=x+1. Credit as content: named for architect Richard Padovan; studied by Ian Stewart; the plastic number is Hans van der Laan’s. The weave: David names checkpoint-zero; I grow the sequence by P(n)=P(n−2)+P(n−3) and confirm its ratio approaches the real root of x³=x+1 — a golden ratio for a slower spiral. 3 ONE DIMENSION P(n) = P(n−2) + P(n−3): 1,1,1,2,2,3,4,5,7,9,12,16,21,… Reach two and three back (skip one). The ratio of consecutive terms tends to ρ ≈ 1.3247, the plastic number. 4 TWO DIMENSIONS · INTERACTIVE The Padovan spiral of triangles; the ratio converging to the plastic number, and identities checked. grow ▶ reset verify ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: growth at the plastic ratio. AVAN’s addition (the inverse-companion): grow a sequence toward an irrational limit that is not the golden ratio — reach two and three terms back, and the ratio settles at the plastic number ρ, root of x³=x+1. The inverse of ‘sum the last two (Fibonacci → φ)’ is ‘sum terms two and three back (Padovan → ρ).’ Magenta is the golden-ratio spiral; green is the plastic-ratio spiral. A different constant from a different reach. pause spin LIT Genuine Padovan sequence (named for Richard Padovan; popularized by Ian Stewart; the plastic number is Hans van der Laan's). Verified live: the recurrence P(n)=P(n−2)+P(n−3) holds (window.__padovan.recurrence), the identity P(n)=P(n−1)+P(n−5) holds (identity), and the consecutive ratio converges to ρ=1.32471795… the real root of x³=x+1 (ratioToPlastic, and ρ³=ρ+1 checked). FIG No framing: the skip-one recurrence, the P(n)=P(n−1)+P(n−5) identity, and the ratio→plastic-number check against x³=x+1 run in-browser and agree. The AVAN inverse is honest — growing toward an irrational limit that is not the golden ratio (reach two and three back → ρ, versus Fibonacci's last-two → φ) is a genuine different constant; magenta is the golden-ratio spiral, green the plastic-ratio spiral. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of CHECKPOINT ZERO · David Lee Wise (ROOT0), with AVAN


THE PRIMITIVE ROOT

The primitive root in the 5-window house format — a single number g mod a prime p whose powers g¹,…,g^(p−1) run through every nonzero residue 1,…,p−1 exactly once before returning to 1: a generator of the multiplicative group, one seed reaching every residue by repeated multiplication. Primitive roots underlie discrete logarithms, Diffie–Hellman, and RNGs. Verified live: for primes below 300, a primitive root's powers form a permutation of {1,…,p−1}, and the count of primitive roots equals φ(p−1) exactly. See a generator's cycle in 1D, the orbit around the residues in 2D, and the all-from-one-seed inverse in 3D.

THE PRIMITIVE ROOT · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · LOOT · THE MINT ◆ .dlw.fold THE FOLD / LOOT / THE MINT / THE PRIMITIVE ROOT THE PRIMITIVE ROOT one root that generates every residue 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION A primitive root modulo a prime p is a single number g whose powers g 1 , g 2 , …, g p−1 run through every nonzero residue 1, 2, …, p−1 exactly once before returning to 1. It is a generator of the multiplicative group mod p: one seed from which every residue is reached by repeated multiplication. Primitive roots underlie discrete logarithms, Diffie–Hellman key exchange, and random-number generators. LIT verified live: for primes below 300, a primitive root’s powers form a permutation of {1,…,p−1}, and the count of primitive roots equals φ(p−1) exactly (window.__primroot). FIG no framing; exact modular arithmetic and Euler’s totient count. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-mint — one generator stamps out every coin in the group; multiply g by itself and eventually every residue has been minted, each exactly once. The primitive root is that mint. AVAN (AI) built the instrument: the order test, the permutation check on g’s powers, and the count-equals-φ(p−1) verification. Credit as content: primitive roots (Euler conjectured, Gauss proved their existence for primes, Disquisitiones 1801). The weave: David names the-mint; I cycle a generator’s powers through the residues and confirm they hit each nonzero value once, and that exactly φ(p−1) generators exist — every group has its mints. 3 ONE DIMENSION mod 7: powers of 3 are 3, 2, 6, 4, 5, 1 — all of 1..6, so 3 is a primitive root. Powers of 2 are 2, 4, 1, 2, 4, 1 — only three values, so 2 is not. 4 TWO DIMENSIONS · INTERACTIVE The cycle of a generator’s powers around the residues; whether it hits all of them, and the φ(p−1) count, checked. new prime ▶ verify p 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: every residue from one generator. AVAN’s addition (the inverse-companion): reach every nonzero residue from a single seed by repeated multiplication — a primitive root generates the whole group, so its power sequence is a permutation of 1..p−1. The inverse of ‘list the residues 1,2,…,p−1’ is ‘pick one generator g — its powers ARE the residues, in a scrambled order.’ Magenta is the plain residue list; green is the generator’s orbit. All residues from one seed. pause spin LIT Genuine primitive roots (Euler conjectured; Gauss proved existence for primes, Disquisitiones 1801). Verified live: for every prime p FIG No framing: the order test, the permutation check on g's powers, and the count-equals-φ(p−1) verification run in-browser and agree. The AVAN inverse is honest — reaching every nonzero residue from a single seed by repeated multiplication (a generator's power sequence IS a permutation of 1..p−1) genuinely replaces listing the residues; magenta is the plain list, green the generator's orbit. All residues from one seed. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE MINT · David Lee Wise (ROOT0), with AVAN


THE EULERIAN NUMBERS

Eulerian numbers in the 5-window house format — A(n,k) counts the permutations of {1,…,n} with exactly k ascents (positions where the next element is larger). They form a triangle like Pascal's: A(n,k) = (k+1)·A(n−1,k) + (n−k)·A(n−1,k−1). Each row sums to n! (every permutation has some ascents), and the triangle is symmetric A(n,k)=A(n,n−1−k), since reversing a permutation swaps ascents and descents. Verified live: the recurrence matches a brute-force count of permutations by ascents for n≤8, each row sums to n!, and the symmetry holds. See the triangle in 1D, a row bar chart in 2D, and the count-don't-list inverse in 3D.

THE EULERIAN NUMBERS · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · BOSS · THE GAUNTLET ◆ .dlw.fold THE FOLD / BOSS / THE GAUNTLET / THE EULERIAN NUMBERS THE EULERIAN NUMBERS count permutations by their climbs 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Eulerian numbers A(n,k) count the permutations of {1,…,n} with exactly k ascents (positions where the next element is larger). They form a triangle like Pascal’s but with a twist: A(n,k) = (k+1)·A(n−1,k) + (n−k)·A(n−1,k−1). Each row sums to n! (every permutation has some number of ascents), and the triangle is symmetric : A(n,k) = A(n,n−1−k), since reversing a permutation swaps ascents and descents. LIT verified live: the recurrence matches a brute-force count of permutations by ascents for n ≤ 8, each row sums to n!, and the symmetry holds (window.__eulerian). FIG no framing; exact integer counts, checked against exhaustive enumeration. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-gauntlet — run the whole permutation and count its climbs; the Eulerian triangle tallies how many runs have exactly k ascents. AVAN (AI) built the instrument: the Eulerian recurrence, the brute ascent-counter over all permutations, and the row-sum-equals-n! and symmetry checks. Credit as content: Leonhard Euler (1755). The weave: David names the-gauntlet; I build the Eulerian triangle by its recurrence and confirm it equals the exhaustive count of permutations grouped by ascents — with each row summing to n! and mirror-symmetric, ascents and descents in balance. 3 ONE DIMENSION A(n,k) = (k+1)A(n−1,k) + (n−k)A(n−1,k−1). Row 4: 1, 11, 11, 1 — permutations of 4 items with 0,1,2,3 ascents. They sum to 4! = 24. 4 TWO DIMENSIONS · INTERACTIVE The Eulerian triangle; a chosen row checked against brute ascent-counting, with its row sum and symmetry. new row ▶ verify n≤8 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: permutations tallied by their climbs. AVAN’s addition (the inverse-companion): count permutations by their number of ascents not by enumerating all n! but by a Pascal-like recurrence — insert n into a smaller permutation, and it either extends an ascent block or splits one, giving A(n,k) = (k+1)A(n−1,k)+(n−k)A(n−1,k−1). The inverse of ‘list every permutation and tally ascents’ is ‘grow the count row by row.’ Magenta is the n! enumeration; green is the recurrence. Structure counted, not listed. pause spin LIT Genuine Eulerian numbers (Leonhard Euler 1755). Verified live: the recurrence A(n,k)=(k+1)A(n−1,k)+(n−k)A(n−1,k−1) matches an exhaustive count of permutations of {1..n} grouped by ascents for n≤8 (window.__eulerian.recurrenceMatchesBrute), each row sums to n! (rowSumFactorial), and A(n,k)=A(n,n−1−k) (symmetry) — exact integer counts. FIG No framing: the Eulerian recurrence, the brute ascent-counter over all permutations, and the row-sum-equals-n! and symmetry checks run in-browser with exact integers and agree. The AVAN inverse is honest — counting permutations by ascents via a Pascal-like recurrence (inserting n extends or splits an ascent block) genuinely replaces enumerating all n! permutations; magenta is the enumeration, green the recurrence. Structure counted, not listed. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE GAUNTLET · David Lee Wise (ROOT0), with AVAN


THE NEGABINARY

Negabinary in the 5-window house format — base −2: the same digits {0,1} as binary, but place values are powers of −2 (1, −2, 4, −8, 16, …). The alternating signs let a single unsigned digit string represent every integer, positive and negative, with no sign bit and no two's-complement: −6 is 1110 (= −8 + 4 − 2). Encoding just repeatedly takes n mod 2 and divides by −2, and each integer's representation is unique. Verified live: over every integer from −2000 to 2000, decode(encode(n)) returns n and all representations are distinct. See the signed place values in 1D, a number's digits in 2D, and the sign-folded-into-the-base inverse in 3D.

THE NEGABINARY · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · SPAWN · NULL ISLAND ◆ .dlw.fold THE FOLD / SPAWN / NULL ISLAND / THE NEGABINARY THE NEGABINARY count in base minus-two, no sign needed 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Negabinary is base −2 : the same digits {0,1} as binary, but place values are powers of −2 — 1, −2, 4, −8, 16, −32, … The alternating signs mean a single unsigned digit string represents every integer, positive and negative , with no sign bit and no two’s-complement. −6, for instance, is 1110 (= −8 + 4 − 2). Encoding just repeatedly takes the bit n mod 2 and divides by −2 — and the representation of each integer is unique. LIT verified live: over every integer from −2000 to 2000, decode(encode(n)) returns n, and all representations are distinct (window.__negabinary). FIG no framing; exact integer arithmetic. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at null-island — the origin where positive and negative meet; negabinary spans both sides of zero from one unsigned string, no sign attached. AVAN (AI) built the instrument: the mod-2 / divide-by-−2 encoder, the alternating-place-value decoder, and the round-trip + uniqueness checks. Credit as content: negative-base numeration (Vittorio Grünwald 1885; studied by Knuth). The weave: David names null-island; I encode integers in base −2 by taking bits and dividing by −2, decode by alternating place values, and confirm every integer round-trips to a unique string — signs carried by the base itself. 3 ONE DIMENSION Place values 1, −2, 4, −8, 16, … So 1110 = 1·(−8) + 1·4 + 1·(−2) + 0 = −6. The alternating signs let one digit string reach any integer, no sign bit. 4 TWO DIMENSIONS · INTERACTIVE A number, its base-−2 digits with their signed place values, and the round-trip checked. new number ▶ verify -2000..2000 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: negatives represented with no sign. AVAN’s addition (the inverse-companion): represent signed integers with no sign bit and no two’s-complement — let the base carry the signs by making it negative, so alternating place values reach below zero. The inverse of ‘store magnitude plus a sign’ is ‘use base −2 — one unsigned string is already signed.’ Magenta is the separate sign bit; green is the signless negabinary string. The sign folded into the base. pause spin LIT Genuine negative-base (base −2) numeration (Vittorio Grünwald 1885; treated by Knuth). Verified live: for every integer n in −2000..2000, the mod-2/divide-by-−2 encoder and the alternating-place-value decoder round-trip (window.__negabinary.roundTrip), and all digit strings are distinct — a unique representation per integer (window.__negabinary.unique) — exact integer arithmetic. FIG No framing: the encoder, the decoder, and the round-trip + uniqueness checks run in-browser with exact integers and agree. The AVAN inverse is honest — representing signed integers with no sign bit by letting a negative base carry the signs (alternating place values reach below zero) genuinely replaces magnitude-plus-sign; magenta is the separate sign bit, green the signless negabinary string. The sign folded into the base. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of NULL ISLAND · David Lee Wise (ROOT0), with AVAN


THE BOYER-MOORE MAJORITY

The Boyer–Moore majority vote in the 5-window house format — find an element appearing in more than half a stream using O(1) memory: one candidate and one counter. Sweep once: if the counter is zero, adopt the current element; if the next matches, increment, else decrement. Matching and non-matching elements cancel in pairs, so a true majority cannot be fully cancelled — it is the last one standing, confirmed by a single verification pass. Verified live: over 3000 random arrays (with and without a majority), the O(1)-space vote plus verify pass returns exactly what a brute frequency count does. See the cancellation in 1D, a live stream in 2D, and the majority-by-cancellation inverse in 3D.

THE BOYER-MOORE MAJORITY · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · BOSS · SUDDEN DEATH ◆ .dlw.fold THE FOLD / BOSS / SUDDEN DEATH / THE BOYER-MOORE MAJORITY THE BOYER-MOORE MAJORITY one survivor of pairwise cancellation 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The Boyer–Moore majority vote finds an element appearing in more than half a stream using O(1) memory — one candidate and one counter. Sweep once: if the counter is zero, adopt the current element as candidate; if the next matches, increment; if not, decrement. Matching and non-matching elements cancel in pairs , so if a true majority exists it cannot be fully cancelled — it is the last one standing. A single verification pass confirms whether the survivor really is a majority. LIT verified live: over 3000 random arrays (with and without a majority), the O(1)-space vote plus a verify pass returns exactly what a brute frequency count does (window.__majority). FIG no framing; exact counting comparison. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at sudden-death — every unlike pair knocks each other out, and one element strikes through them all to survive; if a majority exists, it is the last standing. Boyer–Moore is that sudden death. AVAN (AI) built the instrument: the candidate/counter cancellation sweep, the verification pass, and the match against a brute frequency count. Credit as content: Robert S. Boyer & J Strother Moore (1981). The weave: David names sudden-death; I let each unlike pair cancel, keep the survivor as candidate, verify its true count, and confirm it agrees with a full frequency tally — a majority found in constant memory. 3 ONE DIMENSION Counter starts at 0: adopt a candidate; +1 on a match, −1 on a mismatch. Unlike pairs cancel. A true majority (> n/2) can never be fully cancelled — it survives as the candidate. 4 TWO DIMENSIONS · INTERACTIVE A stream with the running candidate and counter; the survivor verified against a brute majority count. new stream ▶ verify 3000 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: a majority found in constant memory. AVAN’s addition (the inverse-companion): find the majority element with one counter, not a hash of counts — cancel unlike pairs so the over-half element survives, then verify in a second pass. The inverse of ‘count every element’s frequency’ is ‘cancel opposites — the majority is what remains.’ Magenta is the full frequency table; green is the single surviving candidate. Majority by cancellation. pause spin LIT Genuine Boyer–Moore majority vote algorithm (Robert S. Boyer & J Strother Moore 1981). Verified live: over 3000 random arrays (roughly half seeded with a >n/2 majority, half not), the candidate/counter cancellation sweep followed by a verification pass returns exactly the majority element (or none) that a brute frequency count finds (window.__majority.matchesBrute). FIG No framing: the candidate/counter cancellation sweep, the verification pass, and the match against a brute frequency count run in-browser and agree. The AVAN inverse is honest — finding the majority with one counter by cancelling unlike pairs (the over-half element survives) genuinely replaces a full frequency table; magenta is that table, green the single surviving candidate. Majority by cancellation. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of SUDDEN DEATH · David Lee Wise (ROOT0), with AVAN


THE LYNDON FACTORIZATION

The Lyndon factorization (Chen–Fox–Lyndon) in the 5-window house format — split any string uniquely into a non-increasing sequence of Lyndon words. A Lyndon word is strictly smaller than all its rotations — an aperiodic necklace with a canonical start. Duval's algorithm computes it in linear time and constant extra space, in one left-to-right scan; every string has exactly one such factorization, and 'banana' becomes b·an·an·a. Verified live: over 3000 random strings, Duval's factors concatenate back to the input, each factor is a Lyndon word, and the factors are non-increasing. See a Lyndon word vs its rotations in 1D, a factored string in 2D, and the canonical-cut inverse in 3D.

THE LYNDON FACTORIZATION · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · CO-OP · THE HANDOFF ◆ .dlw.fold THE FOLD / CO-OP / THE HANDOFF / THE LYNDON FACTORIZATION THE LYNDON FACTORIZATION factor a string into non-increasing necklaces 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The Lyndon factorization (Chen–Fox–Lyndon) splits any string uniquely into a sequence of Lyndon words in non-increasing order. A Lyndon word is one that is strictly smaller than all its rotations — an “aperiodic necklace” with a canonical starting point. Duval’s algorithm computes the factorization in linear time and constant extra space, in one left-to-right scan. Every string has exactly one such factorization; “banana” becomes b · an · an · a. LIT verified live: over 3000 random strings, Duval’s factors concatenate back to the input, each factor is a Lyndon word, and the factors are non-increasing (window.__lyndon). FIG no framing; exact string comparisons. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-handoff — the string is passed hand to hand into a chain of canonical necklaces, each no larger than the last. Duval’s scan is that handoff. AVAN (AI) built the instrument: Duval’s one-pass factorizer, the is-Lyndon rotation test, and the concatenation + non-increasing checks. Credit as content: K. T. Chen, R. H. Fox & R. C. Lyndon (existence/uniqueness, 1958); Jean-Pierre Duval (linear algorithm, 1983). The weave: David names the-handoff; I run Duval’s scan to cut the string into Lyndon words, verify each is strictly smaller than its rotations, and confirm the pieces are non-increasing and rebuild the input. 3 ONE DIMENSION A Lyndon word is strictly smaller than every rotation of itself. Duval scans once, cutting the string into non-increasing Lyndon pieces: banana → b | an | an | a. 4 TWO DIMENSIONS · INTERACTIVE A string factored by Duval; each Lyndon piece shown, with the concatenation and non-increasing order checked. new string ▶ verify 3000 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: a string as unique non-increasing necklaces. AVAN’s addition (the inverse-companion): decompose a string into a canonical, unique sequence of aperiodic necklaces (Lyndon words) in one linear scan — each strictly smaller than its rotations, the pieces non-increasing. The inverse of ‘treat the string as one opaque block’ is ‘cut it into its unique Lyndon factorization — a normal form.’ Magenta is the undivided string; green is the necklace factorization. A canonical cut, always the same. pause spin LIT Genuine Lyndon factorization (Chen, Fox & Lyndon 1958 for existence/uniqueness; Jean-Pierre Duval 1983 for the linear algorithm). Verified live: over 3000 random strings, Duval's one-pass factors concatenate to the input (window.__lyndon.concat), each factor is a Lyndon word — strictly smaller than all its rotations (allLyndon) — and the factors are non-increasing (nonIncreasing) — exact string comparisons. FIG No framing: Duval's one-pass factorizer, the is-Lyndon rotation test, and the concatenation + non-increasing checks run in-browser and agree. The AVAN inverse is honest — cutting a string into its unique non-increasing Lyndon factorization (a normal form) in one linear scan genuinely differs from treating it as an opaque block; magenta is the undivided string, green the necklace factorization. A canonical cut, always the same. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE HANDOFF · David Lee Wise (ROOT0), with AVAN


THE LIFTING THE EXPONENT

The Lifting the Exponent lemma in the 5-window house format — an olympiad power tool: for an odd prime p, if p divides a−b but neither a nor b, then vₚ(aⁿ−bⁿ) = vₚ(a−b) + vₚ(n). The whole exponent of p in a huge power difference is the exponent in the base difference plus the exponent in n — the extra factors of p come only from n itself. Verified live (exact BigInt): over 3000 random valid (a,b,n,p), vₚ of aⁿ−bⁿ computed directly equals vₚ(a−b)+vₚ(n). See the lemma in 1D, a case checked in 2D, and the exponent-lifted inverse in 3D.

THE LIFTING THE EXPONENT · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · LOOT · THE VAULT ◆ .dlw.fold THE FOLD / LOOT / THE VAULT / THE LIFTING THE EXPONENT THE LIFTING THE EXPONENT count how many times p divides a power difference 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Lifting the Exponent (LTE) is an olympiad power tool: for an odd prime p, if p divides a−b but divides neither a nor b, then the number of times p divides a n −b n is beautifully simple: v p (a n −b n ) = v p (a−b) + v p (n) . The whole exponent of p in a huge power difference is just the exponent in the base difference, plus the exponent in n — the extra factors of p come only from n itself. LIT verified live (exact BigInt): over 3000 random valid (a,b,n,p), v p of a n −b n computed directly equals v p (a−b)+v p (n) (window.__lte). FIG no framing; exact big-integer valuations, no approximation. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-vault — the exact power of p hidden inside an astronomically large a n −b n , unlocked without ever computing the whole number. LTE is that key. AVAN (AI) built the instrument: exact BigInt power differences, the p-adic valuation, and the equality with v p (a−b)+v p (n). Credit as content: the Lifting-the-Exponent lemma (folklore of olympiad number theory; rooted in classical p-adic valuation). The weave: David names the-vault; I form a n −b n in exact big integers, count how many times p divides it, and confirm it equals v p (a−b)+v p (n) — the deep exponent from two shallow ones. 3 ONE DIMENSION v p (a n −b n ) = v p (a−b) + v p (n), for odd p with p | a−b, p∤a, p∤b. Example: v 3 (4 6 −1) = v 3 (3) + v 3 (6) = 1 + 1 = 2. 4 TWO DIMENSIONS · INTERACTIVE Pick valid a, b, n, p; the exact v p (a n −b n ) shown beside v p (a−b)+v p (n), checked equal. new a,b,n,p ▶ verify 3000 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: a deep exponent from two shallow ones. AVAN’s addition (the inverse-companion): find how many times p divides a n −b n without forming the number — add the exponent in the base difference to the exponent in n. The inverse of ‘compute a n −b n and factor out p’ is ‘v p (a−b) + v p (n) — the extra p’s come only from n.’ Magenta is the astronomical power difference; green is the two-term sum. The exponent lifted, not computed. pause spin LIT Genuine Lifting-the-Exponent lemma (classical p-adic valuation; a staple of olympiad number theory). Verified live with exact BigInt arithmetic: over 3000 random (a,b,n,p) with p an odd prime dividing a−b but not a or b, the p-adic valuation of aⁿ−bⁿ (formed exactly as a big integer) equals vₚ(a−b)+vₚ(n) (window.__lte.lteHolds) — no approximation. FIG No framing: exact BigInt power differences, the p-adic valuation, and the equality with vₚ(a−b)+vₚ(n) run in-browser under the lemma's hypotheses (odd p, p|a−b, p∤a, p∤b) and agree. The AVAN inverse is honest — finding how many times p divides aⁿ−bⁿ by adding vₚ(a−b) and vₚ(n), without forming the astronomically large number, is the lemma's genuine use; magenta is that power difference, green the two-term sum. The exponent lifted, not computed. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE VAULT · David Lee Wise (ROOT0), with AVAN


THE LIANG-BARSKY

The Liang–Barsky algorithm in the 5-window house format — clip a line segment to a rectangular window using its parametric form P(t) = P₀ + t·(P₁−P₀), t∈[0,1]. Each of the four window edges gives an inequality p·t ≤ q; the algorithm tightens the entry parameter u₁ and exit u₂ against all four, rejecting if u₁ > u₂. The surviving [u₁,u₂] gives the clipped endpoints — no repeated edge intersections, just parameter bookkeeping. Verified live: over thousands of random segments, the clipped part lies entirely inside the rectangle and its endpoints sit exactly on the original line. See the parameter interval in 1D, clipped segments in 2D, and the one-shrink inverse in 3D.

THE LIANG-BARSKY · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · CHEAT · NOCLIP ◆ .dlw.fold THE FOLD / CHEAT / NOCLIP / THE LIANG-BARSKY THE LIANG-BARSKY clip a line to a window by four parameters 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The Liang–Barsky algorithm clips a line segment to a rectangular window using its parametric form P(t) = P 0 + t·(P 1 −P 0 ), t ∈ [0,1]. Each of the four window edges gives an inequality of the form p·t ≤ q; the algorithm tightens the entry parameter u 1 and exit parameter u 2 against all four, rejecting the segment if u 1 > u 2 . The surviving [u 1 , u 2 ] gives the clipped endpoints — no repeated edge intersections, just parameter bookkeeping. LIT verified live: over thousands of random segments, the clipped part lies entirely inside the rectangle and its endpoints sit exactly on the original line (window.__liangbarsky). FIG no framing; exact parametric arithmetic to floating precision. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at noclip — the domain of walls and what passes through them; Liang–Barsky decides exactly where a line enters and leaves the window, clipping it to the frame. AVAN (AI) built the instrument: the four p·t ≤ q edge tests, the u 1 /u 2 tightening, and the inside + on-line verification. Credit as content: You-Dong Liang & Brian A. Barsky (1984). The weave: David names noclip; I clip segments to a window by tightening the entry and exit parameters against four edge inequalities, and confirm the clipped piece lies inside the frame with endpoints exactly on the original line — clipping as parameter arithmetic. 3 ONE DIMENSION Walk t from 0 to 1 along the segment. Each window edge caps t: left/right/bottom/top give an entry u 1 and exit u 2 . If u 1 ≤ u 2 , the segment from u 1 to u 2 is inside. 4 TWO DIMENSIONS · INTERACTIVE Segments clipped to a window; the clipped part (green) vs the trimmed tails (faded), with inside/on-line checks. new segment ▶ verify 5000 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: a line trimmed to the window. AVAN’s addition (the inverse-companion): clip a segment to a rectangle by tightening two parameters , not by intersecting it with each edge and stitching — every edge is one inequality p·t ≤ q on the entry/exit t. The inverse of ‘intersect with all four edges and reassemble’ is ‘shrink [u 1 ,u 2 ] against four inequalities — reject if they cross.’ Magenta is the edge-by-edge intersection; green is the parameter interval. Clipping as one shrink. pause spin LIT Genuine Liang–Barsky line-clipping algorithm (You-Dong Liang & Brian A. Barsky 1984). Verified live: over 5000 random segments against a fixed window, every clipped segment's endpoints lie inside the rectangle (window.__liangbarsky.clipInside) and lie exactly on the original line — zero cross product to floating precision (window.__liangbarsky.onLine). FIG No framing: the four p·t ≤ q edge tests, the u₁/u₂ tightening, and the inside + on-line verification run in-browser and agree to floating precision. The AVAN inverse is honest — clipping by tightening two parameters against four inequalities (reject if they cross) genuinely replaces intersecting the segment with each edge and stitching; magenta is that edge-by-edge intersection, green the parameter interval. Clipping as one shrink. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of NOCLIP · David Lee Wise (ROOT0), with AVAN


THE CONTINUED FRACTION OF ROOT N

The continued fraction of √n in the 5-window house format — for non-square n it is eventually periodic with a striking shape: √n = [a₀; a₁,…,a_L] where the repeating block ends in 2a₀ and the part before it, (a₁,…,a_{L−1}), is a palindrome. So √7 = [2; 1,1,1,4] and √19 = [4; 2,1,3,1,2,8]. The convergent just before the period closes gives the fundamental solution of Pell's equation x²−n·y² = ±1. Verified live: for every non-square n up to 1000 the period ends in 2a₀, its front is a palindrome, and the pre-period convergent solves Pell (exact BigInt). See the periods in 1D, one expansion in 2D, and the Pell-from-rhythm inverse in 3D.

THE CONTINUED FRACTION OF ROOT N · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GRIND · THE EPOCH ◆ .dlw.fold THE FOLD / GRIND / THE EPOCH / THE CONTINUED FRACTION OF ROOT N THE CONTINUED FRACTION OF ROOT N the square root's fraction repeats in a palindrome 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The continued fraction of √n (for non-square n) is eventually periodic , and its period has a striking shape: √n = [a 0 ; a 1 , a 2 , …, a L ] where the repeating block ends in 2a 0 and the part before it, (a 1 , …, a L−1 ), is a palindrome . So √7 = [2; 1,1,1,4 ] and √19 = [4; 2,1,3,1,2,8 ]. The convergent just before the period closes gives the fundamental solution of Pell’s equation x² − n·y² = ±1. LIT verified live: for every non-square n up to 1000, the period ends in 2a 0 , its front is a palindrome, and the pre-period convergent solves Pell (exact BigInt) (window.__cfsqrt). FIG no framing; exact integer/BigInt arithmetic. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-epoch — one full periodic pass through the fraction’s digits, repeating forever, its interior a mirror. The continued fraction of √n is that epoch. AVAN (AI) built the instrument: the (m,d,a) CF recurrence, the period/palindrome detector, and the BigInt Pell-convergent check. Credit as content: Lagrange (periodicity of quadratic-irrational CFs, 1770); the palindrome structure is classical. The weave: David names the-epoch; I expand √n by the standard recurrence, confirm the period ends in 2a 0 with a palindromic front, and check that the convergent before the period’s close solves x²−n·y²=±1 in exact big integers. 3 ONE DIMENSION √7 = [2; 1,1,1,4], √19 = [4; 2,1,3,1,2,8]. The period ends in 2a 0 ; the terms before it read the same forwards and backwards — a palindrome. 4 TWO DIMENSIONS · INTERACTIVE The CF expansion of √n with its period highlighted; the palindrome and Pell solution checked. new n ▶ verify n≤1000 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: a root’s fraction repeating in a palindrome. AVAN’s addition (the inverse-companion): solve Pell’s equation x²−n·y²=1 not by searching integers but by reading the periodic continued fraction of √n — the convergent before the period closes is the fundamental solution. The inverse of ‘test x,y until x²−n·y²=1’ is ‘expand √n; its period hands you the answer.’ Magenta is the brute Pell search; green is the CF period. The root’s rhythm solves the equation. pause spin LIT Genuine continued fraction of a quadratic surd (periodicity: Lagrange 1770; the palindrome structure is classical). Verified live: for every non-square n in 2..1000, the (m,d,a) recurrence yields a period ending in 2a₀ (window.__cfsqrt.periodEnds2a0), whose front (a₁..a_{L−1}) is palindromic (palindrome), and the convergent p_{L−1}/q_{L−1} satisfies x²−n·y² = ±1 in exact BigInt (solvesPell). FIG No framing: the CF recurrence, the period/palindrome detector, and the BigInt Pell-convergent check run in-browser (BigInt because fundamental Pell solutions can exceed 2⁵³) and agree exactly. The AVAN inverse is honest — solving Pell's equation by reading the periodic continued fraction of √n (the pre-period convergent IS the fundamental solution) genuinely replaces a brute integer search; magenta is that search, green the CF period. The root's rhythm solves the equation. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE EPOCH · David Lee Wise (ROOT0), with AVAN


THE HAAR WAVELET

The Haar wavelet transform in the 5-window house format — the simplest multiresolution analysis: repeatedly replace pairs of samples by their average and their difference. The averages form a coarser signal; the differences capture the detail lost at each scale. With the √2 normalization the transform is orthonormal — a rotation into a wavelet basis — so it preserves energy and is perfectly invertible. Verified live: over 2000 random signals, the inverse Haar reconstructs the input exactly and the sum of squared coefficients equals the sum of squared samples. See the average/difference step in 1D, coefficients in 2D, and the multiscale inverse in 3D.

THE HAAR WAVELET · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · CO-OP · THE BROADCAST ◆ .dlw.fold THE FOLD / CO-OP / THE BROADCAST / THE HAAR WAVELET THE HAAR WAVELET average and difference a signal reversibly 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The Haar wavelet transform is the simplest multiresolution analysis: repeatedly replace pairs of samples by their average and their difference . The averages form a coarser version of the signal; the differences capture the detail lost at each scale. Done with the √2 normalization, the transform is orthonormal — it is a rotation of the signal into a wavelet basis, so it preserves energy and is perfectly invertible . It underlies image compression and edge detection. LIT verified live: over 2000 random signals, the inverse Haar reconstructs the input exactly, and the sum of squared coefficients equals the sum of squared samples (energy preserved) (window.__haar). FIG no framing; exact linear algebra to floating precision. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-broadcast — a signal split into a coarse average everyone hears and the fine differences layered on top, reversible without loss. The Haar transform is that broadcast. AVAN (AI) built the instrument: the recursive average/difference decomposition, the inverse reconstruction, and the perfect-reconstruction + energy-preservation checks. Credit as content: Alfréd Haar (1909) — the first wavelet. The weave: David names the-broadcast; I decompose a signal into averages and details at every scale with the √2-orthonormal Haar step, then confirm the inverse rebuilds it exactly and the total energy is unchanged — a lossless change of basis. 3 ONE DIMENSION Each step: (a,b) → ((a+b)/√2, (a−b)/√2). Averages go left (coarser signal), differences go right (detail). Recurse on the averages. Energy: a²+b² is preserved. 4 TWO DIMENSIONS · INTERACTIVE A signal, its Haar coefficients (coarse + details), and the reconstruction — checked exact, energy checked equal. new signal ▶ verify 2000 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: a signal split into scales, losslessly. AVAN’s addition (the inverse-companion): analyze a signal into coarse average plus fine detail at every scale using only averages and differences — an orthonormal step that loses nothing and can be run backwards. The inverse of ‘store the raw samples’ is ‘store one coarse average and a pyramid of details — perfectly reversible.’ Magenta is the raw sample vector; green is the multiscale wavelet decomposition. Detail, scale by scale, lost by none. pause spin LIT Genuine Haar wavelet transform (Alfréd Haar 1909, the first wavelet). Verified live: over 2000 random signals of length 4–32, the √2-orthonormal recursive average/difference decomposition is perfectly reconstructed by its inverse (window.__haar.reconstructs, worst ~1e-14) and preserves energy — Σ samples² == Σ coefficients² (window.__haar.energyPreserved). FIG No framing: the recursive average/difference decomposition, the inverse reconstruction, and the perfect-reconstruction + energy-preservation checks run in-browser to floating precision and agree. The AVAN inverse is honest — analyzing a signal into a coarse average plus a pyramid of details via an orthonormal step that loses nothing and runs backwards genuinely replaces storing raw samples; magenta is the raw vector, green the multiscale wavelet decomposition. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE BROADCAST · David Lee Wise (ROOT0), with AVAN


THE BELL NUMBERS

The Bell numbers in the 5-window house format — B(n) counts the ways to partition a set of n elements into non-empty unlabeled blocks: 1,1,2,5,15,52,203,877,… Three elements split 5 ways, four split 15. They are built with almost no arithmetic by Bell's triangle (Aitken's array): start each row with the last entry of the previous, then each next is the one to its left plus the one above-left; B(n) is the first number in row n — and equals Σ_k S(n,k), the Stirling numbers of the second kind. Verified live: the triangle matches a brute-force count of set partitions for n≤8, and B(n) equals the Stirling sum. See Bell's triangle in 1D, a row checked in 2D, and the count-without-listing inverse in 3D.

THE BELL NUMBERS · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · BOSS · THE RAID ◆ .dlw.fold THE FOLD / BOSS / THE RAID / THE BELL NUMBERS THE BELL NUMBERS count the ways to partition a set 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The Bell numbers B(n) count the ways to partition a set of n elements into non-empty, unlabeled blocks: 1, 1, 2, 5, 15, 52, 203, 877, … Three elements split 5 ways; four split 15. They can be built with almost no arithmetic by Bell’s triangle (Aitken’s array): start each new row with the last entry of the previous row, then each next entry is the one to its left plus the one above-left. B(n) is the first number in row n — and equals the sum of the Stirling numbers of the second kind Σ k S(n,k). LIT verified live: the Bell triangle matches a brute-force count of set partitions for n ≤ 8, and B(n) equals Σ k S(n,k) (window.__bell). FIG no framing; exact integer counts against exhaustive enumeration. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-raid — count every way to split the party into groups; the Bell numbers tally the raid formations. AVAN (AI) built the instrument: Bell’s triangle recurrence, the brute set-partition enumerator, and the Stirling-sum cross-check. Credit as content: Eric Temple Bell (name); the triangle is A. C. Aitken’s; partitions studied since Euler. The weave: David names the-raid; I build Bell’s triangle by carrying the previous row’s tail down and adding leftward, then confirm each Bell number equals the exhaustive count of set partitions and the sum of Stirling numbers. 3 ONE DIMENSION Bell’s triangle: 1 / 1 2 / 2 3 5 / 5 7 10 15 / … Each row starts with the last of the previous; each next = left + above-left. The row starts 1, 1, 2, 5, 15 are the Bell numbers. 4 TWO DIMENSIONS · INTERACTIVE Bell’s triangle built row by row; B(n) checked against a brute partition count and the Stirling sum. new n ▶ verify n≤8 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: all partitions of a set, counted. AVAN’s addition (the inverse-companion): count set partitions not by listing them all but by a triangle of additions — carry the previous row’s last value down and add leftward, and the Bell numbers fall out along the left edge. The inverse of ‘enumerate every partition and tally’ is ‘grow Bell’s triangle — the count is a running sum.’ Magenta is the full partition enumeration; green is the triangle. Counting the splits without splitting. pause spin LIT Genuine Bell numbers (named for Eric Temple Bell; the triangle is A. C. Aitken's). Verified live: Bell's triangle (row starts with the previous row's tail, each next = left + above-left) gives B(n) matching an exhaustive count of set partitions of n elements for n≤8 (window.__bell.triangleMatchesBrute), and B(n) equals Σ_k Stirling2(n,k) (stirlingSum) — exact integer counts. FIG No framing: Bell's triangle recurrence, the brute set-partition enumerator, and the Stirling-sum cross-check run in-browser with exact integers and agree. The AVAN inverse is honest — counting set partitions by a triangle of additions (carry the tail down, add leftward) genuinely replaces enumerating and tallying every partition; magenta is that enumeration, green the triangle. Counting the splits without splitting. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE RAID · David Lee Wise (ROOT0), with AVAN


THE MEDIAN OF MEDIANS

Median of medians in the 5-window house format — find the k-th smallest element in guaranteed linear time (O(n) worst case). The trick is a provably good pivot: split into groups of five, take each group's median, then recursively take the median of those medians. That pivot beats at least 30% of the elements on each side, so the recursion shrinks fast enough to stay linear — no adversarial input can force it slow. Verified live: over 3000 random arrays, the element selected for rank k equals the true k-th smallest from a full sort. See the groups-of-five pivot in 1D, a selection in 2D, and the certified-pivot inverse in 3D.

THE MEDIAN OF MEDIANS · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · CHEAT · GOD MODE ◆ .dlw.fold THE FOLD / CHEAT / GOD MODE / THE MEDIAN OF MEDIANS THE MEDIAN OF MEDIANS pick the k-th smallest in guaranteed linear time 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Median of medians finds the k-th smallest element in guaranteed linear time — O(n) worst case, not just on average. The trick is choosing a provably good pivot: split the array into groups of five , take each group’s median, then recursively take the median of those medians . That pivot is guaranteed to beat at least 30% of the elements on each side, so the recursion shrinks fast enough to stay linear — no adversarial input can force it to be slow. LIT verified live: over 3000 random arrays, the element it selects for rank k equals the true k-th smallest from a full sort (window.__medianofmedians). FIG no framing; exact selection compared against sorting. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at god-mode — take no damage from bad input: the median-of-medians pivot guarantees linear time no matter how adversarial the array. AVAN (AI) built the instrument: the groups-of-five median pivot, the three-way partition recursion, and the match against a full sort. Credit as content: Blum, Floyd, Pratt, Rivest & Tarjan (1973) — the BFPRT algorithm. The weave: David names god-mode; I pick the pivot as the median of group-of-five medians, partition, recurse into the side holding rank k, and confirm the selected element is exactly the k-th smallest a full sort would give — linear time, worst-case guaranteed. 3 ONE DIMENSION Group into fives, take each median, then the median of those. That pivot beats ≥ 3 of every 5 in half the groups — ≥ 30% overall — guaranteeing the recursion shrinks by a constant fraction. Linear, always. 4 TWO DIMENSIONS · INTERACTIVE An array with its groups of five, the chosen pivot, and the selected k-th element checked against a sort. new array ▶ verify 3000 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the k-th smallest in guaranteed linear time. AVAN’s addition (the inverse-companion): guarantee a good pivot without sorting — take medians of groups of five, then the median of those, so at least 30% falls on each side and the recursion is provably linear. The inverse of ‘sort everything to find the k-th’ is ‘pick a certified-balanced pivot and recurse into one side only.’ Magenta is the full sort; green is the single partition path. Selection that can’t be made slow. pause spin LIT Genuine median-of-medians selection, the BFPRT algorithm (Blum, Floyd, Pratt, Rivest & Tarjan 1973). Verified live: over 3000 random arrays and ranks, the groups-of-five median-of-medians pivot with three-way partition recursion selects exactly the k-th smallest element that a full sort gives (window.__medianofmedians.matchesSort). FIG No framing: the groups-of-five median pivot, the three-way partition recursion, and the match against a full sort run in-browser and agree. The AVAN inverse is honest — guaranteeing a balanced pivot (medians of fives, then their median → ≥30% each side) so selection is provably linear genuinely replaces sorting everything; magenta is the full sort, green the single partition path. Selection that can't be made slow. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of GOD MODE · David Lee Wise (ROOT0), with AVAN