ES
← Back to Portfolio
Research & Thesis September 2026

GapTheo, a Visual Atlas of the Three-Gap Theorem

Place the first N multiples of an irrational number on a circle and the gaps between neighbours take at most three distinct lengths. GapTheo keeps that sorted finite orbit as the primary live calculation and synchronises it with eleven linked readings of the same object: Farey-cell geometry, continued fractions, return gaps, cyclic words, a lattice schematic, a two-interval exchange lens and a finite 0D Rips topology view. Twelve canonical cases, an exact finite direct oracle, generated certificates, a staged reference pipeline, a complete benchmark, the manuscript source and a deep wiki ship together. Seeded random placement, a farthest-point allocator and a two-frequency extension are explicit contrast regimes, never silently treated as inputs to the classical theorem. No new theorem or formal proof is claimed.

Cases and readings
12 canonical cases, 11 linked mathematical readings, generated certificates and validation scripts, a staged reference pipeline and an artifact-backed benchmark
Documentation
6 routes, 35 documentation tabs, 5 architecture plates, the manuscript source and a public deep research review, in English and Spanish
Rendered verification
Every route and top-level tab in both languages, the plates in both themes, direct routes, a 390 by 844 viewport with no document overflow, no gradients and no opaque-black SVG marks; literal labels verified in both languages
What is not claimed
No new theorem, no formal proof, no adoption or external user evidence
Deploy
GitHub Pages at a custom domain, the exact main commit published; shared @fasl-work/caos-app-shell
Architecture diagram of GapTheo, a Visual Atlas of the Three-Gap Theorem
#mathematics #dynamical-systems #three-gap-theorem #continued-fractions #farey #visualization #reproducible-research #education

Business Context

GapTheo is a research and teaching instrument. Its value is that a claim about the orbit can be checked on the screen against a certificate rather than trusted from a figure, and that the eleven readings are one object rather than eleven drawings. That makes it usable in a lecture, in a reading group and as a reference implementation for anyone who needs the sorted orbit and its Farey certificate as data. No adoption or external user evidence is claimed; the value axis of the plan is recorded as unvalidated.

Strategic Value

The product is complete as a research application: twelve cases, eleven linked readings, the pipeline, the benchmark, the manuscript and the wiki are implemented and tested, and it makes no claim beyond them. Its most instructive release is v0.03.002, which corrected a visual-ownership failure in v0.03.000: a bespoke teal and green theme, decorative gradients, custom fonts, local copies of the shell and promotional headings had crept into the app, and they were removed so that the shared shell owns the visual layer again; CI now rejects app-owned theme, palette, font and shell-primitive styling. Production QA covers every route and top-level tab in both languages, the five plates in both themes, direct routes and a phone viewport, and verifies literal labels such as the circular gap partition and the Farey and continued-fraction certificate in both languages.

The Challenge

The three-gap theorem is one of the cleanest statements in Diophantine approximation, and one of the hardest to see: the same finite orbit is at once a set of points on a circle, a walk through the Farey tessellation, a truncated continued fraction, a cyclic word over two or three letters, an interval exchange and a lattice. Textbook figures show one of these at a time. A reader who wants to move N or the rotation number and watch every reading change together has no instrument for it, and a research application that tried to offer one would have to keep every view an exact, certified function of the same orbit rather than a decoration.

Our Approach

The sorted finite orbit is the primary live calculation, computed by an exact finite direct oracle, and every other view is derived from it and kept in sync: the circular gap partition, the Farey-cell geometry with its continued-fraction certificate, return gaps, cyclic words, the lattice schematic, the two-interval exchange lens and a finite 0D Rips topology view. Twelve canonical cases cover the rotation numbers a reader would reach for, each with generated certificates and validation scripts, and the staged reference pipeline bakes them for the artifact-backed benchmark. Three contrast regimes are offered on purpose and labelled as such: seeded random placement, a farthest-point allocator and a two-frequency extension, none of which is an input to the classical theorem. The CAOS shell owns palette, typography, themes, cards, buttons, tabs, page structure and callouts; six routes, 35 documentation tabs and five architecture plates render in English and Spanish, in both themes, down to a 390 pixel viewport with no document overflow. The manuscript source and a public deep research review ship in the repository.

Key Performance Indicators

KPIBaselineResultImpact
One orbit, eleven exact readingsOne textbook figure at a timeThe sorted finite orbit is the live primary calculation; Farey cells, continued fractions, return gaps, cyclic words, lattice, interval exchange and Rips topology are derived from it and stay in sync as N and the rotation number moveA claim is checked against a certificate, not a picture
Contrast regimes kept apartExperiments that quietly become inputs to the theoremSeeded random placement, a farthest-point allocator and a two-frequency extension are labelled as contrasts and never fed to the classical statementThe theorem stays the theorem
A visual regression, owned and revertedv0.03.000 shipped a bespoke theme over the shared shellv0.03.002 removed it; the shell owns the visual layer and CI rejects app-owned themingThe fleet standard is enforced, not assumed

Architecture

gaptheo pipeline

gaptheo pipeline

Technology Stack

TypeScript React Vite Python NumPy KaTeX

Application Screenshots

GapTheo, a Visual Atlas of the Three-Gap Theorem
GapTheo, a Visual Atlas of the Three-Gap Theorem