Skip to content

Commit ffc7c75

Browse files
committed
feat(Verified-zkEVM#140): project repaired prize specs
1 parent c10befc commit ffc7c75

1 file changed

Lines changed: 89 additions & 0 deletions

File tree

ArkLib/Data/CodingTheory/ProximityGap/LineDecodingGrandChallengesPrizeSpec.lean

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,87 @@ theorem exists_mcaPrizeLatticeResolved_with_spec_of_forall_not_mcaEvent
127127
(δ j) (hno j)]
128128
simp
129129

130+
/-- Project the per-rate threshold specification from repaired double-cover data. -/
131+
theorem exists_mcaPrizeLatticeSpec_ofDoubleCover
132+
(domain : ι ↪ F) (δ : Fin 4 → ℝ≥0)
133+
(hδ_le_one : ∀ j : Fin 4, δ j ≤ 1)
134+
(hcov : ∀ j : Fin 4, MCAForallDoubleCover (F := F) (A := F)
135+
(ReedSolomon.code domain ⌊prizeRates j * (Fintype.card ι : ℝ≥0)⌋₊ : Set (ι → F))
136+
(δ j)) :
137+
∃ τ : Fin 4 → Fin (Fintype.card ι + 1),
138+
∀ j : Fin 4,
139+
let C : Set (ι → F) :=
140+
ReedSolomon.code domain ⌊prizeRates j * (Fintype.card ι : ℝ≥0)⌋₊
141+
∃ _ : mcaThresholdExists C epsStar,
142+
mcaSatisfies C epsStar (τ j) ∧
143+
∀ i : Fin (Fintype.card ι + 1), mcaSatisfies C epsStar i → i ≤ τ j := by
144+
rcases exists_mcaPrizeLatticeResolved_with_spec_ofDoubleCover
145+
domain δ hδ_le_one hcov with
146+
⟨τ, _hτ, hspec⟩
147+
exact ⟨τ, hspec⟩
148+
149+
/-- Project the per-rate threshold specification from named bad-scalar double-cover data. -/
150+
theorem exists_mcaPrizeLatticeSpec_ofBadScalarDoubleCover
151+
(domain : ι ↪ F) (δ : Fin 4 → ℝ≥0)
152+
(hδ_le_one : ∀ j : Fin 4, δ j ≤ 1)
153+
(hcov : ∀ j : Fin 4, ∀ (u : Code.WordStack F (Fin 2) ι) (γ : F),
154+
MCABadScalarDoubleCover (F := F) (A := F)
155+
(ReedSolomon.code domain ⌊prizeRates j * (Fintype.card ι : ℝ≥0)⌋₊ : Set (ι → F))
156+
(δ j) (u 0) (u 1) γ) :
157+
∃ τ : Fin 4 → Fin (Fintype.card ι + 1),
158+
∀ j : Fin 4,
159+
let C : Set (ι → F) :=
160+
ReedSolomon.code domain ⌊prizeRates j * (Fintype.card ι : ℝ≥0)⌋₊
161+
∃ _ : mcaThresholdExists C epsStar,
162+
mcaSatisfies C epsStar (τ j) ∧
163+
∀ i : Fin (Fintype.card ι + 1), mcaSatisfies C epsStar i → i ≤ τ j := by
164+
rcases exists_mcaPrizeLatticeResolved_with_spec_ofBadScalarDoubleCover
165+
domain δ hδ_le_one hcov with
166+
⟨τ, _hτ, hspec⟩
167+
exact ⟨τ, hspec⟩
168+
169+
/-- Project the per-rate threshold specification from zero bad-scalar counts. -/
170+
theorem exists_mcaPrizeLatticeSpec_of_mcaBadCount_zero
171+
(domain : ι ↪ F) (δ : Fin 4 → ℝ≥0)
172+
(hδ_le_one : ∀ j : Fin 4, δ j ≤ 1)
173+
(hzero : ∀ j : Fin 4, ∀ u : Code.WordStack F (Fin 2) ι,
174+
mcaBadCount (F := F)
175+
(ReedSolomon.code domain
176+
⌊prizeRates j * (Fintype.card ι : ℝ≥0)⌋₊ : Set (ι → F))
177+
(δ j) (u 0) (u 1) = 0) :
178+
∃ τ : Fin 4 → Fin (Fintype.card ι + 1),
179+
∀ j : Fin 4,
180+
let C : Set (ι → F) :=
181+
ReedSolomon.code domain ⌊prizeRates j * (Fintype.card ι : ℝ≥0)⌋₊
182+
∃ _ : mcaThresholdExists C epsStar,
183+
mcaSatisfies C epsStar (τ j) ∧
184+
∀ i : Fin (Fintype.card ι + 1), mcaSatisfies C epsStar i → i ≤ τ j := by
185+
rcases exists_mcaPrizeLatticeResolved_with_spec_of_mcaBadCount_zero
186+
domain δ hδ_le_one hzero with
187+
⟨τ, _hτ, hspec⟩
188+
exact ⟨τ, hspec⟩
189+
190+
/-- Project the per-rate threshold specification from direct no-bad-event frontiers. -/
191+
theorem exists_mcaPrizeLatticeSpec_of_forall_not_mcaEvent
192+
(domain : ι ↪ F) (δ : Fin 4 → ℝ≥0)
193+
(hδ_le_one : ∀ j : Fin 4, δ j ≤ 1)
194+
(hno : ∀ j : Fin 4, ∀ (u : Code.WordStack F (Fin 2) ι) (γ : F),
195+
¬ mcaEvent (F := F)
196+
(ReedSolomon.code domain
197+
⌊prizeRates j * (Fintype.card ι : ℝ≥0)⌋₊ : Set (ι → F))
198+
(δ j) (u 0) (u 1) γ) :
199+
∃ τ : Fin 4 → Fin (Fintype.card ι + 1),
200+
∀ j : Fin 4,
201+
let C : Set (ι → F) :=
202+
ReedSolomon.code domain ⌊prizeRates j * (Fintype.card ι : ℝ≥0)⌋₊
203+
∃ _ : mcaThresholdExists C epsStar,
204+
mcaSatisfies C epsStar (τ j) ∧
205+
∀ i : Fin (Fintype.card ι + 1), mcaSatisfies C epsStar i → i ≤ τ j := by
206+
rcases exists_mcaPrizeLatticeResolved_with_spec_of_forall_not_mcaEvent
207+
domain δ hδ_le_one hno with
208+
⟨τ, _hτ, hspec⟩
209+
exact ⟨τ, hspec⟩
210+
130211
/-- Package repaired double-cover frontiers and explicit adjacent upper witnesses into the generic
131212
four-rate adjacent-witness frontier. -/
132213
noncomputable def mcaPrizeAdjacentWitnessFrontier_ofDoubleCover_and_upperWitnesses
@@ -869,6 +950,14 @@ set_option linter.style.longLine false in
869950
set_option linter.style.longLine false in
870951
#print axioms ProximityGap.GrandChallengesLattice.exists_mcaPrizeLatticeResolved_with_spec_of_forall_not_mcaEvent
871952
set_option linter.style.longLine false in
953+
#print axioms ProximityGap.GrandChallengesLattice.exists_mcaPrizeLatticeSpec_ofDoubleCover
954+
set_option linter.style.longLine false in
955+
#print axioms ProximityGap.GrandChallengesLattice.exists_mcaPrizeLatticeSpec_ofBadScalarDoubleCover
956+
set_option linter.style.longLine false in
957+
#print axioms ProximityGap.GrandChallengesLattice.exists_mcaPrizeLatticeSpec_of_mcaBadCount_zero
958+
set_option linter.style.longLine false in
959+
#print axioms ProximityGap.GrandChallengesLattice.exists_mcaPrizeLatticeSpec_of_forall_not_mcaEvent
960+
set_option linter.style.longLine false in
872961
#print axioms ProximityGap.GrandChallengesLattice.mcaPrizeAdjacentWitnessFrontier_ofDoubleCover_and_upperWitnesses
873962
set_option linter.style.longLine false in
874963
#print axioms ProximityGap.GrandChallengesLattice.mcaPrizeLatticeResolved_ofDoubleCoverAdjacentFrontier

0 commit comments

Comments
 (0)