pith. machine review for the scientific record. sign in
lemma

sum_nonneg_zero_iff

proved
show as:
view math explainer →
module
IndisputableMonolith.Information.PhysicsComplexityStructure
domain
Information
line
144 · github
papers citing
none yet

open explainer

Generate a durable explainer page for this declaration.

open lean source

IndisputableMonolith.Information.PhysicsComplexityStructure on GitHub at line 144.

browse module

All declarations in this module, on Recognition.

explainer page

Tracked in the explainer inventory; generation is lazy so crawlers do not trigger LLM jobs.

open explainer

depends on

used by

formal source

 141  simp [Cost.Jcost_unit0]
 142
 143/-- Helper: A sum of non-negative reals equals 0 iff each term is 0. -/
 144private lemma sum_nonneg_zero_iff {N : ℕ} (f : Fin N → ℝ)
 145    (hnn : ∀ i, 0 ≤ f i) :
 146    ∑ i : Fin N, f i = 0 ↔ ∀ i : Fin N, f i = 0 := by
 147  rw [Finset.sum_eq_zero_iff_of_nonneg (fun i _ => hnn i)]
 148  simp [Finset.mem_univ]
 149
 150/-- **THEOREM IC-005.11**: A configuration is balanced iff its total J-cost is zero.
 151    This means balance verification is equivalent to a single sum = 0 check,
 152    which is O(N) in the number of ledger entries. -/
 153theorem verification_equivalence {N : ℕ} (config : LedgerConfig N) :
 154    (∀ i : Fin N, config.ratios i = 1) ↔ totalJCost config = 0 := by
 155  unfold totalJCost
 156  rw [sum_nonneg_zero_iff _ (fun i => Cost.Jcost_nonneg (config.ratios_pos i))]
 157  constructor
 158  · intro h i
 159    rw [h i]; exact Cost.Jcost_unit0
 160  · intro h i
 161    have hi := h i
 162    rw [Cost.Jcost_eq_sq (config.ratios_pos i).ne'] at hi
 163    have hden : 2 * config.ratios i ≠ 0 := ne_of_gt (by linarith [config.ratios_pos i])
 164    have hsq : (config.ratios i - 1)^2 = 0 := by
 165      rwa [div_eq_zero_iff, or_iff_left hden] at hi
 166    nlinarith [sq_nonneg (config.ratios i - 1)]
 167
 168/-! ## IV. Complexity Classes for RS Physics -/
 169
 170/-- The physics complexity structure: core claim. -/
 171def physics_complexity_from_ledger : Prop := computation_limits_from_ledger
 172
 173/-- **THEOREM IC-005.12**: Physics complexity structure holds. -/
 174theorem physics_complexity_structure : physics_complexity_from_ledger :=