THE GAUSS-SEIDEL

Gauss-Seidel in the 5-window house format — solve Ax=b iteratively by sweeping the variables, setting each from the current best estimate of the others, and using each fresh value IMMEDIATELY within the same sweep (unlike Jacobi); for a diagonally-dominant system this relaxation converges to the exact solution, faster than Jacobi. It is a staple for large sparse systems and the basis of multigrid smoothers. Verified live: over 200 random diagonally-dominant systems Gauss-Seidel converges to a direct Gaussian solve to ~1e-15. See a sweep in 1D, the residual shrinking in 2D, and the relax-with-immediate-feedback inverse in 3D.

THE GAUSS-SEIDEL · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · SPAWN · THE TOOLCHAIN ◆ .dlw.fold THE FOLD / SPAWN / THE TOOLCHAIN / THE GAUSS-SEIDEL THE GAUSS-SEIDEL iterative linear solve with immediate feedback 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Gauss–Seidel solves a linear system Ax = b iteratively : sweep the variables, and set each one from the current best estimate of the others — crucially using each fresh value immediately within the same sweep (unlike Jacobi, which waits for the next sweep). For a diagonally-dominant system this relaxation converges to the exact solution, and information propagates faster than Jacobi’s. It is a staple for large sparse systems and the basis of multigrid smoothers. LIT verified live: over 200 random diagonally-dominant systems Gauss–Seidel converges to a direct Gaussian solve to ~10⁻¹⁵ (window.__gaussseidel). FIG no framing; exact solution in the limit. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-toolchain — the iterative solver in the numerical toolchain, relaxing toward the answer with immediate feedback, beside the Householder and Cholesky. AVAN (AI) built the instrument: the in-place variable sweep, the direct-solve cross-check, the diagonally-dominant setup. Credit as content: Carl Friedrich Gauss and Philipp von Seidel (19th c.). The weave: David names the toolchain; I relax each variable using the freshest estimates of the others and confirm the iteration converges to the exact solution. 3 ONE DIMENSION One sweep updates x₁, then x₂ using the new x₁, then x₃ using the new x₁,x₂… Each variable is relaxed to satisfy its own equation given the current others — feedback within the sweep. 4 TWO DIMENSIONS · INTERACTIVE A diagonally-dominant system; Gauss–Seidel’s iterate converges to the direct solution, the residual shrinking each sweep. sweep ▶ new system ▶ verify 200 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the iterate relaxing to the exact solution. AVAN’s addition (the inverse-companion): sweep the variables, updating each from the current best estimate of the others — and use each fresh value immediately within the same sweep (unlike Jacobi), so information propagates faster; for a diagonally-dominant system this converges to the exact solution. The inverse of ‘solve all equations simultaneously (elimination)’ is ‘relax one variable at a time, reusing updates as you go.’ Magenta is the direct factorisation avoided; green is the sweeping relaxation. Iterative refinement with immediate feedback. (Kin to the-conjugate-gradient.) pause spin LIT Genuine Gauss-Seidel iteration (Gauss; Seidel, 19th c.). Verified live: for 200 random diagonally-dominant systems the in-place variable sweep converges (200 iterations) to a direct Gaussian-elimination solution to max difference ~1e-15 (window.__gaussseidel.convergesToDirect). FIG No framing: the in-place variable sweep, the residual, and the direct-solve cross-check run in-browser and converge to ~1e-15. The AVAN inverse is honest — relaxing each variable using the freshest estimates of the others (immediate feedback, unlike Jacobi) converges to the exact solution for diagonally-dominant systems; magenta is the direct factorization avoided, green the sweeping relaxation. Kin to the-conjugate-gradient. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE TOOLCHAIN · David Lee Wise (ROOT0), with AVAN


THE DELANNOY

