·
· from-scratch C++20 · 125 verification tests, 0 failing · MIT
▶ Live site — derekmarshall.github.io/primeknots — interactive viewers, the write-ups, and the deck, all rendered.
Read the research (M5 track):
- A pre-registered replication of the Sawin–Sutherland height-ordered murmuration — the data note (PDF)
- What it took: methods, failures, and costs of an AI-driven replication — the methods companion, on how the work was done, what it cost, and what caught the failures (PDF)
▶ Explainer deck (live, with embedded viewers) · PDF · the error ledger
Arithmetic topology, executable. A from-scratch, dependency-free C++ suite that verifies — not just states — the theorem chain running from quadratic reciprocity (as linking symmetry) through Rédei symbols (triple Milnor invariants, Borromean primes) and the Rédei–Reichardt 4-rank theorem (linking controls homology) to the abelian arithmetic Chern–Simons partition function (linking determines the TQFT), the Weil explicit formula (the orbit/spectrum duality), and non-abelian S₃ Dijkgraaf–Witten counting (gauge theory as cubic-field tabulation). Every result is computed two independent ways or refereed by an external oracle; visualizations are emitted as JSON and rendered by static D3 viewers.
No new mathematics: every theorem here is known (Gauss 1801 through Stevenhagen 2022). The output is the verification, the tables, and the method.
The name primeknots is an origin homage — the knots-and-primes analogy of arithmetic
topology — kept deliberately as the project grew past it (into elliptic-curve murmurations and
more); it is a starting point, not a scope claim (CLAUDE.md rule 7).
Each panel is rendered by a static viewer from emitted JSON only (./build/bin/at emit --stage N; sources in viz/).
| Stage | Object / theorem verified | Tests |
|---|---|---|
| 0 | Primitives; quadratic reciprocity + both supplements (exhaustive to 10⁶) | 11 |
| 1 | The linking matrix of primes ≡ 1 (mod 4); reciprocity = symmetry | 9 |
| 2 | Rédei symbols, Rédei reciprocity (S₃ symmetry), Borromean triples | 10 |
| 3 | Class groups as H₁; the Rédei–Reichardt 4-rank (form-side vs linking-side) | 8 |
| 4 | The abelian arithmetic Chern–Simons / Dijkgraaf–Witten partition function | 4 |
| 5 | Weil explicit formula; Riemann–Siegel zeros (Turing-certified); model flow | 13 |
| 6 | Non-abelian S₃ Dijkgraaf–Witten counting vs cubic-field tabulation | 8 |
| total | 63 (10 oracle-refereed) |
All green; stage gates are strict — nothing builds on a stage whose suite isn't.
A second, independent track (spec docs/RESEARCH-M.md, engineering
docs/ARCHITECTURE-M.md) replicates murmurations — the oscillating
correlation between Frobenius traces a_p and root numbers of elliptic curves, discovered in
2022 — from scratch, under the same discipline. Two modes, never blurred: replication (M0–M4)
and pre-registered research (M5). No proofs are claimed (rule 7).
| Stage | Object replicated | Tests |
|---|---|---|
| M0 | a_p machinery + data provenance (char-sum referee, O(p) fast path, Shanks–Mestre O(p^{1/4}) twin) |
9 |
| M1 | The murmuration, replicated (the 2022 discovery) | 3 |
| M2 | Dirichlet characters, fully from scratch | 6 |
| M3 | Zubrilina's murmuration density (the crown replication) | 16 |
| M4 | Sawin–Sutherland height-ordered density (a conjectured density + a proven variant) | 13 |
| M5 | Research mode — a pre-registered height-family study | 13 |
| M5 gate | 2¹⁸ a_p twin + oracle spot (heavy, compute-box only) |
2 |
| total | 62 |
The M5 write-up is the data note (docs/notes/data-note/).
Across both ladders: 125 verification tests (63 + 62), plus 4 infrastructure guards (freshness,
JSON-schema, deck, explainers, constants) = 129 ctest targets, 17 oracle-refereed.
The discipline is in CLAUDE.md. The load-bearing rules:
- Never fit conventions to expected answers. If a published anchor comes out wrong, the bug is in the code or in our reading of the source — go fix the reading, never flip a sign until the number appears.
- Dual implementation before trust. Every load-bearing function has two independent algorithms, or an external oracle (PARI/GP, the Odlyzko zero table, Belabas's cubic enumerator). "A result computed one way is a rumor."
- Oracles referee, never replace — and SKIP visibly (never a silent pass) when absent. CI runs a fast smoke subset (core arithmetic, one M-stage, and the freshness guard) so every branch push is refereed in minutes; the full suite runs locally and on the compute box. In CI the oracle tests SKIP, the rest green.
- Flag, don't smooth. Ambiguities and source discrepancies are recorded, not quietly resolved to whatever makes tests pass.
Every party that touched the project — roadmap generator, LLM assistant, spec
author, human reviewer, coding agent, external referees — was caught in at least one
error, each by a witness value, an exhaustive sweep, an algebraic identity, a parity
argument, an oracle cross-check, or a verbatim quote, never by an argument from
authority. The record is docs/ERRATA.md.
This is n=1 — one project, one problem class, one operator: an existence proof that the discipline can be applied, not evidence that it generalizes.
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j
ctest --test-dir build --output-on-failure # full suite (125 verification tests); oracle tests SKIP if gp/data absent
ctest --test-dir build -L m4 # one stage (labels: stage0..stage6, m0..m5, oracle)
./build/bin/at emit --stage 1 --out viz/data # emit JSON for the viewers
python3 -m http.server -d viz # view at localhost:8000C++20, core dependency-free (__int128 built-ins); GMP only behind a facade where a
stage needs it. Test framework: doctest (vendored). Oracles (PARI/GP, Odlyzko table,
Belabas cubic) are optional — their tests SKIP cleanly when the tool or data is
absent, e.g. in CI.
- Explainers (prerequisite-free, prose):
E1 — murmurations,E2 — primeknots,E3 — method; every claim sourced inCLAIMS-E.md. docs/RESEARCH.md— the mathematics, stage by stage, with normative sources.docs/ARCHITECTURE.md— modules, types, the JSON/viewer contract, acceptance criteria.docs/RESEARCH-M.md/docs/ARCHITECTURE-M.md— the M-ladder (murmurations): mathematics + engineering.docs/notes/— per-stage pinning logs and resolved discrepancies;docs/notes/data-note/— the M5 data note.docs/ERRATA.md— the error ledger.src/core → symbols → linking → redei → classgroup → cs → zeta → dw, plus the M-ladder — ell (elliptic curves /a_p) · mform (modular forms) · murm (murmurations);verify/the point of the repo;oracle/referees;viz/viewers.



