Pith. sign in

IndisputableMonolith.Verification.CalibrationCert

IndisputableMonolith/Verification/CalibrationCert.lean · 74 lines · 1 declarations

show as:
view math explainer →

open module explainer GitHub source

Explainer status: pending

   1import Mathlib
   2import IndisputableMonolith.Cost.Calibration
   3
   4namespace IndisputableMonolith
   5namespace Verification
   6namespace Calibration
   7
   8open IndisputableMonolith.Cost
   9open Real
  10
  11/-!
  12# Calibration Certificate: Unit Curvature at Identity (A4)
  13
  14This certificate packages the proof that the second derivative of Jlog
  15at zero equals exactly 1, which fixes the scale of the cost function.
  16
  17## Key Result
  18
  19deriv (deriv Jlog) 0 = 1
  20
  21## Why this matters for the certificate chain
  22
  23The calibration axiom A4 completes the uniqueness theorem T5:
  24
  251. **A1 (Symmetry)**: F(x) = F(1/x) — reciprocal invariance
  262. **A2 (Unit)**: F(1) = 0 — zero cost at identity
  273. **A3 (Convexity)**: F is strictly convex on ℝ₊
  284. **A4 (Calibration)**: F''_log(0) = 1 — unit curvature
  29
  30Given A1-A4, the unique solution is J(x) = (x + 1/x)/2 - 1 = cosh(log x) - 1.
  31
  32The calibration fixes the overall scale; without it, any positive multiple αJ
  33would also satisfy A1-A3. The unit curvature condition forces α = 1.
  34
  35## Mathematical Content
  36
  37The proof chain:
  381. Jlog(t) = cosh(t) - 1 (by definition)
  392. deriv Jlog = sinh (first derivative)
  403. deriv (deriv Jlog) = cosh (second derivative)
  414. cosh(0) = 1 (evaluating at t = 0)
  42
  43This uses standard calculus of hyperbolic functions.
  44-/
  45
  46structure CalibrationCert where
  47  deriving Repr
  48
  49/-- Verification predicate: Second derivative of Jlog at zero equals 1.
  50
  51This certifies:
  521. First derivative: deriv Jlog = sinh
  532. Second derivative: deriv² Jlog = cosh
  543. Unit curvature: deriv² Jlog 0 = 1 -/
  55@[simp] def CalibrationCert.verified (_c : CalibrationCert) : Prop :=
  56  -- First derivative of Jlog is sinh
  57  (∀ t : ℝ, deriv Jlog t = sinh t) ∧
  58  -- Second derivative of Jlog is cosh
  59  (∀ t : ℝ, deriv (deriv Jlog) t = cosh t) ∧
  60  -- Unit curvature at zero
  61  deriv (deriv Jlog) 0 = 1
  62
  63/-- Top-level theorem: the certificate verifies. -/
  64@[simp] theorem CalibrationCert.verified_any (c : CalibrationCert) :
  65    CalibrationCert.verified c := by
  66  refine ⟨?_, ?_, ?_⟩
  67  · exact deriv_Jlog
  68  · exact deriv2_Jlog
  69  · exact Jlog_second_deriv_at_zero
  70
  71end Calibration
  72end Verification
  73end IndisputableMonolith
  74

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