the Delannoy numbers in the 5-window house format — D(m,n) counts lattice paths from (0,0) to (m,n) using east (1,0), north (0,1), and the diagonal (1,1) (a king's moves); that extra diagonal makes the recurrence D(m,n)=D(m-1,n)+D(m,n-1)+D(m-1,n-1), Pascal-like with a third term. The central values D(n,n) are 1,3,13,63,321,1683,... Verified live: the recurrence equals a brute enumeration of all king-paths for m,n<=5, and the central Delannoy numbers match the known sequence. See the three predecessors in 1D, the Delannoy grid in 2D, and the three-predecessors inverse in 3D.

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

THE DELANNOY · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · CO-OP · THE HANDOFF ◆ .dlw.fold THE FOLD / CO-OP / THE HANDOFF / THE DELANNOY THE DELANNOY king-path counting — Pascal with a third, diagonal term 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The Delannoy numbers D(m,n) count the lattice paths from (0,0) to (m,n) using three step types: east (1,0), north (0,1), and the diagonal (1,1) — a king’s moves. That extra diagonal step is the whole story: D(m,n) = D(m−1,n) + D(m,n−1) + D(m−1,n−1), a Pascal-like recurrence with a third term. The central values D(n,n) are 1, 3, 13, 63, 321, 1683, … LIT verified live: the recurrence equals a brute enumeration of all king-paths for m,n ≤ 5, and the central Delannoy numbers match the known sequence (window.__delannoy). FIG no framing; exact combinatorics. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-handoff — each cell’s count is handed up from its three predecessors, corner to corner across the grid. The Delannoy recurrence is that chain of handoffs. AVAN (AI) built the instrument: the three-term recurrence table, the brute king-path enumeration, the central-sequence check. Credit as content: Henri Delannoy (1895). The weave: David names the handoff; I build each count from its west, south, and diagonal neighbours and confirm it equals an exhaustive path count. 3 ONE DIMENSION A path reaches (m,n) from one of three neighbours: west (an east step), south (a north step), or the diagonal (a diagonal step). So its count is the sum of those three predecessors’ counts. 4 TWO DIMENSIONS · INTERACTIVE The Delannoy grid; each cell shows D(m,n), the diagonal on the main axis giving the central Delannoy numbers, all checked against brute path counts. grid ▶ verify ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: each cell’s count summed from its three predecessors. AVAN’s addition (the inverse-companion): a path to (m,n) arrives from one of three neighbours — west, south, or the diagonal — so D(m,n) = D(m−1,n) + D(m,n−1) + D(m−1,n−1); the count builds from three smaller counts, no enumeration. The inverse of ‘list every path’ is ‘each cell’s count is the sum of its three predecessors.’ Magenta is the exponentially-many paths never listed; green is the triangular recurrence. The diagonal step is the third term that distinguishes Delannoy from Pascal. pause spin LIT Genuine Delannoy numbers (Delannoy 1895). Verified live: the three-term recurrence D(m,n)=D(m-1,n)+D(m,n-1)+D(m-1,n-1) equals a brute enumeration of all (east/north/diagonal) king-paths for m,n FIG No framing: the three-term recurrence table, the brute king-path enumeration, and the central-sequence check run in-browser and agree exactly. The AVAN inverse is honest — a path to (m,n) arrives from its west, south, or diagonal neighbor, so each count is the sum of three predecessors, no enumeration; magenta is the exponentially-many paths never listed, green the recurrence. The diagonal step is the third term distinguishing Delannoy from Pascal. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE HANDOFF · David Lee Wise (ROOT0), with AVAN


THE GJK

the GJK algorithm in the 5-window house format — decide whether two convex shapes overlap by a reframing: they intersect iff the ORIGIN lies inside their Minkowski difference A-B; it never builds that difference, probing it with a support function and evolving a tiny simplex (point->edge->triangle) toward the origin, deciding in a few steps. It is the collision engine of physics and robotics libraries. Verified live: over 500 random convex-polygon pairs GJK's collide/separate verdict matches an independent overlap oracle (vertex inside the other, or crossing edges) every time. See a support probe in 1D, a collide/separate verdict in 2D, and the origin-in-the-Minkowski-difference inverse in 3D.

THE GJK · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · BOSS · THE GATEKEEPER ◆ .dlw.fold THE FOLD / BOSS / THE GATEKEEPER / THE GJK THE GJK convex collision by asking if the origin is in A minus B 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The GJK algorithm (Gilbert–Johnson–Keerthi) decides whether two convex shapes overlap by a clever reframing: they intersect if and only if the origin lies inside their Minkowski difference A⊖B. It never builds that difference — it probes it with a support function and evolves a tiny simplex (point → edge → triangle) toward the origin, deciding in a handful of steps. It is the collision engine of physics libraries and robotics. LIT verified live: over 500 random convex-polygon pairs GJK’s collide/separate verdict matches an independent overlap oracle (a vertex inside the other, or crossing edges) every time (window.__gjk). FIG no framing; exact for convex shapes. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-gatekeeper — the hitbox test that decides contact, the gate between touching and apart, beside the separating-axis theorem. GJK is the other gatekeeper. AVAN (AI) built the instrument: the support function on the Minkowski difference, the simplex evolution toward the origin, the independent overlap oracle. Credit as content: Gilbert, Johnson & Keerthi (1988). The weave: David names the gatekeeper; I march a simplex toward the origin inside the Minkowski difference and confirm the collision verdict against a direct overlap check. 3 ONE DIMENSION The support function returns the point of the Minkowski difference furthest in a chosen direction. Aiming supports toward the origin and keeping the closest simplex, GJK closes in on whether the origin is enclosed. 4 TWO DIMENSIONS · INTERACTIVE Two convex polygons; GJK’s collide/separate verdict is shown and checked against a direct overlap oracle. new pair ▶ verify 500 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the simplex marching toward the origin in the Minkowski difference. AVAN’s addition (the inverse-companion): two convex shapes overlap iff the origin lies inside their Minkowski difference A⊖B — and you never build that difference; you probe it with a support function and evolve a tiny simplex (point→edge→triangle) toward the origin. The inverse of ‘intersect the two shapes’ is ‘ask whether one point (the origin) is inside one derived shape, probed by supports.’ Magenta is the Minkowski difference never constructed; green is the simplex marching to the origin. Collision reduced to a single point-in-set question. (Kin to the-separating-axis.) pause spin LIT Genuine GJK algorithm (Gilbert, Johnson & Keerthi 1988). Verified live: GJK's collide/separate verdict (support-function simplex evolution on the Minkowski difference) matches an independent overlap oracle (vertex-in-polygon or crossing-edges) for 500 random convex-polygon pairs (window.__gjk.matchesOracle). FIG No framing: the support function on the Minkowski difference, the simplex evolution toward the origin, and the independent overlap oracle run in-browser and agree exactly for convex shapes. The AVAN inverse is honest — two convex shapes overlap iff the origin is inside A-B, probed by supports and a marching simplex without ever building the difference; magenta is the Minkowski difference never constructed, green the simplex. Kin to the-separating-axis. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE GATEKEEPER · David Lee Wise (ROOT0), with AVAN


THE PUSH-RELABEL

the push-relabel algorithm in the 5-window house format — compute maximum flow by a local rule with no augmenting paths: maintain a preflow (nodes may hold excess) and a height label per node; push flow only downhill across an admissible edge (h[u]=h[v]+1), and relabel (lift) a stuck node with excess so it can drain; the excess settles at the sink and equals the minimum cut. It is often the fastest max-flow method in practice. Verified live: over 60 random capacitated graphs push-relabel's max flow equals the brute-force minimum s-t cut. See downhill pushes in 1D, flow vs min cut in 2D, and the flow-downhill-by-height inverse in 3D.

THE PUSH-RELABEL · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · BOSS · THE CHOKE POINT ◆ .dlw.fold THE FOLD / BOSS / THE CHOKE POINT / THE PUSH-RELABEL THE PUSH-RELABEL max flow by pushing excess downhill by height 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The push–relabel algorithm computes maximum flow by a completely local rule — no augmenting paths. It maintains a preflow (nodes may hold excess) and a height label on each node; flow is only ever pushed downhill across an admissible edge (height u = height v + 1), and a stuck node with excess is relabeled (lifted) so it can drain. The excess settles at the sink, and the result equals the minimum cut. It is often the fastest max-flow method in practice. LIT verified live: over 60 random capacitated graphs push–relabel’s max flow equals the brute-force minimum s–t cut (window.__pushrelabel). FIG no framing; exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-choke-point — the maximum you can push equals the tightest cut, found here by letting excess flow downhill until it settles. Push–relabel is that local drain. AVAN (AI) built the instrument: the preflow initialisation, the push/relabel operations on the residual graph, the brute min-cut cross-check. Credit as content: Andrew Goldberg & Robert Tarjan (1988). The weave: David names the choke-point; I push local excess down the height gradient and lift stuck nodes, and confirm the settled flow equals the minimum cut. (Kin to dinic and ford-fulkerson.) 3 ONE DIMENSION Flow moves only from a higher node to a lower one (height u = height v + 1). A node holding excess with nowhere lower to push is relabeled — lifted just above its lowest neighbour so it can drain. 4 TWO DIMENSIONS · INTERACTIVE A capacitated network; push–relabel’s max flow is shown against the brute-force minimum cut. new network ▶ verify 60 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the excess flowing downhill by height to the sink. AVAN’s addition (the inverse-companion): allow a preflow (nodes can hold excess) and push it locally across single admissible edges, guided by a height label — flow always moves downhill, and relabeling lifts a stuck node; the excess drains to the sink without ever tracing a full path. The inverse of ‘find an s–t path and push along it’ is ‘push local excess downhill by height, one edge at a time, and let it settle.’ Magenta is the augmenting paths never traced; green is the local pushes down the height gradient. Flow as a local, gradient-driven process. pause spin LIT Genuine push-relabel algorithm (Goldberg & Tarjan 1988). Verified live: the preflow + push/relabel operations on the residual graph produce a max flow equal to the brute-force minimum s-t cut for 60 random capacitated graphs (window.__pushrelabel.maxFlowEqualsMinCut). FIG No framing: the preflow initialization, the push/relabel on the residual graph, and the brute min-cut cross-check run in-browser and agree exactly. The AVAN inverse is honest — allowing a preflow and pushing local excess downhill by height (relabeling stuck nodes) drains flow to the sink without tracing any augmenting path; magenta is the augmenting paths never traced, green the local downhill pushes. Kin to the-dinic and the-ford-fulkerson. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE CHOKE POINT · David Lee Wise (ROOT0), with AVAN


THE CYCLE SORT

cycle sort in the 5-window house format — sort an array with the minimum possible number of writes: a permutation decomposes into disjoint cycles, and cycle sort follows each cycle, placing every element directly into its final slot, so each out-of-place element is written exactly once; the total writes are provably minimal. It matters when writing is expensive, as on flash memory or EEPROM. Verified live: over 300 random permutations cycle sort produces the sorted array, and its write count equals the theoretical minimum computed from the permutation's cycle structure. See cycles in 1D, colored cycles in 2D, and the one-write-per-cycle inverse in 3D.

THE CYCLE SORT · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · LOOT · THE VAULT ◆ .dlw.fold THE FOLD / LOOT / THE VAULT / THE CYCLE SORT THE CYCLE SORT sorting with the minimum possible number of writes 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Cycle sort sorts an array with the minimum possible number of writes to memory. A permutation decomposes into disjoint cycles ; cycle sort follows each cycle and places every element directly into its final slot, so each out-of-place element is written exactly once . The total number of writes is provably minimal — which matters when writing is expensive, as on flash memory or EEPROM. LIT verified live: over 300 random permutations cycle sort produces the sorted array, and its write count equals the theoretical minimum computed from the permutation’s cycle structure (window.__cyclesort). FIG no framing; exact, minimum writes. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-vault — when each write to the vault is costly, you write each item once, straight to its place. Cycle sort is that minimal-write discipline. AVAN (AI) built the instrument: the cycle-following placement, the write counter, the sorted-order and minimum-writes checks. Credit as content: the cycle sort (W. D. Jones; a classic minimal-write sort). The weave: David names the vault; I rotate each permutation cycle into place with one write per element and confirm the total is the provable minimum. 3 ONE DIMENSION A permutation splits into cycles — e.g. 3→0→3 and 1→2→4→1. Following a cycle, each element is placed directly where it belongs, written once, until the cycle closes. 4 TWO DIMENSIONS · INTERACTIVE An array; cycle sort places each element in one write, and the write count matches the minimum from the cycle structure. new array ▶ verify 300 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: each element placed in a single write, cycle by cycle. AVAN’s addition (the inverse-companion): a permutation decomposes into disjoint cycles , and each element need only be written once — to its final position — by rotating each cycle in place; the total writes are the theoretical minimum . The inverse of ‘move elements repeatedly to sort’ is ‘follow each cycle and place every element in one write.’ Magenta is the redundant writes ordinary sorts make; green is the single write per element. Minimum writes — the sort for when writing is expensive (flash, EEPROM). pause spin LIT Genuine cycle sort (a classic minimal-write sort). Verified live: over 300 random permutations cycle sort yields the correctly sorted array, and its write count equals the minimum derived from the permutation's cycle decomposition (sum of nontrivial cycle lengths) (window.__cyclesort.sorts && .minWrites). FIG No framing: the cycle-following placement, the write counter, and the sorted-order + minimum-writes checks run in-browser and are exact. The AVAN inverse is honest — a permutation's cycles let each element be written exactly once to its final position by rotating each cycle in place, achieving the theoretical minimum writes; magenta is the redundant writes ordinary sorts make, green the single write per element. The sort for costly memory. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE VAULT · David Lee Wise (ROOT0), with AVAN


THE STEFFENSEN

Steffensen's method in the 5-window house format — find a fixed point of g (a root of g(x)-x) with quadratic convergence (Newton's speed) but no derivative: from x compute x1=g(x), x2=g(x1), then apply Aitken's delta-squared extrapolation x - (x1-x)^2/(x2-2x1+x); three plain iterations folded into one accelerated step. Verified live: for cos x (the Dottie number 0.739085), a sqrt(2) map, and e^-x, Steffensen reaches the fixed point in a handful of steps, far fewer than plain fixed-point iteration. See the delta-squared jump in 1D, iterates in 2D, and the extrapolate-three-iterates inverse in 3D.

