Commit graph

13 commits

Author SHA1 Message Date
475f6319ea chore(repo): push local 768-commit branch state onto clean remote baseline
This squashes all local history (768 commits) onto the scrubbed PR #90
baseline. Individual commits were lost during filter-repo corruption;
the working tree content is preserved intact.

Build: N/A (working tree state only)
2026-06-15 22:46:50 -05:00
Brandon Schneider
ede983168c feat(lean): complete goldenContractionEnergyDecrease proof + PIST predictions pipeline v2
- PistSimulation.lean: proven goldenContractionEnergyDecrease (no sorry)
  7 supporting lemmas, h_u'_nonneg + h_pt hypothesis, fold induction
- Connectors.lean: restored zeroIsVoid theorem with Q16_16 proof
- CanonSerialization.lean: removed dead theorem, documented blocker
- FixedPointBridge.lean: eliminated Float from compute paths

PIST predictions pipeline:
- pist_matrix_builder.py: reproducible matrix-only builder (SHA256)
- build_pist_matrices_278.py: generates PIST/Matrices278.lean
- PIST/Classify.lean: classifyProxy/classifyExact stubs (v2 surface)
- PIST/Matrices278.lean: 250-entry matrix HashMap
- build_corpus278.py: reads predictions artifact, uses classify*
- Pipeline contract documented in root AGENTS.md

Cleanup:
- Archived 5 orphan pist_* shims, 5 old route_repair variants
- Quarantined PIST/Repair.lean (no external callers)
- Created 4 opencode agents for remaining TODO items

Build: PistSimulation 3309, Compiler 3313, Full 3571 (0 errors)
2026-05-27 12:40:16 -05:00
Brandon Schneider
835299fd9a fix(lean+shim): enforce lean-coding rules across audit surface
## Lean fixes

- RRCLogogramProjection.lean: replace `native_decide` → `decide` in 5
  compiler-surface theorem witnesses (semantic_tear_projects_after_repair,
  semantic_tear_does_not_merge, semantic_tear_uses_quarantine_lane,
  unrepaired_tear_does_not_project, ordinary_logogram_projects_and_merges).
  All 5 pass under `decide`; no logic change.

- PistSimulation.lean: add `-- expect: <value>` to every `#eval`/`#eval!`
  block across §6–§11 (~104 annotation lines). Document 8 undocumented
  `ofRawInt` magic integers in fixtureSpectralWindow (10.0, 20.0, 100.0,
  40.0, 20.0, 10.0, 5.0, 5.0 × 65536).

- DynamicCanal.lean: add `-- expect:` to all 15 #eval witness blocks in
  §17 (fixed-point constructors, DIAT encoding, coarse-graining tests).

- MISignal.lean: add `-- expect: 131072` to both #eval witnesses.

- Functions/BracketedCalculus.lean: add `-- expect: 327680` to #eval.

- AVMIsa/Emit.lean, RRC/Emit.lean, RRC/ReceiptDensity.lean, ReceiptCore.lean:
  previously-staged `-- expect:` additions (from prior session) carried
  forward in this commit.

## Python shim fixes

- Add `# PARTIAL BOUNDARY: contains domain logic; not a provable surface.
  Port to Lean/RRC before treating as authoritative.` to 9 shim files:
  pist_trace_classify_mcp.py, genus0_sphere_shell_demo.py,
  routing_benchmark.py, route_repair_v14a.py, pist_prove_and_classify.py,
  label_canary_theorems.py, validate_rrc_predictions.py,
  pist_receipt_density_injector.py, rrc_pist_shape_alignment.py.

## Build baseline

  lake build Compiler  →  3311 jobs, 0 errors
  lake build           →  3567 jobs, 0 errors

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-05-26 23:17:40 -05:00
Brandon Schneider
95e6cef58d chore(lean): consolidate Compiler surface + goldenContractionEnergyDecrease fix
- lakefile.toml: add Compiler lean_lib with 5 blessed roots
  (Semantics.RRC.Emit, Semantics.AVMIsa.Emit, Semantics.AVMIsa.Run,
  Semantics.ReceiptCore, Semantics.RRCLogogramProjection);
  defaultTargets = ["Semantics", "Compiler"]
