Commit graph

2 commits

Author SHA1 Message Date
359effdfc6 feat(spectral): f/Cartan integration — exact spiral packing, f(n) layout, Cartan Δ-floor, torus-winding fix
STEP 1 — integer spiral-index packing (EXACT): pack_spiral_index/
unpack_spiral_index with corpus-wide base=2·max|c|+1 and offset-encoded
digits, recorded in the codebook JSON header; round-trip verified over
all 250 matrices. Fixes the sign bug in integration_sprint.py's integer
path (unoffset signed packing collapsed (-1,1) with (1,0) in base 2).

STEP 2 — f(n) layout (DECORATIVE): per-entry radius_sq + angle_frac,
computed in decimal arithmetic (indices reach ~1e44 >> 2^52); verified
against VERIFICATION_LOG V007 f(20121); min angular separation ≈4.64e-6
of a turn reported.

STEP 3 — Cartan Δ-floor (--cartan-floor): Δ=17/1792 exact
(CartanConnection.lean:70) as Fisher-distance resolution floor on Δ₇;
13 sub-Δ pairs merge 196 fingerprints into 187 Δ-resolution codewords
vs 9 gap-rule clusters; emitted alongside, not replacing, the 3×-median
rule. Caveat asserted in tests: the |c|/Σ|c| simplex projection is
lossy (one corpus pair at Fisher distance 0) — similarity, not identity.

STEP 4 — torus-winding saturation fix: TorusWinding gains
a_exact/b_exact (plain ℤ, no Q16.16 clamp); torus_to_spiral_index
prefers them, making the round trip lossless (regression-tested at
n=1e9). BraidEigensolid.lean needs the same widening — noted, Lean
untouched.

Also corrects charpoly_codebook.py's stale docstring counts (192/180 →
196/182, cross-checked against the exact Faddeev–LeVerrier fingerprints:
identical on all 250 matrices).

Tests: 43 passed (19 new).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-01 20:53:47 -05:00
allaunthefox
f96de68af8 feat: exact charpoly codebook + fix design doc
python/charpoly_codebook.py:
- Exact characteristic polynomial as codebook key
- 196 unique fingerprints vs 182 from spectral radius (8% improvement)
- 13 cospectral groups identified (same polynomial, different matrix)
- Cartan floor Δ=17/1792 as operator resolution bound
- 72 pairs within Cartan floor but distinguishable by charpoly
- Cayley-Hamilton verifiable in Z (integer-only doctrine)
- Verification: all checks pass

data/charpoly_codebook.json:
- 250 entries with exact charpoly coefficients
- Spectral radius computed from polynomial (not power iteration)
- Cartan-floor snapped values for operator-level grouping

docs/FIX_DESIGN.md:
- Fix 1: Lean charpoly via Faddeev-LeVerrier (design, not yet implemented)
- Fix 2: Python charpoly codebook (IMPLEMENTED)
- Fix 3: Cartan floor as distinguishability bound (IMPLEMENTED)
- Fix 4: Integer spiral packing (already done in cd91eca)
- Open questions for Lean-side integration
2026-07-01 21:15:46 +00:00