mirror of
https://github.com/allaunthefox/Research-Stack.git
synced 2026-07-31 03:05:21 +00:00
Resolves the convergence_to_fixed_point failure by proving the correct eigensolid statement: stepExact stabilizes all value components (N_7, N_8, N_11) in one application. The original theorem was mathematically false (iteration counter is free-running). QC cleanup sweep across Physics/ (20 files): - 3 remaining LOW items fixed: h00/h01 factoring, rD->rd, rdDr1/rdDr2 x100 - 6 of 7 sorry theorems proved; 1 explicitly FAILED (convergence) - Unused imports removed, naming violations fixed, #eval witnesses added - 210 -> 144 issues remaining (all WARNING/INFO, zero ERROR) New tooling: - scripts/qc-flag/lean_qc_flagger.py implemements 5-point inspection protocol - Outputs structured JSON + Markdown pass/fail reports DAG receipts at shared-data/data/stack_solidification/qc_*_dag_2026-05-13.md
2.1 KiB
2.1 KiB
QC Fix DAG — L10: h00/h01 Helper Factoring
Date: 2026-05-13
Examiner: subagent-task
Verdict: PASS
Input
0-Core-Formalism/lean/Semantics/Semantics/Physics/UniversalBridge.lean
Transformation
- Created
hermiteSharedTermsprivate helper factoring shared Q16.16 arithmetic - Refactored
h00andh01to use helper
Output
0-Core-Formalism/lean/Semantics/Semantics/Physics/UniversalBridge.lean(modified)
Verification
- Command:
lake build - Result: PASS
- Jobs: 3530
Diff
diff --git a/0-Core-Formalism/lean/Semantics/Semantics/Physics/UniversalBridge.lean b/0-Core-Formalism/lean/Semantics/Semantics/Physics/UniversalBridge.lean
index c652b1bb..9913a2b7 100644
--- a/0-Core-Formalism/lean/Semantics/Semantics/Physics/UniversalBridge.lean
+++ b/0-Core-Formalism/lean/Semantics/Semantics/Physics/UniversalBridge.lean
@@ -33,6 +33,13 @@ private def q16_add (a b : Int) : Int := a + b
private def q16_sub (a b : Int) : Int := a - b
+private def hermiteSharedTerms (t : Int) : Int × Int × Int × Int :=
+ let t2 := q16Mul t t
+ let t3 := q16Mul t2 t
+ let term3 := q16Mul (3 * scale) t2
+ let term2 := q16Mul (2 * scale) t3
+ (t2, t3, term3, term2)
+
-- ============================================================================
-- Normalized variable t = (Re − 2300) / 1700, as Q16.16
-- ============================================================================
@@ -48,18 +55,12 @@ def normalizedT (re : Int) : Option Int :=
/-- Basis function h00(t) = (1 − t)²(1 + 2t) = 1 − 3t² + 2t³ -/
def h00 (t : Int) : Int :=
- let t2 := q16Mul t t
- let t3 := q16Mul t2 t
- let term3 := q16Mul (3 * scale) t2
- let term2 := q16Mul (2 * scale) t3
+ let (_, _, term3, term2) := hermiteSharedTerms t
q16_sub (q16_add scale term2) term3
/-- Basis function h01(t) = t²(3 − 2t) = 3t² − 2t³ -/
def h01 (t : Int) : Int :=
- let t2 := q16Mul t t
- let t3 := q16Mul t2 t
- let term3 := q16Mul (3 * scale) t2
- let term2 := q16Mul (2 * scale) t3
+ let (_, _, term3, term2) := hermiteSharedTerms t
q16_sub term3 term2
/-- Basis function h10(t) = (1 − t)²·t -/