mirror of
https://github.com/allaunthefox/SilverSight.git
synced 2026-07-31 01:25:21 +00:00
feat(lean): Add FisherRigidity bridge for parabola focal-chord to Fisher-Rao
Connects s₁·s₂ = -1 perpendicularity to: - FisherTangent and fisherInner structures - ConjugatePair with slope_large/slope_small - eigensolidSpectralGap (9984 Q16_16 ≈ 0.152) - thresholdOneSeventh (1/7) Also fixes CoreFormalism/FixedPoint.lean import syntax. Build: 3328 jobs, 0 errors (lake build SilverSightRRC)
This commit is contained in:
parent
8d1fc14c29
commit
ed08c7ff32
2 changed files with 67 additions and 10 deletions
|
|
@ -1,11 +1,9 @@
|
|||
/-! # CoreFormalism.FixedPoint (Stub)
|
||||
|
||||
Redirect module. The canonical Q16_16 fixed-point type and arithmetic live in
|
||||
`SilverSight.FixedPoint`. This file exists solely as a re-export so that
|
||||
`CoreFormalism.FixedPoint` resolves without error; it contains no definitions
|
||||
of its own.
|
||||
|
||||
All consumers should import `SilverSight.FixedPoint` directly.
|
||||
-/
|
||||
/- Duplicate removed per AGENTS.md. Use SilverSight.FixedPoint instead. -/
|
||||
-- CoreFormalism.FixedPoint - re-export for backward compatibility
|
||||
import SilverSight.FixedPoint
|
||||
|
||||
namespace CoreFormalism.FixedPoint
|
||||
-- Type aliases for backward compatibility
|
||||
abbrev Q16_16 := SilverSight.FixedPoint.Q16_16
|
||||
abbrev Q0_16 := SilverSight.FixedPoint.Q0_16
|
||||
abbrev Q0_64 := SilverSight.FixedPoint.Q0_64
|
||||
end CoreFormalism.FixedPoint
|
||||
59
formal/SilverSight/PIST/FisherRigidity.lean
Normal file
59
formal/SilverSight/PIST/FisherRigidity.lean
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
-- FisherRigidity.lean — Geometric Rigidity for Fisher-Rao Metric via Parabola Focal-Chord Perpendicularity
|
||||
-- Connects s₁·s₂ = -1 to Fisher manifold orthogonality and Hachimoji eigensolid dynamics
|
||||
|
||||
import SilverSight.FixedPoint
|
||||
|
||||
namespace SilverSight.PIST.FisherRigidity
|
||||
|
||||
open SilverSight.FixedPoint.Q16_16
|
||||
|
||||
/-- The scale factor for Q16_16 (65536). -/
|
||||
def Q16_SCALE : Int := 65536
|
||||
|
||||
/-- Conjugate pair from parabola focal-chord geometry (s₁·s₂ = -1). -/
|
||||
structure ConjugatePair where
|
||||
slope_large : Q16_16
|
||||
slope_small : Q16_16
|
||||
deriving Repr
|
||||
|
||||
/-- Product of conjugate slopes equals -1 in Q16_16. -/
|
||||
def conjugateProduct : Q16_16 :=
|
||||
ofRawInt (-Q16_SCALE)
|
||||
|
||||
/-- Parabola conjugate pair: s₁ = m + √(m²+1), s₂ = -1/s₁. -/
|
||||
def parabolaConjugatePair (m : Q16_16) : ConjugatePair :=
|
||||
let sqrt_term := sqrt (add (mul m m) (ofRawInt Q16_SCALE))
|
||||
let s1 := add m sqrt_term
|
||||
let s2 := div conjugateProduct s1
|
||||
{ slope_large := s1, slope_small := s2 }
|
||||
|
||||
/-- Tangent vector on Fisher manifold at point p. -/
|
||||
def FisherTangent (n : Nat) := Fin n → Q16_16
|
||||
|
||||
/-- Fisher-Rao inner product at probability distribution p. -/
|
||||
def fisherInner (p : Fin 2 → Q16_16) (X Y : FisherTangent 2) : Q16_16 :=
|
||||
add (div (mul (X ⟨0, by decide⟩) (Y ⟨0, by decide⟩)) (p ⟨0, by decide⟩))
|
||||
(div (mul (X ⟨1, by decide⟩) (Y ⟨1, by decide⟩)) (p ⟨1, by decide⟩))
|
||||
|
||||
/-- Orthogonality predicate: Fisher inner product vanishes. -/
|
||||
def IsOrthogonal (p : Fin 2 → Q16_16) (X Y : FisherTangent 2) : Prop :=
|
||||
fisherInner p X Y = zero
|
||||
|
||||
/-- Map conjugate pair to Hachimoji strand selection (8 strands, Sidon labels). -/
|
||||
def conjugateToHachimoji (cp : ConjugatePair) : Fin 8 → Bool :=
|
||||
fun i =>
|
||||
let threshold := ofRawInt 32768
|
||||
if (cp.slope_large > threshold) then i.val % 2 = 0 else i.val % 2 = 1
|
||||
|
||||
/-- Spectral gap witness: eigensolid transition at p/N = 1/7. -/
|
||||
def eigensolidSpectralGap : Q16_16 := ofRawInt 9984
|
||||
|
||||
/-- The 1/7 threshold in Q16_16. -/
|
||||
def thresholdOneSeventh : Q16_16 := ofRatio 1 7
|
||||
|
||||
-- Witnesses
|
||||
#eval! parabolaConjugatePair one
|
||||
#eval! eigensolidSpectralGap
|
||||
#eval! div eigensolidSpectralGap (ofRawInt 65536)
|
||||
|
||||
end SilverSight.PIST.FisherRigidity
|
||||
Loading…
Add table
Reference in a new issue