pith. machine review for the scientific record. sign in

IndisputableMonolith.RRF.Core.Octave

IndisputableMonolith/RRF/Core/Octave.lean · 127 lines · 12 declarations

show as:
view math explainer →

open module explainer GitHub source

Explainer status: ready · generated 2026-05-13 17:10:20.102136+00:00

   1import IndisputableMonolith.RRF.Core.DisplayChannel
   2import IndisputableMonolith.RRF.Core.Strain
   3import Mathlib.Order.Basic
   4import Mathlib.Tactic
   5
   6/-!
   7# RRF Core: Octave
   8
   9An octave is a scale of manifestation. The same underlying pattern can appear
  10at different octaves, related by scaling (φⁿ in the full theory).
  11
  12Key insight:
  13- Particles, proteins, thoughts are "the same thing" at different octaves
  14- Each octave has its own display channels
  15- The φ-scaling is a hypothesis, not a definition (see Hypotheses/PhiLadder.lean)
  16
  17This module provides the abstract octave structure without physical constants.
  18-/
  19
  20
  21namespace IndisputableMonolith
  22namespace RRF.Core
  23
  24/-- An octave: a state space with strain and observation channels.
  25
  26This is the abstract structure; no physical constants (φ, 8-tick) here.
  27Those are hypotheses layered on top.
  28-/
  29structure Octave where
  30  /-- The state space at this octave. -/
  31  State : Type*
  32  /-- The strain functional (J-cost). -/
  33  strain : StrainFunctional State
  34  /-- Display channels available at this octave. -/
  35  channels : ChannelBundle State
  36  /-- Non-emptiness: at least one state exists. -/
  37  inhabited : Nonempty State
  38
  39namespace Octave
  40
  41variable (O : Octave)
  42
  43/-- The equilibrium states of an octave. -/
  44def equilibria : Set O.State := O.strain.equilibria
  45
  46/-- An octave is well-posed if it has at least one equilibrium. -/
  47def wellPosed : Prop := ∃ x : O.State, O.strain.isBalanced x
  48
  49end Octave
  50
  51/-- A morphism between octaves: a map that preserves strain ordering. -/
  52structure OctaveMorphism (O₁ O₂ : Octave) where
  53  /-- The underlying map on states. -/
  54  map : O₁.State → O₂.State
  55  /-- The map preserves strain ordering. -/
  56  preserves_order : ∀ x y, O₁.strain.weaklyBetter x y →
  57                           O₂.strain.weaklyBetter (map x) (map y)
  58
  59namespace OctaveMorphism
  60
  61/-- Identity morphism. -/
  62def id (O : Octave) : OctaveMorphism O O where
  63  map := fun x => x
  64  preserves_order := fun _ _ h => h
  65
  66/-- Composition of morphisms. -/
  67def comp {O₁ O₂ O₃ : Octave}
  68    (g : OctaveMorphism O₂ O₃) (f : OctaveMorphism O₁ O₂) : OctaveMorphism O₁ O₃ where
  69  map := g.map ∘ f.map
  70  preserves_order := fun x y h => g.preserves_order _ _ (f.preserves_order x y h)
  71
  72/-- Morphisms preserve equilibria (if target has NonNeg strain). -/
  73theorem preserves_equilibria {O₁ O₂ : Octave}
  74    [inst : StrainFunctional.NonNeg O₂.strain]
  75    (f : OctaveMorphism O₁ O₂)
  76    (x : O₁.State) (hx : O₁.strain.isBalanced x)
  77    (hf : O₂.strain.J (f.map x) ≤ O₁.strain.J x) :
  78    O₂.strain.isBalanced (f.map x) := by
  79  simp only [StrainFunctional.isBalanced] at *
  80  rw [hx] at hf
  81  have h₁ := @StrainFunctional.NonNeg.nonneg _ O₂.strain inst (f.map x)
  82  linarith
  83
  84end OctaveMorphism
  85
  86/-- Two octaves are equivalent if there exist mutually inverse morphisms
  87    that both preserve strain exactly (isometric in both directions). -/
  88structure OctaveEquiv (O₁ O₂ : Octave) where
  89  /-- Forward morphism. -/
  90  toFun : OctaveMorphism O₁ O₂
  91  /-- Backward morphism. -/
  92  invFun : OctaveMorphism O₂ O₁
  93  /-- Strain is preserved exactly (forward isometry). -/
  94  strain_eq : ∀ x, O₂.strain.J (toFun.map x) = O₁.strain.J x
  95  /-- Strain is preserved exactly (inverse isometry). -/
  96  strain_eq_inv : ∀ y, O₁.strain.J (invFun.map y) = O₂.strain.J y
  97
  98namespace OctaveEquiv
  99
 100/-- Reflexivity. -/
 101def refl (O : Octave) : OctaveEquiv O O where
 102  toFun := OctaveMorphism.id O
 103  invFun := OctaveMorphism.id O
 104  strain_eq := fun _ => rfl
 105  strain_eq_inv := fun _ => rfl
 106
 107/-- Symmetry. -/
 108def symm {O₁ O₂ : Octave} (e : OctaveEquiv O₁ O₂) : OctaveEquiv O₂ O₁ where
 109  toFun := e.invFun
 110  invFun := e.toFun
 111  strain_eq := e.strain_eq_inv
 112  strain_eq_inv := e.strain_eq
 113
 114end OctaveEquiv
 115
 116/-- The "octave index" in Z (integer rung number).
 117    This is just a type alias; the physical interpretation is in Hypotheses. -/
 118abbrev OctaveRung := ℤ
 119
 120/-- A family of octaves indexed by rung. -/
 121structure OctaveFamily where
 122  /-- The octave at each rung. -/
 123  octaveAt : OctaveRung → Octave
 124
 125end RRF.Core
 126end IndisputableMonolith
 127

source mirrored from github.com/jonwashburn/shape-of-logic