Skip to content

Commit 1159785

Browse files
ErVinuelasclaude
andcommitted
fix[Hachi]: reconcile openCore with branch's batchPackage API after main merge
The merge of main brought in the Verified-zkEVM#650 skeleton's Composition.lean (which calls batchPackage with hq2 : 2*b ≤ q+1 and hb : b-1 ≤ bound) but kept this branch's sorry-free Batch.lean, whose batchPackage instead takes hn : n₀ ≤ 2^m₁ (shortness asserted directly in relBatched rather than derived from H₀ ≡ 0). The two disagreed, breaking the build. Adapt openCore/openingChain/hachi_iteration_coordinateWiseSpecialSound back to the hn API and restore the explicit (b := b) in the theorem (b is no longer pinned by a hypothesis). Also drop mem_relLiftE_of_relBatchedE from the module header's sorry inventory: it is now proved sorry-free (#print axioms: propext, Classical.choice, Quot.sound only). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent ffcc20e commit 1159785

1 file changed

Lines changed: 13 additions & 14 deletions

File tree

ArkLib/Commitments/Functional/Hachi/Composition.lean

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,8 @@ seam a home for the `w̃`-commitment's weak-binding break (design G1; `E` abstra
100100
`coordinateWiseSpecialSound_of_mkWitness_scalar` (`ScalarRound.lean`, consumed only by future
101101
proofs). *Escape threading* (F2.0): `quadEval_coordinateWiseSpecialSound_withEscape`.
102102
*Per-link math*: the F2 index bookkeeping (`rlinStmt`/`unstack`/`mem_relOutE_of_relRlinE`),
103-
Lemma 9 (`lift_coordinateWiseSpecialSound`), the F5 encodings (`Constraints.lean`), the
104-
un-batching (`mem_relLiftE_of_relBatchedE`), corrected Lemma 10
105-
(`zeroCheck_coordinateWiseSpecialSound`), the sum-to-point bridge, Lemma 11
103+
Lemma 9 (`lift_coordinateWiseSpecialSound`), the F5 encodings (`Constraints.lean`), corrected
104+
Lemma 10 (`zeroCheck_coordinateWiseSpecialSound`), the sum-to-point bridge, Lemma 11
106105
(`round_coordinateWiseSpecialSound`), F8 (`finalEval_coordinateWiseSpecialSound` + the
107106
`finalCheck` encoding), G2 (`partialEval_coordinateWiseSpecialSound` + its encoding defs), G3
108107
(`handoff_coordinateWiseSpecialSound` + `traceCheck`/`toNextQuadEvalStatement`/`hatEval`).
@@ -234,7 +233,7 @@ noncomputable def openCore (init : ProbComp σ) (impl : QueryImpl oSpec (StateT
234233
[SampleableType (ShortChallenge 𝓜(q, α) ω)]
235234
(K : LiftCom (LiftedWitness 𝓜(q, α) μ₀ n₀) E (liftShort 𝓜(q, α) γ ρBound))
236235
(φF : ZMod q →+* F)
237-
(hd : 0 < (𝓜(q, α)).φ.natDegree) (hq2 : 2 * b ≤ q + 1) (hb : b - 1 ≤ γ) :
236+
(hd : 0 < (𝓜(q, α)).φ.natDegree) (hn : n₀ ≤ 2 ^ m₁) :
238237
CWSSPackage init impl
239238
(PolyEvalStatement 𝓜(q, α) innerRows messageDigits outerRows innerDigits dRows m r)
240239
(QuadEvalWitness 𝓜(q, α) innerRows (2 ^ m) messageDigits (2 ^ r) innerDigits ⊕ E)
@@ -250,7 +249,7 @@ noncomputable def openCore (init : ProbComp σ) (impl : QueryImpl oSpec (StateT
250249
evalChainE (b := b) (γ := γ) init impl hq5 hκ hτ K.esc ▷
251250
rlinPackage (zDigits := zDigits) 𝓜(q, α) init impl (b : ZMod q) ω γ K.esc ▷
252251
liftPackage 𝓜(q, α) γ ρBound K φF init impl hd ▷
253-
batchPackage 𝓜(q, α) m₀ m₁ γ ρBound init impl K φF b hq2 hb
252+
batchPackage 𝓜(q, α) m₀ m₁ γ ρBound init impl K φF b hn
254253
zeroCheckPackage 𝓜(q, α) m₀ m₁ γ ρBound init impl K φF b ▷
255254
sumcheckBridgePackage 𝓜(q, α) m₀ m₁ γ ρBound init impl K φF b
256255

@@ -272,7 +271,7 @@ noncomputable def openingChain (init : ProbComp σ) (impl : QueryImpl oSpec (Sta
272271
[SampleableType (ShortChallenge 𝓜(q, α) ω)]
273272
(K : LiftCom (LiftedWitness 𝓜(q, α) μ₀ n₀) E (liftShort 𝓜(q, α) γ ρBound))
274273
(φF : ZMod q →+* F)
275-
(hd : 0 < (𝓜(q, α)).φ.natDegree) (hq2 : 2 * b ≤ q + 1) (hb : b - 1 ≤ γ)
274+
(hd : 0 < (𝓜(q, α)).φ.natDegree) (hn : n₀ ≤ 2 ^ m₁)
276275
(zpow : Fin (2 ^ κ) → F)
277276
(Φ' : CyclotomicModulus (ZMod q)) [IsCyclotomic Φ']
278277
{innerRows' messageDigits' outerRows' innerDigits' dRows' m' r' : ℕ}
@@ -300,7 +299,7 @@ noncomputable def openingChain (init : ProbComp σ) (impl : QueryImpl oSpec (Sta
300299
roundsSpec F b (mLow + κ)) ++ₚ pSpecFinalEval F).Challenge i) :=
301300
ProtocolSpec.instSampleableTypeChallengeAppend (h₁ := i₁)
302301
(h₂ := instSampleableTypeChallengePSpecFinalEval)
303-
(((openCore (m₀ := mLow + κ) (m₁ := m₁) init impl hq5 hκ hτ K φF hd hq2 hb).toGuarded.append
302+
(((openCore (m₀ := mLow + κ) (m₁ := m₁) init impl hq5 hκ hτ K φF hd hn).toGuarded.append
304303
(roundsChain 𝓜(q, α) (mLow + κ) m₁ γ ρBound b init impl K φF (mLow + κ))
305304
(roundsChain_relIn 𝓜(q, α) (mLow + κ) m₁ γ ρBound b init impl K φF
306305
(mLow + κ)).symm).append
@@ -322,24 +321,24 @@ theorem hachi_iteration_coordinateWiseSpecialSound (init : ProbComp σ)
322321
[SampleableType (ShortChallenge 𝓜(q, α) ω)]
323322
(K : LiftCom (LiftedWitness 𝓜(q, α) μ₀ n₀) E (liftShort 𝓜(q, α) γ ρBound))
324323
(φF : ZMod q →+* F)
325-
(hd : 0 < (𝓜(q, α)).φ.natDegree) (hq2 : 2 * b ≤ q + 1) (hb : b - 1 ≤ γ)
324+
(hd : 0 < (𝓜(q, α)).φ.natDegree) (hn : n₀ ≤ 2 ^ m₁)
326325
(zpow : Fin (2 ^ κ) → F)
327326
(Φ' : CyclotomicModulus (ZMod q)) [IsCyclotomic Φ']
328327
{innerRows' messageDigits' outerRows' innerDigits' dRows' m' r' : ℕ}
329328
(pp' : Hachi.PublicParamsD Φ' innerRows' (2 ^ m') messageDigits' outerRows' (2 ^ r')
330329
innerDigits' dRows')
331330
(reinterpretCom : K.TCom → Commitment Φ' outerRows')
332331
(base' : ZMod q) (βSq' γ' κ' : ℕ) :
333-
((openingChain (zDigits := zDigits) (ω := ω) (mLow := mLow) (m₁ := m₁) init impl hq5 hκ
334-
hτ K φF hd hq2 hb zpow Φ' pp' reinterpretCom base' βSq'
332+
((openingChain (zDigits := zDigits) (ω := ω) (mLow := mLow) (m₁ := m₁) (b := b) init impl hq5 hκ
333+
hτ K φF hd hn zpow Φ' pp' reinterpretCom base' βSq'
335334
γ' κ')).verifier.coordinateWiseSpecialSound init impl
336-
(openingChain (zDigits := zDigits) (ω := ω) (mLow := mLow) (m₁ := m₁) init impl hq5 hκ hτ
337-
K φF hd hq2 hb zpow Φ' pp' reinterpretCom base' βSq' γ' κ').struct
335+
(openingChain (zDigits := zDigits) (ω := ω) (mLow := mLow) (m₁ := m₁) (b := b) init impl
336+
hq5 hκ hτ K φF hd hn zpow Φ' pp' reinterpretCom base' βSq' γ' κ').struct
338337
(relPolyEvalE 𝓜(q, α) (b : ZMod q)
339338
(quadEvalBetaSq γ b zDigits ((𝓜(q, α)).φ.natDegree) m messageDigits) γ (2 * ω) K.esc)
340339
(relInE Φ' base' βSq' γ' κ' K.esc) :=
341-
(openingChain (zDigits := zDigits) (ω := ω) (mLow := mLow) (m₁ := m₁) init impl hq5 hκ hτ
342-
K φF hd hq2 hb zpow Φ' pp' reinterpretCom base' βSq' γ' κ').isCWSS
340+
(openingChain (zDigits := zDigits) (ω := ω) (mLow := mLow) (m₁ := m₁) (b := b) init impl hq5 hκ hτ
341+
K φF hd hn zpow Φ' pp' reinterpretCom base' βSq' γ' κ').isCWSS
343342

344343
end OpeningChain
345344

0 commit comments

Comments
 (0)