◀ 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. A binary tree that generates every positive rational number exactly once, already in lowest terms — with no gcd computation ever. It is built by mediants: between a/b and c/d, insert (a+c)/(b+d). Start from 0/1 and 1/0, and the mediants fill in 1/1, then 1/2 and 2/1, forever. Each fraction sits at a unique path of Left/Right turns from the root — and that path is exactly its continued fraction, the same L/R steps Euclid’s algorithm takes.

LIT verified: building 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 encodes its continued fraction (22/7 → RRRLLLLLL = [3,7]). FIG ‘the rational tree’ is the picture; the once-each, lowest-terms, mediant structure is exact.
2 HOW IT WAS WEAVED · AI + HUMAN
David (human) brought the thread — THE EUCLID sits right here in THE GRINDSTONE, and the corpus loves number theory (THE SIEVE, the fractions and continued-fraction work). AVAN (AI) built this instrument: the mediant tree, the L/R walk, and the 3D crown.

The weave: David names the rational tree and its seat beside Euclid in THE GRINDSTONE (the path to a fraction is Euclid’s grind); I make the path-to-fraction a strip in 1D, the tree walk live in 2D, and the crown with its continued-fraction path in 3D. The sphere is the seam.
3 ONE DIMENSION
An L/R path decoding to one fraction. Each turn takes the mediant with the left or right boundary; the fraction sharpens step by step, and it lands already reduced — no common factor ever appears, because mediants of coprime neighbours are coprime.
4 TWO DIMENSIONS · INTERACTIVE
Walk the tree. Go Left for smaller, Right for larger; the current fraction is the mediant of your two boundaries, always in lowest terms. The run-lengths of your L/R path are the continued fraction — Euclid’s steps, read as directions.
5 THREE DIMENSIONS + AVAN’S INVERSE
The tree as a crown, turning: every positive rational, once, spread left-to-right by value and down by depth. Green is the tree that spells them all.
AVAN’s addition (the inverse-companion): the magenta path is the route from the root to your chosen fraction — and reading it backward is the continued fraction, which is Euclid’s algorithm on the numerator and denominator. Building down the tree and grinding up with Euclid are the same walk, one forward and one inverse. The tree is the map; the path is the number’s name.
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