pith. machine review for the scientific record. sign in
def

musicCost

definition
show as:
view math explainer →
module
IndisputableMonolith.Foundation.UniversalForcing.MusicRealization
domain
Foundation
line
21 · github
papers citing
none yet

open explainer

Read the cached plain-language explainer.

open lean source

IndisputableMonolith.Foundation.UniversalForcing.MusicRealization on GitHub at line 21.

browse module

All declarations in this module, on Recognition.

explainer page

A cached Ask Recognition explainer exists for this declaration.

open explainer

depends on

used by

formal source

  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)