pith. machine review for the scientific record. sign in

IndisputableMonolith.ClassicalBridge.Fluids.CPM2D

IndisputableMonolith/ClassicalBridge/Fluids/CPM2D.lean · 116 lines · 9 declarations

show as:
view math explainer →

open module explainer GitHub source

Explainer status: ready · generated 2026-05-15 04:58:06.304681+00:00

   1import Mathlib
   2import IndisputableMonolith.CPM.LawOfExistence
   3import IndisputableMonolith.ClassicalBridge.Fluids.CPM
   4import IndisputableMonolith.ClassicalBridge.Fluids.Galerkin2D
   5
   6namespace IndisputableMonolith.ClassicalBridge.Fluids
   7
   8/-!
   9# CPM2D (Milestone M4)
  10
  11This file instantiates the **CPM core** (`IndisputableMonolith.CPM.LawOfExistence`) for the
  12finite-dimensional 2D Galerkin model (`Galerkin2D`).
  13
  14Important: the nontrivial analytic inequalities needed for a real fluids proof are **not**
  15proved here.  Instead, we package them explicitly in a `...Hypothesis` structure, so downstream
  16theorems can state exactly what they depend on **without** using `axiom` or `sorry`.
  17-/
  18
  19open IndisputableMonolith.CPM.LawOfExistence
  20-- `GalerkinState` lives directly in `IndisputableMonolith.ClassicalBridge.Fluids`
  21-- (the module is `...Fluids.Galerkin2D`, but there is no nested `namespace ...Galerkin2D`).
  22
  23namespace CPM2D
  24
  25/-- The discrete 2D Galerkin state type at truncation level `N`. -/
  26abbrev State (N : ℕ) : Type := GalerkinState N
  27
  28/-- The four CPM functionals required by `CPM.LawOfExistence.Model`. -/
  29structure Functionals (N : ℕ) where
  30  defectMass : State N → ℝ
  31  orthoMass  : State N → ℝ
  32  energyGap  : State N → ℝ
  33  tests      : State N → ℝ
  34
  35/-- Hypothesis bundle: a CPM instance for `GalerkinState N`.
  36
  37This is *exactly* the data needed to build a `CPM.LawOfExistence.Model`.
  38-/
  39structure Hypothesis (N : ℕ) where
  40  C : Constants
  41  F : Functionals N
  42  /- Projection-Defect (A): D ≤ K_net · C_proj · ||proj_{S⊥}||² -/
  43  projection_defect : ∀ a : State N, F.defectMass a ≤ C.Knet * C.Cproj * F.orthoMass a
  44  /- Energy control (B): ||proj_{S⊥}||² ≤ C_eng · (E−E₀) -/
  45  energy_control    : ∀ a : State N, F.orthoMass a ≤ C.Ceng * F.energyGap a
  46  /- Dispersion/interface (C): ||proj_{S⊥}||² ≤ C_disp · sup tests -/
  47  dispersion        : ∀ a : State N, F.orthoMass a ≤ C.Cdisp * F.tests a
  48
  49/-- Build a CPM `Model` from the hypothesis bundle. -/
  50noncomputable def model {N : ℕ} (H : Hypothesis N) : Model (State N) :=
  51  { C := H.C
  52    defectMass := H.F.defectMass
  53    orthoMass  := H.F.orthoMass
  54    energyGap  := H.F.energyGap
  55    tests      := H.F.tests
  56    projection_defect := H.projection_defect
  57    energy_control    := H.energy_control
  58    dispersion        := H.dispersion }
  59
  60/-- Pack the `Model` into the bridge-local `CPMBridge` structure (for traceability notes). -/
  61noncomputable def bridge {N : ℕ} (H : Hypothesis N) : ClassicalBridge.Fluids.CPMBridge (State N) :=
  62  { model := model H
  63    defectMeaning := "Galerkin2D defectMass: discrete distance to structured (e.g. divergence-free / low-cost) subspace."
  64    energyMeaning := "Galerkin2D energyGap: discrete kinetic energy gap above the structured baseline."
  65    testsMeaning  := "Galerkin2D tests: supremum of local dispersion / window tests on the discrete state." }
  66
  67/-!
  68## A fully proved (but minimal) concrete instantiation
  69
  70To reduce the hypothesis layer, we provide an explicit choice of CPM constants and functionals
  71for which the A/B/C inequalities are **provable by reflexivity**.
  72
  73This is not yet the physically meaningful CPM for fluids; it is a useful “base instance” that
  74lets downstream modules stop carrying `Hypothesis` when they only need a concrete CPM model.
  75-/
  76
  77/-- A convenient all-ones constant bundle. -/
  78noncomputable def constantsOne : Constants :=
  79  { Knet := 1
  80    Cproj := 1
  81    Ceng := 1
  82    Cdisp := 1
  83    Knet_nonneg := by norm_num
  84    Cproj_nonneg := by norm_num
  85    Ceng_nonneg := by norm_num
  86    Cdisp_nonneg := by norm_num }
  87
  88/-- Concrete functionals: everything is measured by `‖u‖^2` (a nonnegative scalar). -/
  89noncomputable def functionalsNormSq (N : ℕ) : Functionals N :=
  90  { defectMass := fun u => ‖u‖ ^ 2
  91    orthoMass  := fun u => ‖u‖ ^ 2
  92    energyGap  := fun u => ‖u‖ ^ 2
  93    tests      := fun u => ‖u‖ ^ 2 }
  94
  95/-- A no-assumption CPM hypothesis instance using `constantsOne` and `functionalsNormSq`. -/
  96noncomputable def hypothesisNormSq (N : ℕ) : Hypothesis N :=
  97  { C := constantsOne
  98    F := functionalsNormSq N
  99    projection_defect := by
 100      intro a
 101      simp [constantsOne, functionalsNormSq]
 102    energy_control := by
 103      intro a
 104      simp [constantsOne, functionalsNormSq]
 105    dispersion := by
 106      intro a
 107      simp [constantsOne, functionalsNormSq] }
 108
 109/-- The corresponding concrete CPM bridge instance (still minimal/placeholder). -/
 110noncomputable def bridgeNormSq (N : ℕ) : ClassicalBridge.Fluids.CPMBridge (State N) :=
 111  bridge (hypothesisNormSq N)
 112
 113end CPM2D
 114
 115end IndisputableMonolith.ClassicalBridge.Fluids
 116

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