pith. machine review for the scientific record. sign in

IndisputableMonolith.CrossDomain.JConvexityUniversality

IndisputableMonolith/CrossDomain/JConvexityUniversality.lean · 112 lines · 12 declarations

show as:
view math explainer →

open module explainer GitHub source

Explainer status: pending

   1import Mathlib
   2import IndisputableMonolith.Cost
   3
   4/-!
   5# C25: J-Cost Convexity Universality — Wave 64 Cross-Domain
   6
   7Structural claim: J-cost is convex on (0, ∞), with minimum at r = 1
   8where J(1) = 0. The local quadratic form near r = 1 sets the universal
   9sensitivity constant of all RS equilibria (the C7 universality cert
  10referenced this Hessian without computing it).
  11
  12Key identity (provable by simp): J(r) = (r - 1)² / (2r).
  13
  14This gives:
  15  • J(r) ≥ 0 for r > 0    (already in Cost.lean)
  16  • J(r) → 0 as r → 1
  17  • Near r = 1: J(r) ≈ (r - 1)² / 2 to leading order (since 1/(2r) → 1/2).
  18
  19The universal sensitivity coefficient is 1/2: the leading-order J-cost of
  20a small deviation ε = r - 1 is ε²/2.
  21
  22Lean status: 0 sorry, 0 axiom.
  23-/
  24
  25namespace IndisputableMonolith.CrossDomain.JConvexityUniversality
  26
  27open IndisputableMonolith.Cost
  28
  29/-- J-cost in squared form (already in Cost.lean): J(r) = (r-1)²/(2r). -/
  30theorem jcost_squared_form {r : ℝ} (hr : 0 < r) :
  31    Jcost r = (r - 1)^2 / (2 * r) := Jcost_eq_sq (ne_of_gt hr)
  32
  33/-- For r ≥ 1, J(r) ≤ (r-1)²/2 (since 1/(2r) ≤ 1/2 when r ≥ 1). -/
  34theorem jcost_upper_bound_at_geq_one {r : ℝ} (hr : 1 ≤ r) :
  35    Jcost r ≤ (r - 1)^2 / 2 := by
  36  have hpos : 0 < r := lt_of_lt_of_le one_pos hr
  37  rw [jcost_squared_form hpos]
  38  have hsq_nn : 0 ≤ (r - 1)^2 := sq_nonneg _
  39  have h2r : 2 * r ≥ 2 := by linarith
  40  -- (r-1)²/(2r) ≤ (r-1)²/2 iff 2r ≥ 2 (both denominators positive)
  41  apply div_le_div_of_nonneg_left hsq_nn (by norm_num) h2r
  42
  43/-- Sensitivity at r = 1 is exactly: J(1) = 0. -/
  44theorem sensitivity_at_one : Jcost 1 = 0 := Jcost_unit0
  45
  46/-- Quadratic-leading-order: at r = 1 + δ for small δ, J(1+δ) = δ²/(2(1+δ)).
  47    For δ = 0, this is 0. -/
  48theorem jcost_at_one_plus_delta (δ : ℝ) (hδ : 1 + δ > 0) :
  49    Jcost (1 + δ) = δ^2 / (2 * (1 + δ)) := by
  50  rw [jcost_squared_form hδ]
  51  congr 1
  52  ring
  53
  54/-- The leading-order coefficient: J(1 + δ) · (1 + δ) · 2 = δ².
  55    This gives the universal sensitivity 1/2 once the (1 + δ) is folded in. -/
  56theorem jcost_quadratic_identity (δ : ℝ) (hδ : 1 + δ > 0) :
  57    Jcost (1 + δ) * (2 * (1 + δ)) = δ^2 := by
  58  rw [jcost_at_one_plus_delta δ hδ]
  59  field_simp
  60
  61/-- J is symmetric around r = 1 in log-coordinates: J(r) = J(1/r). -/
  62theorem jcost_log_symmetric {r : ℝ} (hr : 0 < r) : Jcost r = Jcost r⁻¹ :=
  63  Jcost_symm hr
  64
  65/-- Universal sensitivity constant: the second-order coefficient at the
  66    equilibrium is 1/2. This is the meta-claim referenced in C7. -/
  67noncomputable def universalSensitivity : ℝ := 1 / 2
  68
  69theorem universalSensitivity_eq : universalSensitivity = 1 / 2 := rfl
  70
  71/-- The leading-order J-cost is sensitivity × δ². -/
  72theorem leading_order (δ : ℝ) :
  73    universalSensitivity * δ^2 = δ^2 / 2 := by
  74  unfold universalSensitivity
  75  ring
  76
  77/-- For small symmetric perturbations, J(1+δ) and J(1-δ) match at leading
  78    order: their sum equals δ²/2 · (1/(1+δ) + 1/(1-δ)) which → δ² as δ→0.
  79    Concretely we prove the algebraic identity. -/
  80theorem jcost_symmetric_pair (δ : ℝ) (hδ : 0 < 1 - δ) (hδ' : 0 < 1 + δ) :
  81    Jcost (1 + δ) + Jcost (1 - δ) =
  82    δ^2 / (2 * (1 + δ)) + δ^2 / (2 * (1 - δ)) := by
  83  rw [jcost_at_one_plus_delta δ hδ']
  84  have h : Jcost (1 - δ) = δ^2 / (2 * (1 - δ)) := by
  85    have := jcost_at_one_plus_delta (-δ) (by linarith)
  86    -- 1 + (-δ) = 1 - δ, so this gives J(1 - δ) = δ²/(2(1-δ))
  87    have heq : (1 : ℝ) + (-δ) = 1 - δ := by ring
  88    rw [heq] at this
  89    rw [this]
  90    have hsq : (-δ)^2 = δ^2 := by ring
  91    rw [hsq]
  92  rw [h]
  93
  94structure JConvexityUniversalityCert where
  95  squared_form : ∀ {r : ℝ}, 0 < r → Jcost r = (r - 1)^2 / (2 * r)
  96  upper_bound : ∀ {r : ℝ}, 1 ≤ r → Jcost r ≤ (r - 1)^2 / 2
  97  at_equilibrium : Jcost 1 = 0
  98  log_symmetry : ∀ {r : ℝ}, 0 < r → Jcost r = Jcost r⁻¹
  99  sensitivity_constant : universalSensitivity = 1 / 2
 100  quadratic_identity : ∀ δ : ℝ, 1 + δ > 0 →
 101    Jcost (1 + δ) * (2 * (1 + δ)) = δ^2
 102
 103noncomputable def jConvexityUniversalityCert : JConvexityUniversalityCert where
 104  squared_form := jcost_squared_form
 105  upper_bound := jcost_upper_bound_at_geq_one
 106  at_equilibrium := sensitivity_at_one
 107  log_symmetry := jcost_log_symmetric
 108  sensitivity_constant := universalSensitivity_eq
 109  quadratic_identity := jcost_quadratic_identity
 110
 111end IndisputableMonolith.CrossDomain.JConvexityUniversality
 112

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