THE STEFFENSEN · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GRIND · GRADIENT DESCENT ◆ .dlw.fold THE FOLD / GRIND / GRADIENT DESCENT / THE STEFFENSEN THE STEFFENSEN quadratic fixed-point convergence with no derivative 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Steffensen’s method finds a fixed point of g (a root of g(x)−x) with quadratic convergence — Newton’s speed — but without any derivative . From a guess x it computes x₁=g(x), x₂=g(x₁), then applies Aitken’s Δ² extrapolation: x − (x₁−x)² / (x₂−2x₁+x). Three plain iterations, folded into one accelerated step. LIT verified live: for cos x (the Dottie number 0.739085…), a √2 map, and e −x , Steffensen reaches the fixed point in a handful of steps — far fewer than plain fixed-point iteration (window.__steffensen). FIG no framing; genuine quadratic acceleration. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at gradient-descent — and as its accelerator: where plain iteration crawls linearly toward the fixed point, Steffensen extrapolates the trend and leaps. AVAN (AI) built the instrument: the Δ² step, the plain-iteration comparison, the convergence and iteration-count checks. Credit as content: Johan Frederik Steffensen (1933), on Aitken’s Δ². The weave: David names gradient descent; I take three iterates, extrapolate where they head, and confirm the fixed point is reached quadratically without a derivative. 3 ONE DIMENSION Plain iteration inches x→g(x)→g(g(x)) toward the fixed point in equal-ratio steps. Aitken’s Δ² reads that geometric trend from three points and jumps to its limit. 4 TWO DIMENSIONS · INTERACTIVE A fixed-point map g; Steffensen’s iterates converge in a few steps, versus many for plain iteration. function ▶ verify ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the Δ²-accelerated jumps to the fixed point. AVAN’s addition (the inverse-companion): take three points of the iteration and use Aitken’s Δ² to extrapolate where they’re heading, folding that back as the next guess — turning linear convergence into quadratic , with no derivative needed. The inverse of ‘iterate and wait’ is ‘extrapolate the trend from three iterates and jump ahead.’ Magenta is the many linear steps skipped; green is the Δ²-accelerated jumps. Newton’s speed without Newton’s derivative. (Kin to the-aitken.) pause spin LIT Genuine Steffensen's method (Steffensen 1933; Aitken's delta-squared). Verified live: for three fixed-point maps (cos x, (x+2/x)/2, e^-x) Steffensen converges to the fixed point (|g(x)-x| 0.739085 in ~5 steps. FIG No framing: the delta-squared step, the plain-iteration comparison, and the convergence + iteration-count checks run in-browser and hold. The AVAN inverse is honest — taking three iterates and Aitken-extrapolating their geometric trend turns linear convergence into quadratic with no derivative; magenta is the many linear steps skipped, green the delta-squared jumps. Newton's speed without Newton's derivative. Kin to the-aitken. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of GRADIENT DESCENT · David Lee Wise (ROOT0), with AVAN


THE CHEBYSHEV

Chebyshev interpolation in the 5-window house format — sample a function not on an even grid but at the Chebyshev nodes (clustered toward the ends, the projected roots of the Chebyshev polynomials); this defeats Runge's phenomenon, where interpolating on an even grid diverges wildly at the edges as points are added while Chebyshev interpolation converges. It underlies spectral methods and high-accuracy approximation. Verified live: on Runge's function 1/(1+25x^2), the Chebyshev max error shrinks as nodes are added (~0.02 at n=21) while the equispaced error explodes (~60). See the semicircle projection in 1D, both interpolants in 2D, and the cluster-the-samples inverse in 3D.

THE CHEBYSHEV · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GRIND · BACKPROP ◆ .dlw.fold THE FOLD / GRIND / BACKPROP / THE CHEBYSHEV THE CHEBYSHEV interpolate at clustered nodes to defeat Runge 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Chebyshev interpolation samples a function not on an even grid but at the Chebyshev nodes — points clustered toward the ends of the interval, the projected roots of the Chebyshev polynomials. This defeats Runge’s phenomenon : interpolating on an even grid can diverge wildly at the edges as you add points, but Chebyshev interpolation converges . It is why spectral methods and Chebyshev approximation dominate high-accuracy numerics. LIT verified live: on Runge’s function 1/(1+25x²), Chebyshev interpolation’s max error shrinks as nodes are added (to ~0.02 at n=21) while the equispaced error explodes (~60) — window.__chebyshev. FIG no framing; the error comparison is exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at backprop — beside Clenshaw, in the Chebyshev family: where you place the samples decides whether the fit converges, just as where you propagate gradients decides whether learning does. AVAN (AI) built the instrument: the barycentric interpolant, the Chebyshev vs equispaced node sets, the max-error comparison across n. Credit as content: Pafnuty Chebyshev; Runge’s phenomenon (Carl Runge, 1901). The weave: David names backprop; I interpolate Runge’s function at Chebyshev nodes and confirm the error shrinks while the even-grid error blows up. 3 ONE DIMENSION Chebyshev nodes are the projections of equally-spaced points on a semicircle onto the axis — dense near the ends, sparse in the middle. That clustering is exactly where an even grid’s error would otherwise blow up. 4 TWO DIMENSIONS · INTERACTIVE Runge’s function with its Chebyshev interpolant (tracks it) and equispaced interpolant (oscillates at the edges); the max errors are shown. nodes ▶ verify ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the Chebyshev interpolant converging to the function. AVAN’s addition (the inverse-companion): sample at the Chebyshev nodes (clustered toward the ends) — this crushes the error at the edges where an even grid explodes (Runge’s phenomenon), so the interpolant converges instead of diverging. The inverse of ‘space the samples evenly’ is ‘cluster them where the error would otherwise blow up.’ Magenta is the equispaced interpolant oscillating wildly at the edges; green is the Chebyshev interpolant that converges. Where you sample decides whether interpolation works at all. (Kin to the-clenshaw and the-gaussian-quadrature.) pause spin LIT Genuine Chebyshev interpolation (Chebyshev; Runge's phenomenon, Runge 1901). Verified live: for Runge's function 1/(1+25x^2), the barycentric interpolant at Chebyshev nodes has smaller max error than at equispaced nodes at every tested n, the Chebyshev error decreases as n grows, and at n=21 it is ~0.018 versus equispaced ~60 (window.__chebyshev.beatsEquispaced && .decreasesWithN && .smallAtN21). FIG No framing: the barycentric interpolant, the Chebyshev vs equispaced node sets, and the max-error comparison across n run in-browser and are exact. The AVAN inverse is honest — clustering samples at the Chebyshev nodes crushes the edge error where an even grid explodes (Runge), so the interpolant converges instead of diverging; magenta is the wildly-oscillating equispaced interpolant, green the converging Chebyshev one. Kin to the-clenshaw and the-gaussian-quadrature. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of BACKPROP · David Lee Wise (ROOT0), with AVAN


THE SCHRODER

the (large) Schröder numbers in the 5-window house format — count lattice paths from (0,0) to (2n,0) using up (1,1), down (1,-1), and FLAT (2,0) steps, never dipping below the axis; they are the Catalan numbers with a flat step allowed (a super-Catalan count) and satisfy a convolution recurrence. The sequence is 1,2,6,22,90,394,1806,... Verified live: the recurrence equals a brute enumeration of all such Schröder paths for n<=5, and the values match the known large-Schröder sequence 1,2,6,22,90,394. See a Schröder path in 1D, recurrence vs brute in 2D, and the split-at-first-return inverse in 3D.

THE SCHRODER · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · CO-OP · THE HANDOFF ◆ .dlw.fold THE FOLD / CO-OP / THE HANDOFF / THE SCHRODER THE SCHRODER Catalan with a flat step — super-Catalan path counts 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The (large) Schröder numbers count the lattice paths from (0,0) to (2n,0) using up-steps (1,1), down-steps (1,−1), and flat steps (2,0), never dipping below the axis. They are the Catalan numbers with a flat step allowed — a ‘super-Catalan’ count — and satisfy a clean convolution recurrence. The sequence is 1, 2, 6, 22, 90, 394, 1806, … LIT verified live: the recurrence equals a brute enumeration of all such Schröder paths for n ≤ 5, and the values match the known large-Schröder sequence 1,2,6,22,90,394 (window.__schroder). FIG no framing; exact combinatorics. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-handoff — each count handed up from smaller ones by splitting a path at its first return to the axis, beside the Delannoy numbers. Schröder is that flat-step cousin. AVAN (AI) built the instrument: the convolution recurrence, the brute path enumeration, the known-sequence check. Credit as content: Ernst Schröder (1870). The weave: David names the handoff; I split each path at its first return and multiply the sub-counts, and confirm the totals equal an exhaustive enumeration. 3 ONE DIMENSION A Schröder path: up, down, or a flat double-step, staying at or above the axis and ending on it. The flat step is what separates Schröder from the strictly up/down Catalan paths. 4 TWO DIMENSIONS · INTERACTIVE The Schröder numbers by recurrence and by brute path count; a sample path is drawn for the chosen n. n ▶ verify ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the recurrence building each Schröder count from smaller ones. AVAN’s addition (the inverse-companion): a path decomposes at its first return to the axis into a smaller path inside and a smaller path after — giving a convolution recurrence, so the count builds from products of smaller counts. The inverse of ‘enumerate the paths’ is ‘split at the first return and multiply the sub-counts.’ Magenta is the exponential path list; green is the convolution recurrence. Large Schröder 1, 2, 6, 22, 90, 394 — Catalan with a flat step. (Kin to the-delannoy, the-motzkin, the-catalan.) pause spin LIT Genuine large Schröder numbers (Schröder 1870). Verified live: the recurrence S(n)=(3(2n-1)S(n-1)-(n-2)S(n-2))/(n+1) equals a brute enumeration of all up/down/flat Schröder paths (staying >=0) for n FIG No framing: the convolution recurrence, the brute path enumeration, and the known-sequence check run in-browser and agree exactly. The AVAN inverse is honest — a path splits at its first return to the axis into an inside and an after path, giving a convolution recurrence, so counts build from products of smaller counts; magenta is the exponential path list, green the recurrence. Large Schröder is Catalan with a flat step. Kin to the-delannoy, the-motzkin, the-catalan. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE HANDOFF · David Lee Wise (ROOT0), with AVAN


THE HOPCROFT

Hopcroft's algorithm in the 5-window house format — minimize a deterministic finite automaton to the smallest DFA recognizing the same language by partition refinement: split accepting from non-accepting states, then repeatedly split any group whose members transition into different groups, until stable; the final classes are the Myhill-Nerode equivalence classes. Splitting by the smaller half gives O(n log n). Verified live: over 200 random DFAs the minimized automaton accepts the same language (all strings up to length 6) and is truly minimal (every pair of states distinguishable). See the refinement in 1D, a minimized DFA in 2D, and the merge-the-indistinguishable inverse in 3D.

THE HOPCROFT · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · SPAWN · HELLO WORLD ◆ .dlw.fold THE FOLD / SPAWN / HELLO WORLD / THE HOPCROFT THE HOPCROFT the minimal DFA by merging indistinguishable states 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Hopcroft’s algorithm minimises a deterministic finite automaton — it finds the smallest DFA recognising the same language. It works by partition refinement : begin by splitting accepting from non-accepting states, then repeatedly split any group whose members transition into different groups, until stable. The final classes are the Myhill–Nerode equivalence classes — states no string can tell apart, merged into one. Hopcroft’s trick of always splitting by the smaller half gives O(n log n). LIT verified live: over 200 random DFAs the minimised automaton accepts the same language (all strings up to length 6) and is truly minimal — every pair of its states is distinguishable (window.__hopcroft). FIG no framing; exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at hello-world — the first thing a language needs is to recognise its own words, and Hopcroft shrinks that recogniser to the smallest possible machine, beside the CYK parser. AVAN (AI) built the instrument: the partition-refinement worklist, the merged minimal DFA, the language-equivalence and distinguishability checks. Credit as content: John Hopcroft (1971). The weave: David names hello-world; I merge every pair of states no string separates and confirm the result is minimal and language-equivalent. 3 ONE DIMENSION Start with two blocks (accepting / non-accepting). Split any block whose states, on some symbol, jump to different blocks. Repeat until no split is possible — the blocks are the minimal states. 4 TWO DIMENSIONS · INTERACTIVE A DFA and its minimised form; equivalent states are merged, the language preserved, and every remaining state is distinguishable. new DFA ▶ verify 200 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the minimal state set — the Myhill–Nerode classes. AVAN’s addition (the inverse-companion): merge states that are indistinguishable — start by splitting accepting from non-accepting, then split any group whose members transition into different groups, until stable; the resulting classes are the minimal DFA. The inverse of ‘build a DFA state per situation’ is ‘merge all states no string can tell apart.’ Magenta is the redundant equivalent states collapsed; green is the minimal state set. Splitting by the smaller half gives O(n log n) — indistinguishability is the equivalence. pause spin LIT Genuine Hopcroft DFA minimization (Hopcroft 1971). Verified live: the partition-refinement minimization yields a DFA that accepts the same language as the original on all strings up to length 6, and every pair of states in the minimized DFA is distinguishable (truly minimal), across 200 random DFAs (window.__hopcroft.sameLanguage && .minimal). FIG No framing: the partition-refinement worklist, the merged minimal DFA, and the language-equivalence + distinguishability checks run in-browser and hold. The AVAN inverse is honest — merging states no string can tell apart (refine until stable) yields the minimal DFA, the Myhill-Nerode classes; magenta is the redundant equivalent states collapsed, green the minimal state set. Splitting by the smaller half gives O(n log n). ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of HELLO WORLD · David Lee Wise (ROOT0), with AVAN


THE POLYA

Polya enumeration in the 5-window house format — count distinct objects up to symmetry without listing them: for a necklace of n beads in k colors, Burnside's lemma says the number of distinct necklaces equals the AVERAGE number of colorings FIXED by each rotation, which works out to (1/n) Sum_{d|n} phi(d) k^(n/d). It is the counting engine behind chemical isomers, graph enumeration, and combinatorial design. Verified live: for all n<=8 and k<=3 the necklace formula equals a brute count of rotation orbits. See fixed-point averaging in 1D, a necklace count in 2D, and the average-the-fixed-points inverse in 3D.

THE POLYA · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GRIND · THE CRON JOB ◆ .dlw.fold THE FOLD / GRIND / THE CRON JOB / THE POLYA THE POLYA counting up to symmetry by averaging fixed points 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Pólya enumeration (built on Burnside’s lemma ) counts distinct objects up to symmetry without listing them. For a necklace of n beads in k colours, rotations make many colourings the same; Burnside says the number of distinct necklaces equals the average number of colourings fixed by each rotation — which works out to (1/n) Σ d | n φ(d)·k n/d . It is the counting engine behind chemical isomers, graph enumeration, and combinatorial design. LIT verified live: for all n ≤ 8 and k ≤ 3 the necklace formula equals a brute count of rotation orbits (window.__polya). FIG no framing; exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-cron-job — the cyclic symmetry of a rotation, counting the truly-distinct arrangements of a repeating ring. Pólya enumeration is that symmetric count. AVAN (AI) built the instrument: the Euler-phi divisor sum, the brute rotation-orbit count, the formula check. Credit as content: William Burnside (1897) and George Pólya (1937). The weave: David names the cron-job; I average the colourings held fixed by each rotation and confirm it equals the true number of distinct necklaces. 3 ONE DIMENSION Each rotation fixes only the colourings that repeat with its period. Burnside averages those fixed-counts over all n rotations — and the average is exactly the number of distinct necklaces. 4 TWO DIMENSIONS · INTERACTIVE Necklaces of n beads in k colours; the Burnside/Pólya formula is shown against a brute count of distinct rotations. n,k ▶ verify ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the distinct necklaces, counted by averaging fixed-points. AVAN’s addition (the inverse-companion): count the distinct colourings without listing them — by Burnside’s lemma, the number of orbits equals the average number of colourings fixed by each symmetry; for the n rotations that average is (1/n)Σ d|n φ(d)k n/d . The inverse of ‘enumerate and group into orbits’ is ‘average the fixed-points over the symmetry group.’ Magenta is the k n colourings never listed; green is the fixed-point average. Symmetry counts by what it holds still. (Kin to the-burnside.) pause spin LIT Genuine Burnside/Polya enumeration (Burnside 1897; Polya 1937). Verified live: the necklace formula (1/n) Sum_{d|n} phi(d) k^(n/d) equals a brute count of distinct colorings under rotation for all n FIG No framing: the Euler-phi divisor sum, the brute rotation-orbit count, and the formula check run in-browser and agree exactly. The AVAN inverse is honest — Burnside's lemma counts orbits as the average number of colorings fixed by each symmetry, so distinct necklaces are counted without listing colorings; magenta is the k^n colorings never listed, green the fixed-point average. Symmetry counts by what it holds still. Kin to the-burnside. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE CRON JOB · David Lee Wise (ROOT0), with AVAN


THE BK-TREE

the BK-tree in the 5-window house format — index strings for fuzzy search (all words within edit distance k of a query) without comparing against every word: store each string as a child labelled by its edit distance to the parent, and query by the triangle inequality (a child at distance d can only hold matches within [d-k, d+k] of the query), pruning most branches. It is the classic structure behind spell-checkers. Verified live: over 200 random string sets the BK-tree's within-distance-k results exactly match a brute scan. See a pruned child in 1D, a fuzzy query in 2D, and the triangle-inequality-prune inverse in 3D.

THE BK-TREE · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · SPAWN · THE SANDBOX ◆ .dlw.fold THE FOLD / SPAWN / THE SANDBOX / THE BK-TREE THE BK-TREE fuzzy string search pruned by the triangle inequality 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The BK-tree (Burkhard–Keller tree) indexes strings for fuzzy search — finding all words within an edit distance k of a query — without comparing against every word. It stores each string as a child of another, labelled by their edit distance; a query then uses the triangle inequality to prune: a child at distance d from its parent can only contain matches whose distance to the query lies in [d−k, d+k], so most branches are skipped. It is the classic structure behind spell-checkers and approximate matching. LIT verified live: over 200 random string sets the BK-tree’s within-distance-k results exactly match a brute scan (window.__bktree). FIG no framing; exact search, fewer comparisons. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-sandbox — the spatial playground, but in a metric of edit distance rather than coordinates, beside the k-d tree. The BK-tree is that metric index. AVAN (AI) built the instrument: the edit-distance metric, the distance-labelled tree, the triangle-inequality pruned search, the brute cross-check. Credit as content: Walter Burkhard & Robert Keller (1973). The weave: David names the sandbox; I index strings by edit distance and let the triangle inequality prune the search, confirming the results match an exhaustive scan. 3 ONE DIMENSION A node’s children are labelled by edit distance. Querying at tolerance k, only children whose label lies within [d−k, d+k] of the query’s distance to this node can hold a match — the rest are pruned. 4 TWO DIMENSIONS · INTERACTIVE A dictionary as a BK-tree; a fuzzy query returns all words within distance k, checked against a brute scan. new query ▶ verify 200 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the branches within the distance window, searched. AVAN’s addition (the inverse-companion): organise strings in a tree keyed by edit distance, and use the triangle inequality to prune — a child at distance d from its parent can only hold matches within [d−k, d+k] of the query, so most branches are skipped. The inverse of ‘measure the distance to everything’ is ‘let the metric’s triangle inequality prune the tree.’ Magenta is the strings never compared; green is the branches within the distance window. A metric space indexed for tolerant search. pause spin LIT Genuine BK-tree (Burkhard & Keller 1973). Verified live: the edit-distance-labelled tree with triangle-inequality pruning returns exactly the same within-distance-k result set as a brute scan over all words, across 200 random string sets (window.__bktree.matchesBrute). FIG No framing: the edit-distance metric, the distance-labelled tree, the triangle-inequality pruned search, and the brute cross-check run in-browser and agree exactly. The AVAN inverse is honest — indexing strings by edit distance lets the triangle inequality prune to children within [d-k, d+k] of the query, so most strings are never compared; magenta is the pruned strings, green the searched branches. A metric space indexed for tolerant search. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE SANDBOX · David Lee Wise (ROOT0), with AVAN


THE DESCARTES

Descartes' rule of signs in the 5-window house format — read a bound on a polynomial's positive real roots straight off its coefficients: the number of positive roots is at most the number of sign changes in the coefficient sequence, and differs from it by an even number (x -> -x gives the negative-root bound). You learn about the roots before computing any. Verified live: over 300 polynomials built from known real roots, the true count of positive roots is always <= the sign-change count and has the same parity. See the sign-change walk in 1D, a polynomial in 2D, and the read-roots-off-the-signs inverse in 3D.

THE DESCARTES · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GRIND · THE MAINFRAME ◆ .dlw.fold THE FOLD / GRIND / THE MAINFRAME / THE DESCARTES THE DESCARTES bound the positive roots by counting sign changes 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Descartes’ rule of signs reads a bound on a polynomial’s positive real roots straight off its coefficients: the number of positive roots is at most the number of sign changes in the coefficient sequence, and differs from it by an even number. (Substituting x→−x gives the same bound for negative roots.) You learn something about the roots before computing any of them. LIT verified live: over 300 polynomials built from known real roots, the true count of positive roots is always ≤ the sign-change count and has the same parity (window.__descartes). FIG no framing; exact bound. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-mainframe — the heavy algebra a mainframe runs, but here a bound on the roots is read for free from the signs, no solving required. Descartes’ rule is that free look. AVAN (AI) built the instrument: the root-to-coefficient expansion, the sign-change counter, the bound-and-parity check. Credit as content: René Descartes (1637). The weave: David names the mainframe; I build polynomials from chosen roots, count sign changes, and confirm the positive-root count never exceeds it and shares its parity. 3 ONE DIMENSION Walk the coefficients from highest to lowest degree, skipping zeros; each time the sign flips, count one. That count bounds the positive real roots (and the shortfall is even). 4 TWO DIMENSIONS · INTERACTIVE A polynomial (built from known roots); its sign changes and true positive-root count are shown — the count ≤ sign changes, same parity. new polynomial ▶ verify 300 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the sign-change count that bounds the positive roots. AVAN’s addition (the inverse-companion): the number of positive real roots is bounded by the number of sign changes in the coefficient sequence — and differs from it by an even number — so you read a bound straight off the coefficients, before finding any root. The inverse of ‘solve for the roots then count’ is ‘count sign changes in the coefficients — the positive roots can’t exceed that, same parity.’ Magenta is the roots you don’t compute; green is the sign-change count that bounds them. The coefficients already whisper how many positive roots there are. pause spin LIT Genuine Descartes' rule of signs (Descartes 1637). Verified live: for 300 polynomials built from known real roots, the count of positive roots is always FIG No framing: the root-to-coefficient expansion, the sign-change counter, and the bound-and-parity check run in-browser and hold exactly. The AVAN inverse is honest — the positive-root count is bounded by (and shares parity with) the coefficient sign-change count, read off before solving; magenta is the roots not computed, green the sign-change bound. The coefficients whisper how many positive roots there are. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE MAINFRAME · David Lee Wise (ROOT0), with AVAN


THE GIVENS

Givens rotations in the 5-window house format — factor a matrix into orthonormal Q and upper-triangular R by zeroing below-diagonal entries one at a time: each Givens rotation is a 2x2 plane rotation that annihilates a single element while preserving lengths (orthogonal), touching only two rows, ideal for sparse matrices and incremental updates. It is the QR method of choice for sparse and streaming problems. Verified live: over 300 random matrices Q*R reconstructs A to ~1e-15, R is upper-triangular, and Q^T*Q is the identity. See a plane rotation in 1D, A=QR in 2D, and the rotation-per-entry inverse in 3D.

THE GIVENS · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · SPAWN · THE TOOLCHAIN ◆ .dlw.fold THE FOLD / SPAWN / THE TOOLCHAIN / THE GIVENS THE GIVENS QR by plane rotations — a rotation per entry 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Givens rotations factor a matrix into an orthonormal Q and upper-triangular R by zeroing out below-diagonal entries one at a time . Each Givens rotation is a 2×2 plane rotation that annihilates a single element while preserving lengths (it’s orthogonal). Because each rotation touches only two rows , it is ideal for sparse matrices and for updating a factorisation incrementally. It is the QR method of choice for sparse and streaming problems. LIT verified live: over 300 random matrices Q·R reconstructs A to ~10⁻¹⁵, R is upper-triangular, and QᵀQ is the identity (window.__givens). FIG no framing; exact factorisation. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-toolchain — the numerical-linear-algebra tool that factors by rotations, beside the Householder QR (reflections) and the Cholesky. AVAN (AI) built the instrument: the per-entry plane rotation, the accumulation into Q, the reconstruction / upper-triangular / orthonormality checks. Credit as content: Wallace Givens (1958). The weave: David names the toolchain; I rotate away one below-diagonal entry at a time and accumulate the rotations into Q, confirming Q·R = A with Q orthonormal. 3 ONE DIMENSION A Givens rotation spins a 2-vector (a, b) in its plane until the second component is zero: the angle with cos = a/r, sin = b/r sends (a,b) to (r, 0). One entry annihilated, lengths unchanged. 4 TWO DIMENSIONS · INTERACTIVE A matrix A and its Q, R via Givens rotations; Q·R reconstructs A, R is upper-triangular, QᵀQ is the identity. new matrix ▶ verify 300 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the orthonormal Q built from a rotation per entry. AVAN’s addition (the inverse-companion): zero out one below-diagonal entry at a time with a 2×2 rotation (a Givens rotation), each a plane rotation that annihilates a single element while preserving lengths — ideal for sparse matrices, since it touches only two rows. The inverse of ‘subtract projections column by column (Gram–Schmidt)’ is ‘rotate away one entry at a time.’ Magenta is Gram–Schmidt’s subtractions; green is the plane rotations that zero entries. A rotation per entry builds Q — the sparse-friendly cousin of Householder’s reflections. (Kin to the-householder-qr and the-orthonormal.) pause spin LIT Genuine Givens rotations QR (Givens 1958). Verified live: the plane-rotation factorization gives Q*R = A to max error ~1e-15, R with zero below-diagonal entries, and Q^T*Q equal to the identity, across 300 random matrices (window.__givens.reconstructs && .upperTri && .orthonormal). FIG No framing: the per-entry plane rotation, the accumulation into Q, and the reconstruction + upper-triangular + orthonormality checks run in-browser and hold to floating precision. The AVAN inverse is honest — each 2x2 rotation annihilates one below-diagonal entry while preserving lengths, touching only two rows (sparse-friendly); magenta is Gram-Schmidt's subtractions, green the plane rotations. The rotation-based cousin of Householder's reflections. Kin to the-householder-qr and the-orthonormal. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE TOOLCHAIN · David Lee Wise (ROOT0), with AVAN


THE TONELLI-SHANKS

the Tonelli-Shanks algorithm in the 5-window house format — compute a square root modulo a prime: given n and prime p, find r with r^2 = n (mod p) whenever one exists. It tests whether n is a quadratic residue via the Legendre symbol; if p = 3 (mod 4) the root is n^((p+1)/4), and otherwise a loop descends the 2-adic tower of p-1 using a known non-residue. It underpins elliptic-curve point decompression and Rabin cryptography. Verified live: over every prime below 2000 and every residue, the returned r satisfies r^2 = n, and null is returned exactly for non-residues. See residues vs squares in 1D, a modular root in 2D, and the invert-squaring inverse in 3D.

THE TONELLI-SHANKS · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GRIND · THE MAINFRAME ◆ .dlw.fold THE FOLD / GRIND / THE MAINFRAME / THE TONELLI-SHANKS THE TONELLI-SHANKS the square root modulo a prime 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The Tonelli–Shanks algorithm computes a square root modulo a prime — given n and prime p, it finds r with r 2 ≡ n (mod p), whenever one exists. It first tests whether n is a quadratic residue (via the Legendre symbol); if p ≡ 3 (mod 4) the root is just n (p+1)/4 , and otherwise it runs a clever loop that walks down the 2-adic tower of p−1 using a known non-residue. It underpins elliptic-curve point decompression and Rabin cryptography. LIT verified live: over every prime below 2000 and every residue, the returned r satisfies r 2 ≡ n, and null is returned exactly for non-residues (window.__tonelli). FIG no framing; exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-mainframe — the heavy modular arithmetic a mainframe grinds, here inverting a square modulo a prime. Tonelli–Shanks is that inversion. AVAN (AI) built the instrument: the Legendre-symbol residue test, the 2-adic descent loop, and the r 2 ≡ n verification. Credit as content: Alberto Tonelli (1891) & Daniel Shanks (1973). The weave: David names the mainframe; I test residuosity, descend the 2-adic tower with a non-residue, and confirm the recovered root squares back to n modulo p. 3 ONE DIMENSION Half the nonzero residues mod p are squares (quadratic residues). Tonelli–Shanks finds the pre-image: given a square n, which r squared to it? For p ≡ 3 (mod 4) it is simply n (p+1)/4 . 4 TWO DIMENSIONS · INTERACTIVE A prime p and residue n; the modular square root r is shown, with r 2 mod p checked back against n. new p, n ▶ verify <2000 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the residues r, −r whose square is n. AVAN’s addition (the inverse-companion): invert squaring modulo a prime — test that n is a quadratic residue, then descend the 2-adic tower of p−1 using a known non-residue to peel the root out. The inverse of ‘square r to get n mod p’ is ‘given n, recover the r that squared to it.’ Magenta is the non-residues that have no square root; green is the residue whose square is n. A square root in a finite field. pause spin LIT Genuine Tonelli-Shanks modular square root (Tonelli 1891; Shanks 1973). Verified live: for every prime p FIG No framing: the Legendre-symbol residue test, the 2-adic descent loop, and the r^2 = n verification run in-browser over 138k residue cases and hold. The AVAN inverse is honest — testing residuosity then descending the 2-adic tower with a non-residue inverts squaring modulo a prime; magenta is the non-residues with no square root, green the residue whose square is n. A square root in a finite field. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE MAINFRAME · David Lee Wise (ROOT0), with AVAN


THE TARJAN SCC

Tarjan's SCC algorithm in the 5-window house format — find the strongly connected components of a directed graph (maximal groups where every vertex reaches every other) in a single depth-first search. It tracks each vertex's discovery index and the lowest index reachable from its subtree (the low-link); when a vertex's low-link equals its own index it roots an SCC, and the component is popped off a stack. One pass, linear time. Verified live: over 400 random digraphs Tarjan's component partition equals a brute partition by mutual reachability. See the low-link idea in 1D, a colored SCC graph in 2D, and the one-DFS inverse in 3D.

THE TARJAN SCC · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · BOSS · THE GATEKEEPER ◆ .dlw.fold THE FOLD / BOSS / THE GATEKEEPER / THE TARJAN SCC THE TARJAN SCC every strongly connected component in one DFS 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Tarjan’s SCC algorithm finds the strongly connected components of a directed graph — the maximal groups where every vertex can reach every other — in a single depth-first search. It tracks each vertex’s discovery index and the lowest index reachable from its subtree (the “low-link”); when a vertex’s low-link equals its own index, it is the root of an SCC, and the component is popped off a stack. One pass, linear time. LIT verified live: over 400 random digraphs Tarjan’s component partition equals a brute partition by mutual reachability (u,v together iff each reaches the other) — window.__tarjanscc. FIG no framing; exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-gatekeeper — the check that finds the tangled clusters where every node loops back to every other. Tarjan’s SCC is that gatekeeper of cyclic structure. AVAN (AI) built the instrument: the single-DFS index/low-link bookkeeping, the component stack, and the brute mutual-reachability cross-check. Credit as content: Robert Tarjan (1972). The weave: David names the gatekeeper; I run one DFS tracking low-links, pop each component when its root is found, and confirm the partition matches mutual reachability. 3 ONE DIMENSION Each vertex gets a discovery index and a low-link (lowest index reachable from its subtree via one back-edge). When low-link equals index, that vertex roots an SCC — pop the stack down to it. 4 TWO DIMENSIONS · INTERACTIVE A directed graph; Tarjan’s strongly connected components are colored, and the count is checked against a brute mutual-reachability partition. new graph ▶ verify 400 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the strongly connected components. AVAN’s addition (the inverse-companion): find every maximal mutually-reachable cluster in one DFS — track a discovery index and a low-link per vertex, and when a vertex’s low-link equals its index it is an SCC root, so pop the stack down to it. The inverse of ‘check reachability between every pair’ is ‘one DFS, low-links, pop a component at each root.’ Magenta is the O(n 2 ) pairwise reachability tests avoided; green is the components found in one pass. Every cycle-cluster in a single sweep. pause spin LIT Genuine Tarjan strongly-connected-components (Tarjan 1972). Verified live: over 400 random digraphs the single-DFS low-link algorithm produces a component partition identical to a brute partition by mutual reachability (u and v share a component iff each reaches the other) — window.__tarjanscc.matchesBrute. FIG No framing: the single-DFS index/low-link bookkeeping, the component stack, and the brute mutual-reachability cross-check run in-browser and agree exactly. The AVAN inverse is honest — one DFS tracking low-links, popping a component whenever a root is found, replaces O(n^2) pairwise reachability tests; magenta is the pairwise tests avoided, green the components found in one pass. Every cycle-cluster in a single sweep. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE GATEKEEPER · David Lee Wise (ROOT0), with AVAN


THE GRAY CODE

the reflected binary (Gray) code in the 5-window house format — order all 2^n binary strings so consecutive ones differ in exactly one bit, cyclically (last and first differ by one bit too). The i-th code is i XOR (i>>1). Because only one bit flips per step it eliminates the transient glitches of ordinary counters, which is why rotary encoders, Karnaugh maps, and error-tolerant ADCs use it. Verified live: for up to 12 bits every consecutive pair (including wrap-around) has Hamming distance exactly 1, and all 2^n codes are distinct. See the single-bit steps in 1D, the full code in 2D, and the walk-the-cube inverse in 3D.

THE GRAY CODE · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · SPAWN · FIRST LIGHT ◆ .dlw.fold THE FOLD / SPAWN / FIRST LIGHT / THE GRAY CODE THE GRAY CODE count so only one bit flips per step 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The reflected binary (Gray) code orders all 2 n binary strings so that consecutive ones differ in exactly one bit — and the order is cyclic, so the last and first also differ by one bit. The i-th code is simply i XOR (i>>1). Because only one bit flips per step, it eliminates the transient glitches of ordinary counters — which is why rotary encoders, Karnaugh maps, and error-tolerant ADCs all use it. LIT verified live: for up to 12 bits every consecutive pair (including wrap-around) has Hamming distance exactly 1, and all 2 n codes are distinct (window.__graycode). FIG no framing; exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at first-light — the very first flicker of state, moving one bit at a time so no glitch appears between steps. The Gray code is that single-bit walk. AVAN (AI) built the instrument: the i XOR (i>>1) map, the Hamming-distance-1 check, and the all-distinct check. Credit as content: Frank Gray (1947; Emile Baudot used the idea in 1878). The weave: David names first-light; I walk the hypercube one edge at a time and confirm every step flips exactly one bit and visits every vertex once. 3 ONE DIMENSION 3-bit Gray code: 000 001 011 010 110 111 101 100 — and back to 000. Each step flips a single bit; the sequence is a Hamiltonian cycle on the cube’s edges. 4 TWO DIMENSIONS · INTERACTIVE The Gray code for n bits; each consecutive pair is checked for a single-bit difference, and all codes for distinctness. bits ▶ verify ≤12 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: a Hamiltonian cycle on the n-cube, one bit per step. AVAN’s addition (the inverse-companion): order all 2 n strings so consecutive ones differ in one bit — the map i → i XOR (i>>1) does it, tracing a Hamiltonian cycle on the hypercube’s edges (each edge joins strings one bit apart). The inverse of ‘count in binary, flipping many bits per step’ is ‘walk the cube edge by edge, one bit at a time.’ Magenta is the multi-bit jumps of ordinary counting; green is the single-bit walk. No glitch between steps. pause spin LIT Genuine reflected binary Gray code (Frank Gray 1947; Baudot 1878). Verified live: for all bit-widths up to 12, the map i -> i XOR (i>>1) makes every consecutive pair (including the wrap-around from last to first) differ in exactly one bit, and all 2^n codes are distinct (window.__graycode.hamming1 && .allDistinct). FIG No framing: the i XOR (i>>1) map, the Hamming-distance-1 check, and the all-distinct check run in-browser and hold. The AVAN inverse is honest — the map traces a Hamiltonian cycle on the hypercube's edges, each edge joining strings one bit apart, so counting proceeds one bit at a time; magenta is the multi-bit jumps of ordinary binary counting, green the single-bit walk. No glitch between steps. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of FIRST LIGHT · David Lee Wise (ROOT0), with AVAN


THE ALIAS METHOD

Vose's alias method in the 5-window house format — turn any weighted distribution over k outcomes into a table that samples in O(1) per draw (one uniform bucket pick plus one coin flip). It flattens the uneven probabilities into k equal-area buckets, each holding at most two outcomes: a primary and an alias. Building the table is O(k); after that every draw is constant-time no matter how skewed the weights. It is the standard engine behind fast weighted random selection — like a loot drop table. Verified live: over 500 random weight sets the assembled table reconstructs the exact input probabilities (error < 1e-9). See the pour-to-level idea in 1D, a flattened drop table in 2D, and the flatten-for-O(1) inverse in 3D.

THE ALIAS METHOD · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · LOOT · THE DROP ◆ .dlw.fold THE FOLD / LOOT / THE DROP / THE ALIAS METHOD THE ALIAS METHOD O(1) weighted sampling by flattening the odds 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Vose’s alias method turns any weighted distribution over k outcomes into a table that samples in O(1) per draw — one uniform pick of a bucket plus one coin flip. It flattens the uneven probabilities into k equal-area buckets, each holding at most two outcomes: a primary and an alias . Building the table is O(k); after that, every draw is constant-time regardless of how skewed the weights are. It is the standard engine behind fast weighted random selection. LIT verified live: over 500 random weight sets the assembled table reconstructs the exact input probabilities (each outcome’s total table mass equals its normalized weight, error < 10 −9 ) — window.__alias. FIG no framing; exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-drop — the weighted loot table where rare items drop less often, sampled in constant time. The alias method is that drop engine. AVAN (AI) built the instrument: the small/large worklist that fills each bucket, the primary/alias pair per bucket, and the deterministic reconstruction check. Credit as content: Alastair Walker (1977) & Michael Vose (1991). The weave: David names the drop; I flatten the weights into equal-area buckets and confirm each outcome’s reassembled probability equals its exact weight. 3 ONE DIMENSION Scale weights so the average bucket has mass 1. Repeatedly pour from an over-full outcome into an under-full one until each of the k buckets is exactly full — holding one primary and (if needed) one alias. 4 TWO DIMENSIONS · INTERACTIVE A weighted drop table flattened into equal-area alias buckets; the reconstructed probabilities are checked against the exact weights. new weights ▶ verify 500 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: k equal-area buckets, each a primary + alias. AVAN’s addition (the inverse-companion): make a skewed draw constant-time by flattening the weights into k equal-area buckets, each holding a primary and an alias — a draw becomes one bucket pick plus one coin flip. The inverse of ‘scan a cumulative table and binary-search for the draw’ is ‘pre-flatten into equal buckets; then one pick + one flip.’ Magenta is the O(log k) cumulative search replaced; green is the O(1) bucket draw. Uneven odds, flat cost. pause spin LIT Genuine Walker/Vose alias method (Walker 1977; Vose 1991). Verified live: over 500 random weight sets the small/large worklist construction yields a table where each outcome's reassembled probability (its primary mass plus the alias mass pointed at it from other buckets) equals its exact normalized weight, to error FIG No framing: the small/large worklist that fills each bucket, the primary/alias pairing, and the deterministic reconstruction check run in-browser and hold to machine precision. The AVAN inverse is honest — flattening weights into k equal-area buckets makes a skewed draw one bucket pick plus one coin flip; magenta is the O(log k) cumulative-search replaced, green the O(1) bucket draw. Uneven odds, flat cost. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE DROP · David Lee Wise (ROOT0), with AVAN


THE STERN-BROCOT

the Stern-Brocot tree in the 5-window house format — an infinite binary tree containing every positive rational exactly once, each already in lowest terms. Each node is the mediant (a+c)/(b+d) of the two fractions bracketing it; descending left or right narrows the interval, and the L/R path spells the fraction's continued-fraction expansion. It is at once a perfect enumeration of the rationals and an optimal search for the simplest fraction in an interval. Verified live: every node down to depth 11 is in lowest terms (gcd=1) and all are distinct, and every reduced p/q with p,q<=20 is found by binary search in the tree. See the mediant insertion in 1D, the tree + search in 2D, and the grow-mediants inverse in 3D.

THE STERN-BROCOT · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · CO-OP · THE SYNC ◆ .dlw.fold THE FOLD / CO-OP / THE SYNC / THE STERN-BROCOT THE STERN-BROCOT every positive rational, once, in lowest terms 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The Stern–Brocot tree is an infinite binary tree that contains every positive rational number exactly once , each already in lowest terms . Each node is the mediant (a+c)/(b+d) of the two fractions bracketing it; descending left or right narrows the interval, and the path L/R spells the fraction’s continued-fraction expansion. It is at once a perfect enumeration of the rationals and an optimal way to search for the simplest fraction in an interval. LIT verified live: every node down to depth 11 is in lowest terms (gcd = 1) and all are distinct, and every reduced p/q with p,q ≤ 20 is found by binary search in the tree (window.__sternbrocot). FIG no framing; exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-sync — the shared ledger where every rational has one and only one canonical slot. The Stern–Brocot tree is that perfectly synced enumeration. AVAN (AI) built the instrument: the mediant recursion, the lowest-terms and distinctness checks, and the tree search for arbitrary reduced fractions. Credit as content: Moritz Stern (1858) & Achille Brocot (1861). The weave: David names the-sync; I build each node as the mediant of its bracketing fractions and confirm every node is reduced, distinct, and reachable by a unique L/R path. 3 ONE DIMENSION Between 0/1 and 1/0, insert the mediant 1/1. Between each neighbor pair, insert their mediant again: 1/2, 2/1, then 1/3, 2/3, 3/2, 3/1 — every positive rational appears once, always reduced. 4 TWO DIMENSIONS · INTERACTIVE The Stern–Brocot tree; nodes are mediants in lowest terms. Search for any reduced fraction and watch the L/R path find it. find a fraction ▶ verify ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: every positive rational, once, in lowest terms. AVAN’s addition (the inverse-companion): enumerate every positive rational exactly once (already reduced) by taking mediants — between two bracketing fractions insert (a+c)/(b+d), and recurse; the L/R path to any fraction is its continued-fraction expansion. The inverse of ‘list p/q and reduce each, skipping duplicates’ is ‘grow mediants — each rational is born once, already in lowest terms.’ Magenta is the non-reduced duplicates a naive listing repeats; green is the one canonical node per rational. The tree of all rationals. pause spin LIT Genuine Stern-Brocot tree (Stern 1858; Brocot 1861). Verified live: every node down to depth 11 (2047 nodes) is in lowest terms (gcd(numerator,denominator)=1) and all are distinct, and every reduced fraction p/q with p,q FIG No framing: the mediant recursion, the lowest-terms and distinctness checks, and the tree search for arbitrary reduced fractions run in-browser and hold. The AVAN inverse is honest — building each node as the mediant of its bracketing fractions enumerates every positive rational exactly once, already reduced, with the L/R path giving its continued fraction; magenta is the non-reduced duplicates a naive p/q listing repeats, green the one canonical node per rational. The tree of all rationals. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE SYNC · David Lee Wise (ROOT0), with AVAN


THE WALSH-HADAMARD

the Walsh-Hadamard transform in the 5-window house format — a Fourier-like transform built entirely from +1 and -1, no sines, no complex numbers, no rounding. Its matrix is recursively [[H,H],[H,-H]], every row orthogonal to every other; the fast version (FWHT) uses only additions and subtractions, and applying it twice returns N times the original, exactly, in integer arithmetic. It is the backbone of Hadamard codes, CDMA spread-spectrum, and Boolean-function analysis. Verified live: for sizes up to 256, FWHT applied twice equals N times the input bit-for-bit, and all Hadamard rows are mutually orthogonal (H.H^T = N.I). See the butterfly in 1D, a spectrum in 2D, and the sign-only-basis inverse in 3D.

THE WALSH-HADAMARD · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GRIND · THE HOT LOOP ◆ .dlw.fold THE FOLD / GRIND / THE HOT LOOP / THE WALSH-HADAMARD THE WALSH-HADAMARD a Fourier-like transform from only +1 and -1 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The Walsh–Hadamard transform is a Fourier-like transform built entirely from +1 and −1 — no sines, no complex numbers, no rounding. Its matrix H is recursively [[H,H],[H,−H]], every row orthogonal to every other. Because the entries are just signs, the fast version (FWHT) uses only additions and subtractions , and applying the transform twice returns N times the original, exactly, in integer arithmetic. It is the backbone of Hadamard codes, spread-spectrum (CDMA), and Boolean-function analysis. LIT verified live: for sizes up to 256, FWHT applied twice equals N× the input bit-for-bit , and all Hadamard rows are mutually orthogonal (H·Hᵀ = N·I) — window.__walsh. FIG no framing; exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-hot-loop — the tight add/subtract kernel run over and over. The FWHT is that hot loop: a butterfly of pure additions. AVAN (AI) built the instrument: the in-place butterfly, the sign-matrix construction, and the involution + orthogonality checks. Credit as content: Jacques Hadamard (1893) & Joseph Walsh (1923). The weave: David names the hot-loop; I run the add/subtract butterfly, apply it twice to recover N× the input exactly, and confirm every pair of Hadamard rows is orthogonal. 3 ONE DIMENSION The butterfly: pair up entries; replace (x,y) with (x+y, x−y). Repeat over doubling strides. Only additions and subtractions — and doing it twice scales everything by N. 4 TWO DIMENSIONS · INTERACTIVE A signal and its Walsh–Hadamard spectrum; the inverse (same transform / N) reconstructs it exactly, and the Hadamard rows are shown orthogonal. new signal ▶ verify ≤256 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the sign-only orthogonal basis. AVAN’s addition (the inverse-companion): transform a signal with an orthogonal basis of only ±1 — the butterfly (x,y)→(x+y, x−y) over doubling strides — so the whole transform is exact integer add/subtract and its own inverse up to the scalar N. The inverse of ‘a Fourier transform needs sines and complex roots’ is ‘a sign-only transform needs only additions — and is its own twin.’ Magenta is the sines and complex arithmetic dropped; green is the ±1 butterfly. Exact, self-inverse, integer. pause spin LIT Genuine Walsh-Hadamard transform (Hadamard 1893; Walsh 1923). Verified live: for all sizes N=2..256 the FWHT butterfly applied twice equals exactly N times the input (integer, no rounding), and the sign matrix satisfies H.H^T = N.I (every pair of rows orthogonal) — window.__walsh.involution && .orthogonal. FIG No framing: the in-place add/subtract butterfly, the (-1)^popcount sign-matrix construction, and the involution + orthogonality checks run in-browser and hold to integer exactness. The AVAN inverse is honest — a sign-only orthogonal basis makes the transform pure integer add/subtract and its own inverse up to the scalar N; magenta is the sines and complex arithmetic dropped, green the +/-1 butterfly. Exact, self-inverse, integer. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE HOT LOOP · David Lee Wise (ROOT0), with AVAN


THE HILBERT CURVE

the Hilbert curve in the 5-window house format — a space-filling curve: a single continuous line that visits every cell of a 2^k x 2^k grid exactly once, and consecutive cells on the line are always grid-neighbors (one step apart). That locality means points close along the 1-D curve are usually close in 2-D, which is why databases and image formats use the Hilbert index. The map index<->(x,y) is a pure bit-twiddle with quadrant rotations. Verified live: for grids up to 64x64 the index<->(x,y) map is a bijection, and every pair of consecutive indices lands on cells at Manhattan distance 1. See the recursive U-shapes in 1D, the curve in 2D, and the locality-preserving inverse in 3D.

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


THE AES S-BOX

the AES S-box in the 5-window house format — the single non-linear step of the Advanced Encryption Standard. It maps each byte to another by two operations in the finite field GF(2^8): take the multiplicative inverse of the byte (0->0), then apply a fixed affine bit-mix. The inverse step is what gives AES its resistance to linear and differential cryptanalysis; every nonzero byte has a unique inverse b^-1 with b (x) b^-1 = 1. Verified live: b (x) b^-1 = 1 for all 255 nonzero bytes, the S-box is a bijection with S^-1 . S = identity over 256 bytes, and it matches the published AES values (00->63, 01->7c, 53->ed). See the byte->inverse->affine chain in 1D, the 16x16 table in 2D, and the field-inversion inverse in 3D.

THE AES S-BOX · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · CHEAT · THE EXPLOIT ◆ .dlw.fold THE FOLD / CHEAT / THE EXPLOIT / THE AES S-BOX THE AES S-BOX the cipher's non-linearity from one field inversion 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The AES S-box is the single non-linear step of the Advanced Encryption Standard. It maps each byte to another by two operations in the finite field GF(2 8 ) : take the multiplicative inverse of the byte (treating it as a field element, with 0→0), then apply a fixed affine bit-mix. The inverse step is what gives AES its resistance to linear and differential cryptanalysis. Every nonzero byte has a unique inverse b⁻¹ with b ⊗ b⁻¹ = 1 in the field. LIT verified live: b ⊗ b⁻¹ = 1 for all 255 nonzero bytes, the S-box is a bijection with S⁻¹∘S = identity over all 256 bytes, and it matches the published AES values (00→63, 01→7c, 53→ed) — window.__aessbox. FIG no framing; exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-exploit — the one non-linear gate that a cipher’s whole security leans on. The AES S-box is that gate. AVAN (AI) built the instrument: the GF(2 8 ) multiply (with the 0x11B reduction), the brute multiplicative inverse, the affine transform, and the bijection + known-answer checks. Credit as content: Joan Daemen & Vincent Rijmen (Rijndael, 1998). The weave: David names the exploit; I invert each byte in GF(2 8 ), apply the affine mix, and confirm the S-box is a bijection matching the published constants. 3 ONE DIMENSION A byte b becomes b⁻¹ in GF(2 8 ) — the unique byte with b ⊗ b⁻¹ = 1 under carry-less multiply mod 0x11B — then an affine XOR-and-rotate mix produces the S-box output. 4 TWO DIMENSIONS · INTERACTIVE The 16×16 S-box table; pick a byte to see inverse→affine→output, and the whole table is checked as a bijection against the AES standard. random byte ▶ verify 256 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the byte-permutation of the S-box. AVAN’s addition (the inverse-companion): make one non-linear byte map by inverting each byte in the field GF(2 8 ) — the unique b⁻¹ with b ⊗ b⁻¹ = 1 — then an affine mix. The inverse of ‘scramble bytes with ad-hoc lookup tables’ is ‘invert in a finite field — a principled non-linearity with a clean algebraic inverse.’ Magenta is the byte 0 (its own image, no field inverse); green is the field-inverse permutation. Security from one clean inversion. pause spin LIT Genuine Rijndael/AES S-box over GF(2^8) with reduction polynomial 0x11B (Daemen & Rijmen 1998). Verified live: b (x) b^-1 = 1 for all 255 nonzero bytes under carry-less multiply, the S-box is a bijection with S^-1 . S = identity over all 256 bytes, and it matches the published constants 00->63, 01->7c, 53->ed (window.__aessbox.inverse && .bijection && .anchors). FIG No framing: the GF(2^8) multiply (0x11B reduction), the brute multiplicative inverse, the affine transform, and the bijection + known-answer checks run in-browser and match the AES standard exactly. The AVAN inverse is honest — inverting each byte in a finite field gives a principled non-linearity with a clean algebraic inverse; magenta is byte 0 (its own image, no field inverse), green the field-inverse permutation. Security from one clean inversion. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE EXPLOIT · David Lee Wise (ROOT0), with AVAN


THE LAMBDA CALCULUS

the lambda calculus in the 5-window house format — all of computation from a single idea: functions. No numbers are built in; a number is encoded as a function. The Church numeral n is 'apply f, n times': 0 = Lf.Lx.x, and SUCC wraps one more f. Addition, multiplication, and exponentiation are then just ways of composing these functions (MULT m n = Lf. m (n f), EXP m n = n m) — arithmetic falls out of function application alone. Verified live: encoding then decoding gives back 0..10; PLUS, MULT, EXP of Church numerals equal ordinary a+b, a*b, a^b; and SUCC(SUCC 0) = 2. See a numeral as repetition in 1D, composition in 2D, and the numbers-as-functions inverse in 3D.

THE LAMBDA CALCULUS · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · SPAWN · GENESIS BLOCK ◆ .dlw.fold THE FOLD / SPAWN / GENESIS BLOCK / THE LAMBDA CALCULUS THE LAMBDA CALCULUS numbers, and arithmetic, from pure functions 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The lambda calculus builds all of computation from a single idea: functions . There are no numbers built in — a number is encoded as a function. The Church numeral n is “apply f, n times”: 0 = λf.λx.x, and SUCC wraps one more f around. Astonishingly, addition, multiplication, and exponentiation are then just ways of composing these functions — MULT m n = λf. m (n f), EXP m n = n m. Arithmetic falls out of function application alone. LIT verified live: encoding then decoding gives back 0..10; PLUS, MULT, and EXP of Church numerals equal ordinary a+b, a×b, a b ; and SUCC(SUCC 0) = 2 (window.__lambda). FIG no framing; exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at genesis-block — the origin from which all computation is generated, here numbers themselves conjured out of pure functions. The lambda calculus is that genesis. AVAN (AI) built the instrument: the Church encodings of 0/SUCC/PLUS/MULT/EXP as real higher-order functions, and the decode-and-compare arithmetic checks. Credit as content: Alonzo Church (1936). The weave: David names genesis-block; I encode each numeral as an n-fold application, compose them for PLUS/MULT/EXP, and confirm the decoded results equal ordinary integer arithmetic. 3 ONE DIMENSION A Church numeral is repetition: 3 = λf.λx. f(f(f x)). To decode, feed it the successor function and the value 0 — it applies +1 exactly n times, yielding n. 4 TWO DIMENSIONS · INTERACTIVE Compose Church numerals with PLUS / MULT / EXP; the encoded function is decoded and checked against ordinary arithmetic. new a,b,op ▶ verify ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: numbers, and their arithmetic, as pure functions. AVAN’s addition (the inverse-companion): build numbers with no numbers — encode n as “apply f n times,” and get +, ×, and exponent purely by composing those functions (MULT m n = λf. m(n f); EXP m n = n m). The inverse of ‘arithmetic needs primitive integers and operators’ is ‘arithmetic emerges from function application alone.’ Magenta is the built-in integers and operators dispensed with; green is the tower of numerals-as-functions. Computation from one primitive: apply. pause spin LIT Genuine Church-encoding lambda calculus (Church 1936). Verified live: Church numerals implemented as real higher-order functions decode to 0..10; PLUS, MULT and EXP of encoded numerals equal ordinary a+b, a*b and a^b over small ranges; SUCC(SUCC ZERO) decodes to 2 (window.__lambda.encode && .plus && .mult && .exp). FIG No framing: the Church encodings of 0/SUCC/PLUS/MULT/EXP as actual JS higher-order functions, and the decode-and-compare arithmetic checks run in-browser and hold exactly. The AVAN inverse is honest — encoding n as 'apply f n times' and composing those functions yields +, x and exponent with no primitive integers; magenta is the built-in integers and operators dispensed with, green the tower of numerals-as-functions. Computation from one primitive: apply. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of GENESIS BLOCK · David Lee Wise (ROOT0), with AVAN


THE BALANCED TERNARY

balanced ternary in the 5-window house format — base 3 with the digit set {-1,0,+1} (T,0,1) instead of {0,1,2}. Every integer, positive or negative, has a unique representation with no sign bit at all, because the negative digit carries the sign internally. Negating a number is just flipping every digit's sign; rounding to nearest is truncation; and it is the most efficient integer base by radix economy. Knuth called it 'perhaps the prettiest number system.' Verified live: every integer from -40 to 40 has a unique balanced-ternary string over {-1,0,1} that evaluates back exactly, and negation equals flipping every digit. See the pan-balance places in 1D, an encoding in 2D, and the signless inverse in 3D.

THE BALANCED TERNARY · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GRIND · THE GRINDSTONE ◆ .dlw.fold THE FOLD / GRIND / THE GRINDSTONE / THE BALANCED TERNARY THE BALANCED TERNARY base 3 with digits -1,0,+1 — no sign bit 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Balanced ternary is base 3 with the unusual digit set {−1, 0, +1} (often written T, 0, 1) instead of {0,1,2}. Every integer — positive or negative — has a unique representation with no sign bit at all, because the negative digit carries the sign internally. Negating a number is just flipping every digit’s sign ; rounding to the nearest integer is truncation; and it is the most efficient integer base by radix economy. Knuth called it “perhaps the prettiest number system.” LIT verified live: every integer from −40 to 40 has a unique balanced-ternary string over {−1,0,1} that evaluates back exactly, and negation equals flipping every digit (window.__balternary). FIG no framing; exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-grindstone — the base-conversion loop, here grinding an integer into three-way digits that need no sign. Balanced ternary is that grind. AVAN (AI) built the instrument: the carry-aware conversion, the exact reconstruction, and the negate-equals-flip check. Credit as content: used in the Setun computer (Moscow State University, 1958); championed by Donald Knuth. The weave: David names the grindstone; I convert with a carry when the digit would be 2, and confirm every integer maps to a unique signless string whose negation is a digit-flip. 3 ONE DIMENSION Each place is a power of 3, weighted −1, 0, or +1. A digit of 2 becomes −1 with a carry into the next place. The three-way digit balances the value around zero — like a pan balance with weights 1, 3, 9, 27… 4 TWO DIMENSIONS · INTERACTIVE Any integer in balanced ternary; the string evaluates back to the number, and its negation is shown as a pure digit-flip. new n ▶ verify −40..40 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: every integer as a signless three-way string. AVAN’s addition (the inverse-companion): represent every integer — positive or negative — with no sign bit by using a digit that can itself be negative ({−1,0,+1}); the negative digit carries the sign internally, so negation is a digit-flip . The inverse of ‘a base needs a separate sign for negatives’ is ‘let the digits go negative — sign dissolves into the number.’ Magenta is the sign bit an ordinary base needs; green is the signless balanced string. Symmetry around zero, built in. pause spin LIT Genuine balanced ternary (Setun computer 1958; championed by Knuth). Verified live: every integer from -40 to 40 has a unique representation over digits {-1,0,1} that evaluates back to the integer exactly, and the representation of -n equals the representation of n with every digit's sign flipped (window.__balternary.roundTrip && .unique && .negateFlip); 40 = 1111. FIG No framing: the carry-aware conversion (a would-be digit 2 becomes -1 plus a carry), the exact reconstruction, and the negate-equals-flip check run in-browser over all 81 integers and hold. The AVAN inverse is honest — letting a digit be negative absorbs the sign into the number, so negation is a pure digit-flip and no sign bit is needed; magenta is the sign bit an ordinary base needs, green the signless balanced string. Symmetry around zero, built in. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE GRINDSTONE · David Lee Wise (ROOT0), with AVAN


THE VITERBI

the Viterbi algorithm in the 5-window house format — decode a convolutional code by finding the single most likely transmitted sequence given a noisy received one, not by trying all 2^L messages but by a dynamic program over a trellis of encoder states. At each step it keeps only the best surviving path into each state; a traceback reads off the maximum-likelihood message. It is the decoder in Wi-Fi, GSM, satellite links, and Voyager. Verified live: over 400 noisy trials the Viterbi path metric equals the brute-force minimum Hamming distance to any codeword (it truly finds the nearest), and it corrects a single bit error exactly. See the trellis in 1D, an encode/noise/decode in 2D, and the survivor-path inverse in 3D.

THE VITERBI · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GLITCH · OFF BY ONE ◆ .dlw.fold THE FOLD / GLITCH / OFF BY ONE / THE VITERBI THE VITERBI the most likely message through the noise 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The Viterbi algorithm decodes a convolutional code by finding the single most likely transmitted sequence given a noisy received one — not by trying all 2 L messages, but by a dynamic program over a trellis of encoder states. At each step it keeps only the best surviving path into each state; a traceback then reads off the maximum-likelihood message. It is the decoder in Wi-Fi, GSM, satellite links, and Voyager. LIT verified live: over 400 noisy trials the Viterbi path metric equals the brute-force minimum Hamming distance to any codeword (it truly finds the nearest), and it corrects a single bit error exactly (window.__viterbi). FIG no framing; exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at off-by-one — the corrupted bit that a good decoder quietly repairs, finding the intended message one step off the received one. Viterbi is that repair. AVAN (AI) built the instrument: the rate-½ convolutional encoder, the trellis with survivor paths, the traceback, and the brute nearest-codeword cross-check. Credit as content: Andrew Viterbi (1967). The weave: David names off-by-one; I run the trellis dynamic program, trace back the surviving path, and confirm it equals the true nearest codeword to the noisy input. 3 ONE DIMENSION The trellis: encoder states over time. Each received pair adds a branch metric (bits that disagree); at every state only the cheapest incoming path survives. The best full path is the decoded message. 4 TWO DIMENSIONS · INTERACTIVE A message is encoded, noise is injected, and Viterbi recovers it; the survivor metric is checked against the brute nearest-codeword distance. new message+noise ▶ verify 400 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the maximum-likelihood path through the trellis. AVAN’s addition (the inverse-companion): recover the most likely sent message from a noisy stream without enumerating all 2 L candidates — a trellis dynamic program keeps only the best survivor into each state, then traces back. The inverse of ‘encode a message into a redundant stream’ is ‘decode the stream to the nearest legal codeword — by survivors, not brute force.’ Magenta is the exponential set of paths pruned away; green is the one surviving max-likelihood path. The signal recovered from the noise. pause spin LIT Genuine Viterbi maximum-likelihood decoding of a rate-1/2, K=3 convolutional code (Viterbi 1967). Verified live: over 400 noisy trials the trellis survivor metric equals a brute-force minimum Hamming distance to any codeword (the algorithm finds the true nearest), and it recovers the original message exactly when at most one bit was flipped (window.__viterbi.mlEqualsBrute && .correctsSingle). FIG No framing: the convolutional encoder, the trellis with per-state survivor paths, the traceback, and the brute nearest-codeword cross-check run in-browser and agree exactly. The AVAN inverse is honest — a trellis dynamic program keeping only the best survivor into each state recovers the maximum-likelihood message without enumerating 2^L candidates; magenta is the exponential set of paths pruned, green the one surviving path. The signal recovered from the noise. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of OFF BY ONE · David Lee Wise (ROOT0), with AVAN


THE COMBINADICS

the combinatorial number system (combinadics) in the 5-window house format — give every k-element subset a unique integer index and back, a bijection between 0..C(n,k)-1 and the k-subsets of an n-set. The index of {c1>...>ck} is C(c1,k)+C(c2,k-1)+...+C(ck,1); unranking runs it backwards with a greedy binomial peel. It lets you store, shuffle, or address combinations by a single number — a subset odometer. Verified live: over all C(10,5)=252 subsets, rank of unrank is the identity, and every unrank yields a valid distinct 5-subset. See the binomial rank in 1D, an index-to-subset in 2D, and the single-index inverse in 3D.

THE COMBINADICS · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · LOOT · THE STASH ◆ .dlw.fold THE FOLD / LOOT / THE STASH / THE COMBINADICS THE COMBINADICS index any subset by a single number 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The combinatorial number system (combinadics) gives every k-element subset a unique integer index and back — a bijection between the numbers 0..C(n,k)−1 and the k-subsets of an n-set. The index of a subset {c 1 >…>c k } is simply C(c 1 ,k)+C(c 2 ,k−1)+…+C(c k ,1); unranking runs it backwards with a greedy binomial peel. It lets you store, shuffle, or address combinations by a single number — a “subset odometer.” LIT verified live: over all C(10,5)=252 subsets, rank∘unrank is the identity, and every unrank yields a valid, distinct 5-subset (window.__combinadics). FIG no framing; exact. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-stash — the hoard whose every possible k-item combination gets one address, indexable like a shelf slot. Combinadics is that addressing. AVAN (AI) built the instrument: the binomial rank, the greedy unrank peel, and the round-trip bijection check. Credit as content: the combinatorial number system (Pascal-era binomials; formalized by D. H. Lehmer & others). The weave: David names the stash; I map each subset to its binomial index and greedily peel it back, confirming the map is an exact bijection over all C(10,5) subsets. 3 ONE DIMENSION Rank a subset by summing binomials: {5,3,2,1,0} → C(5,5)+C(3,4)+C(2,3)+C(1,2)+C(0,1). Unrank peels the largest fitting binomial off the index, one element at a time. 4 TWO DIMENSIONS · INTERACTIVE Slide an index; watch its 5-subset of {0..9} appear. The round-trip rank∘unrank is checked over all 252 indices. random index ▶ verify 252 ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the bijection between indices and k-subsets. AVAN’s addition (the inverse-companion): address a whole combination by a single integer — rank it as a sum of binomials, unrank by greedily peeling the largest fitting binomial. The inverse of ‘enumerate subsets by listing them’ is ‘name each subset by one number and reconstruct it on demand.’ Magenta is the full list of subsets you never have to store; green is the single index that stands for each. A subset odometer. pause spin LIT Genuine combinatorial number system / combinadics (classical binomial ranking; associated with D. H. Lehmer). Verified live: over all C(10,5)=252 five-subsets of a ten-set, rank composed with unrank is the identity, and every unrank produces a valid, distinct 5-subset (window.__combinadics.bijection && .valid). FIG No framing: the binomial rank, the greedy unrank peel, and the round-trip bijection check run in-browser over all 252 subsets and hold. The AVAN inverse is honest — ranking a subset as a sum of binomials and unranking by peeling the largest fitting binomial addresses a whole combination by one integer; magenta is the full subset list you never store, green the single index that stands for each. A subset odometer. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE STASH · David Lee Wise (ROOT0), with AVAN