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

twoPowZ

definition
show as:
view math explainer →
module
IndisputableMonolith.RecogSpec.Scales
domain
RecogSpec
line
37 · github
papers citing
none yet

open explainer

Generate a durable explainer page for this declaration.

open lean source

IndisputableMonolith.RecogSpec.Scales on GitHub at line 37.

browse module

All declarations in this module, on Recognition.

explainer page

Tracked in the explainer inventory; generation is lazy so crawlers do not trigger LLM jobs.

open explainer

depends on

used by

formal source

  34      simpa [B_of_succ, mul_comm] using this
  35
  36/-- Two to an integer power: 2^k for k ∈ ℤ. -/
  37noncomputable def twoPowZ (k : Int) : ℝ :=
  38  if 0 ≤ k then (2 : ℝ) ^ (Int.toNat k)
  39  else 1 / ((2 : ℝ) ^ (Int.toNat (-k)))
  40
  41@[simp] lemma twoPowZ_zero : twoPowZ 0 = 1 := by simp [twoPowZ]
  42@[simp] lemma twoPowZ_ofNat (k : Nat) : twoPowZ (Int.ofNat k) = (2 : ℝ) ^ k := by simp [twoPowZ]
  43@[simp] lemma twoPowZ_negSucc (k : Nat) : twoPowZ (Int.negSucc k) = 1 / ((2 : ℝ) ^ k.succ) := by
  44  simp [twoPowZ]
  45
  46/-- φ-power wrapper. -/
  47noncomputable def PhiPow (x : ℝ) : ℝ := Real.exp (Real.log (Constants.phi) * x)
  48
  49lemma PhiPow_add (x y : ℝ) : PhiPow (x + y) = PhiPow x * PhiPow y := by
  50  unfold PhiPow
  51  have hx : Real.log (Constants.phi) * (x + y)
  52        = Real.log (Constants.phi) * x + Real.log (Constants.phi) * y := by
  53    ring
  54  simp [hx, Real.exp_add]
  55
  56lemma PhiPow_sub (x y : ℝ) : PhiPow (x - y) = PhiPow x / PhiPow y := by
  57  unfold PhiPow
  58  have hx : Real.log (Constants.phi) * (x - y)
  59        = Real.log (Constants.phi) * x + Real.log (Constants.phi) * (-y) := by
  60    ring
  61  calc
  62    Real.exp (Real.log (Constants.phi) * (x - y))
  63        = Real.exp (Real.log (Constants.phi) * x + Real.log (Constants.phi) * (-y)) := by
  64              simp [hx]
  65    _   = Real.exp (Real.log (Constants.phi) * x)
  66            * Real.exp (Real.log (Constants.phi) * (-y)) := by
  67              simp [Real.exp_add]