- PistSimulation.lean: restore goldenContractionEnergyDecrease theorem body
  (was commented out as TODO forward-ref to arrayKineticEnergy); moved to
  after burgersPhiEnergyStep where all dependencies are in scope;
  proof stub retained with sorry + TODO(lean-port) comment
- AGENTS.md: document blessed Compiler surface, Goal A receipt shape,
  quarantine table, pending proof work, and key Lean 4.30 API notes

Build: 3566 jobs, 0 errors (lake build)

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-05-26 22:05:46 -05:00
Brandon Schneider
7c2d628f7a fix(lean): full lake build green — quarantine 29 probe stubs + 3 Lean 4.30 fixes
Semantics.lean:
- Quarantine 29 missing-file Probe imports (AtomicTimescaleProbe …
  LandauerGeneticClockProbe) that caused `lake build` to crash with
  "no such file or directory" before Lean even ran. All 29 are commented out
  with a TODO(lean-port) block; files don't exist yet.
- Remove bare `import PistSimulation` (line 58) — it caused a
  double-import collision: Semantics.PistSimulation is already reachable via
  Semantics.TreeDIATKruskal, and the Semantics lib also glob-builds
  Semantics/PistSimulation.lean, so the bare root-level import created an
  "environment already contains" error.

PistSimulation.lean:
- Fix fixtureSpectralWindow list literal: ⟨655360⟩ … → Q16_16.ofRawInt N
  (same Subtype.mk two-field pattern fixed throughout this series)
- Quarantine goldenContractionEnergyDecrease theorem: it forward-references
  arrayKineticEnergy (defined 240 lines later); commented out with
  TODO(lean-port): move after arrayKineticEnergy definition

TreeDIATKruskal.lean:
- Fix treeNodeCountExact_pos and treeLeafCountExact_pos: in Lean 4.30
  `simp [treeNodeCountExact/treeLeafCountExact, ihL, ihR]` now closes the
  node case fully; trailing `omega` had "no goals to be solved"

Result: lake build → Build completed successfully (3557 jobs)

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-05-26 21:59:16 -05:00
Brandon Schneider
2de3dd65e2 feat(lean): fix Q16_16 signed mul/div, add N=8 periodic spectrum, formal energy theorem
(a) Fixed Q16_16.mul and Q16_16.div in FixedPoint.lean:
    • Old: raw UInt64 arithmetic on underlying UInt32 values — broke
      for negative operands (sign bit treated as magnitude).
    • New: convert to signed Int, perform operation, saturate at bounds,
      convert back.  Matches Q0_64 pattern.
    • This fixes the golden-contraction energy blowup on mixed-sign
      fields (shock, gaussian, double_shock).
    • Restored proofs for zero_mul, mul_zero, one_mul, mul_one, zero_div
      using native_decide and sorry-TODO boundaries.

(b) Added N=8 periodic lattice spectrum (§11 in PistSimulation.lean):
    • Periodic sine wave (smooth, symmetric)
    • Periodic sawtooth (sharp drop at wrap)
    • Periodic square wave (alternating blocks)
    • Periodic triangle wave (symmetric rise/fall)
    • Periodic single shock (one sharp transition)
    • Full invariant check + energy dissipation + winding consistency
      for all 5 periodic fixtures.

(c) Formal theorem goldenContractionEnergyDecrease:
    • States that golden contraction reduces kinetic energy for convex
      fields (where each point ≥ its 3-point moving average).
    • Proof sketch: u' = (1−φ⁻¹)·c + φ⁻¹·u is a convex combination;
      Jensen's inequality on x² gives Σ(u')² < Σu².
    • Currently a sorry with proof sketch; verified computationally on
      all 14 test fixtures (9 N=5 + 5 N=8).

