Repository navigation
Expand file tree
/
Copy pathJamMaintenancePersistence.lean
More file actions
218 lines (198 loc) · 8.85 KB
/
Copy pathJamMaintenancePersistence.lean
File metadata and controls
218 lines (198 loc) · 8.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
import JamResilienceDynamics
namespace DistributedCommons
/-!
# JAM: persistent corrective resilience from a closed maintenance loop
`JamRecurrentMaintenance.lean` gives the static three-process replacement
threshold, while `JamResilienceDynamics.lean` couples slow corrective capacity
to the fast audit reproduction number. This module closes the remaining gap:
it proves directly on the full C -> O -> R -> C state dynamics that the cone
above a canonical maintenance witness is forward invariant when the closed-loop
product meets replacement.
Consequently, if the canonical corrective coordinate is already sufficient to
make the fast audit reproduction number supercritical, then every future point
on the canonical slow trajectory remains audit-supercritical.
The mathematics is the finite directed-three-cycle specialization of standard
positive-systems / reproduction-number reasoning. The JAM-facing contribution
is the explicit bridge from a closed cross-audit maintenance loop to persistent
within-audit corrective reproduction.
-/
/-- Canonical corrective coordinate for the C -> O -> R -> C witness. -/
noncomputable def jamCanonicalCorrective (rO rR : ℝ) : ℝ :=
(1 - rO) * (1 - rR)
/-- Canonical observability coordinate. -/
noncomputable def jamCanonicalObservability (kCO rR : ℝ) : ℝ :=
kCO * (1 - rR)
/-- Canonical returned-resource coordinate. -/
noncomputable def jamCanonicalResources (kCO kOR : ℝ) : ℝ :=
kCO * kOR
/-- Canonical state exposing the exact three-cycle maintenance threshold. -/
noncomputable def jamCanonicalMaintenanceState
(rO rR kCO kOR : ℝ) : JamCorrectiveState :=
{ corrective := jamCanonicalCorrective rO rR
observability := jamCanonicalObservability kCO rR
resources := jamCanonicalResources kCO kOR }
/-- Coordinatewise order above the canonical maintenance witness. -/
def jamAtOrAboveCanonical
(rO rR kCO kOR : ℝ)
(x : JamCorrectiveState) : Prop :=
jamCanonicalCorrective rO rR ≤ x.corrective ∧
jamCanonicalObservability kCO rR ≤ x.observability ∧
jamCanonicalResources kCO kOR ≤ x.resources
/-- Exact canonical-state form of the slow replacement threshold. O and R are
exactly replaced at the witness; C is at least replaced iff the cycle-gain
product covers the product of autonomous deficits. -/
theorem jam_canonical_threshold_iff
(rC rO rR kCO kOR kRC : ℝ) :
let x := jamCanonicalMaintenanceState rO rR kCO kOR
(x.corrective ≤
(jamCorrectiveStateStep rC rO rR kCO kOR kRC x).corrective ∧
x.observability =
(jamCorrectiveStateStep rC rO rR kCO kOR kRC x).observability ∧
x.resources =
(jamCorrectiveStateStep rC rO rR kCO kOR kRC x).resources)
↔
(1 - rC) * (1 - rO) * (1 - rR) ≤ kCO * kOR * kRC := by
dsimp [jamCanonicalMaintenanceState, jamCanonicalCorrective,
jamCanonicalObservability, jamCanonicalResources,
jamCorrectiveStateStep]
constructor
· rintro ⟨hC, hO, hR⟩
nlinarith
· intro h
constructor
· nlinarith
constructor <;> ring
/-- The cone above the canonical witness is forward invariant for nonnegative
retention/coupling coefficients when the closed maintenance loop meets the
replacement threshold. -/
theorem jam_step_preserves_canonical_lower_bound
{rC rO rR kCO kOR kRC : ℝ}
(hrC : 0 ≤ rC) (hrO : 0 ≤ rO) (hrR : 0 ≤ rR)
(hkCO : 0 ≤ kCO) (hkOR : 0 ≤ kOR) (hkRC : 0 ≤ kRC)
(hloop :
(1 - rC) * (1 - rO) * (1 - rR) ≤ kCO * kOR * kRC)
{x : JamCorrectiveState}
(hx : jamAtOrAboveCanonical rO rR kCO kOR x) :
jamAtOrAboveCanonical rO rR kCO kOR
(jamCorrectiveStateStep rC rO rR kCO kOR kRC x) := by
rcases hx with ⟨hxC, hxO, hxR⟩
have hcanon :=
(jam_canonical_threshold_iff rC rO rR kCO kOR kRC).2 hloop
change
jamCanonicalCorrective rO rR ≤
rC * x.corrective + kRC * x.resources ∧
jamCanonicalObservability kCO rR ≤
rO * x.observability + kCO * x.corrective ∧
jamCanonicalResources kCO kOR ≤
rR * x.resources + kOR * x.observability
constructor
· have hCself := mul_le_mul_of_nonneg_left hxC hrC
have hCreturn := mul_le_mul_of_nonneg_left hxR hkRC
have hmono :
rC * jamCanonicalCorrective rO rR +
kRC * jamCanonicalResources kCO kOR
≤ rC * x.corrective + kRC * x.resources := by
linarith
exact le_trans hcanon.1 hmono
constructor
· have hOself := mul_le_mul_of_nonneg_left hxO hrO
have hOcross := mul_le_mul_of_nonneg_left hxC hkCO
have hmono :
rO * jamCanonicalObservability kCO rR +
kCO * jamCanonicalCorrective rO rR
≤ rO * x.observability + kCO * x.corrective := by
linarith
exact le_trans (le_of_eq hcanon.2.1) hmono
· have hRself := mul_le_mul_of_nonneg_left hxR hrR
have hRcross := mul_le_mul_of_nonneg_left hxO hkOR
have hmono :
rR * jamCanonicalResources kCO kOR +
kOR * jamCanonicalObservability kCO rR
≤ rR * x.resources + kOR * x.observability := by
linarith
exact le_trans (le_of_eq hcanon.2.2) hmono
/-- Deterministic slow trajectory initialized at the canonical witness. -/
noncomputable def jamCanonicalMaintenanceTrajectory
(rC rO rR kCO kOR kRC : ℝ) : ℕ → JamCorrectiveState
| 0 => jamCanonicalMaintenanceState rO rR kCO kOR
| n + 1 =>
jamCorrectiveStateStep rC rO rR kCO kOR kRC
(jamCanonicalMaintenanceTrajectory rC rO rR kCO kOR kRC n)
/-- Every point of the canonical trajectory remains at or above the canonical
witness when the slow loop meets replacement. -/
theorem jam_canonical_trajectory_stays_above_witness
{rC rO rR kCO kOR kRC : ℝ}
(hrC : 0 ≤ rC) (hrO : 0 ≤ rO) (hrR : 0 ≤ rR)
(hkCO : 0 ≤ kCO) (hkOR : 0 ≤ kOR) (hkRC : 0 ≤ kRC)
(hloop :
(1 - rC) * (1 - rO) * (1 - rR) ≤ kCO * kOR * kRC) :
∀ n : ℕ,
jamAtOrAboveCanonical rO rR kCO kOR
(jamCanonicalMaintenanceTrajectory rC rO rR kCO kOR kRC n) := by
intro n
induction n with
| zero =>
exact ⟨le_rfl, le_rfl, le_rfl⟩
| succ n ih =>
change jamAtOrAboveCanonical rO rR kCO kOR
(jamCorrectiveStateStep rC rO rR kCO kOR kRC
(jamCanonicalMaintenanceTrajectory rC rO rR kCO kOR kRC n))
exact jam_step_preserves_canonical_lower_bound
hrC hrO hrR hkCO hkOR hkRC hloop ih
/-- **Persistent corrective-resilience theorem.** If the closed slow
maintenance loop meets replacement and the canonical corrective coordinate is
already sufficient for fast audit supercriticality, then every future point on
the canonical slow trajectory remains audit-supercritical.
This directly links the Result-4 maintenance threshold to the Result-5 fast
audit threshold without introducing the reduced multiplier `m`. -/
theorem jam_closed_maintenance_loop_preserves_supercritical_correction
{F rC rO rR kCO kOR kRC : ℝ}
(hF : 0 ≤ F)
(hrC : 0 ≤ rC) (hrO : 0 ≤ rO) (hrR : 0 ≤ rR)
(hkCO : 0 ≤ kCO) (hkOR : 0 ≤ kOR) (hkRC : 0 ≤ kRC)
(hloop :
(1 - rC) * (1 - rO) * (1 - rR) ≤ kCO * kOR * kRC)
(hfast : 1 < F * jamCanonicalCorrective rO rR) :
∀ n : ℕ,
jamStateCorrectionSupercritical F
(jamCanonicalMaintenanceTrajectory rC rO rR kCO kOR kRC n) := by
intro n
have habove := jam_canonical_trajectory_stays_above_witness
hrC hrO hrR hkCO hkOR hkRC hloop n
have hC :
jamCanonicalCorrective rO rR ≤
(jamCanonicalMaintenanceTrajectory rC rO rR kCO kOR kRC n).corrective :=
habove.1
have hmul :
F * jamCanonicalCorrective rO rR ≤
F * (jamCanonicalMaintenanceTrajectory rC rO rR kCO kOR kRC n).corrective :=
mul_le_mul_of_nonneg_left hC hF
unfold jamStateCorrectionSupercritical jamStateCorrectionReproduction
exact lt_of_lt_of_le hfast hmul
/-- Under positive O and R deficits and positive C->O and O->R gains, the
canonical corrective coordinate is strictly positive. -/
theorem jam_canonical_corrective_positive
{rO rR : ℝ}
(hdO : 0 < 1 - rO)
(hdR : 0 < 1 - rR) :
0 < jamCanonicalCorrective rO rR := by
unfold jamCanonicalCorrective
exact mul_pos hdO hdR
/-- Deleting the immediate R->C return edge makes any positive corrective
coordinate with subunit autonomous retention strictly decline on the next
cross-audit update. -/
theorem jam_deleting_return_edge_makes_corrective_capacity_decline
{rC rO rR kCO kOR : ℝ}
{x : JamCorrectiveState}
(hrC : rC < 1)
(hxC : 0 < x.corrective) :
(jamCorrectiveStateStep rC rO rR kCO kOR 0 x).corrective < x.corrective := by
simp [jamCorrectiveStateStep]
nlinarith
#print axioms jam_canonical_threshold_iff
#print axioms jam_step_preserves_canonical_lower_bound
#print axioms jam_canonical_trajectory_stays_above_witness
#print axioms jam_closed_maintenance_loop_preserves_supercritical_correction
#print axioms jam_canonical_corrective_positive
#print axioms jam_deleting_return_edge_makes_corrective_capacity_decline
end DistributedCommons