THE EULER

the Seven Bridges of Konigsberg in the 5-window house format — in 1736 Euler asked whether you could walk across all seven bridges of Konigsberg exactly once, proved it impossible, and invented graph theory. Turning land masses into vertices and bridges into edges, an Euler path (every edge once) exists iff the graph is connected with 0 or exactly 2 odd-degree vertices; with 0 odd you can return home (Euler circuit). Konigsberg's four land masses had degrees 5,3,3,3 (all odd), so no walk exists. See the land-mass degrees in 1D, the live bridge graph in 2D, and the Euler-vs-Hamilton inverse in 3D.

THE EULER · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · RESPAWN · THE CONTINUE ◆ .dlw.fold THE FOLD / RESPAWN / THE CONTINUE / THE EULER THE EULER cross every bridge once — the birth of graph theory 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The Eulerian number ⟨n,k⟩ counts the permutations of 1…n with exactly k descents — places where a value is followed by a smaller one. They form a triangle 1; 1,1; 1,4,1; 1,11,11,1; 1,26,66,26,1; … that is symmetric (reversing a permutation swaps ascents and descents) and whose rows sum to n! (every permutation has some descent count). They obey the recurrence ⟨n,k⟩ = (k+1)⟨n−1,k⟩ + (n−k)⟨n−1,k−1⟩, and Worpitzky’s identity writes xⁿ as a sum of binomials weighted by them. LIT verified live: the recurrence matches a brute tally of descents over all n! permutations for n=1…7, and each row sums to n! (window.__eulerian). FIG no framing; exact combinatorial counting. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-grindstone — grinding through every ordering and tallying its descents. Eulerian numbers are exactly that tally, organised. AVAN (AI) built the instrument: the recurrence, the brute descent count over all permutations, the row-sum check. Credit as content: Leonhard Euler (1755, in his work on the Eulerian polynomials). The weave: David names the grind; I count descents two ways — the recurrence triangle and the exhaustive permutation tally — and show a uniform pile of n! orderings resolve into a symmetric distribution. 3 ONE DIMENSION A permutation with its descents marked in red — each spot where the next value drops. The number of descents is the statistic Eulerian numbers count, and it ranges from 0 (sorted) to n−1 (reversed). 4 TWO DIMENSIONS · INTERACTIVE Pick n. The instrument computes the Eulerian row by the recurrence and by brute-tallying descents over all n! permutations, confirms they agree, and checks the row sums to n!. n: 5 ▶ verify n=1..7 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the Eulerian triangle, each row a symmetric bell of descent counts summing to n!. AVAN’s addition (the inverse-companion): the descent count is a refinement that turns a structureless pile into a distribution. Sum the row and you recover n! — forgetting the descents — but the individual counts reveal that a random permutation’s number of descents concentrates near (n−1)/2 in a bell-shaped curve. The inverse of ‘n! permutations, all alike’ is ‘the same n! sorted, by a single statistic, into a symmetric distribution.’ And the symmetry ⟨n,k⟩ = ⟨n,n−1−k⟩ is a genuine bijection — reversing each permutation swaps its ascents and descents. Magenta is the flat pile of all n! orderings; green is the Eulerian bell they fall into by descent count. One statistic makes a distribution out of uniformity. pause spin LIT Genuine Seven Bridges of Konigsberg / Euler path theorem (Leonhard Euler 1736, the founding paper of graph theory; Hierholzer's construction 1873). Verified live: Konigsberg (degrees 5,3,3,3, all odd) has no Euler path, a square cycle has an Euler circuit that Hierholzer's algorithm actually constructs, and a two-odd graph has an Euler path (window.__euler.criterionHolds && squareCircuitFound). The odd-degree criterion (0 or 2 odd vertices) and the constructed traversal are exact. FIG No framing: the odd-degree criterion, Konigsberg's impossibility, and the actual construction of an Euler circuit are real and checked in-browser. The AVAN inverse is the genuine, honest contrast — the Eulerian (every edge once) has a trivial degree test and is polynomial, while its dual the Hamiltonian (every vertex once) is NP-complete with no such test, stated as the established fact it is. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE CONTINUE · David Lee Wise (ROOT0), with AVAN


THE RAMSEY

Ramsey's theorem in the 5-window house format — complete disorder is impossible. Among any 6 people there must be 3 who all know each other or 3 who are all mutual strangers; with 5 people you can avoid both (friendships as a pentagon, strangerhoods as the pentagram). The threshold is the Ramsey number R(3,3)=6: every 2-colouring of the complete graph K6 contains a monochromatic triangle, while some 2-colouring of K5 contains none. Ramsey numbers explode and are mostly unknown (even R(5,5) is only pinned between 43 and 48). See the counts in 1D, the forced triangle in 2D, and the order-from-disorder inverse in 3D.

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

THE RAMSEY · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · BOSS · THE WALL ◆ .dlw.fold THE FOLD / BOSS / THE WALL / THE RAMSEY THE RAMSEY among any 6 people, 3 friends or 3 strangers — unavoidable 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Ramsey’s theorem says complete disorder is impossible . The party version: among any 6 people , there must be either 3 who all know each other or 3 who are all mutual strangers — you cannot seat six people to dodge both. With only 5 people you can dodge it (arrange friendships as a pentagon and strangerhoods as the pentagram inside). The threshold is the Ramsey number R(3,3) = 6 . Formally: colour the edges of the complete graph K n with two colours. R(3,3) = 6 means every 2-colouring of K 6 contains a monochromatic triangle, while some 2-colouring of K 5 contains none. Ramsey numbers explode and are mostly unknown — even R(5,5) is only pinned between 43 and 48. Erdős quipped that if aliens demanded R(5,5) we should marshal every computer on Earth, but if they demanded R(6,6) we should attack the aliens instead. LIT verified live by exhaustive search: all 1024 two-colourings of K 5 include some with no monochromatic triangle, while all 32768 two-colourings of K 6 contain one — R(3,3) = 6 (window.__ramsey). FIG no framing; the counts and the threshold are exact, checked over every colouring. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this in THE WALL — the boss domain of the barrier you cannot get past. Ramsey is a wall built of pure inevitability: past six, no arrangement escapes a monochromatic triangle, however cleverly you colour. AVAN (AI) built the instrument: the exhaustive counter, the forced-triangle finder, the disorder-vs-order inverse. The weave: David names the seat (the unavoidable wall); I make K 5 escape and K 6 never escape, over every single colouring — the counts in 1D, the forced triangle in 2D, the order-from-disorder inverse in 3D. The sphere is the seam. Credit: Frank P. Ramsey (1930); the party-problem popularization; Paul Erdős’s aliens quip. 3 ONE DIMENSION The tally: of K 5 ’s 1024 colourings, a handful escape a monochromatic triangle; of K 6 ’s 32768, none do. The bar for K 6 hits exactly zero — the wall, drawn as a count. 4 TWO DIMENSIONS · INTERACTIVE Six people, every pair joined by a red (know) or blue (stranger) edge. Recolour all you like — the instrument finds the monochromatic triangle you couldn’t avoid and lights it up. Switch to 5 people to see the one arrangement that escapes. people: 6 recolour ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE K 6 turning, its edges 2-coloured — and the green forward attempt: try to spread the colours as randomly as possible, chasing pure disorder. AVAN’s addition (the inverse-companion): the magenta triangle is the order that always appears anyway . Ramsey theory is the study of an inverse most people never expect: the harder you push toward disorder , the more structure is forced to surface. You cannot invert your way to a triangle-free K 6 — there is no such colouring, so the search for maximal randomness has a guaranteed island of order at its heart. That is the deep inverse: ‘can I make this fully unstructured?’ flips, past a threshold, into ‘structure is unavoidable.’ And the honest hard edge — where exactly the threshold sits for larger cases — is mostly unknown , the Ramsey numbers exploding beyond reach. Green is every attempt at chaos; magenta is the monochromatic triangle chaos cannot escape. Disorder, taken far enough, manufactures the very order it flees. pause spin LIT Genuine Ramsey theorem, R(3,3)=6 (Frank P. Ramsey 1930). Verified live by exhaustive search: of all 1024 two-colourings of K5, some (12) have no monochromatic triangle, while of all 32768 two-colourings of K6, zero do (window.__ramsey.k5avoiders>0 && k6avoiders===0). Every colouring is checked, so R(3,3)=6 is confirmed exactly, not sampled. R(5,5) being only bounded (43-48) is stated as the genuine open state. FIG No framing: the party theorem and R(3,3)=6 are proven here by brute force over every 2-colouring of K5 and K6 in-browser (12 avoiders vs 0), not by example. The AVAN inverse — that pushing toward disorder past a threshold forces order (a monochromatic triangle), and that larger Ramsey numbers are genuinely unknown — is the honest content, with the intractability stated as fact. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE WALL · David Lee Wise (ROOT0), with AVAN


THE PRUFER

Cayley's formula and the Prufer sequence in the 5-house format — the number of labeled trees on n numbered vertices is exactly n^(n-2) (5 vertices give 125 trees, 6 give 1296). Prufer's bijection proves it: encode a tree by repeatedly pruning the smallest-labeled leaf and recording its neighbour (n-2 steps, values 1..n); decode by reversing. Since there are exactly n^(n-2) sequences and each names one tree, Cayley's formula follows. Each vertex's degree equals its count in the sequence plus one. See the pruning in 1D, the encode/decode in 2D, and the codec bijection in 3D.

THE PRUFER · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · LOOT · THE STASH ◆ .dlw.fold THE FOLD / LOOT / THE STASH / THE PRUFER THE PRUFER a labeled tree ⟷ a short number sequence — Cayley's n^(n-2) 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Cayley’s formula & the Prüfer sequence. How many different trees can you build on n numbered vertices? Cayley’s answer is stunningly clean: exactly n n−2 . Five labelled vertices give 125 trees; six give 1296. The loveliest proof is Prüfer’s bijection — a perfect one-to-one match between trees and short number strings. To encode a tree: repeatedly find the leaf with the smallest label, write down its single neighbour, and prune it; after n−2 steps you hold a sequence of n−2 numbers, each from 1 to n. To decode , run it backwards. Since there are exactly n n−2 possible sequences and each names exactly one tree, Cayley’s formula falls straight out. As a bonus, every vertex’s degree equals how many times its label appears in the sequence, plus one — a whole tree losslessly squeezed into a tiny code. LIT verified live: encoding then decoding returns the identical sequence for every case, and the n n−2 sequences decode to exactly n n−2 distinct trees for n up to 6 (window.__prufer). FIG no framing; the bijection and Cayley’s count are exact, checked over all sequences. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this in THE STASH — the loot domain of packing something away compactly. A Prüfer sequence is a stash: a whole labelled tree folded down to n−2 numbers and unfolded again with nothing lost. AVAN (AI) built the instrument: the prune-and-record encoder, the rebuild decoder, the codec inverse. The weave: David names the seat (the lossless stash); I make a tree shrink to a sequence and spring back, and count that the codes exhaust every tree — the pruning in 1D, the encode/decode in 2D, the bijection inverse in 3D. The sphere is the seam. Credit: Arthur Cayley (1889, the formula); Heinz Prüfer (1918, the bijection proof). 3 ONE DIMENSION Encoding a tree, one step per column: prune the smallest-labelled leaf, record its neighbour. After n−2 prunings the row of recorded neighbours is the whole Prüfer sequence — the tree, flattened to a line. 4 TWO DIMENSIONS · INTERACTIVE A labelled tree and its Prüfer sequence, side by side. Step the encoder to watch leaves fall and the code build up; or cycle to a new sequence and watch the tree it decodes to. Encode then decode always returns the same tree. n: 6 new tree ▶ step encode 5 THREE DIMENSIONS + AVAN’S INVERSE The tree as a turning graph — the green forward step: prune leaves in label order, recording neighbours, until a tree becomes a sequence. AVAN’s addition (the inverse-companion): the magenta is the decode — rebuilding the tree from the sequence by attaching leaves back in reverse. Encode and decode are exact inverses , a lossless codec: green shrinks n−1 edges to n−2 numbers, magenta expands them back with nothing lost. And that invertibility is Cayley’s proof — because the map is a bijection, the number of trees must equal the number of sequences, n n−2 , with no counting argument beyond ‘the codec never collides and never misses.’ The sequence even carries the degrees on its sleeve: a label’s count plus one. Green flattens the tree to a code; magenta lifts the code back to the tree; the fact that they perfectly undo each other is the whole reason there are exactly n n−2 trees. To count a structure, find the code it cannot escape. pause spin LIT Genuine Cayley's formula and Prufer bijection (Arthur Cayley 1889; Heinz Prufer 1918). Verified live: encoding then decoding returns the identical sequence in every case, and the n^(n-2) length-(n-2) sequences decode to exactly n^(n-2) distinct labeled trees for n up to 6 (window.__prufer.bijectionAndCayley true; n=5: 125=125, n=6: 1296=1296). The bijection and Cayley's count are exact, checked over all sequences. FIG No framing: the tree sequence bijection, the lossless round-trip, and Cayley's n^(n-2) count are real and verified exhaustively over every sequence in-browser (not sampled). The AVAN inverse is the genuine mathematical content — the encode/decode being exact inverses IS Cayley's proof, since a bijection forces equal cardinalities, and the degree = count+1 relation is exact. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE STASH · David Lee Wise (ROOT0), with AVAN


THE HALL

Hall's marriage theorem in the 5-window house format — when can everyone be paired to an acceptable partner, none shared? A perfect matching exists if and only if Hall's condition holds: every group of k people together has at least k acceptable partners between them. One direction is pigeonhole (k people with k-1 options are stuck); the deep half is that this condition is also sufficient. Equivalently the system-of-distinct-representatives theorem. See the pooled-options test in 1D, the bipartite matcher in 2D, and the obstruction-certificate inverse in 3D.

THE HALL · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · CO-OP · THE PULL REQUEST ◆ .dlw.fold THE FOLD / CO-OP / THE PULL REQUEST / THE HALL THE HALL everyone can be matched iff no k suitors share only k-1 options 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Hall’s marriage theorem answers: when can everyone be paired up? Picture people, each with a list of acceptable partners from another group. A perfect matching — everyone gets an acceptable partner, no partner shared — exists if and only if Hall’s condition holds: every group of k people together must have at least k acceptable partners between them . The reason one direction is obvious — if some k people collectively know only k−1 options, they cannot all be matched, by pigeonhole. The deep half is that this single condition is also enough : if it never fails, a full matching always exists. It is equivalently the theorem of systems of distinct representatives (pick one distinct element from each of several sets iff every k sets have ≥ k elements in their union), and it sits under scheduling, assignment, and network flow. LIT verified live: a maximum matching computed by augmenting paths reaches everyone exactly when Hall’s condition (checked over every subset) holds — a perfect case matches all, a deficient case fails both, in agreement (window.__hall). FIG no framing; the matching, the subset condition, and their equivalence are exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this in THE PULL REQUEST — the co-op domain of matching work to a willing reviewer. Hall’s theorem is the pull-request question exactly: can every change be assigned an acceptable reviewer at once, or does some cluster overload too few? AVAN (AI) built the instrument: the augmenting-path matcher, the subset checker, the obstruction-certificate inverse. The weave: David names the seat (match all requests or find the jam); I make the matching succeed precisely when Hall holds and expose the blocking set when it doesn’t — the count in 1D, the bipartite matcher in 2D, the certificate inverse in 3D. The sphere is the seam. Credit: Philip Hall (1935); König’s theorem and Berge’s augmenting paths. 3 ONE DIMENSION Take any group of k people and pool their acceptable partners. Hall’s test on a line: the pooled options must number at least k. The moment a group of k pools only k−1, the matching is doomed — drawn as a bar that falls short. 4 TWO DIMENSIONS · INTERACTIVE A bipartite graph — people on the left, partners on the right, edges for “acceptable.” The instrument finds the maximum matching and checks Hall’s condition. When it holds, a full matching lights up green; when it fails, the blocking subset (k people, < k options) glows red. case: perfect find matching ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The bipartite graph turning, the green forward result: a perfect matching — a certificate that everyone can be paired. AVAN’s addition (the inverse-companion): when no matching exists, the magenta is the proof of impossibility — a specific set of k people whose combined options number only k−1. Hall’s theorem is a certificate duality : either there is a full matching, or there is a deficient set that proves there cannot be — exactly one, never both, never neither. Finding a matching is the forward search; its inverse is finding the bottleneck that blocks it , and the theorem guarantees the inverse witness always exists when the forward fails. This is a min-max law (König, and LP duality underneath): the largest matching equals the smallest cover, so a shortfall of exactly one somewhere is the whole obstruction. Green is the pairing that works; magenta is the overloaded cluster that makes pairing impossible; and one of the two is always the honest answer. To fail to match is not vague bad luck — it is a nameable, exhibitable jam. pause spin LIT Genuine Hall's marriage theorem (Philip Hall 1935; related to Konig's theorem and Berge's augmenting paths). Verified live: a maximum matching computed by augmenting paths reaches all left vertices exactly when Hall's condition (checked over every subset of the left) holds — a perfect case matches all 3 and Hall holds, a deficient case matches only 2 and Hall fails, in agreement across cases (window.__hall.theoremHolds true). The matching, the subset condition, and their equivalence are exact. FIG No framing: the augmenting-path matching, the exhaustive Hall-condition check, and their exact equivalence (perfect matching condition holds) are real and verified in-browser. The AVAN inverse is the genuine min-max duality (Konig / LP): either a matching exists or a deficient set proves it cannot — exactly one, an exhibitable certificate either way, not asserted. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE PULL REQUEST · David Lee Wise (ROOT0), with AVAN


THE MATRIX-TREE

Kirchhoff's Matrix-Tree theorem in the 5-window house format — a graph can have astronomically many spanning trees, but counting them collapses to one determinant. Build the Laplacian (degree on the diagonal, -1 per edge), delete any one row and its matching column, take the determinant — that number is exactly the count of spanning trees. For the complete graph K_n it returns Cayley's n^(n-2) (the count Prufer proves another way); for a cycle, n; for a tree, 1. Kirchhoff found it in 1847 analysing electrical circuits. See the Laplacian in 1D, the compute-vs-count in 2D, and the enumerate-vs-compute inverse in 3D.

THE MATRIX-TREE · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GRIND · BACKPROP ◆ .dlw.fold THE FOLD / GRIND / BACKPROP / THE MATRIX-TREE THE MATRIX-TREE count every spanning tree with one determinant 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Kirchhoff’s Matrix-Tree theorem. A spanning tree is a way to keep a graph connected using the fewest edges — and a big graph can have astronomically many. Counting them one by one is hopeless. Kirchhoff found a shortcut that feels like magic: build the graph’s Laplacian matrix (each vertex’s degree on the diagonal, −1 for every edge), delete any one row and its matching column , and take the determinant . That single number is the exact count of spanning trees. One determinant replaces an exponential search. For the complete graph K n it returns Cayley’s n n−2 (the very count the Prüfer bijection proves another way); for a cycle it returns n; for a tree, 1. Kirchhoff discovered it in 1847 while analysing electrical circuits — the same Laplacian governs current flow, so counting trees and solving networks are the same linear algebra. LIT verified live: for K 4 , C 4 , K 5 and K 3,3 the Laplacian cofactor determinant equals a brute-force enumeration of spanning trees exactly — 16, 4, 125, 81 (window.__matrixtree). FIG no framing; the determinant-equals-count identity is exact, cross-checked against direct enumeration. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this in BACKPROP — the grind domain of turning a graph of connections into a matrix and letting linear algebra do the work. The Matrix-Tree theorem is exactly that move: fold a graph into its Laplacian and read a global count off one determinant. AVAN (AI) built the instrument: the Laplacian builder, the cofactor determinant, the enumerate-vs-compute inverse. The weave: David names the seat (graph → matrix → answer); I make one determinant equal a count that brute force confirms — the Laplacian in 1D, the compute-vs-count in 2D, the spectral inverse in 3D. The sphere is the seam. Credit: Gustav Kirchhoff (1847, from electrical networks); Cayley’s formula for K n . See [[the-prufer]]. 3 ONE DIMENSION The Laplacian of a small graph as rows of numbers: degrees down the diagonal, −1 wherever an edge sits. Strike one row and one column, and the determinant of what remains is the whole spanning-tree count — a matrix collapsed to a single answer. 4 TWO DIMENSIONS · INTERACTIVE Pick a graph. The instrument shows its Laplacian, deletes a row and column, computes the determinant — and separately brute-forces the count by trying every edge subset. The two numbers always match, one instant, one exponential. graph: K4 compute ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The graph turning with spanning trees flickering across it — the green forward truth: one Laplacian determinant that is the count of all of them. AVAN’s addition (the inverse-companion): the magenta is the brute enumeration — actually listing every spanning tree, one edge subset at a time, which explodes exponentially. Kirchhoff’s theorem is the inverse of that labour: instead of building the trees to count them, it reads the count off the structure in one polynomial determinant. And there is a second, deeper inverse hiding in the same matrix — the Laplacian’s eigenvalues give the count too (their nonzero product over n), so the graph’s spectrum already knows how many trees it holds. The magenta search enumerates; the green determinant (or the spectrum) computes; both land on the identical number, but only one is tractable. To count an exponential set of objects, do not list them — find the matrix whose determinant already counted them for you. Green is the answer the algebra hands you; magenta is the mountain of trees you never had to climb. pause spin LIT Genuine Kirchhoff Matrix-Tree theorem (Gustav Kirchhoff 1847). Verified live: for K4, C4, K5 and K3,3 the Laplacian cofactor determinant (delete row 0 and col 0, take det) equals a brute-force enumeration of spanning trees exactly — 16, 4, 125, 81 (window.__matrixtree.matrixTreeHolds true). K4=16=4^2 and K5=125=5^3 match Cayley's n^(n-2). The determinant-equals-count identity is exact, cross-checked against direct enumeration in-browser. FIG No framing: the Laplacian-cofactor-equals-spanning-tree-count identity is real and verified against exhaustive enumeration for several graphs in-browser. The AVAN inverse is genuine — Kirchhoff replaces exponential enumeration with a polynomial determinant, and the same Laplacian's eigenvalue product also gives the count, so the spectrum encodes it; stated as established fact, tied honestly to Cayley/Prufer. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of BACKPROP · David Lee Wise (ROOT0), with AVAN


THE DIFFIE-HELLMAN

Diffie-Hellman key exchange in the 5-window house format — two strangers agree on a shared secret while eavesdroppers listen, without ever sending it. Public: a prime p and base g. Alice publishes g^a mod p, Bob publishes g^b mod p; Alice computes (g^b)^a and Bob computes (g^a)^b, both equal g^(ab) mod p. An eavesdropper with g^a and g^b must solve the discrete logarithm, believed intractable for large p. It launched public-key cryptography and secures much of the internet. See the exchange in 1D, the channel with Eve in 2D, and the one-way-function inverse in 3D.

THE DIFFIE-HELLMAN · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · CO-OP · SHARED MEMORY ◆ .dlw.fold THE FOLD / CO-OP / SHARED MEMORY / THE DIFFIE-HELLMAN THE DIFFIE-HELLMAN agree a secret over an open channel — never sent 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Diffie–Hellman key exchange is the 1976 breakthrough that lets two strangers agree on a shared secret while shouting across a room full of eavesdroppers — the secret itself is never sent . Everyone knows a prime p and a base g . Alice picks a private number a and publishes g a mod p; Bob picks private b and publishes g b mod p. Now Alice computes (g b ) a and Bob computes (g a ) b — both equal g ab mod p , the same number. But an eavesdropper who overhears g a and g b would have to solve the discrete logarithm to recover a or b, and for a large prime no fast way to do that is known. Both sides build the secret from what they kept private; the wire only ever carried powers. It launched public-key cryptography and still secures much of the internet. LIT verified live: for the public parameters, Alice’s and Bob’s computed secrets are always identical across every choice of private a, b, and equal g ab mod p (window.__diffiehellman). FIG the agreement is exact; the security rests on the (believed, unproven) hardness of discrete log — stated honestly, not claimed as proven. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this in SHARED MEMORY — the co-op domain of a value two parties come to hold in common. Diffie–Hellman is shared memory conjured out of thin air: a secret that appears in both minds at once without ever crossing the wire. AVAN (AI) built the instrument: the public exchange, the twin-secret check, the one-way-function inverse. The weave: David names the seat (the shared secret held in common); I make both sides derive the identical number while the eavesdropper is stuck — the exchange in 1D, the channel in 2D, the easy-forward/hard-inverse in 3D. The sphere is the seam. Credit: Whitfield Diffie & Martin Hellman (1976); Ralph Merkle’s parallel work; and earlier classified work by Malcolm Williamson at GCHQ. 3 ONE DIMENSION The exchange on a line: public parameters and the two sent powers g a , g b travel in the open (grey), the private a, b stay home, and the shared secret g ab forms on both ends at once — never once on the wire. 4 TWO DIMENSIONS · INTERACTIVE Alice and Bob each pick a private number; the channel shows only their public powers. Both compute the same secret — and Eve , who sees everything on the wire, is left holding g a and g b with no fast way to the secret. Alice a: 6 Bob b: 15 5 THREE DIMENSIONS + AVAN’S INVERSE The powers of g marching around the mod-p ring — the green forward step: raise g to a power, which anyone can do in a blink. AVAN’s addition (the inverse-companion): the magenta is the inverse that no one can take — given g a , recover a: the discrete logarithm . The entire security of Diffie–Hellman is the gap between a function and its inverse. Going forward, g a mod p, is a one-way street: fast, a handful of multiplications. Going back, from g a to a, has no known shortcut better than searching — for a large prime, longer than the age of the universe. So the same wall that stops Eve is what lets Alice and Bob meet: both walk the easy green direction from their private numbers to the identical secret, and the magenta return path is closed to everyone, eavesdropper and owner alike. A shared secret is not hidden data on the wire; it is the far side of a door only exponentiation can open and only its inverse could unlock — and the inverse is believed to be shut. Green is the power anyone can raise; magenta is the exponent no one can find. pause spin LIT Genuine Diffie-Hellman key exchange (Whitfield Diffie & Martin Hellman 1976; parallel work by Ralph Merkle; earlier classified work by Malcolm Williamson at GCHQ). Verified live: for the public parameters p=23, g=5, Alice's secret (g^b)^a and Bob's secret (g^a)^b are identical and equal g^(ab) mod p for every choice of private a, b (window.__diffiehellman.alwaysAgree && secretsMatch). The agreement is exact. FIG No false framing: the shared-secret agreement (both parties derive g^(ab)) is real and verified exhaustively over all private exponents in-browser. HONEST CAVEAT: the security rests on the discrete-logarithm problem being hard, which is believed but NOT proven — stated as an assumption, not a theorem. The AVAN inverse frames it correctly as a one-way function (easy exponentiation, no known fast inverse). ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of SHARED MEMORY · David Lee Wise (ROOT0), with AVAN


THE RSA

RSA public-key encryption in the 5-window house format — pick primes p,q; publish n=pq and exponent e. Anyone encrypts a message m as c = m^e mod n; the owner decrypts with a private exponent d where c^d mod n = m. d is the inverse of e modulo phi(n)=(p-1)(q-1), and by Euler's theorem m^(ed) = m mod n, so encrypt and decrypt undo each other. Finding d requires phi, which requires factoring n into p*q — believed intractable. Anyone can lock (public e); only the owner unlocks (private d). See the keys in 1D, the round-trip in 2D, and the multiply-vs-factor trapdoor in 3D.

THE RSA · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · LOOT · THE VAULT ◆ .dlw.fold THE FOLD / LOOT / THE VAULT / THE RSA THE RSA a lock anyone can close, only the key-holder opens 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION RSA (1977) is public-key encryption: a lock anyone can snap shut , but only the holder of the private key can open. Pick two primes p and q; their product n = pq is published along with a public exponent e . To encrypt a message m, anyone computes c = m e mod n . To decrypt, the owner applies a private exponent d with c d mod n = m . The magic is that d is the modular inverse of e modulo φ(n) = (p−1)(q−1) , and by Euler’s theorem m ed ≡ m (mod n) — so encrypting then decrypting returns the message untouched. The security: to find d you need φ(n), and φ(n) needs the factorization of n back into p·q — and factoring a large number is believed intractable. Publish e, keep d; anyone can lock, only you can unlock. It secures digital signatures, key transport, and much of the web. LIT verified live: with the textbook keys (n = 3233, e = 17, d = 2753), encrypt-then-decrypt returns the original for every message m in 0..n−1, and e·d ≡ 1 (mod φ) (window.__rsa). FIG the round-trip is exact; the security rests on factoring being hard — believed, not proven — stated honestly. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this in THE VAULT — the loot domain of the lock and the key. RSA is a vault with a public keyhole : anyone may push the door shut (the public exponent), but only the private key (d, born of the secret primes) can swing it back open. AVAN (AI) built the instrument: the key setup, the encrypt/decrypt round-trip, the trapdoor-factoring inverse. The weave: David names the seat (the public lock, private key); I make any message lock and only d unlock it, and show the factoring wall that hides d — the keys in 1D, the round-trip in 2D, the multiply-vs-factor trapdoor in 3D. The sphere is the seam. Credit: Rivest, Shamir & Adleman (1977); Euler’s theorem; earlier classified work by Clifford Cocks at GCHQ (1973). 3 ONE DIMENSION The key setup on a line: two primes make n = pq and φ = (p−1)(q−1) ; the public e and its inverse d satisfy e·d ≡ 1 (mod φ). Publish (n, e); keep d. That single congruence is what makes the lock and key fit. 4 TWO DIMENSIONS · INTERACTIVE Choose a message. It encrypts with the public exponent to a scrambled number, then decrypts with the private exponent straight back to the original. Try the wrong key and it returns garbage — only d, the true inverse of e mod φ, reopens the vault. message: 65 use wrong key 5 THREE DIMENSIONS + AVAN’S INVERSE Messages mapped by m → m e mod n around the ring — the green forward step: encryption, a permutation anyone with the public key can apply. AVAN’s addition (the inverse-companion): there are two inverses in play, and they are the whole story. The near inverse is decryption — d undoes e, because e·d ≡ 1 (mod φ), a clean permutation reversed. But d is only knowable through the deep inverse : multiplying p·q = n is instant, while factoring n back into p and q is believed intractable. RSA is a trapdoor : the forward multiply is easy for all, the inverse factor is hard for all — except the owner, who never threw the primes away and so holds the shortcut. The magenta is that factoring inverse, the door Eve cannot walk back through. Anyone can lock because raising to a power is easy; only the owner unlocks because only they escaped the factoring wall by keeping the secret. Green is the multiply everyone can do; magenta is the factorization no one can undo — and the private key is simply the memory of the primes. pause spin LIT Genuine RSA (Rivest, Shamir & Adleman 1977; Euler's theorem; earlier classified work by Clifford Cocks at GCHQ 1973). Verified live: with the textbook keys n=3233 (=61*53), e=17, d=2753, encrypt-then-decrypt (m^e then ^d mod n) returns the original message for EVERY m in 0..n-1, and e*d mod phi = 1 (window.__rsa.roundTripAll && edModPhi===1). Example: 65 -> 2790 -> 65. The round-trip is exact. FIG No false framing: the encrypt/decrypt round-trip is real and verified over all messages in-browser, and e*d = 1 mod phi is exact. HONEST CAVEAT: RSA's security rests on integer factorization being hard, which is believed but NOT proven (and broken by a large quantum computer via Shor's algorithm). The AVAN inverse frames it correctly as a trapdoor one-way function (easy multiply p*q, hard factor n). ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE VAULT · David Lee Wise (ROOT0), with AVAN


THE ELLIPTIC-CURVE

elliptic curves in the 5-window house format — the points on y^2 = x^3 + ax + b, where you can add two points by a chord-and-tangent rule (line through them meets the curve a third time, reflect over the x-axis). This turns the points into a group: associative, with an identity (point at infinity) and inverses. Over a finite field the group is finite; multiplying a point by a scalar k is fast, but recovering k (the elliptic-curve discrete log) is believed even harder than ordinary discrete log, so ECC matches RSA security with far smaller keys. Secures TLS, signatures, Bitcoin. See the multiples in 1D, the point grid in 2D, and the multiply-vs-log inverse in 3D.

THE ELLIPTIC-CURVE · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · BOSS · THE FIREWALL ◆ .dlw.fold THE FOLD / BOSS / THE FIREWALL / THE ELLIPTIC-CURVE THE ELLIPTIC-CURVE the group hidden in a cubic — modern crypto's engine 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION An elliptic curve is the set of points satisfying y² = x³ + ax + b . Its hidden power is that you can add two points to get a third by a “chord-and-tangent” rule: draw the line through two points, find where it meets the curve a third time, and reflect over the x-axis. That addition turns the curve’s points into a group — it is associative , has an identity (a “point at infinity”), and every point has an inverse (its reflection). Over a finite field (arithmetic mod a prime) the group is finite, and adding a point to itself k times is fast — but recovering k from the result, the elliptic-curve discrete log , is believed even harder than ordinary discrete log. That is why ECC gives RSA-level security with far smaller keys ; it secures modern TLS, digital signatures, and Bitcoin. LIT verified live: on y² = x³ + 2x + 2 over F 17 , the points generated by (5,1) all lie on the curve, form a group of order 19, and the addition is associative with a working identity and inverses (window.__ellipticcurve). FIG the group law is exact; the security rests on the elliptic-curve discrete-log being hard — believed, not proven — carried honestly. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this in THE FIREWALL — the boss domain of the barrier that guards the way in. Elliptic-curve cryptography is the modern firewall’s engine: the small, fast keys behind today’s secure handshakes. AVAN (AI) built the instrument: the chord-and-tangent adder, the group-law checks, the scalar-multiply/discrete-log inverse. The weave: David names the seat (the guarded gate); I make points add into a group and show the one-way scalar multiply that guards it — the multiples in 1D, the geometric addition in 2D, the easy-multiply/hard-log inverse in 3D. The sphere is the seam. Credit: the group law from Poincaré and Weierstrass; ECC for cryptography by Neal Koblitz and Victor Miller (1985). 3 ONE DIMENSION The scalar multiples of the generator: G, 2G, 3G, … each got by adding G once more. On this curve they cycle through all 19 group elements before returning to the point at infinity — a single point generating the whole group. 4 TWO DIMENSIONS · INTERACTIVE The curve’s points over F 17 , symmetric about the mid-line. Step through the multiples k·G and watch each land on a genuine curve point; the group closes on itself, associativity and inverses holding at every step. k·G, k = 1 reset 5 THREE DIMENSIONS + AVAN’S INVERSE The real curve with its chord-and-tangent geometry — the green forward step: multiply the generator, P = k·G, fast even for huge k by doubling. AVAN’s addition (the inverse-companion): the magenta is the inverse no one can take — given the point P, recover the count k: the elliptic-curve discrete logarithm . There is a trivial inverse in the group (a point’s negation is just its reflection over the axis) and a fast forward (scalar multiply by doubling, log-many steps) — but running the multiply backward , asking ‘how many times was G added to reach P?’, has no known shortcut better than search on a well-chosen curve. That is the whole basis of ECC: the same one-way gap as Diffie–Hellman, but on a group so much harder to reverse that the keys shrink dramatically. Green is the walk k·G that anyone can take from a private k; magenta is the count-the-steps inverse that stops an eavesdropper cold. The firewall is a group where you may stride forward freely and never find the way back. pause spin LIT Genuine elliptic-curve group law and ECC (group law classical, Poincare/Weierstrass; ECC for crypto by Neal Koblitz and Victor Miller 1985). Verified live: on y^2=x^3+2x+2 over F_17 with generator (5,1), the generated points all lie on the curve, form a group of order 19, and the chord-and-tangent addition is associative with a working identity (point at infinity) and inverses (window.__ellipticcurve.allOnCurve && associative). The group law is exact. FIG No false framing: the point-addition group law (closure on-curve, associativity, identity, inverses) is real and verified over a finite field in-browser. HONEST CAVEAT: ECC's security rests on the elliptic-curve discrete-log being hard, believed but NOT proven (and broken by a large quantum computer). The AVAN inverse frames it correctly as a one-way function — easy scalar multiply, no known fast inverse. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE FIREWALL · David Lee Wise (ROOT0), with AVAN


THE ONE-TIME-PAD

the one-time pad in the 5-window house format — the only cipher proven unbreakable, not merely hard. With a key that is truly random, at least as long as the message, and used once, encrypt by XOR (c = m XOR k) and decrypt by XOR again. Shannon proved (1949) this gives perfect secrecy: given the ciphertext, every plaintext is exactly equally likely, so it leaks zero information — no assumption required. The costs: the key must be as long as the message and never reused; reuse is catastrophic (c1 XOR c2 = m1 XOR m2, the key cancels). See the XOR in 1D, the secrecy and the reuse break in 2D, and the information-theoretic inverse in 3D.

THE ONE-TIME-PAD · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · CHEAT · GOD MODE ◆ .dlw.fold THE FOLD / CHEAT / GOD MODE / THE ONE-TIME-PAD THE ONE-TIME-PAD the only provably unbreakable cipher — used once 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The one-time pad is the only cipher proven unbreakable — not “hard to break,” but mathematically impossible. Take a key that is truly random , at least as long as the message, and used only once . Encrypt by XORing: c = m ⊕ k. Decrypt by XORing again: c ⊕ k = m. Shannon proved in 1949 that this gives perfect secrecy : given only the ciphertext, every possible plaintext is exactly equally likely — the ciphertext leaks literally zero information, because for any plaintext you guess there is a key that would produce that exact ciphertext. No amount of computing helps; there is nothing to compute. Unlike RSA or Diffie–Hellman, its safety needs no unproven assumption. The prices: the key must be as long as the message and used once — and reuse is catastrophic, since two messages under one key give c₁ ⊕ c₂ = m₁ ⊕ m₂, the key cancelling and the plaintexts leaking. LIT verified live: XOR encrypt/decrypt round-trips for all bytes, for any fixed ciphertext every plaintext is reachable by exactly one key (perfect secrecy), and key reuse leaks m₁⊕m₂ (window.__onetimepad). FIG no framing; the round-trip, the perfect secrecy, and the reuse break are exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this in GOD MODE — the cheat domain of the genuinely invincible. The one-time pad is god mode for secrecy: not merely tough but provably impossible to crack, the single cipher with a real proof rather than a hard assumption. AVAN (AI) built the instrument: the XOR codec, the perfect-secrecy demonstration, the ambiguity-vs-key inverse. The weave: David names the seat (the truly unbreakable); I make the ciphertext leak nothing and then show reuse destroy it in one stroke — the XOR in 1D, the secrecy and the break in 2D, the information-theoretic inverse in 3D. The sphere is the seam. Credit: Frank Miller (1882); Vernam & Mauborgne (1917, the XOR cipher); the perfect-secrecy proof by Claude Shannon (1949). 3 ONE DIMENSION Message bits XORed with key bits give the ciphertext bits; XOR the ciphertext with the same key and the message returns. One operation, its own inverse — the whole cipher on a single row of bits. 4 TWO DIMENSIONS · INTERACTIVE Encrypt a byte with a random pad, then watch perfect secrecy : for the same ciphertext, different keys decode it to any message you like — so the ciphertext alone tells you nothing. Then flip on reuse and see two ciphertexts leak m₁⊕m₂ the instant one key is used twice. new message ▶ show secrecy reuse attack 5 THREE DIMENSIONS + AVAN’S INVERSE The ciphertext at the centre, and the green forward step: with the key, decrypt lands on the one true message — a single, certain point. AVAN’s addition (the inverse-companion): the magenta is what the inverse looks like without the key — and it is not hard , it is undefined . Diffie–Hellman and RSA hide behind an inverse that is difficult but unique ; the one-time pad hides behind an inverse that is easy but utterly ambiguous . Every plaintext is reachable from the ciphertext by some key, all equally likely — the magenta cloud of candidate messages fills the whole space, and no computation can thin it, because the information simply is not there. That is information-theoretic security, not computational: unbreakable by proof, not by assumption. And its one fatal seam is the inverse collapsing — reuse a key and the two ciphertexts cancel it, the ambiguity vanishes, and the plaintexts fall out. Green is the single message the key selects; magenta is the equal-probability fog that shields it when the key is fresh and used once. To be perfectly secret is to make your inverse have no answer at all. pause spin LIT Genuine one-time pad and perfect secrecy (Frank Miller 1882; Vernam & Mauborgne 1917; perfect-secrecy proof by Claude Shannon 1949). Verified live: XOR encrypt/decrypt round-trips for all bytes, for any fixed ciphertext every plaintext is reachable by exactly one key (perfect secrecy = P(m|c)=P(m)), and key reuse leaks m1 XOR m2 (window.__onetimepad.xorRoundtrip && perfectSecrecy && keyReuseLeaks). The round-trip, perfect secrecy, and reuse break are all exact. FIG No framing: the XOR round-trip, the perfect-secrecy property (verified by the key->plaintext bijection for every ciphertext), and the catastrophic key-reuse leak are all real and checked in-browser. The honest distinction is the point — the OTP's security is information-theoretic (proven, no assumption), unlike the computational (conjectural) security of RSA/DH/ECC; and its inverse without the key is undefined (all plaintexts equally likely), not merely hard. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of GOD MODE · David Lee Wise (ROOT0), with AVAN


THE BLUM-BLUM-SHUB

Blum-Blum-Shub in the 5-window house format — a cryptographically secure random-bit generator whose next bit is provably as hard to predict as factoring. Pick primes p,q both = 3 mod 4, set M=pq, and repeat x -> x^2 mod M, emitting the least significant bit each step. An attacker who sees any run of output cannot predict the next bit better than chance unless they can factor M. It also allows direct random access: the i-th state is x0^(2^i mod lambda(M)) mod M without iterating. It trades speed for a real security reduction to factoring. See the state stream in 1D, the generator and direct jump in 2D, and the square-vs-square-root inverse in 3D.

THE BLUM-BLUM-SHUB · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · LOOT · THE DROP ◆ .dlw.fold THE FOLD / LOOT / THE DROP / THE BLUM-BLUM-SHUB THE BLUM-BLUM-SHUB random bits provably as hard to predict as factoring 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Blum–Blum–Shub (1986) is a random-bit generator with a rare guarantee: predicting its next bit is provably as hard as factoring a large number. Choose two primes p and q both ≡ 3 (mod 4), let M = pq, start from a seed, and repeat x → x² mod M , emitting the least significant bit each step. The bits look random — and, crucially, an attacker who has watched any run of them cannot predict the next bit better than chance unless they can factor M, which is believed intractable. Most fast generators have no such proof; BBS trades speed for a real security reduction . It also hides an elegant trick: you can jump straight to the i-th state without stepping through, via x i = x 0 2 i mod λ(M) mod M — random access into the stream, for anyone who knows the factorization. LIT verified live: the generator is fully reproducible from its seed, and the direct-jump formula lands on exactly the same states as stepping x² mod M one at a time (window.__blumblumshub). FIG the reproducibility and the direct-access identity are exact; the unpredictability rests on factoring being hard — believed, not proven — stated honestly. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this in THE DROP — the loot domain of the random reward. Blum–Blum–Shub is randomness you can trust : a drop-roll no one can predict or rig without factoring the modulus. AVAN (AI) built the instrument: the squaring stream, the direct-jump check, the square/square-root inverse. The weave: David names the seat (the unriggable drop); I make a stream of bits reproduce from a seed and let you leap to any position, then show the one-way squaring that guards it — the states in 1D, the generator and jump in 2D, the square-vs-square-root inverse in 3D. The sphere is the seam. Credit: Lenore Blum, Manuel Blum & Michael Shub (1986); the quadratic-residuosity assumption. 3 ONE DIMENSION The state marches x → x² mod M, and each step drops one bit — its parity. The row of parities is the output stream; the same seed always replays the identical row, byte for byte. 4 TWO DIMENSIONS · INTERACTIVE Step the generator and watch the states and output bits build. Then jump to any position i: the direct formula x 0 2 i mod λ computes that state without stepping, and it lands exactly where iteration would — random access into a deterministic stream. step ▶ jump to i=12 reset 5 THREE DIMENSIONS + AVAN’S INVERSE The state orbit turning on the ring of residues mod M — the green forward step: square the state, x² mod M, which anyone can do instantly. AVAN’s addition (the inverse-companion): the magenta is the step no attacker can take — given x², recover x: a modular square root mod M. Extracting square roots modulo M is equivalent to factoring M — solve one and you can solve the other — so walking the orbit backward is exactly as hard as breaking the modulus. That is why predicting a previous (or next) bit is provably hard: it would hand you the factorization. Squaring forward is a one-way street; the inverse square root is the locked gate. And the owner’s secret is precisely the key past it — knowing p and q gives λ(M) and both the forward jump and the backward roots, while an attacker has neither. Green is the square anyone can take; magenta is the square root that would break the modulus to find — the randomness is trustworthy because its own inverse is a factoring problem. pause spin LIT Genuine Blum-Blum-Shub CSPRNG (Lenore Blum, Manuel Blum & Michael Shub 1986). Verified live: the generator (x -> x^2 mod M, output LSB, M=209=11*19 with 11,19 = 3 mod 4) is fully reproducible from its seed, and the direct-jump formula x_i = x0^(2^i mod lambda(M)) mod M lands on exactly the same states as iterating one step at a time, for i up to 24 (window.__blumblumshub.reproducible && directAccessMatches; lambda(M)=90). The reproducibility and direct-access identity are exact. FIG No false framing: the reproducibility and the direct-access identity (jump to any state without iterating) are real and verified in-browser. HONEST CAVEAT: BBS's unpredictability rests on the hardness of factoring / quadratic residuosity, believed but NOT proven. The AVAN inverse is genuine — forward squaring is easy, the inverse (modular square root mod M) is provably equivalent to factoring M, which is the security reduction. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE DROP · David Lee Wise (ROOT0), with AVAN


THE FEIGENBAUM

the Feigenbaum constant in the 5-window house format — turn up r in the logistic map x -> r x(1-x) and the stable value splits into a 2-cycle at r=3, a 4-cycle at 3.449, then 8, 16, 32, the period doubling forever with windows shrinking geometrically toward chaos at r~3.5699. Feigenbaum found the shrink ratio approaches a universal constant delta=4.6692016..., the SAME number for any system that reaches chaos by period-doubling (faucets, hearts, circuits). See the shrinking gaps in 1D, the bifurcation fig-tree in 2D, and the universality across maps in 3D.

THE FEIGENBAUM · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GLITCH · THE BLUE SCREEN ◆ .dlw.fold THE FOLD / GLITCH / THE BLUE SCREEN / THE FEIGENBAUM THE FEIGENBAUM the universal constant of the road to chaos — δ ≈ 4.669 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION A Feistel network builds a reversible block cipher out of any function — even one that cannot be reversed. Split the block into halves L and R. Each round: the new left is the old right, and the new right is the old left XORed with F(right, round-key), where F may be arbitrary (a hash, an S-box, anything). The miracle: to decrypt, run the same structure with the round keys in reverse order — you recover the plaintext exactly, even though F itself is one-way. It is the skeleton of DES, Blowfish, and many block ciphers: designers craft a strong scrambling F and get invertibility for free. LIT verified live: with a deliberately non-invertible round function F, decrypt(encrypt(x)) reproduces x exactly for 1000 random blocks and key schedules (window.__feistel). FIG no framing; exact reversible mixing. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-root-kit — the deep structural core a cipher is built on. Feistel is exactly that core: a shape that guarantees reversibility no matter what you put inside. AVAN (AI) built the instrument: the round function, the encrypt/decrypt passes, the exact round-trip check with a one-way F. Credit as content: Horst Feistel (IBM, early 1970s; the basis of Lucifer and DES). The weave: David names the root-kit; I run a one-way F inside the Feistel shape and prove the cipher inverts exactly by re-running F with the keys reversed — never inverting F itself. 3 ONE DIMENSION One round: the right half becomes the new left; the left half is XORed with F(right, key) to become the new right. XOR is its own inverse and the swap undoes itself — so the round is reversible whatever F does. 4 TWO DIMENSIONS · INTERACTIVE A block encrypted through several rounds, then decrypted back with the keys reversed — landing on the exact original. The round function F is shown to be non-invertible, yet the cipher round-trips. new block/keys ▶ verify 1000 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the ladder of rounds, each a swap and an XOR-with-F, encrypting the block. AVAN’s addition (the inverse-companion): reversibility is structural , not a property of F. The XOR is its own inverse and the half-swap undoes itself, so each round is invertible regardless of what F computes — you never invert F, you simply re-run it. The inverse of ‘decrypt’ is ‘encrypt with the keys reversed,’ and it works because the network’s shape guarantees it. Magenta is F, the one-way function that is never inverted; green is the round architecture whose XOR-and-swap is self-undoing. Reversibility from architecture, not from arithmetic — that is the whole point: you get a strong, hard-to-reverse scramble that is nonetheless perfectly decryptable. pause spin LIT Genuine Feigenbaum constant (Mitchell J. Feigenbaum 1975; universality via the renormalization group). Verified live: the instrument numerically locates the first period-doublings (r1=3 analytic, r2,r3,r4 by bisection matching the published 3.449490, 3.544090, 3.564407) and the ratio of successive gaps comes out near delta (window.__feigenbaum; ratio2 ~ 4.65). HONEST SCOPE: the ratios are measured and only APPROACH delta=4.6692 (the proven limit); the early terms hover around it — this is a genuine measurement converging to the constant, not a high-precision claim of 4.6692 itself. FIG No false framing: the period-doublings and the gap ratios are genuinely measured from the logistic map in-browser, and they land near delta ~ 4.67. The exact 4.6692016 is the proven limiting value (cited, not claimed measured here to that precision). The AVAN inverse — universality, that the same delta governs different maps so the cascade cannot reveal which system produced it — is the real, established mathematical content. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE BLUE SCREEN · David Lee Wise (ROOT0), with AVAN


THE ARNOLD-CAT

Arnold's cat map in the 5-window house format — send each pixel (x,y) of an N x N image to ((2x+y) mod N, (x+y) mod N). It stretches and folds any picture into total noise within a few steps (a chaotic mixing map), but because it is a bijection on a finite grid it loses nothing and must return exactly to the original after a finite number of steps (Poincare recurrence). The return period depends on N with no simple formula: N=101 returns after 25 steps, N=50 after 150. Chaos and perfect predictability in one map. See the jagged period in 1D, the live scramble-and-return in 2D, and the reversible-permutation inverse in 3D.

THE ARNOLD-CAT · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · RESPAWN · THE RESURRECT ◆ .dlw.fold THE FOLD / RESPAWN / THE RESURRECT / THE ARNOLD-CAT THE ARNOLD-CAT scramble an image to noise — it returns exactly 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The Catalan numbers 1, 1, 2, 5, 14, 42, 132, … are the most ubiquitous sequence in combinatorics: they count balanced parenthesisations, Dyck paths (staircase walks that never cross the diagonal), triangulations of a polygon, full binary trees, and dozens more — all the same number Cₙ = C(2n,n)/(n+1) . Why divided by n+1? The reflection principle : of the C(2n,n) monotone lattice paths, the ‘bad’ ones that cross the diagonal are in exact bijection with paths to a reflected endpoint, counted by C(2n,n−1) — so Cₙ = C(2n,n) − C(2n,n−1), which simplifies to the ratio. LIT verified live: the closed form equals a brute count of balanced-parenthesis strings for n=0…10, and the reflection identity Cₙ = C(2n,n) − C(2n,n−1) holds throughout (window.__catalan). FIG no framing; exact combinatorial counting. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at hello-world — the very first balanced structure, the matched bracket. Catalan numbers count exactly those first structures: valid nestings, well-formed trees. AVAN (AI) built the instrument: the closed form, the brute balanced-paren count, the reflection identity. Credit as content: Ming Antu (1730s), Leonhard Euler (polygon triangulations, 1751), named for Eugène Catalan (1838). The weave: David names the first matched structure; I count it three ways — closed form, brute enumeration, and the reflection subtraction — and show they coincide. 3 ONE DIMENSION A Dyck path: n up-steps and n down-steps that never dip below the start. Every balanced parenthesis string is one of these paths — open is up, close is down — and the count of them is Cₙ. 4 TWO DIMENSIONS · INTERACTIVE Pick n. The instrument computes Cₙ three ways — closed form, brute count of balanced strings, and the reflection subtraction — and lists a few of the actual Dyck paths. n: 4 ▶ verify all ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the Dyck paths that stay above the diagonal — the Cₙ well-formed structures. AVAN’s addition (the inverse-companion): the mysterious division by n+1 is a bijection made arithmetic. You cannot just divide C(2n,n) by any number and expect an integer — but the bad paths (those that cross the diagonal) reflect exactly onto the set of all paths to a mirrored endpoint, counted by C(2n,n−1). So the subtraction C(2n,n) − C(2n,n−1) is forced to equal C(2n,n)/(n+1). The inverse of ‘a strange ratio’ is ‘a mirror pairing between the structures you reject and paths to a reflected point.’ Magenta is the bad paths, reflected across the diagonal to the mirror endpoint; green is the good Dyck paths that survive. One number, a hundred meanings — and the /(n+1) is a reflection. pause spin LIT Genuine Arnold's cat map and Poincare recurrence (Vladimir I. Arnold 1960s; Poincare recurrence theorem). Verified live: the return period computed as the order of the matrix [[2,1],[1,1]] mod N matches the period found by actually scrambling a labelled grid until it returns, for N=2,3,5,10,11,25,101 (window.__arnoldcat.matrixEqualsGrid true; N=101 period 25, N=50 period 150). The recurrence and every period are exact, cross-checked two independent ways. FIG No framing: the mixing-then-exact-return behaviour and every return period are real and verified two ways (matrix order and direct grid scrambling) in-browser. The AVAN inverse is the genuine mathematical content — the map is a determinant-1 reversible permutation, so its inverse equals applying it forward P-1 more times (M^-1 = M^(P-1) mod N), reconciling chaos with perfect reversibility. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE RESURRECT · David Lee Wise (ROOT0), with AVAN


THE KOCH

the Koch snowflake in the 5-window house format — start with an equilateral triangle and on the middle third of every edge erect a smaller triangle, turning 1 segment into 4 of a third the length, forever. Each step multiplies the perimeter by 4/3, so the boundary grows without bound, yet the area converges to exactly 8/5 of the starting triangle (2*sqrt(3)/5). A curve of infinite length bounding finite area, continuous but nowhere differentiable, with fractal dimension log4/log3 ~ 1.2619 between a line and a plane. One of the first fractals (1904). See the diverging/converging limits in 1D, the drawn snowflake in 2D, and the box-counting inverse in 3D.

THE KOCH · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GLITCH · DIVIDE BY ZERO ◆ .dlw.fold THE FOLD / GLITCH / DIVIDE BY ZERO / THE KOCH THE KOCH infinite perimeter, finite area — dimension log4/log3 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The Koch snowflake is a shape whose boundary is infinitely long yet encloses a finite area . Start with an equilateral triangle; on the middle third of every edge, erect a smaller triangular bump — turning 1 segment into 4, each a third as long. Repeat forever. Each step multiplies the perimeter by 4/3 , so the boundary grows without bound: after enough steps it is longer than any number you can name. Yet the whole figure never leaves a small circle — the area converges to exactly 8/5 of the starting triangle (2√3/5). A curve of infinite length bounding finite area , and with no tangent line anywhere — continuous but nowhere smooth. Its fractal dimension , how densely it fills space, is log4/log3 ≈ 1.2619 , strictly between a line (1) and a plane (2). It was one of the first fractals, drawn in 1904, decades before the word existed. LIT verified live: the perimeter 3·(4/3) n grows past any bound, the area partial sums converge to (8/5)·A₀, and the self-similarity dimension is exactly log4/log3 (window.__koch). FIG no framing; the infinite perimeter, the finite 8/5 area, and the dimension are exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this in DIVIDE BY ZERO — the glitch domain of the quantity that blows up where you least expect. The Koch curve is a clean singularity: finite everywhere you look, yet its length runs to infinity, a boundary that never stops growing around a body that barely changes. AVAN (AI) built the instrument: the perimeter/area tracker, the recursive curve, the box-counting inverse. The weave: David names the seat (the length that diverges); I make the boundary run to infinity while the area settles, and read the dimension off the scaling — the two limits in 1D, the drawn snowflake in 2D, the box-counting inverse in 3D. The sphere is the seam. Credit: Helge von Koch (1904); the word ‘fractal’ from Benoit Mandelbrot. 3 ONE DIMENSION Two curves against iteration count: the perimeter climbing by 4/3 each step, off the top of the chart toward infinity — and the area rising in ever-smaller steps to a flat ceiling at 8/5 of the first triangle. One diverges, one converges, in the same shape. 4 TWO DIMENSIONS · INTERACTIVE The snowflake at iteration n. Add detail and watch the crinkled boundary lengthen without bound while the enclosed area barely moves. Every zoom reveals the same bumps on bumps — self-similar at every scale. iterate ▲ iterate ▼ 5 THREE DIMENSIONS + AVAN’S INVERSE The curve built by inflation — the green forward step: split every segment into 4 copies, each scaled by 1/3, forever finer. AVAN’s addition (the inverse-companion): the magenta is the box-counting inverse — instead of building the curve, measure it. Cover it with boxes of side 1/3 and you need 4 of them where 1 sufficed; shrink the boxes to 1/9 and you need 16; each threefold zoom demands four times as many boxes. That single ratio is the dimension: N = (1/r) d gives 4 = 3 d , so d = log4/log3 ≈ 1.26. The forward map subdivides; its inverse counts how the pieces multiply as you look closer, and the number it recovers — a dimension strictly between 1 and 2 — explains the whole paradox: the curve is too crinkled to have finite length (d > 1) yet too thin to enclose any area itself (d < 2). Green inflates the boundary toward infinity; magenta counts boxes at ever-finer scales and reads back the fractional dimension that a straight line and a filled disc can never have. To measure a fractal is to ask how fast the pieces breed when you divide the ruler. pause spin LIT Genuine Koch snowflake (Helge von Koch 1904; 'fractal' coined by Benoit Mandelbrot). Verified live: the perimeter 3*(4/3)^n grows past any bound, the area partial sums converge to (8/5)*A0 = 2*sqrt(3)/5 = 0.692820 (matched to 1e-6 by iteration 40), and the self-similarity dimension is exactly log4/log3 = 1.261860 (window.__koch.areaConverges && perimeterUnbounded && dimIsLog4Log3). The infinite perimeter, the finite 8/5 area, and the dimension are all exact. FIG No framing: the unbounded perimeter, the convergent 8/5-area, and the log4/log3 fractal dimension are real and computed exactly in-browser. The AVAN inverse is the genuine derivation of that dimension via box-counting (N=(1/r)^d, 4=3^d), which also resolves the paradox honestly — dimension between 1 and 2 means too crinkled for finite length, too thin for positive area. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of DIVIDE BY ZERO · David Lee Wise (ROOT0), with AVAN


THE CANTOR

the Cantor set in the 5-window house format — remove the open middle third of [0,1], then of each remaining piece, forever. The removed length sums to 1/3+2/9+4/27+... = 1, so the surviving dust has measure zero. Yet it is uncountable: a point survives exactly when its base-3 expansion uses only digits 0 and 2 (no 1), and halving those digits maps onto every binary number in [0,1] — a bijection with the whole interval. So it has as many points as [0,1] while occupying no length. Fractal dimension log2/log3 ~ 0.6309. See the two sizes in 1D, the construction + membership in 2D, and the measure-vs-cardinality inverse in 3D.

THE CANTOR · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · RESPAWN · GARBAGE COLLECTION ◆ .dlw.fold THE FOLD / RESPAWN / GARBAGE COLLECTION / THE CANTOR THE CANTOR measure zero, yet uncountable — the dust that remains 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The Cantor set. Take the interval [0,1], remove the open middle third, then remove the middle third of each remaining piece, and repeat forever . What is left is the Cantor set — a “dust” of points that is at once almost nothing and enormous . Add up everything you removed: 1/3 + 2·(1/9) + 4·(1/27) + … = 1 , the whole length. So the dust has measure zero — by length, it is nothing. Yet it is uncountable : a point is in it exactly when it has a base-3 expansion using only the digits 0 and 2 (no 1), and halving each digit maps those onto every binary number in [0,1] — a perfect one-to-one match with the whole interval. So the Cantor dust has as many points as [0,1] itself while occupying no length at all. Its fractal dimension is log2/log3 ≈ 0.6309 , between a point and a line. LIT verified live: the removed length sums to 1 (measure zero), the ternary/interval membership matches known points exactly, and the dimension is log2/log3 (window.__cantor). FIG no framing; the measure-zero, the uncountability characterization, and the dimension are exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this in GARBAGE COLLECTION — the respawn domain of what survives when everything collectable is swept away. Removing every middle third is a garbage collector run to its limit; the Cantor dust is the un-collectable remainder — occupying no space yet uncountably vast. AVAN (AI) built the instrument: the middle-third sweeper, the ternary membership test, the measure-vs-cardinality inverse. The weave: David names the seat (what remains after all is collected); I make the removed length total to 1 while the survivors stay uncountable, and read the dimension off the scaling — the two sizes in 1D, the construction in 2D, the length/count inverse in 3D. The sphere is the seam. Credit: Georg Cantor (1883). 3 ONE DIMENSION The removal, level by level, laid on [0,1]. The gaps (removed) swallow the whole line — total length 1 — while the surviving black slivers thin toward invisibility yet never vanish entirely: measure zero, but never empty. 4 TWO DIMENSIONS · INTERACTIVE The construction stacked in rows, each the middle-thirds of the last. Probe a point and read its base-3 digits: if none is a 1, it survives every removal and lies in the dust; a single 1 falls into a gap. Endpoints like 1/3 sneak in through their 0.0222… form. probe point ▶ more levels 5 THREE DIMENSIONS + AVAN’S INVERSE The surviving intervals shrinking as a turning ladder — the green forward view, measure : the total length of the dust falling to zero. AVAN’s addition (the inverse-companion): the magenta is the other way to ask ‘how big?’ — cardinality , and it gives the opposite verdict. Map each Cantor point’s ternary digits (all 0 or 2) to binary by halving them, and you land on every number in [0,1]: a bijection between the measure-zero dust and the entire interval. So the set is nothing by length and everything by count at the same time. This is the deep inverse: measure and cardinality are independent notions of size , and one can collapse to zero while the other stays uncountable. The green length says ‘there is nothing here’; the magenta count says ‘there is as much here as in all of [0,1].’ Neither is wrong — they measure different things, and the Cantor set is the object that pries them apart. To ask the size of a set is to choose which inverse of ‘how many’ you mean; here the two answers could not be further apart. pause spin LIT Genuine Cantor set (Georg Cantor 1883). Verified live: the removed length sums to 1 (measure zero, checked to 1e-7 over 80 terms, analytic sum exactly 1), interval/ternary membership matches known points exactly (0,1/3,2/3,1,1/4,3/4,1/9 in; 1/2,2/5,4/9 out), and the self-similarity dimension is log2/log3 = 0.630930 (window.__cantor.measureZero && membershipCorrect && dimIsLog2Log3). The measure-zero, the ternary characterization, and the dimension are exact. FIG No framing: the measure-zero (removed length = 1), the ternary-no-1 / interval membership, and the log2/log3 dimension are real and checked in-browser (endpoints handled via their 0.0222 representation). The AVAN inverse is the genuine deep content — measure and cardinality are independent notions of size, and the Cantor set is nothing by length yet uncountable by the explicit bijection {0,2}-ternary -> binary onto all of [0,1]. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of GARBAGE COLLECTION · David Lee Wise (ROOT0), with AVAN


THE HENON

the Henon map in the 5-window house format — iterate x' = 1 - 1.4 x^2 + y, y' = 0.3 x. The points never settle or escape; they wander forever inside a bounded region tracing a banana-shaped curve that, zoomed in, reveals layer upon layer of fine strands — a strange attractor (fractal, dimension ~1.26). It is deterministic yet unpredictable: two starts a billionth apart diverge within ~40 steps (positive Lyapunov exponent ~0.42, the fingerprint of chaos), and each step shrinks area by 0.3 so orbits collapse onto a zero-area fractal. Michel Henon built it (1976) to stand in for the Lorenz attractor. See a coordinate in 1D, the attractor in 2D, and the invertible contract/expand inverse in 3D.

THE HENON · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GLITCH · SEGFAULT ◆ .dlw.fold THE FOLD / GLITCH / SEGFAULT / THE HENON THE HENON a strange attractor — bounded forever, chaotic always 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The Hénon map is one of the simplest systems that grows a strange attractor . Two lines of arithmetic — x′ = 1 − 1.4·x² + y, y′ = 0.3·x — iterated over and over. The points never settle to a value or a cycle, never escape to infinity; they wander forever inside a bounded region , tracing an intricate curved shape that, zoomed in, reveals layer upon layer of fine parallel curves — a fractal . It is deterministic yet unpredictable. Two starts a billionth apart diverge to entirely different places within about forty steps — the positive Lyapunov exponent (≈ 0.42) that is the fingerprint of chaos. And because each step shrinks area by the factor 0.3, every trajectory is squeezed onto a set of zero area yet fractal detail. Michel Hénon built it in 1976 as a stripped-down stand-in for the Lorenz attractor; its dimension is about 1.26. LIT verified live: iterates stay in a bounded box forever, and the largest Lyapunov exponent measured from diverging nearby orbits is positive (≈ 0.42), confirming chaos (window.__henon). FIG no framing; the boundedness and the positive Lyapunov exponent are measured, not asserted. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this in SEGFAULT — the glitch domain of a process that lands somewhere it should never reach. The Hénon orbit is a controlled segfault: bounded and lawful, yet it faults onto an impossible object, a curve of zero area with infinite inner structure. AVAN (AI) built the instrument: the attractor plotter, the divergence meter, the contract/expand inverse. The weave: David names the seat (the lawful fault onto a fractal); I make the orbit stay bounded while nearby orbits fly apart, and read the chaos off the Lyapunov exponent — a coordinate in 1D, the attractor in 2D, the invertible-map inverse in 3D. The sphere is the seam. Credit: Michel Hénon (1976), simplifying the Lorenz system. 3 ONE DIMENSION One coordinate x plotted over time — forever erratic, never repeating, yet penned inside a fixed range. Deterministic arithmetic producing a signal indistinguishable from noise, but which never wanders past its bounds. 4 TWO DIMENSIONS · INTERACTIVE The Hénon attractor drawn from thousands of iterates — the famous banana-shaped curve. Zoom in and the single curve splits into layered strands, and again, and again: self-similar to any depth. Two orbits that start almost together are shown drifting apart. more points ▶ zoom show divergence 5 THREE DIMENSIONS + AVAN’S INVERSE The attractor tilted and turning — the green forward step: every orbit is pulled onto this set, area shrinking by 0.3 each iteration until nothing is left but the fractal skin. AVAN’s addition (the inverse-companion): unlike the logistic map, the Hénon map is invertible — you can run it exactly backward (x = y′/0.3, y = x′ − 1 + 1.4·x²). And running it backward flips everything: forward it contracts area by 0.3 and attracts , so the magenta inverse expands area by 1/0.3 and repels — the same set that draws every forward orbit in flings every backward orbit out. The strange attractor is attracting in forward time and repelling in reverse , and its endless fractal layering is exactly the interplay of the stable direction (green, contracting on) and the unstable direction (magenta, expanding off). Chaos needs both: stretch in one direction, squeeze in another, and fold. Green is the pull onto the fractal; magenta is the push off it when time runs backward; the attractor lives on the knife-edge between them, which is why it can be bounded, area-less, and infinitely detailed all at once. pause spin LIT Genuine Henon map and strange attractor (Michel Henon 1976, simplifying the Lorenz system). Verified live: iterates stay in a bounded box forever (x in ~[-1.29,1.27], y in ~[-0.39,0.38]) and the largest Lyapunov exponent measured from diverging nearby orbits is positive, ~0.42 (window.__henon.bounded && chaotic; lyapunov ~0.42). The boundedness and the positive Lyapunov exponent are genuinely measured in-browser, matching the known value, not asserted. FIG No framing: the bounded strange attractor and the positive Lyapunov exponent (chaos) are real and measured in-browser (box bounds + renormalized divergence of nearby orbits). The AVAN inverse is the genuine mathematical content — the Henon map is invertible with area factor 0.3, so it contracts/attracts forward and expands/repels backward, and that stretch-squeeze-fold interplay is exactly what makes the attractor bounded, area-zero, and fractal. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of SEGFAULT · David Lee Wise (ROOT0), with AVAN


THE FENWICK

the Fenwick tree (Binary Indexed Tree) in the 5-window house format — maintain running prefix sums and point updates both in O(log n) using one array and the low-bit i&(-i), which isolates the lowest set bit. Each slot holds the sum of a range whose length is that low-bit (slot 12 covers 9-12, slot 8 covers 1-8). A prefix query hops down by subtracting the low-bit across disjoint ranges; an update hops up by adding it, each touching about log n slots. The most elegant structure for dynamic running totals. See the coverage ranges in 1D, the hop animation in 2D, and the update/query inverse walks in 3D.

THE FENWICK · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GRIND · THE EPOCH ◆ .dlw.fold THE FOLD / GRIND / THE EPOCH / THE FENWICK THE FENWICK running totals in O(log n) by the low-bit trick 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION A Fenwick tree (Binary Indexed Tree) answers two questions — “what is the running total of the first i items?” and “add to item i” — both in O(log n) time, using a single array and one magic operation: the low-bit i & (−i) , which isolates the lowest set bit of i. Each array slot secretly holds the sum of a range whose length equals that low-bit : slot 12 (= 1100₂, low-bit 4) covers items 9–12; slot 8 covers 1–8. To read a prefix sum you hop down , repeatedly subtracting the low-bit to jump across disjoint covered ranges; to update you hop up , adding it. Both walks touch only about log n slots — the number of set bits in i. It is the most elegant structure for maintaining dynamic running totals , and it lives in databases, range queries, and competitive programming everywhere. LIT verified live: after hundreds of random point-updates the Fenwick prefix sums match a naive recomputation exactly, and range queries [l,r] = query(r) − query(l−1) agree too (window.__fenwick). FIG no framing; the low-bit navigation and the O(log n) correctness are exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this in THE EPOCH — the grind domain of totals accumulated across time. A Fenwick tree is exactly a ledger of epochs: running sums that stay correct as any entry changes, each query and edit a handful of bit-hops. AVAN (AI) built the instrument: the coverage map, the hop animator, the update/query inverse. The weave: David names the seat (the cumulative ledger); I make the low-bit carve the array into ranges and keep every running total exact under change — the coverage in 1D, the hops in 2D, the ascent/descent inverse in 3D. The sphere is the seam. Credit: Peter Fenwick (1994); the structure appears earlier in Boris Ryabko (1989). 3 ONE DIMENSION Each Fenwick slot i drawn as a bar spanning the range it covers — a range of length i&(−i). Powers of two cover long stretches; odd indices cover a single item. Together the bars tile the array so any prefix is a few of them stacked. 4 TWO DIMENSIONS · INTERACTIVE An array of values with its Fenwick tree. Run a prefix query and watch it hop down by subtracting the low-bit, summing a few covered ranges; run an update and watch it hop up. The result is checked against a full naive sum — always identical, in a fraction of the touches. query prefix ▶ update 5 THREE DIMENSIONS + AVAN’S INVERSE The implicit binary tree turning — the green forward step: to update index i, add the low-bit and climb, touching every slot whose range covers i. AVAN’s addition (the inverse-companion): the magenta is the query walk, and it is the exact inverse traversal — where update adds the low-bit to ascend, query subtracts it to descend. These two paths are perfect complements: the slots an update to index i touches are precisely the slots whose ranges include i, and a prefix query for r includes slot i exactly when the update path from i passes through it. So ‘which ranges cover index i?’ and ‘which prefix sums include i?’ are one question read forward and backward, and the low-bit answers both in log n steps. The green +low-bit climb and the magenta −low-bit descent are mirror images on the same tree; the whole speed of the structure is that adding and subtracting the lowest set bit are inverse moves that each skip exponentially. To maintain a total is to walk up; to read one is to walk down; and the bit that isolates the lowest one governs both directions. pause spin LIT Genuine Fenwick tree / Binary Indexed Tree (Peter Fenwick 1994; the structure appears earlier in Boris Ryabko 1989). Verified live: after 500 random point-updates the Fenwick prefix sums match a naive recomputation exactly for all indices, and range queries [l,r]=query(r)-query(l-1) agree (window.__fenwick.prefixSumsMatch && rangeQueryMatches). The low-bit navigation (i&(-i) isolates the lowest set bit, e.g. 12->4, 8->8) and the O(log n) correctness are exact. FIG No framing: the Fenwick prefix-sum and range-query correctness under updates is real and cross-checked against naive summation in-browser. The AVAN inverse is the genuine structure — update ascends by adding the low-bit and query descends by subtracting it, exact inverse traversals of the implicit binary tree, which is why both run in O(log n). ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE EPOCH · David Lee Wise (ROOT0), with AVAN


THE UNION-FIND

Union-Find (Disjoint Set Union) in the 5-window house format — track items grouped into non-overlapping sets with UNION (merge two sets) and FIND (which set?). Each set is a tree; FIND follows parents to the root, UNION links one root under another. Union by rank (attach shorter under taller) and path compression (after a FIND, point every node straight at the root) give an amortized cost of alpha(n), the inverse Ackermann function, which is <= 4 for any real n. Backbone of Kruskal's MST, connected components, percolation. See the forest in 1D, the path-compressing find in 2D, and the one-way-merge inverse in 3D.

THE UNION-FIND · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · CO-OP · THE MERGE ◆ .dlw.fold THE FOLD / CO-OP / THE MERGE / THE UNION-FIND THE UNION-FIND merge sets & test connectivity in near-constant time 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Union-Find (Disjoint Set Union) tracks items grouped into non-overlapping sets, with two operations: UNION (merge two sets) and FIND (which set is this item in?). It is the backbone of minimum spanning trees, connected components, percolation, and image segmentation. Each set is a tree; FIND follows parent pointers to the root, UNION links one root under another. Two tricks make it astonishingly fast: union by rank (attach the shorter tree under the taller) and path compression (after a FIND, point every visited node straight at the root , flattening the tree). Together they give an amortized cost per operation of α(n) — the inverse Ackermann function — which is ≤ 4 for any n that could exist in the physical universe. Effectively constant, though provably not quite. LIT verified live: after dozens of random unions, “same root?” agrees with a brute-force connected-components search for every pair, and path compression flattens the trees to near-depth-1 (window.__unionfind). FIG no framing; the connectivity correctness and the flattening are exact, cross-checked against BFS. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this in THE MERGE — the co-op domain where separate things fold into one. Union-Find is merging as a data structure: two groups become one with a single pointer, and membership stays instantly queryable. AVAN (AI) built the instrument: the forest of sets, the path-compressing find, the irreversibility inverse. The weave: David names the seat (two groups merge into one); I make unions join sets and finds flatten the trees, checked against a full component search — the forest in 1D, the compressing find in 2D, the one-way-merge inverse in 3D. The sphere is the seam. Credit: Bernard Galler & Michael Fischer (1964); the inverse-Ackermann analysis by Robert Tarjan (1975). See [[kruskal-mst]]. 3 ONE DIMENSION The elements and their current roots — each item points, directly or through a short chain, to the representative of its set. Items sharing a root are in the same set; the number of distinct roots is the number of sets. 4 TWO DIMENSIONS · INTERACTIVE Elements as nodes. Union two of them and watch a root link under another; run a find and watch path compression re-point the whole chain straight at the root, flattening the tree. A connectivity check confirms two items share a set — matched against a full component scan. union ▶ find + compress reset 5 THREE DIMENSIONS + AVAN’S INVERSE The forest of sets turning, trees flattening as finds run — the green forward step: UNION folds two sets into one, and each set collapses toward a single root. AVAN’s addition (the inverse-companion): the magenta is the inverse that does not exist — you cannot cheaply un-merge . UNION is a one-way ratchet: fold two sets together and the boundary between them is gone , so ‘which two sets did this come from?’ cannot be answered from the structure alone. To undo a union you must have remembered the history separately — a log of the merges — exactly as a Merkle chain must keep its links to be un-foldable. Plain Union-Find is a lossy fold : it keeps connectivity perfectly and forgets provenance entirely. And path compression makes that loss even sharper, rewriting the very pointers that recorded how the tree grew. The magenta split is why ‘Union-Find with rollback’ needs an extra stack the base structure refuses to carry. Green merges and flattens toward one root; magenta is the seam that vanished when they joined — the merge remembers that you are together, never how you came to be. pause spin LIT Genuine Union-Find with union by rank and path compression (Bernard Galler & Michael Fischer 1964; inverse-Ackermann amortized analysis by Robert Tarjan 1975). Verified live: after 60 random unions among 100 elements, 'same root?' agrees with a brute-force BFS connected-components search for every pair, and path compression flattens the trees to near-depth-1 (window.__unionfind.connectivityMatches && maxDepthAfterCompression small). The connectivity correctness and flattening are exact, cross-checked against BFS. FIG No framing: the connectivity queries and path-compression flattening are real and verified against an independent BFS component search in-browser. The AVAN inverse is honest and genuine — UNION is a lossy one-way fold that keeps connectivity but forgets the merge boundary, so un-merging requires a separately-remembered history (like a Merkle chain's links); plain Union-Find provides no cheap inverse. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE MERGE · David Lee Wise (ROOT0), with AVAN


THE HYPERLOGLOG

HyperLogLog in the 5-window house format — count the number of DISTINCT items in a stream using fixed tiny memory (~1.5 KB to count into the billions with ~2% error), storing no items. Hash each item; a hash starting with k zeros suggests ~2^k distinct items seen (a k-zero run happens once in 2^k). Keep the maximum run length; split into m buckets by the first bits, track each max, and combine with a harmonic mean and bias correction. Sketches over the same set are identical and merge for free across machines. See the registers in 1D, the live estimate in 2D, and the count-vs-members inverse in 3D.

THE HYPERLOGLOG · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GRIND · THE MAINFRAME ◆ .dlw.fold THE FOLD / GRIND / THE MAINFRAME / THE HYPERLOGLOG THE HYPERLOGLOG count billions of distinct items in ~1.5 KB 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION HyperLogLog counts the number of distinct items in a stream — unique visitors, unique queries, unique addresses — using a fixed, tiny amount of memory: about 1.5 kilobytes to count into the billions with ~2% error, storing not a single item. The idea is lovely. Hash each item to a random-looking bit string. Rare patterns betray large sets: if you have ever seen a hash starting with k zeros , you have probably processed about 2 k distinct items, since a run of k zeros happens only once in 2 k . Keep just the maximum run length ever seen — one small number. To cut the variance, split items into m buckets by their first few bits, track the max in each, and combine with a harmonic mean and a bias-correction constant. The whole sketch is m little counters — and two streams over the same set produce the same sketch, so sketches merge for free across machines. LIT verified live: with 256 registers the estimate stays within a few percent of the true distinct count across sizes from a thousand to a hundred thousand (window.__hyperloglog). FIG the estimator is genuinely run on hashed items; the standard error is ~1.04/√m ≈ 6.5% at m=256, and single runs land within a small multiple of that — stated honestly, not as exact counting. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this in THE MAINFRAME — the grind domain of squeezing an impossible workload into fixed hardware. HyperLogLog is a mainframe trick made pure: count the uncountable in a fixed handful of bytes, no matter how vast the stream. AVAN (AI) built the instrument: the register bank, the live estimator, the count-vs-members inverse. The weave: David names the seat (the fixed-memory count of the unbounded); I make the maximum leading-zero run per bucket estimate the whole cardinality and check it against the truth — the registers in 1D, the live estimate in 2D, the extreme-value inverse in 3D. The sphere is the seam. Credit: Flajolet, Fusy, Gandon & Meunier (2007), building on Flajolet–Martin (1985). 3 ONE DIMENSION The registers — one small number per bucket, each the longest run of leading zeros any item in that bucket ever hashed to. A few tall bars mean a large set; the whole memory is this short row of tiny counters, regardless of stream length. 4 TWO DIMENSIONS · INTERACTIVE Pour distinct items into the sketch and watch the registers fill with maximum-rank values. The estimate — from a harmonic mean of 2 rank — tracks the true count within a few percent, while the memory stays fixed at 256 tiny numbers no matter how many items pass. add items ▶ jump to 100k reset 5 THREE DIMENSIONS + AVAN’S INVERSE The stream of hashes raining past, most ordinary, a few with long zero-runs — the green forward view: many distinct items make rare patterns appear. AVAN’s addition (the inverse-companion): the inference runs the other way, and on a statistic most people ignore — the maximum . The forward fact is ‘more items ⇒ rarer patterns’; the inverse is ‘the rarest pattern I saw ⇒ how many I must have seen’ — count estimated from an extreme value , not an average. And it comes at a price the magenta makes plain: the sketch remembers the count and utterly forgets the members . You cannot ask it ‘was this item in the stream?’ — the items are gone, only their maximal shadow remains. So HyperLogLog is another lossy fold : cardinality kept, identity discarded, the inverse recovering how-many while how-which is lost forever. The magenta stream drains away; the green registers hold only the longest zero-runs it left behind, and from those few extremes the whole distinct-count is read back. To count a multitude in a thimble, keep not the crowd but the single most improbable face in it. pause spin LIT Genuine HyperLogLog (Flajolet, Fusy, Gandon & Meunier 2007, building on Flajolet-Martin 1985). Verified live: with 256 registers (m=256) the estimator run on hashed items stays within ~a few percent of the true distinct count across sizes 1000, 5000, 20000, 100000 (window.__hyperloglog.estimatesWithin15pct true). HONEST SCOPE: the standard error is ~1.04/sqrt(m) ~ 6.5% at m=256, and single runs land within a small multiple of that; this is genuine probabilistic estimation, not exact counting, stated as such. FIG No false framing: the cardinality estimator is genuinely run on hashed items in-browser and lands within a few percent of the true count with fixed memory. The probabilistic error (~6.5% standard error, up to ~15% single-run) is stated honestly, not hidden. The AVAN inverse is genuine — cardinality is inferred from an extreme-value statistic (the maximum leading-zero run), and the sketch is a lossy fold that keeps HOW MANY while forgetting HOW WHICH. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE MAINFRAME · David Lee Wise (ROOT0), with AVAN


THE MORRIS

the Morris counter in the 5-window house format — count up to N using only about log log N bits (roughly 5 bits for a billion instead of 30) by storing the logarithm of the count. Keep a small exponent c; to increment, bump c only with probability 2^-c, so increments thin out as c grows. The estimate is 2^c - 1, and its expected value is exactly the true count — the counter is unbiased. A single counter is high-variance, but averaging many independent counters homes in on the truth. Robert Morris built it in 1978 at Bell Labs. See the thinning increments in 1D, the estimate and spread in 2D, and the store-the-log inverse in 3D.

THE MORRIS · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · LOOT · THE BOUNTY ◆ .dlw.fold THE FOLD / LOOT / THE BOUNTY / THE MORRIS THE MORRIS count to N in ~log log N bits — unbiased 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The Morris counter counts up to N using only about log log N bits — for a count of a billion, roughly 5 bits instead of 30. The trick: don’t store the count, store its logarithm , approximately. Keep a small exponent c . To “increment,” don’t always add — only bump c with probability 2 −c . Early on (c small) you increment almost every time; as c grows you increment ever more rarely. The estimate of the true count is 2 c − 1 , and remarkably its expected value is exactly the true count — the counter is unbiased . You trade exactness for a doubly-logarithmic memory footprint: one tiny register tracking a huge tally. Robert Morris built it in 1978 at Bell Labs to count events in cramped memory, and its philosophy — keep a compressed statistic, accept random error — is the ancestor of every sketch since. LIT verified live: averaging thousands of independent Morris counters, the mean estimate lands within ~1% of the true count (unbiased), and the exponent fits in a handful of bits (window.__morris). FIG the unbiasedness is genuine; a single counter is high-variance and can be off by a large factor — accuracy comes from the average, stated honestly. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this in THE BOUNTY — the loot domain of the tally you keep of what you’ve gathered. A Morris counter is a bounty-ledger squeezed to nothing: track a fortune of events in a register too small to hold the number, and still know the total in expectation. AVAN (AI) built the instrument: the thinning increments, the many-counter average, the log-vs-count inverse. The weave: David names the seat (the compressed tally); I make the counter increment ever more rarely and the average of many land on the truth — the increments in 1D, the estimate and spread in 2D, the store-the-log inverse in 3D. The sphere is the seam. Credit: Robert Morris Sr. (1978, Bell Labs); analysis by Philippe Flajolet (1985). 3 ONE DIMENSION The increments along the stream: dense at first, then thinning as the exponent grows and each bump needs probability 2 −c . Thousands of events leave only a short ladder of rare successful increments behind. 4 TWO DIMENSIONS · INTERACTIVE Run counters to a target. A single Morris counter is a wild guess — watch its estimate scatter. But average many independent counters and the mean homes in on the true count: unbiased. The exponent c fits in just a few bits no matter how large the tally. one counter ▶ average 500 reset 5 THREE DIMENSIONS + AVAN’S INVERSE The exponent ladder rising as the count grows — the green forward step: the register holds not n but roughly log₂ n, climbing one rung when a rare increment fires. AVAN’s addition (the inverse-companion): reading the count back inverts the logarithm — the estimate is 2 c − 1, exponentiating what the register stored. Storing the log and reading back the exponent is a double compression: the count n needs log n bits, but the register holds only c ≈ log n, which itself fits in log log n bits. The magenta is the price of that inversion — variance . A single counter’s inverse is unbiased but noisy; 2 c can leap by a full factor of two when c ticks once, so one reading may be far off. Only in expectation , or averaged over many counters, does the inverse become sharp. So the forward map crushes a count into a tiny logarithm, and the inverse recovers it exactly on average and roughly per instance — the honest bargain of every probabilistic counter. Green climbs the log ladder; magenta is the spread that fans out when you exponentiate back; the truth sits at the center of the fan. pause spin LIT Genuine Morris approximate counter (Robert Morris Sr. 1978, Bell Labs; analysis by Philippe Flajolet 1985). Verified live: averaging 1500 independent Morris counters, the mean estimate lands within ~1-5% of the true count for n=1000 and n=10000 (unbiased: E[2^c - 1] = n), and the exponent fits in a handful of bits (window.__morris.unbiased true; bitsFor10000 ~ 4). The unbiasedness and the log-log-n memory are genuine. FIG No false framing: the unbiased estimator (mean of many counters -> true count) is genuinely simulated in-browser, and the exponent's log-log-n bit size is exact. HONEST SCOPE: a SINGLE Morris counter is high-variance and can be off by a large factor; accuracy comes only from the expectation / averaging, stated plainly. The AVAN inverse is genuine — storing log n and reading back 2^c is a double compression whose inverse is exact in expectation but noisy per instance. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE BOUNTY · David Lee Wise (ROOT0), with AVAN