theorem
proved
empty_ledger_balanced
show as:
view math explainer →
open explainer
Generate a durable explainer page for this declaration.
open lean source
IndisputableMonolith.Foundation.LedgerForcing on GitHub at line 114.
browse module
All declarations in this module, on Recognition.
explainer page
depends on
used by
formal source
111}
112
113/-- The empty ledger is balanced. -/
114theorem empty_ledger_balanced : balanced empty_ledger := empty_ledger.double_entry
115
116/-- The empty ledger has zero cost. -/
117theorem empty_ledger_cost : ledger_cost empty_ledger = 0 := by simp [ledger_cost, empty_ledger]
118
119/-- The empty ledger has zero net flow. -/
120theorem empty_ledger_net_flow (agent : ℕ) : net_flow empty_ledger agent = 0 := by
121 simp [net_flow, empty_ledger]
122
123/-! ## Conservation from Symmetry -/
124
125/-- Log reciprocal cancellation: log(r) + log(1/r) = 0. -/
126theorem log_reciprocal_cancel {r : ℝ} (_hr : r > 0) : Real.log r + Real.log (r⁻¹) = 0 := by
127 rw [Real.log_inv]; ring
128
129/-- For any event e, logs of e and reciprocal(e) sum to zero. -/
130theorem paired_log_sum_zero (e : RecognitionEvent) :
131 Real.log e.ratio + Real.log (reciprocal e).ratio = 0 := by
132 simp only [reciprocal]
133 exact log_reciprocal_cancel e.ratio_pos
134
135/-- Helper: net flow contribution from a single event for an agent -/
136noncomputable def flow_contribution (e : RecognitionEvent) (agent : ℕ) : ℝ :=
137 if e.source = agent ∨ e.target = agent then Real.log e.ratio else 0
138
139/-- Flow contribution of reciprocal event negates the original -/
140theorem flow_contribution_reciprocal (e : RecognitionEvent) (agent : ℕ) :
141 flow_contribution e agent + flow_contribution (reciprocal e) agent = 0 := by
142 unfold flow_contribution reciprocal
143 simp only
144 by_cases hs : e.source = agent