pith. machine review for the scientific record. sign in

IndisputableMonolith.Foundation.UniversalForcing.MusicRealization

IndisputableMonolith/Foundation/UniversalForcing/MusicRealization.lean · 78 lines · 7 declarations

show as:
view math explainer →

open module explainer GitHub source

Explainer status: pending

   1import IndisputableMonolith.Foundation.UniversalForcing.Invariance.Universal
   2
   3/-!
   4  MusicRealization.lean
   5
   6  Lightweight musical realization: the carrier records interval steps. The
   7  semantic reading is pitch-ratio stacking; the forced arithmetic is the
   8  iteration count of interval composition.
   9-/
  10
  11namespace IndisputableMonolith
  12namespace Foundation
  13namespace UniversalForcing
  14namespace MusicRealization
  15
  16open ArithmeticFromLogic
  17open Invariance.Universal
  18
  19abbrev MusicalIntervalStep := Nat
  20
  21def musicCost (a b : MusicalIntervalStep) : Nat :=
  22  if a = b then 0 else 1
  23
  24@[simp] theorem musicCost_self (a : MusicalIntervalStep) : musicCost a a = 0 := by
  25  simp [musicCost]
  26
  27theorem musicCost_symm (a b : MusicalIntervalStep) : musicCost a b = musicCost b a := by
  28  by_cases h : a = b
  29  · subst h; simp [musicCost]
  30  · have h' : b ≠ a := by intro hb; exact h hb.symm
  31    simp [musicCost, h, h']
  32
  33def musicInterpret (n : LogicNat) : MusicalIntervalStep :=
  34  LogicNat.toNat n
  35
  36/-- Musical realization as interval-step comparison. -/
  37def musicRealization : LogicRealization where
  38  Carrier := MusicalIntervalStep
  39  Cost := Nat
  40  zeroCost := inferInstance
  41  compare := musicCost
  42  zero := 0
  43  step := Nat.succ
  44  Orbit := LogicNat
  45  orbitZero := LogicNat.zero
  46  orbitStep := LogicNat.succ
  47  interpret := musicInterpret
  48  interpret_zero := by rfl
  49  interpret_step := by
  50    intro n
  51    show LogicNat.toNat (LogicNat.succ n) = Nat.succ (LogicNat.toNat n)
  52    rfl
  53  orbit_no_confusion := by intro n h; exact LogicNat.zero_ne_succ n h
  54  orbit_step_injective := LogicNat.succ_injective
  55  orbit_induction := by
  56    intro P h0 hs n
  57    exact LogicNat.induction (motive := P) h0 hs n
  58  orbitEquivLogicNat := Equiv.refl LogicNat
  59  orbitEquiv_zero := rfl
  60  orbitEquiv_step := by intro n; rfl
  61  identity := musicCost_self
  62  nonContradiction := musicCost_symm
  63  excludedMiddle := True
  64  composition := True
  65  actionInvariant := True
  66  nontrivial := by
  67    refine ⟨1, ?_⟩
  68    simp [musicCost]
  69
  70noncomputable def music_arith_equiv_nat :
  71    (arithmeticOf musicRealization).peano.carrier ≃ LogicNat :=
  72  musicRealization.orbitEquivLogicNat
  73
  74end MusicRealization
  75end UniversalForcing
  76end Foundation
  77end IndisputableMonolith
  78

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