Spectrum verification results (all 14 fixtures, after mul/div fix):
  N=5 parabola:    E=17.00 → 14.55 (delta = −2.45) ✓
  N=5 shock:       E=4.00  → 3.08  (delta = −0.92) ✓ (was +8241!)
  N=5 gaussian:    E=5.50  → 4.37  (delta = −1.13) ✓ (was +16378!)
  N=5 double_shock:E=9.00  → 5.29  (delta = −3.71) ✓ (was +28866!)
  N=8 periodic_sine:      E=9.50  → 8.78  (delta = −0.72) ✓
  N=8 periodic_sawtooth:  E=45.50 → 40.55 (delta = −4.95) ✓
  N=8 periodic_square:    E=13.50 → 11.50 (delta = −2.00) ✓
  N=8 periodic_single_shock: E=32.00 → 30.22 (delta = −1.78) ✓

Build: lake build Semantics green at 3541 jobs.

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-05-21 01:54:22 -05:00
Brandon Schneider
f33d15b888 feat(lean): spectrum invariant verification harness for Burgers-PhiNUVMAP bridge
Comprehensive §10 test suite running the bridge across 9 initial conditions
and verifying against known invariants:

Test fixtures:
  • smooth parabola (convex, all diffs ≥ 0)
  • shock step (mixed-sign diffs)
  • sinusoidal (convex, same as parabola)
  • rarefaction wave (linear, identity under contraction)
  • asymmetric ramp (linear, non-zero winding)
  • gaussian bump (mixed-sign diffs)
  • zero field (trivial, identity)
  • constant field (linear, identity)
  • double shock (mixed-sign diffs)

Invariant checks:
  • Regime classification via spectral discriminant gate
  • Kinetic energy of initial state (non-negative)
  • Golden-contraction energy dissipation (convex/linear fields)
  • Spatial & temporal winding numbers (physically consistent)
  • CFL-like stability proxy

Key finding: Q16_16.mul/div use raw UInt64 arithmetic on the underlying
UInt32 values, which produces incorrect results for negative operands
(the sign bit is treated as magnitude).  This affects fields where the
golden contraction has negative local deviations (u−c < 0).  Working
cases (convex/linear fields where all u−c ≥ 0) verify correctly:
  – Parabola: E=17.0 → 14.55 (delta = −2.45)  ✓
  – Linear fields: identity contraction (delta = 0)  ✓
  – Zero field: identity (delta = 0)  ✓

Build: lake build Semantics green at 3541 jobs.

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-05-21 01:26:00 -05:00
Brandon Schneider
d5fb1bf711 feat(lean): genus-1 torus carrier — winding numbers, surface braids, and C1/C2 lane formalization
Three interconnected additions resolving the genus-1 vs genus-3 topology
question through structural derivation from the gap-6 prime lane pair:

(a) Burgers-PhiNUVMAP bridge (PistSimulation.lean):
  • `burgersSpatialWinding`: net circulation Σu[i]·dx around torus spatial cycle
  • `burgersTemporalWinding`: t/dt phase-step count (quarter-turns of T²)
  • dims 14-15 now hold (w_space, w_time) instead of reserved zeros
  • Eval witnesses: smooth parabola w_space=10, shock step w_space=4

(b) Torus surface-braid enrichment (BraidEigensolid.lean):
  • `TorusWinding` structure with a, b cycle counts (spatial + phase)
  • `TorusBraidCarrier`: wraps BraidState with torus topology
  • `torusCrossStep`: crossing step with phase winding increment
  • Each crossStep round at step_count mod 4 = 0 adds one phase increment
  • Preserves all existing eigensolid_convergence / receipt_invertible proofs

(c) Genus1TopologyMetaprobe.lean (new module):
  • χ = 0, b₁ = 2 theorems for genus 1
  • C1 = 6k−1 / C2 = 6k+1 lane predicates and gap-6 pair structure
  • Torsion-as-time: 4 steps = 1 torus wrap, phaseAngle in Q16_16 turns
  • Temperature-entropy reciprocity T·S = 1 for single handle
  • Symplectic intersection ω(a,b) = +1, ω(b,a) = −1
  • Surface braid group on T²: winding generators a, b with commutator relation

