pith. machine review for the scientific record. sign in

IndisputableMonolith.URCGenerators.CPMMethodCert

IndisputableMonolith/URCGenerators/CPMMethodCert.lean · 101 lines · 5 declarations

show as:
view math explainer →

open module explainer GitHub source

Explainer status: pending

   1import Mathlib
   2import IndisputableMonolith.CPM.LawOfExistence
   3
   4namespace IndisputableMonolith
   5namespace URCGenerators
   6
   7open IndisputableMonolith.CPM.LawOfExistence
   8
   9/-!
  10# CPM Method Certificate (Standalone)
  11
  12This certificate intentionally avoids any domain/problem-specific material.
  13It certifies:
  14
  15- the generic CPM A/B/C consequences are available for any CPM `Model`, and
  16- the CPM assumptions are consistent (witnessed by a concrete toy model).
  17
  18This file is part of the CPM-standalone layer.
  19-/
  20
  21/-- Standalone certificate for the CPM method. -/
  22structure CPMMethodCert where
  23  deriving Repr
  24
  25/-- A small toy CPM model witnessing consistency of the assumptions.
  26
  27All functionals are constant 1, and the inequalities hold numerically with
  28`Knet = 1`, `Cproj = 2`, `Ceng = 1`, `Cdisp = 1`.
  29
  30This is not intended to model physics; it is only a nontrivial consistency witness.
  31-/
  32noncomputable def toyModel : Model Unit where
  33  C := {
  34    Knet := 1,
  35    Cproj := 2,
  36    Ceng := 1,
  37    Cdisp := 1,
  38    Knet_nonneg := by norm_num,
  39    Cproj_nonneg := by norm_num,
  40    Ceng_nonneg := by norm_num,
  41    Cdisp_nonneg := by norm_num
  42  }
  43  defectMass := fun _ => 1
  44  orthoMass  := fun _ => 1
  45  energyGap  := fun _ => 1
  46  tests      := fun _ => 1
  47  projection_defect := by
  48    intro _
  49    norm_num
  50  energy_control := by
  51    intro _
  52    norm_num
  53  dispersion := by
  54    intro _
  55    norm_num
  56
  57lemma toyModel_defect_pos : toyModel.defectMass () > 0 := by
  58  simp [toyModel]
  59
  60lemma toyModel_energy_pos : toyModel.energyGap () > 0 := by
  61  simp [toyModel]
  62
  63lemma toyModel_cmin_pos : 0 < cmin toyModel.C := by
  64  have hpos : 0 < toyModel.C.Knet ∧ 0 < toyModel.C.Cproj ∧ 0 < toyModel.C.Ceng := by
  65    simp [toyModel]
  66  simpa using (IndisputableMonolith.CPM.LawOfExistence.cmin_pos (C:=toyModel.C) hpos)
  67
  68/-- Verification predicate for the standalone CPM method certificate.
  69
  70It asserts the generic A/B/C consequences (for any CPM model) and includes a
  71concrete toy model witness to avoid vacuity.
  72-/
  73@[simp] def CPMMethodCert.verified (_c : CPMMethodCert) : Prop :=
  74  (∀ {β : Type} (M : Model β) (a : β),
  75      M.defectMass a ≤ (M.C.Knet * M.C.Cproj * M.C.Ceng) * M.energyGap a)
  76
  77  (∀ {β : Type} (M : Model β)
  78      (_hpos : 0 < M.C.Knet ∧ 0 < M.C.Cproj ∧ 0 < M.C.Ceng) (a : β),
  79      M.energyGap a ≥ cmin M.C * M.defectMass a)
  80
  81  (∀ {β : Type} (M : Model β) (a : β),
  82      M.defectMass a ≤ (M.C.Knet * M.C.Cproj * M.C.Cdisp) * M.tests a)
  83
  84  (∃ toy : Model Unit,
  85      toy.defectMass () > 0 ∧ toy.energyGap () > 0 ∧ 0 < cmin toy.C)
  86
  87/-- The standalone CPM method certificate verifies. -/
  88@[simp] theorem CPMMethodCert.verified_any (c : CPMMethodCert) :
  89    CPMMethodCert.verified c := by
  90  refine And.intro ?_ (And.intro ?_ (And.intro ?_ ?_))
  91  · intro β M a
  92    exact IndisputableMonolith.CPM.LawOfExistence.Model.defect_le_constants_mul_energyGap (M:=M) a
  93  · intro β M hpos a
  94    exact IndisputableMonolith.CPM.LawOfExistence.Model.energyGap_ge_cmin_mul_defect (M:=M) hpos a
  95  · intro β M a
  96    exact IndisputableMonolith.CPM.LawOfExistence.Model.defect_le_constants_mul_tests (M:=M) a
  97  · refine ⟨toyModel, toyModel_defect_pos, toyModel_energy_pos, toyModel_cmin_pos⟩
  98
  99end URCGenerators
 100end IndisputableMonolith
 101

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