◀ THE FOLD0ROOT.AI // WORLD II · GRIND · THE GRINDSTONE◆ .dlw.fold
THE FOLD / GRIND / THE GRINDSTONE / THE RATIONAL TREE

THE RATIONAL TREE

every fraction once, in lowest terms, no gcd
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.
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.
LIT A genuine Stern-Brocot tree. Verified live: to depth 11 (2047 fractions) every one is in lowest terms (gcd=1), none repeats, each is the mediant of its two boundary parents, and the L/R path to a fraction is its continued fraction (22/7 → RRRLLLLLL = [3,7]). Mediants of coprime neighbours stay coprime — that's why no gcd is ever needed (verifiable: window.__sternbrocot.lowestTerms && noRepeat && mediantProperty).

FIG 'The rational tree' is the picture; the once-each enumeration, the automatic lowest-terms, and the continued-fraction path are exact. The path really is Euclid's algorithm read as directions — the sphere sits beside THE EUCLID on purpose.
◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE GRINDSTONE · David Lee Wise (ROOT0), with AVAN