Build: lake build Semantics green at 3541 jobs.

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-05-21 01:06:37 -05:00
Brandon Schneider
8c7676ada8 feat(lean): add Burgers-PhiNUVMAP bridge — 16D golden-ratio projection for viscous shock fields
- `burgersStateToSpectralWindow`: extracts inner lattice points as 8-bin PIST window
- `burgersStateToRegime`: classifies velocity profile via spectral discriminant
- `burgersFieldToPhiNUVMAP`: projects BurgersState into 16D φ-NUVMAP space
  (dims 0-7: velocity samples, 8: ν, 9: t, 10: max|u|, 11: KE, 12: dissipation,
   13: CFL, 14-15: reserved)
- `burgersPhiDissipationStep`: golden contraction s' = c + φ⁻¹·(s-c) as viscous
  dissipation operator, using 3-point moving average as attractor center
- Eval witnesses for smooth parabola and shock-step fixtures

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-05-21 00:47:07 -05:00
Brandon Schneider
2febafa8e8 feat(lean): add PhiNUVMAP — golden-ratio fractal 16D coordinate system
PhiNUVMAP lifts NUVMAP into a 16D golden-ratio-scaled fractal space:

- phiQ16_16 ≈ 4181/2584 (Fibonacci ratio, error < 10⁻⁹)
- phiInvQ16_16 = φ⁻¹ for exact golden contraction
- 16D vector ops: add, sub, scale, zero
- PhiNUVMAP structure: center + coords + scaleLevel + spectralMode
- Golden contraction law: s' = c + φ⁻¹·(s-c)
- Fractal zoom: zoom in (×φ) / zoom out (×φ⁻¹) by level
- Tree-to-16D projection: TreeDIAT → 16D φ-NUVMAP state
- 16D chaos game with φ-contraction and deterministic perturbation
- 13 #eval! witnesses: φ·φ⁻¹≈1, φ²=φ+1, contraction, zoom, tree projection,
  chaos game convergence

Build: lake build Semantics.PistSimulation = 3309 jobs green.

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-05-21 00:29:27 -05:00
Brandon Schneider
fbf1a54def feat(lean): add TreeDIAT prototype to PistSimulation.lean
TreeDIAT = Tree-to-Shell Coordinate Transform, enabling tree-structured
search traces to participate in PIST spectral refinement alongside
integer-shell (DIAT) data.

Components:
- TreeNode inductive type (binary tree with Nat labels)
- treeMetrics: O(n) extraction of depth, leafCount, nodeCount, maxLabel
- TreeDIAT structure: feature vector packed into Q16_16 space
- treeDIATEmbeddingScore: heuristic bushy=embeddable, stringy=not
- treeDIATToChaosState: project tree features into 3D chaos-game space
- treeSequenceRegime: classify tree sequences by Kruskal-bound proximity
- 14 #eval! witnesses on bushy/balanced/stringy fixtures

Build: lake build Semantics.PistSimulation = 3309 jobs green.

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-05-20 23:56:33 -05:00
Brandon Schneider
81548958bb feat(lean): inline spectral refinement kernel into PistSimulation.lean
Port the Gauss-Jordan LSQ spectral pipeline from the cascade stash
into a self-contained, policy-clean module:

- BraggPeak, MagneticDomain, pseudoVoigtQ16, chiSqWindow inlined
  as pure Q16_16 types (no Float, no string fields in compute paths)
- MagneticRegime inductive type replaces string-based regime classification
- QuadraticPacket with vertex-form (a, h, k, Δ, width, χ²)
- MatrixPacket with Gram matrix G=AᵀA, det3, rank3, trace3, spectral placeholder
- ChaosState + chaosConverge affine IFS contraction loop (converges in 5 steps)
- 13 #eval! witnesses passing on synthetic 8-bin fixture
- Removes dependency on deleted Astrophysics modules

Build: lake build Semantics = 3541 jobs green.

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-05-20 23:48:32 -05:00
Brandon Schneider
5f88abf618 initial: sovereign research stack (consolidated, weightless, and lfs-optimized) 2026-05-04 18:11:36 -05:00