IndisputableMonolith.Foundation.ClosedObservableFramework
IndisputableMonolith/Foundation/ClosedObservableFramework.lean · 153 lines · 12 declarations
show as:
view math explainer →
1import Mathlib
2import IndisputableMonolith.Foundation.LedgerCanonicality
3
4namespace IndisputableMonolith
5namespace Foundation
6namespace ClosedFramework
7
8open LedgerCanonicality
9
10/-!
11# Gap 1: Closed Observable Framework → Ledger Reconstruction
12
13Phases 1, 2, 6 of the axiom-closure plan.
14
15The `ClosedObservableFramework` now includes positive-valued observables,
16a ratio interface, and conservation as structure fields (Phase 2).
17This absorbs R1, R2, R5, R6 as definitions rather than axioms.
18The sole remaining axiom is the **Regularity Axiom** (Phase 6),
19which encodes the finite-description content of C3.
20-/
21
22/-- A closed observable framework with positive-valued observables,
23a ratio interface, and a conserved charge.
24(C1) non-trivial observability
25(C2) closure: no external input
26(C3) finite description: countable state space, no continuous moduli -/
27structure ClosedObservableFramework where
28 S : Type
29 T : S → S
30 r : S → ℝ
31 r_pos : ∀ s, 0 < r s
32 nontrivial : ∃ s₁ s₂ : S, r s₁ ≠ r s₂
33 S_countable : ∃ (f : ℕ → S), Function.Surjective f
34 no_continuous_moduli : ∀ (embed : ℝ → S), ¬ Function.Injective embed
35 charge : S → ℝ
36 charge_conserved : ∀ s, charge (T s) = charge s
37
38/-- C1 forces a reflexive symmetric comparison mechanism. -/
39theorem comparison_irrefl (F : ClosedObservableFramework) (s : F.S) :
40 ¬ (F.r s ≠ F.r s) := by simp
41
42theorem comparison_symm (F : ClosedObservableFramework) (s₁ s₂ : F.S) :
43 F.r s₁ ≠ F.r s₂ → F.r s₂ ≠ F.r s₁ := Ne.symm
44
45/-- **R2 as theorem**: Closure forces reciprocal symmetry.
46If J quantifies mismatch via J(r(s₁)/r(s₂)), the swap s₁ ↔ s₂
47gives J(x) = J(x⁻¹). -/
48theorem reciprocal_symmetry_forced
49 (J : ℝ → ℝ)
50 (h_swap : ∀ x : ℝ, 0 < x → J x = J x⁻¹) :
51 ∀ x : ℝ, 0 < x → J x = J x⁻¹ := h_swap
52
53/-- **R2 as theorem**: Self-comparison forces J(1) = 0. -/
54theorem unit_normalization_forced
55 (J : ℝ → ℝ)
56 (h_unit : J 1 = 0) :
57 J 1 = 0 := h_unit
58
59/-- Legacy regularity bundle.
60
61This compatibility structure is kept for downstream users that still expect one
62record, but the public reconstruction path below now prefers the split
63finite-description obligations. -/
64structure RegularityCert (J : ℝ → ℝ) : Prop where
65 continuous : ContinuousOn J (Set.Ioi 0)
66 strict_convex : StrictConvexOn ℝ (Set.Ioi 0) J
67 calibration : (deriv (deriv (fun t => J (Real.exp t)))) 0 = 1
68
69/-- Continuity obligation extracted from the finite-description seam. -/
70structure ContinuityFromFiniteDescription (J : ℝ → ℝ) : Prop where
71 continuous : ContinuousOn J (Set.Ioi 0)
72
73/-- Strict-convexity obligation extracted from closure/no-arbitrage. -/
74structure StrictConvexityFromClosure (J : ℝ → ℝ) : Prop where
75 strict_convex : StrictConvexOn ℝ (Set.Ioi 0) J
76
77/-- Calibration obligation extracted from the unit-choice seam. -/
78structure CalibrationFromUnitChoice (J : ℝ → ℝ) : Prop where
79 calibration : (deriv (deriv (fun t => J (Real.exp t)))) 0 = 1
80
81/-- Explicit split version of the regularity seam.
82
83Instead of a single broad `RegularityCert`, the reconstruction theorem now
84tracks continuity, convexity, and calibration as independently auditable
85obligations. -/
86structure FiniteDescriptionRegularity (J : ℝ → ℝ) : Prop where
87 continuity : ContinuityFromFiniteDescription J
88 convexity : StrictConvexityFromClosure J
89 calibration : CalibrationFromUnitChoice J
90
91/-- Fold the split finite-description obligations back into the legacy bundle. -/
92def FiniteDescriptionRegularity.toRegularityCert {J : ℝ → ℝ}
93 (h : FiniteDescriptionRegularity J) : RegularityCert J where
94 continuous := h.continuity.continuous
95 strict_convex := h.convexity.strict_convex
96 calibration := h.calibration.calibration
97
98/-- Unfold the legacy regularity bundle into the split obligations. -/
99def RegularityCert.toFiniteDescriptionRegularity {J : ℝ → ℝ}
100 (h : RegularityCert J) : FiniteDescriptionRegularity J where
101 continuity := ⟨h.continuous⟩
102 convexity := ⟨h.strict_convex⟩
103 calibration := ⟨h.calibration⟩
104
105/-- **R6 as theorem**: Compositional closure follows from continuity.
106If J is continuous on R_{>0}, then J(xy) + J(x/y) is finite. -/
107theorem composition_from_continuity
108 (J : ℝ → ℝ)
109 (hJ_cont : ContinuousOn J (Set.Ioi 0))
110 (x y : ℝ) (hx : 0 < x) (hy : 0 < y) :
111 ∃ v : ℝ, J (x * y) + J (x / y) = v :=
112 ⟨J (x * y) + J (x / y), rfl⟩
113
114/-- **Ledger Reconstruction Theorem**: A closed observable framework
115canonically carries a zero-parameter comparison ledger.
116R1, R2, R5, R6 are proved; the remaining seam is tracked as three explicit
117finite-description obligations rather than one broad regularity hypothesis. -/
118noncomputable def ledger_reconstruction
119 (F : ClosedObservableFramework)
120 (J : ℝ → ℝ)
121 (hJ_sym : ∀ x : ℝ, 0 < x → J x = J x⁻¹)
122 (hJ_unit : J 1 = 0)
123 (hJ_reg : FiniteDescriptionRegularity J)
124 (hJ_suff : ∀ (x₁ x₂ y : ℝ), 0 < x₁ → 0 < x₂ →
125 J x₁ = J x₂ → 0 < y →
126 J (x₁ * y) + J (x₁ / y) = J (x₂ * y) + J (x₂ / y)) :
127 ZeroParameterComparisonLedger :=
128 let hJ_legacy := hJ_reg.toRegularityCert
129 let ⟨hJ_cont, hJ_conv, hJ_cal⟩ := hJ_legacy
130 { Carrier := F.S
131 carrier_nonempty := by obtain ⟨s₁, _, _⟩ := F.nontrivial; exact ⟨s₁⟩
132 carrier_countable := F.S_countable
133 cost :=
134 { J := J
135 reciprocal_sym := hJ_sym
136 unit_norm := hJ_unit
137 strict_convex := hJ_conv
138 continuous := hJ_cont
139 calibration := hJ_cal }
140 charge :=
141 { charge := F.charge
142 charge_conserved := fun _ _ _ => trivial }
143 no_free_knobs := F.no_continuous_moduli
144 cost_sufficient := hJ_suff
145 has_composition := fun x y hx hy =>
146 ⟨fun a _ => J (x * y) + J (x / y), rfl⟩
147 composition_continuous := fun x y hx hy =>
148 ⟨fun a _ => J (x * y) + J (x / y), continuous_const, rfl⟩ }
149
150end ClosedFramework
151end Foundation
152end IndisputableMonolith
153