Pith. sign in

IndisputableMonolith.Verification.ODECoshUniqueCert

IndisputableMonolith/Verification/ODECoshUniqueCert.lean · 94 lines · 1 declarations

show as:
view math explainer →

open module explainer GitHub source

Explainer status: pending

   1import Mathlib
   2import IndisputableMonolith.Cost.FunctionalEquation
   3
   4namespace IndisputableMonolith
   5namespace Verification
   6namespace ODECoshUnique
   7
   8open IndisputableMonolith.Cost.FunctionalEquation
   9
  10/-!
  11# ODE Cosh Uniqueness Certificate
  12
  13This certificate packages the proof that cosh is the **unique** C² solution to
  14the second-order ODE:
  15
  16  H''(t) = H(t)
  17
  18with initial conditions H(0) = 1 and H'(0) = 0.
  19
  20## Why this matters for the certificate chain
  21
  22This uniqueness theorem is foundational for the T5 cost uniqueness proof:
  23
  241. **Jlog = cosh - 1**: The log-coordinate cost function Jlog(t) equals cosh(t) - 1
  25
  262. **ODE characterization**: Any function satisfying the d'Alembert functional equation
  27   and regularity conditions must satisfy H'' = H
  28
  293. **Uniqueness**: This certificate proves that cosh is the ONLY such function,
  30   which means Jlog is uniquely determined (up to the constant shift)
  31
  324. **No free parameters**: The ODE + initial conditions fully specify the solution -
  33   there are no parameters to tune
  34
  35## Proven Results
  36
  371. `ode_zero_uniqueness`: The unique C² solution to f'' = f with f(0) = f'(0) = 0 is f ≡ 0
  382. `cosh_second_deriv_eq`: cosh'' = cosh (cosh satisfies the ODE)
  393. `cosh_initials`: cosh(0) = 1 and cosh'(0) = 0 (cosh satisfies the initial conditions)
  404. `ode_cosh_uniqueness_contdiff`: Any C² solution with H(0) = 1, H'(0) = 0 equals cosh
  41-/
  42
  43structure ODECoshUniqueCert where
  44  deriving Repr
  45
  46/-- Verification predicate: cosh is the unique solution to its defining ODE.
  47
  48This certifies:
  491. The ODE f'' = f with zero initial data has only the zero solution
  502. cosh satisfies cosh'' = cosh and cosh(0) = 1, cosh'(0) = 0
  513. Any C² function satisfying the ODE with the same initial conditions equals cosh
  52-/
  53@[simp] def ODECoshUniqueCert.verified (_c : ODECoshUniqueCert) : Prop :=
  54  -- 1) Zero uniqueness: f'' = f with f(0) = f'(0) = 0 implies f = 0
  55  (∀ f : ℝ → ℝ, ContDiff ℝ 2 f →
  56    (∀ t, deriv (deriv f) t = f t) →
  57    f 0 = 0 →
  58    deriv f 0 = 0 →
  59    ∀ t, f t = 0) ∧
  60  -- 2) cosh satisfies the ODE: cosh'' = cosh
  61  (∀ t : ℝ, deriv (deriv Real.cosh) t = Real.cosh t) ∧
  62  -- 3) cosh satisfies initial conditions
  63  (Real.cosh 0 = 1 ∧ deriv Real.cosh 0 = 0) ∧
  64  -- 4) Cosh uniqueness: H'' = H with H(0) = 1, H'(0) = 0 implies H = cosh
  65  (∀ H : ℝ → ℝ, ContDiff ℝ 2 H →
  66    (∀ t, deriv (deriv H) t = H t) →
  67    H 0 = 1 →
  68    deriv H 0 = 0 →
  69    ∀ t, H t = Real.cosh t)
  70
  71/-- Top-level theorem: the certificate verifies. -/
  72@[simp] theorem ODECoshUniqueCert.verified_any (c : ODECoshUniqueCert) :
  73    ODECoshUniqueCert.verified c := by
  74  constructor
  75  · -- Zero uniqueness
  76    intro f h_diff h_ode h_f0 h_f'0
  77    exact ode_zero_uniqueness f h_diff h_ode h_f0 h_f'0
  78  constructor
  79  · -- cosh'' = cosh
  80    exact cosh_second_deriv_eq
  81  constructor
  82  · -- cosh initial conditions
  83    constructor
  84    · exact Real.cosh_zero
  85    · have h := Real.deriv_cosh
  86      simp only [h, Real.sinh_zero]
  87  · -- Cosh uniqueness
  88    intro H h_diff h_ode h_H0 h_H'0
  89    exact ode_cosh_uniqueness_contdiff H h_diff h_ode h_H0 h_H'0
  90
  91end ODECoshUnique
  92end Verification
  93end IndisputableMonolith
  94

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