pith. machine review for the scientific record. sign in

IndisputableMonolith.Gravity.SPARCFalsifier

IndisputableMonolith/Gravity/SPARCFalsifier.lean · 196 lines · 29 declarations

show as:
view math explainer →

open module explainer GitHub source

Explainer status: pending

   1import Mathlib
   2import IndisputableMonolith.Constants
   3
   4/-!
   5# SPARC Chi-Squared Falsifier for ILG
   6
   7Formalizes the falsification criterion for the ILG rotation curve prediction:
   8if the median chi-squared per degree of freedom exceeds a threshold when
   9computed across the SPARC galaxy sample with zero per-galaxy free parameters,
  10the ILG model is falsified.
  11
  12## RS Parameters (locked, from phi)
  13
  14- alpha_t = (1 - 1/phi) / 2 ≈ 0.191
  15- C_lag = phi^(-5) ≈ 0.090
  16- Upsilon_star = phi ≈ 1.618
  17
  18## Falsification Protocol
  19
  201. Compute ILG-predicted rotation curves for all ~175 SPARC galaxies
  212. Use ZERO per-galaxy free parameters (all locked to phi)
  223. Compute chi-squared per degree of freedom for each galaxy
  234. Take the median across the sample
  245. If median chi2/dof > threshold, ILG is FALSIFIED
  25
  26## Threshold Choice
  27
  28The theory document (line ~3304) claims median chi2/dof ~ 2.75.
  29A generous threshold of 5.0 allows for systematic errors.
  30A tight threshold of 3.0 tests the specific RS prediction.
  31
  32See: scripts/sparc_ilg_comparison.py for the computational implementation.
  33-/
  34
  35namespace IndisputableMonolith
  36namespace Gravity
  37namespace SPARCFalsifier
  38
  39open Constants
  40
  41/-! ## Falsification Criterion -/
  42
  43/-- The generous falsification threshold for ILG chi-squared per dof.
  44    If median chi2/dof > 5.0 across the SPARC sample, ILG is falsified. -/
  45def generous_threshold : ℝ := 5.0
  46
  47/-- The tight threshold matching the RS prediction (median ~ 2.75).
  48    If median chi2/dof > 3.0, the specific RS prediction is refuted
  49    (though ILG as a framework might survive with different parameters). -/
  50def tight_threshold : ℝ := 3.0
  51
  52/-- ILG is falsified if median chi2/dof exceeds the generous threshold. -/
  53def ILG_falsified (median_chi2_dof : ℝ) : Prop :=
  54  generous_threshold < median_chi2_dof
  55
  56/-- The RS-specific prediction is refuted if median > tight threshold. -/
  57def RS_prediction_refuted (median_chi2_dof : ℝ) : Prop :=
  58  tight_threshold < median_chi2_dof
  59
  60/-- If the median is below the generous threshold, ILG PASSES. -/
  61def ILG_passes (median_chi2_dof : ℝ) : Prop :=
  62  median_chi2_dof ≤ generous_threshold
  63
  64/-- The falsification criterion is decidable (for any real number). -/
  65theorem falsification_decidable (x : ℝ) :
  66    ILG_falsified x ∨ ILG_passes x := by
  67  unfold ILG_falsified ILG_passes generous_threshold
  68  exact le_or_gt x 5.0 |>.elim (Or.inr) (Or.inl)
  69
  70/-! ## RS Parameter Lock -/
  71
  72/-- The alpha parameter is locked to alphaLock ≈ 0.191. -/
  73noncomputable def alpha_locked : ℝ := alphaLock
  74
  75/-- The mass-to-light ratio is locked to phi ≈ 1.618. -/
  76noncomputable def upsilon_locked : ℝ := phi
  77
  78/-- The lag coupling is locked to phi^(-5) ≈ 0.090. -/
  79noncomputable def clag_locked : ℝ := cLagLock
  80
  81/-- All three parameters are derived from phi (zero free parameters). -/
  82theorem parameters_from_phi :
  83    alpha_locked = (1 - 1/phi) / 2 ∧
  84    upsilon_locked = phi ∧
  85    clag_locked = phi ^ (-(5 : ℝ)) := by
  86  unfold alpha_locked upsilon_locked clag_locked alphaLock cLagLock
  87  exact ⟨rfl, rfl, rfl⟩
  88
  89/-- The number of per-galaxy free parameters is exactly zero. -/
  90def per_galaxy_free_parameters : ℕ := 0
  91
  92theorem zero_free_params : per_galaxy_free_parameters = 0 := rfl
  93
  94/-! ## SPARC Benchmark Values
  95
  96The theory document (line ~3304) gives benchmark chi2 values.
  97These are encoded as hypotheses (to be discharged by the Python script). -/
  98
  99/-- RS-predicted median chi2/dof across SPARC. -/
 100def predicted_median : ℝ := 2.75
 101
 102/-- The RS prediction: median chi2/dof ≈ 2.75 (within 1.0). -/
 103def H_SPARC_median : Prop :=
 104  ∃ median_obs : ℝ, abs (median_obs - predicted_median) < 1.0 ∧
 105    ILG_passes median_obs
 106
 107/-! ## Paper II Benchmark Values (Rotation-curves-Paper2-Sept-26.tex) -/
 108
 109/-- Paper II reports ILG median chi2/N = 2.75 on SPARC Q=1 subset. -/
 110def paper2_median_chi2 : ℝ := 2.75
 111
 112/-- Paper II reports ILG mean chi2/N = 4.23 on SPARC Q=1 subset. -/
 113def paper2_mean_chi2 : ℝ := 4.23
 114
 115/-- Paper II SPARC Q=1 sample size. -/
 116def paper2_N_galaxies : ℕ := 127
 117
 118/-- MOND simple-nu comparison: median 2.47, mean 4.65. -/
 119def mond_median_chi2 : ℝ := 2.47
 120def mond_mean_chi2 : ℝ := 4.65
 121
 122/-- ILG has higher median but LOWER mean than MOND — it handles
 123    outliers better due to the global-only constraint. -/
 124theorem ilg_better_mean_than_mond :
 125    paper2_mean_chi2 < mond_mean_chi2 := by
 126  unfold paper2_mean_chi2 mond_mean_chi2; norm_num
 127
 128/-! ## Global-Only Policy (Paper I + Paper II) -/
 129
 130/-- The global-only policy: the ILG weight function w(r) depends ONLY
 131    on catalog-level constants (alpha, C_lag, Upsilon, tau_star) and
 132    the photometric baryonic profile (v_gas, v_disk, v_bul).
 133
 134    It does NOT depend on:
 135    - The observed rotation velocity (kinematic data)
 136    - Any per-galaxy fitted parameter
 137    - The galaxy's morphological classification (beyond photometry)
 138
 139    This is formalized as: the parameters are functions of phi alone. -/
 140structure GlobalOnlyPolicy where
 141  alpha_from_phi : alpha_locked = (1 - 1/phi) / 2
 142  upsilon_from_phi : upsilon_locked = phi
 143  clag_from_phi : clag_locked = phi ^ (-(5 : ℝ))
 144  per_galaxy_params : per_galaxy_free_parameters = 0
 145
 146theorem global_only_policy : GlobalOnlyPolicy where
 147  alpha_from_phi := parameters_from_phi.1
 148  upsilon_from_phi := parameters_from_phi.2.1
 149  clag_from_phi := parameters_from_phi.2.2
 150  per_galaxy_params := zero_free_params
 151
 152/-! ## Negative Control Tests -/
 153
 154/-- Negative control: velocity permutation (shuffle v_obs across radii).
 155    Must inflate chi2 well above the ILG median. -/
 156def NegativeControl := ℝ → Prop
 157
 158/-- Velocity permutation: randomly reassign v_obs to different radii. -/
 159def velocity_permutation_control (chi2_perm : ℝ) : Prop :=
 160  paper2_median_chi2 < chi2_perm
 161
 162/-- 180-degree rotation: reverse the radial profile. -/
 163def rotation_180_control (chi2_rot : ℝ) : Prop :=
 164  paper2_median_chi2 < chi2_rot
 165
 166/-- Gas-stars swap: interchange v_gas and v_disk. -/
 167def gas_stars_swap_control (chi2_swap : ℝ) : Prop :=
 168  paper2_median_chi2 < chi2_swap
 169
 170/-- All negative controls must inflate chi2 above the ILG result. -/
 171def all_controls_inflated (chi2_perm chi2_rot chi2_swap : ℝ) : Prop :=
 172  velocity_permutation_control chi2_perm ∧
 173  rotation_180_control chi2_rot ∧
 174  gas_stars_swap_control chi2_swap
 175
 176/-! ## Certificate -/
 177
 178structure SPARCFalsifierCert where
 179  zero_params : per_galaxy_free_parameters = 0
 180  params_from_phi : alpha_locked = (1 - 1/phi) / 2 ∧ upsilon_locked = phi ∧
 181    clag_locked = phi ^ (-(5 : ℝ))
 182  criterion_decidable : ∀ x : ℝ, ILG_falsified x ∨ ILG_passes x
 183  global_only : GlobalOnlyPolicy
 184  ilg_beats_mond_mean : paper2_mean_chi2 < mond_mean_chi2
 185
 186theorem sparc_falsifier_cert : SPARCFalsifierCert where
 187  zero_params := zero_free_params
 188  params_from_phi := parameters_from_phi
 189  criterion_decidable := falsification_decidable
 190  global_only := global_only_policy
 191  ilg_beats_mond_mean := ilg_better_mean_than_mond
 192
 193end SPARCFalsifier
 194end Gravity
 195end IndisputableMonolith
 196

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