Skip to content

feat/refactor[Hachi]: fig. 3 protocol + CWSSPackages abstraction + partial reorg of Hachi folder - #626

Merged
alexanderlhicks merged 20 commits into
mainfrom
hachi-polynomial-quadratic-eq
Jul 17, 2026
Merged

feat/refactor[Hachi]: fig. 3 protocol + CWSSPackages abstraction + partial reorg of Hachi folder#626
alexanderlhicks merged 20 commits into
mainfrom
hachi-polynomial-quadratic-eq

Conversation

@tobias-rothmann

@tobias-rothmann tobias-rothmann commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

TLDR

This PR adds the (sub)protocol of fig. 3 from the Hachi paper and along the way, introduces a new abstraction called CWSSPackage that allows for easy composition of CWSS protocols (even has nice notation). It also slightly restructures the Hachi folder to be more readable (typically with subfolders for subprotocols and more documentation of where what is to be found).

Figure 3 Protocol

This PR adds the Hachi/QuadEval/ development for the Figure 3 polynomial-evaluation reduction.

The reduction rewrites a multilinear evaluation claim f(x) = y as the quadratic form bᵀ M a, then folds the 2^r carrier blocks under the verifier’s challenge vector. In Lean, the protocol is split into:

  • QuadEval/Gadgets.lean: gadget algebra for PublicParamsD, the carrier w, its decomposition ŵ, the short commitment v = D ŵ, the J decomposition, and the tensorG / tensorG1 identities used by the extractor.
  • QuadEval/Reduction.lean: the Figure 3 protocol data, including QuadEvalStatement, QuadEvalResponse, QuadEvalWitness, ShortChallenge, relIn, relOut, verifier, and the honest prover skeleton.
  • QuadEval/Soundness.lean: Hachi Lemma 8 as quadEval_coordinateWiseSpecialSound, together with buildWitness and the composable quadEvalPackage.
  • QuadEval/Bridge.lean: the zero-round polynomial-level bridge from PolyEvalStatement to QuadEvalStatement, with relPolyEval, bridge_coordinateWiseSpecialSound, and bridgePackage.

The implementation is organized as a two-package CWSS chain. The first package is a zero-round
adapter into the Figure 3 statement shape; the second package is the actual two-round Figure 3
protocol. At the relation level, the chain looks like this:

flowchart LR
  R0(["<b>relPolyEval</b><br/>on PolyEvalStatement"])
  R1(["<b>relIn</b><br/>on QuadEvalStatement"])
  R2(["<b>relOut</b><br/>Eq. (20) + range checks"])

  R0 -- "bridgePackage<br/><i>0-round adapter<br/>toQuadEvalStatement</i>" --> R1
  R1 -- "quadEvalPackage<br/><i>2-round Figure 3<br/>pSpec CarrierCom ShortChallenge r</i>" --> R2

  classDef rel fill:#eef4fb,stroke:#4a7ab5,color:#1a3a5c
  class R0,R1,R2 rel
Loading

Relations are the nodes; each CWSSPackage is an edge reducing one relation to the next, and the
whole chain is evalChain = bridgePackage ▷ quadEvalPackage.

Zooming into the quadEvalPackage, the implemented Figure 3 interaction is:

sequenceDiagram
  autonumber
  participant P as Prover
  participant V as Verifier

  Note over P,V: shared input:<br/>stmt : QuadEvalStatement (satisfying relIn)

  Note left of P: decompose the carrier w<br/>into short digits ŵ
  P->>V: v = D ŵ : CarrierCom

  Note right of V: sample 2^r short challenges
  V->>P: c : Fin (2^r) → ShortChallenge

  Note left of P: fold the 2^r carrier blocks under c,<br/>assemble QuadEvalResponse (ŵ, t̂, ẑ)

  Note over P,V: reduces to relOut: Eq. (20) + range checks<br/>on statement (stmt, v, c) and witness (ŵ, t̂, ẑ)
Loading

In other words:

  • bridgePackage covers the statement reduction into Figure 3: it turns a PolyEvalStatement
    into a QuadEvalStatement using toQuadEvalStatement, with bvec := mb(xl) and
    avec := mb(xh). It has no messages or challenges, so its structure is
    CWSSStructure.ofIsEmpty.
  • quadEvalPackage covers the Figure 3 protocol itself: the prover sends the short carrier
    commitment v = D ŵ, the verifier sends the challenge vector
    c : Fin (2^r) → ShortChallenge, and the output relation relOut checks the Eq. (20)
    constraints and range checks against QuadEvalResponse = (ŵ, t̂, ẑ).
  • The seam is definitional: bridgePackage.relOut is the same relation as
    quadEvalPackage.relIn, so the two compose as bridgePackage ▷ quadEvalPackage.

CWSSPackage Composition

This PR introduces CWSSPackage, a small bundle for reusable CWSS composition. A package collects
exactly the data needed to reuse one protocol as a link in a larger CWSS proof:

  • verifier: the verifier/reduction implemented by this component;
  • struct: the CWSSStructure describing the component's challenge shape;
  • relIn: the input relation the component reduces from;
  • relOut: the output relation the component reduces to;
  • isPure: the proof that the verifier is deterministic as a function of the statement and
    transcript, which is the hypothesis needed to compose it on the left;
  • isCWSS: the actual coordinate-wise-special-soundness certificate for this component.

Packages compose with:

P₁ ▷ P₂ ▷ P₃ ▷ P₄

whenever each adjacent seam matches, i.e. Pᵢ.relOut = Pᵢ₊₁.relIn. The result is again a
CWSSPackage, whose isCWSS field is the composed CWSS certificate for the whole chain.

For the Figure 3 core in this PR, the concrete chain is:

evalChain = bridgePackage ▷ quadEvalPackage

where bridgePackage is the zero-round polynomial-level bridge into QuadEval, and
quadEvalPackage is the two-round Figure 3 reduction with its Lemma 8 CWSS proof.

Generic Infrastructure

This PR also adds reusable CWSS infrastructure for:

  • no-challenge protocols via CWSSStructure.ofIsEmpty;
  • single-round challenge-vector protocols via CoordinateWise.SingleRound;
  • sequential CWSS composition;
  • verifier purity propagation through composition.

Hachi Integration

This PR adds the Hachi folder landing page and a Commitment.Scheme shell with the multilinear evaluation oracle, honest keygen, and honest commit.

The full opening proof remains documented as future work pending the remaining §4.3+/§4.5 subprotocols and the completeness layer. The Figure 3 CWSS core itself is exposed through evalChain and eval_coordinateWiseSpecialSound.

cc @ErVinuelas

@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

🤖 PR Summary

⚠️ PR title does not follow conventional commit format type[(scope)]: subject. Got: feat/refactor[Hachi]: fig. 3 protocol + CWSSPackages abstraction + partial reorg of Hachi folder

sorry delta: +1 (1 added) — proof obligations increased

This pull request formalizes the Figure 3 protocol from the Hachi paper and introduces the CWSSPackage abstraction for composing coordinate-wise special soundness proofs. The work is concentrated in new files under ArkLib/Commitments/Functional/Hachi/QuadEval/, plus supporting infrastructure in ArkLib/OracleReduction/Security/CoordinateWiseSpecialSoundness/. The PR also restructures the existing Hachi folder for clarity.


Statistics

Metric Count
📝 Files Changed 28
Lines Added 3273
Lines Removed 382

Lean Declarations

✏️ Removed: 18 declaration(s)

ArkLib/Commitments/Functional/Hachi/Gadget.lean (12)

  • def IsLawfulGadgetDecomposition (base : R) {rows digits : Nat}
  • def gadgetDecompose {rows digits : Nat} (dd : DigitDecomposition base digits)
  • def gadgetEntry (base : R) {rows digits : Nat} (i : Fin rows) (j : Fin (rows * digits)) : Rq Φ
  • def gadgetMatrix (base : R) (rows digits : Nat) : PolyMatrix (Rq Φ) rows (rows * digits)
  • def gadgetMul (base : R) {rows digits : Nat} (v : PolyVec (Rq Φ) (rows * digits)) :
  • def zmodDigitDecomposition (b digits : ℕ) (hb : 1 < b) (hq : q ≤ b ^ digits) :
  • private theorem ofDigits_eq_sum_range {α : Type*} [CommSemiring α] (β : α) (L : List ℕ) :
  • private theorem ofDigits_eq_sum_range_of_len_le {α : Type*} [CommSemiring α] (β : α) (L : List ℕ)
  • theorem gadgetDecompose_apply {rows digits : Nat} (dd : DigitDecomposition base digits)
  • theorem gadgetDecompose_lawful {rows digits : Nat} (hd : 0 < digits) (h1 : 1 ≤ Φ.φ.natDegree)
  • theorem gadgetEntry_finProdFinEquiv (base : R) {rows digits : Nat} (hd : 0 < digits)
  • theorem gadgetMul_apply (base : R) {rows digits : Nat} (hd : 0 < digits)

ArkLib/Commitments/Functional/Hachi/GadgetNorms.lean (6)

  • theorem gadgetDecompose_coeff {base : ZMod q} {rows digits : ℕ}
  • theorem gadgetDecompose_zmod_l2NormSq_le {b digits rows : ℕ} (hb : 1 < b) (hq : q ≤ b ^ digits)
  • theorem gadgetDecompose_zmod_lInftyNorm_le {b digits rows : ℕ} (hb : 1 < b) (hq : q ≤ b ^ digits)
  • theorem gadgetDecompose_zmod_vecL2NormSq_le {b digits rows : ℕ} (hb : 1 < b) (hq : q ≤ b ^ digits)
  • theorem gadgetDecompose_zmod_vecLInftyNorm_le {b digits rows : ℕ} (hb : 1 < b) (hq : q ≤ b ^ digits)
  • theorem zmodDigit_natAbs_le {b digits : ℕ} (hb : 1 < b) (hq : q ≤ b ^ digits)
✏️ Added: 128 declaration(s)

ArkLib/Commitments/Functional/Hachi/Commitment.lean (4)

  • def commit [DecidableEq (ZMod q)] (hb : 1 < b)
  • def hachi [DecidableEq (ZMod q)] (hb : 1 < b) :
  • def keygen :
  • instance multilinearEvalOracleInterface {n : ℕ} :

ArkLib/Commitments/Functional/Hachi/Composition.lean (2)

  • def evalChain (init : ProbComp σ) (impl : QueryImpl oSpec (StateT σ ProbComp))
  • theorem eval_coordinateWiseSpecialSound (init : ProbComp σ)

ArkLib/Commitments/Functional/Hachi/EvalSplit.lean (5)

  • @[simp] theorem toMatrix_toPolynomial (M : PolyMatrix R (2 ^ nl) (2 ^ nh)) :
  • @[simp] theorem toPolynomial_get (M : PolyMatrix R (2 ^ nl) (2 ^ nh))
  • @[simp] theorem toPolynomial_toMatrix (p : CMlPolynomial R (nl + nh)) :
  • def toPolynomial (M : PolyMatrix R (2 ^ nl) (2 ^ nh)) : CMlPolynomial R (nl + nh)
  • theorem splitForm_monomialBasis_eq_eval (M : PolyMatrix R (2 ^ nl) (2 ^ nh))

ArkLib/Commitments/Functional/Hachi/Gadget/Basic.lean (12)

  • def IsLawfulGadgetDecomposition (base : R) {rows digits : Nat}
  • def gadgetDecompose {rows digits : Nat} (dd : DigitDecomposition base digits)
  • def gadgetEntry (base : R) {rows digits : Nat} (i : Fin rows) (j : Fin (rows * digits)) : Rq Φ
  • def gadgetMatrix (base : R) (rows digits : Nat) : PolyMatrix (Rq Φ) rows (rows * digits)
  • def gadgetMul (base : R) {rows digits : Nat} (v : PolyVec (Rq Φ) (rows * digits)) :
  • def zmodDigitDecomposition (b digits : ℕ) (hb : 1 < b) (hq : q ≤ b ^ digits) :
  • private theorem ofDigits_eq_sum_range {α : Type*} [CommSemiring α] (β : α) (L : List ℕ) :
  • private theorem ofDigits_eq_sum_range_of_len_le {α : Type*} [CommSemiring α] (β : α) (L : List ℕ)
  • theorem gadgetDecompose_apply {rows digits : Nat} (dd : DigitDecomposition base digits)
  • theorem gadgetDecompose_lawful {rows digits : Nat} (hd : 0 < digits) (h1 : 1 ≤ Φ.φ.natDegree)
  • theorem gadgetEntry_finProdFinEquiv (base : R) {rows digits : Nat} (hd : 0 < digits)
  • theorem gadgetMul_apply (base : R) {rows digits : Nat} (hd : 0 < digits)

ArkLib/Commitments/Functional/Hachi/Gadget/Norms.lean (11)

  • theorem gadgetDecompose_coeff {base : ZMod q} {rows digits : ℕ}
  • theorem gadgetDecompose_zmod_l2NormSq_le {b digits rows : ℕ} (hb : 1 < b) (hq : q ≤ b ^ digits)
  • theorem gadgetDecompose_zmod_lInftyNorm_le {b digits rows : ℕ} (hb : 1 < b) (hq : q ≤ b ^ digits)
  • theorem gadgetDecompose_zmod_vecL2NormSq_le {b digits rows : ℕ} (hb : 1 < b) (hq : q ≤ b ^ digits)
  • theorem gadgetDecompose_zmod_vecLInftyNorm_le {b digits rows : ℕ} (hb : 1 < b) (hq : q ≤ b ^ digits)
  • theorem gadgetMul_zmod_coeff_natAbs_le {b rows digits : ℕ} (hd : 0 < digits)
  • theorem gadgetMul_zmod_lInftyNorm_le {b rows digits : ℕ} (hd : 0 < digits)
  • theorem gadgetMul_zmod_sub_l2NormSq_le {b rows digits : ℕ} (hd : 0 < digits)
  • theorem gadgetMul_zmod_vecL2NormSq_le {b rows digits : ℕ} (hd : 0 < digits)
  • theorem gadgetMul_zmod_vecLInftyNorm_le {b rows digits : ℕ} (hd : 0 < digits)
  • theorem zmodDigit_natAbs_le {b digits : ℕ} (hb : 1 < b) (hq : q ≤ b ^ digits)

ArkLib/Commitments/Functional/Hachi/QuadEval/Bridge.lean (8)

  • @[simp] theorem toMatrix_extractedPoly (base : ZMod q)
  • def bridgePackage {σ : Type} (init : ProbComp σ) (impl : QueryImpl oSpec (StateT σ ProbComp))
  • def bridgeVerifier :
  • def extractedPoly (base : ZMod q)
  • def relPolyEval (base : ZMod q) (βSq γ κ : ℕ) :
  • def toQuadEvalStatement
  • theorem bridge_coordinateWiseSpecialSound {σ : Type}
  • theorem mem_relPolyEval_of_relIn (base : ZMod q) (βSq γ κ : ℕ)

ArkLib/Commitments/Functional/Hachi/QuadEval/Gadgets.lean (14)

  • def carrier (a : PolyVec (Rq Φ) messageRows)
  • def carrierCommit {dRows : Nat} (D : Simple.PublicParams Φ dRows (blocks * messageDigits))
  • def carrierDecomp {base : R} (ddCarrier : DigitDecomposition base messageDigits)
  • def carrierEntry (a : PolyVec (Rq Φ) messageRows)
  • def jMatrix (base : R) (n zDigits : Nat) : PolyMatrix (Rq Φ) n (n * zDigits)
  • def tensorG (base : R) (k digits : Nat) (c : PolyVec (Rq Φ) blocks)
  • def tensorG1 (base : R) (digits : Nat) (c : PolyVec (Rq Φ) blocks)
  • def zDecomp {n zDigits : Nat} {base : R} (ddZ : DigitDecomposition base zDigits)
  • theorem carrier_eq_gadget {base : R} (hd : 0 < messageDigits) (h1 : 1 ≤ Φ.φ.natDegree)
  • theorem tensorG1_coord_diff (base : R) (digits : Nat)
  • theorem tensorG1_sub_challenge (base : R) (digits : Nat) (c c' : PolyVec (Rq Φ) blocks)
  • theorem tensorG_coord_diff (base : R) (k digits : Nat)
  • theorem tensorG_sub_challenge (base : R) (k digits : Nat) (c c' : PolyVec (Rq Φ) blocks)
  • theorem z_eq_jMatrix {n zDigits : Nat} {base : R} (hd : 0 < zDigits)

ArkLib/Commitments/Functional/Hachi/QuadEval/Reduction.lean (19)

  • abbrev CarrierCom (Φ : CyclotomicModulus R) (dRows : Nat)
  • def InSb (β : ℕ) (a : Rq Φ) : Prop
  • def ShortChallenge (Φ : CyclotomicModulus (ZMod q)) (ω : ℕ) : Type
  • def dShort (γ : ℕ) : ModuleSIS.Solution Φ (blocks * messageDigits) → Bool
  • def derivedMsgMatrix (base : ZMod q)
  • def evalConsistency (base : ZMod q) (a : PolyVec (Rq Φ) (2 ^ m)) (b : PolyVec (Rq Φ) (2 ^ r))
  • def paperRelOut (base : ZMod q) (ω b : ℕ) :
  • def prover (WitIn : Type)
  • def relIn (base : ZMod q) (βSq γ κ : ℕ) :
  • def relOut (base : ZMod q) (ω γ : ℕ) :
  • def val (c : ShortChallenge Φ ω) : Rq Φ
  • def vecInSb (β : ℕ) {cols : ℕ} (z : PolyVec (Rq Φ) cols) : Prop
  • def verifier :
  • theorem l1Norm_le (c : ShortChallenge Φ ω) : ‖c.val‖₁ ≤ ω
  • theorem l1Norm_val_sub_le (c c' : ShortChallenge Φ ω) : ‖c.val - c'.val‖₁ ≤ 2 * ω
  • theorem lInftyNorm_le_of_InSb {β γ : ℕ} (hγ : β / 2 ≤ γ) {a : Rq Φ} (h : InSb Φ β a) :
  • theorem paperRelOut_subset_relOut (base : ZMod q) (ω : ℕ) {b γ : ℕ} (hγ : b / 2 ≤ γ) :
  • theorem val_ne_of_ne {c c' : ShortChallenge Φ ω} (h : c ≠ c') : c.val ≠ c'.val
  • theorem vecLInftyNorm_le_of_vecInSb {β γ cols : ℕ} (hγ : β / 2 ≤ γ)

ArkLib/Commitments/Functional/Hachi/QuadEval/Soundness.lean (15)

  • def quadEvalBetaSq (γ b τ d m δ : ℕ) : ℕ
  • def quadEvalPackage {ι : Type} {oSpec : OracleSpec ι} {σ : Type}
  • def quadEvalZL2SqBound (γ b τ d m δ : ℕ) : ℕ
  • noncomputable def buildWitness (base : ZMod q)
  • noncomputable def extractedOpening (base : ZMod q)
  • theorem ShortChallenge.coordEq_val {ℓ : ℕ} {i : Fin ℓ} {x y : Fin ℓ → ShortChallenge Φ ω}
  • theorem buildWitness_mem_relIn (hq5 : q % 8 = 5) {b ω γ : ℕ} (hκ : (2 * ω) ^ 2 < q)
  • theorem evalConsistency_of_relOut_star (hq5 : q % 8 = 5) {b ω γ : ℕ} (hκ : (2 * ω) ^ 2 < q)
  • theorem evalConsistency_of_star (base : ZMod q) (a : PolyVec (Rq Φ) (2 ^ m))
  • theorem inner_eq_of_chain {base : ZMod q} {cols : Nat}
  • theorem msis_of_commit_eq {rows cols γ : ℕ}
  • theorem quadEval_coordinateWiseSpecialSound {ι : Type} {oSpec : OracleSpec ι} {σ : Type}
  • theorem quadEval_coordinateWiseSpecialSound_paperParams {ι : Type} {oSpec : OracleSpec ι} {σ : Type}
  • theorem slack_isUnit (hq5 : q % 8 = 5) {ω : ℕ} (hκ : (2 * ω) ^ 2 < q)
  • theorem verifiedOpening_of_star (hq5 : q % 8 = 5) {b ω γ : ℕ} (hκ : (2 * ω) ^ 2 < q)

ArkLib/Data/Lattices/CyclotomicRing/NormBounds/Basic.lean (6)

  • def zRecomposeL2SqBound (γ b τ d cols : ℕ) : ℕ
  • theorem Rq.eq_zero_of_l1Norm_eq_zero {x : Rq Φ} (h : ‖x‖₁ = 0) : x = 0
  • theorem Rq.l1Norm_pos_of_ne_zero {x : Rq Φ} (hx : x ≠ 0) : 0 < ‖x‖₁
  • theorem Rq.l1Norm_sub_le (a b : Rq Φ) : ‖a - b‖₁ ≤ ‖a‖₁ + ‖b‖₁
  • theorem Rq.l2NormSq_le_natDegree_mul_lInftyNorm_sq (x : Rq Φ) :
  • theorem vecL2NormSq_le_card_mul_lInftyNorm_sq {cols : ℕ} (v : PolyVec (Rq Φ) cols) :

ArkLib/OracleReduction/Security/CoordinateWiseSpecialSoundness/NoChallenge.lean (1)

  • def ofIsEmpty {n : ℕ} {pSpec : ProtocolSpec n} [IsEmpty pSpec.ChallengeIdx] :

ArkLib/OracleReduction/Security/CoordinateWiseSpecialSoundness/Package.lean (1)

  • def append {init : ProbComp σ} {impl : QueryImpl oSpec (StateT σ ProbComp)}

ArkLib/OracleReduction/Security/CoordinateWiseSpecialSoundness/SingleRound.lean (30)

  • @[reducible] def pSpec (CarrierCom C : Type) (r : ℕ) : ProtocolSpec 2
  • @[simp] theorem readChallenges_tree2 (v : CarrierCom)
  • @[simp] theorem readPre_tree2 (v : CarrierCom)
  • def StarAt {ℓ K : ℕ} (challenges : Fin K → (Fin ℓ → C)) (e : Fin K) : Prop
  • def branchPath (v : CarrierCom)
  • def branchTr (v : CarrierCom)
  • def chalsAux : {a : Fin 3} → ChallengeTree (pSpec CarrierCom C r) arity a → a = (1 : Fin 3) →
  • def foldStructure : CWSSStructure (pSpec CarrierCom C r) where
  • def readChallenges (tree : ChallengeTree (pSpec CarrierCom C r) arity 0) :
  • def readPre (tree : ChallengeTree (pSpec CarrierCom C r) arity 0) :
  • def topMsgAux : {a : Fin 3} → ChallengeTree (pSpec CarrierCom C r) arity a → a = (0 : Fin 3) →
  • def tree2 (v : CarrierCom)
  • noncomputable def central {ℓ K : ℕ} (challenges : Fin K → (Fin ℓ → C)) [Nonempty (Fin K)] :
  • noncomputable def sib {ℓ K : ℕ} (challenges : Fin K → (Fin ℓ → C)) [Nonempty (Fin K)]
  • noncomputable def treeExtractor {StmtIn WitOut WitIn : Type} [Nonempty WitOut]
  • theorem branch_challenge (v : CarrierCom)
  • theorem branch_mem (v : CarrierCom)
  • theorem branch_pre (v : CarrierCom)
  • theorem branch_relOut_language (init : ProbComp σ)
  • theorem chal_shape : {a : Fin 3} → (t : ChallengeTree (pSpec CarrierCom C r) arity a) →
  • theorem coordEq_symm {S : Type*} {ℓ : ℕ} {i : Fin ℓ} {x y : Fin ℓ → S}
  • theorem coordinateWiseSpecialSound_of_mkWitness
  • theorem eq_leaf : {a : Fin 3} → (t : ChallengeTree (pSpec CarrierCom C r) arity a) →
  • theorem exists_starAt {ℓ k K : ℕ} (hk : 2 ≤ k) (hK : K = ℓ * (k - 1) + 1)
  • theorem foldStructure_arity :
  • theorem nodeOk_iff_family
  • theorem sib_coordEq {ℓ K : ℕ} (challenges : Fin K → (Fin ℓ → C)) [Nonempty (Fin K)]
  • theorem sib_coordEq_ne {ℓ K : ℕ} (challenges : Fin K → (Fin ℓ → C)) [Nonempty (Fin K)]
  • theorem tree_shape (tree : ChallengeTree (pSpec CarrierCom C r) arity 0) :
  • theorem tree_shape_aux : {a : Fin 3} → (t : ChallengeTree (pSpec CarrierCom C r) arity a) →

sorry Tracking

Added: 1 `sorry`(s)

ArkLib/Commitments/Functional/Hachi/Commitment.lean (1)

  • def hachi [DecidableEq (ZMod q)] (hb : 1 < b) : (L151)

📋 **Additional Analysis**

No findings.


📄 **Per-File Summaries**
  • ArkLib.lean: Summary unavailable — error: 1 validation error for _ProseSummary
    Invalid JSON: expected value at line 1 column 1 [type=json_invalid, input_value='The file reorganizes and...admit are introduced.', input_type=str]
    For further information visit https://errors.pydantic.dev/2.13/v/json_invalid
  • ArkLib/Commitments/Functional/Hachi.lean: This file adds the top-level module documentation for ArkLib/Commitments/Functional/Hachi, which formalizes the Hachi [NOZ26] lattice-based multilinear polynomial commitment. It outlines the folder structure organized by paper sections—covering the gadget matrix, inner-outer Ajtai commitment (§4.1) with proven correctness and weak-binding reduction, the quadratic polynomial-evaluation reduction (§4.2, Lemma 8) with coordinate-wise special soundness and a polynomial-level bridge, and the CWSS composition home (Composition.lean) containing the finished evalChain. The file notes that the opening Proof in Commitment.lean remains a documented sorry pending remaining subprotocols, and that all other components are sorry-free with proven axioms down to the Lyubashevsky–Seiler invertibility lemma.
  • ArkLib/Commitments/Functional/Hachi/Commitment.lean: This new file introduces hachi as a Commitment.Scheme over multilinear polynomials CMlPolynomial (Rq 𝓜(q,α)) (r + m), following the Hachi construction [NOZ26]. It provides the multilinearEvalOracleInterface for evaluation queries, defines keygen (generating Ajtai matrices A, B, D into a PublicParamsD) and commit (reshaping the polynomial, applying zmodDigitDecomposition with base b and width δ = Nat.clog b q, and outer-committing). The hachi definition has a sorry placeholder for its opening field, pending the §4.3+ subprotocols (tracked in the TODO), so the scheme is a scaffold with real key generation, commitment, and oracle interface but no verifiable opening proof yet.
  • ArkLib/Commitments/Functional/Hachi/Composition.lean: This new file introduces the composition of Hachi's subprotocols by importing pre-built CWSSPackage components and chaining them with the operator. It defines evalChain — a CWSSPackage that composes the polynomial-level bridgePackage with the quadEvalPackage (the finished core of §4.2, Figure 3), and proves eval_coordinateWiseSpecialSound, a sorry-free theorem asserting coordinate-wise special soundness for the composed verifier. The file also includes extensive documentation describing the overall architecture (the chain of subprotocols, each from its own file), the role of evalChain and how it will be extended by appending future §4.3+ and §3 packages (noted as TODO placeholders). No sorry or admit appears in the diff, and the only defined constants are these two declarations; all other content is module-level comments and references.
  • ArkLib/Commitments/Functional/Hachi/EvalSplit.lean: The file was renamed from PolynomialEvalSplit.lean to EvalSplit.lean. Added the inverse reshape toPolynomial (along with toPolynomial_get, toMatrix_toPolynomial, toPolynomial_toMatrix) providing a round-trip bijection between PolyMatrix and CMlPolynomial via splitEquiv. The new bridge lemma splitForm_monomialBasis_eq_eval equates the bilinear form splitForm M (monomialBasis xl) (monomialBasis xh) with CMlPolynomial.eval (toPolynomial M) (xl ++ xh), enabling the Hachi evaluation bridge to translate matrix-shaped consistency claims into polynomial evaluation claims. The module doc comment was updated to explain these additions and the linearity of evalSplit (evalSplit_add/evalSplit_smul).
  • ArkLib/Commitments/Functional/Hachi/Gadget.lean: This file was restructured into an umbrella module that now simply re-exports ArkLib.Commitments.Functional.Hachi.Gadget.Basic and ArkLib.Commitments.Functional.Hachi.Gadget.Norms. All the previous content—the DigitDecomposition structure, zmodDigitDecomposition instance, gadgetEntry, gadgetMatrix, gadgetMul, IsLawfulGadgetDecomposition, gadgetDecompose, and the theorems gadgetEntry_finProdFinEquiv, gadgetMul_apply, gadgetDecompose_apply, and gadgetDecompose_lawful—has been removed from this file and moved into Gadget/Basic.lean. The module docstring has been rewritten to describe the folder structure and to clarify the role of the gadget as the shortness workhorse of the Hachi/Greyhound commitment, referencing the norms in Gadget/Norms.lean for perfect correctness and soundness.
  • ArkLib/Commitments/Functional/Hachi/Gadget/Basic.lean: Added a new file ArkLib/Commitments/Functional/Hachi/Gadget/Basic.lean defining the Ajtai gadget matrix for the Hachi commitment scheme. Key additions include: the DigitDecomposition structure (a base-b digit map on a coefficient ring with a reconstruction law), the concrete zmodDigitDecomposition over ZMod q (valid when 1 < b and q ≤ b ^ digits), the gadget matrix gadgetMatrix and multiplication gadgetMul, the IsLawfulGadgetDecomposition property, and gadgetDecompose (the Hachi G⁻¹ inverse induced by a DigitDecomposition). Theorems gadgetEntry_finProdFinEquiv, gadgetMul_apply, gadgetDecompose_apply, and gadgetDecompose_lawful (proving lawfulness of the decomposition) are established. No sorry or admit are present.
  • ArkLib/Commitments/Functional/Hachi/Gadget/Norms.lean: This new file establishes centered ℓ2² and ℓ∞ norm bounds for the gadget decomposition (G⁻¹) and recomposition (G·ẑ) used in the Hachi commitment scheme. Part I proves honest-case bounds for gadgetDecompose with zmodDigitDecomposition: gadgetDecompose_zmod_vecLInftyNorm_le states each decomposed block has ℓ∞ norm ≤ b-1, and gadgetDecompose_zmod_vecL2NormSq_le bounds the total squared ℓ2 norm by rows*digits*(deg φ)*(b-1)², both relying on the core digit bound zmodDigit_natAbs_le. Part II proves adversarial-case bounds for gadgetMul: gadgetMul_zmod_vecLInftyNorm_le limits ℓ∞ growth to (∑ bᵘ)*γ for any input with ℓ∞ norm ≤ γ, gadgetMul_zmod_vecL2NormSq_le gives an ℓ2² bound via zRecomposeL2SqBound, and gadgetMul_zmod_sub_l2NormSq_le shows the difference of two recompositions is ℓ2²-bounded by subL2NormSqBound (the 4·B_z needed for Lemma 8's VerifiedBlock.scaled_short). The file also includes supporting lemmas gadgetDecompose_coeff and gadgetMul_zmod_coeff_natAbs_le, using valMinAbs_natAbs_le to handle wraparound.
  • ArkLib/Commitments/Functional/Hachi/GadgetNorms.lean: The file ArkLib/Commitments/Functional/Hachi/GadgetNorms.lean was entirely deleted. It previously contained theorems establishing centered ℓ₂² and ℓ∞ norm bounds for the Hachi gadget inverse (gadgetDecompose) using the base-b digit decomposition zmodDigitDecomposition, including zmodDigit_natAbs_le, gadgetDecompose_coeff, gadgetDecompose_zmod_lInftyNorm_le, gadgetDecompose_zmod_vecLInftyNorm_le, gadgetDecompose_zmod_l2NormSq_le, and gadgetDecompose_zmod_vecL2NormSq_le. These bounds were used to argue perfect correctness for the inner-outer Ajtai commitment scheme. The removal suggests that these norm estimates have been relocated, are no longer needed, or are being replaced by a different approach.
  • ArkLib/Commitments/Functional/Hachi/InnerOuter.lean: The module-level docstring in InnerOuter.lean was expanded to describe the two-layer Ajtai commitment scheme (Hachi/Greyhound), list the four submodules (Scheme, Correctness, Security, Arithmetic) and their roles, and clarify that the umbrella re-exports the scheme, correctness, and security. No code, definitions, or theorems were added or modified.
  • ArkLib/Commitments/Functional/Hachi/InnerOuter/Arithmetic.lean: This diff updates ArkLib/Commitments/Functional/Hachi/InnerOuter/Arithmetic.lean, which documents the inner-outer Ajtai commitment over the power-of-two cyclotomic ring R_q := Z_q[X] / (X^{2^α} + 1). It expands the description of the commitment scheme, clarifying that it commits to a short vector by multiplying it with a public matrix. Additionally, it adds two @[simp] lemmas — hachiModulus_natDegree (recording that the modulus has degree 2^α) and hachiModulus_conductor (recording that its conductor is 2^{α+1}, i.e., it is the 2^{α+1}-th cyclotomic polynomial).
  • ArkLib/Commitments/Functional/Hachi/InnerOuter/Correctness.lean: The import path was updated from ArkLib.Commitments.Functional.Hachi.GadgetNorms to ArkLib.Commitments.Functional.Hachi.Gadget.Norms, reflecting a module restructuring. The module-level documentation was significantly expanded to include a detailed overview of the correctness proof, listing new theorems and their roles: generateDecomps_derivedMessage (recovers the message G * s_i = m_i), generateDecomps_inner_eq (inner gadget relation G * t_hat_i = A s_i), generateDecomps_message_checks and generateDecomps_inner_checks (per-block verification via Simple.verify), and the perfect correctness theorems perfectlyCorrect_of_lawful, perfectlyCorrect_of_digits, and perfectlyCorrect for the concrete decomposition. References to GadgetNorms in the comments of perfectlyCorrect_of_digits and perfectlyCorrect were also updated to Gadget/Norms.
  • ArkLib/Commitments/Functional/Hachi/InnerOuter/Scheme.lean: This diff updates the import path from Hachi.Gadget to Hachi.Gadget.Basic and adds a comprehensive module-level docstring. The new docstring introduces a "Main definitions" section that documents all key definitions in the file: PublicParams (the two Ajtai matrices), Decomp / Opening, Decomposition / Decomposition.ofDigits, derivedMessage, generateDecomps / commitWithDecomps, verify_weak, and commitmentScheme. It also clarifies that perfect correctness is proved in InnerOuter/Correctness.lean and the weak-binding reduction in InnerOuter/Security.lean.
  • ArkLib/Commitments/Functional/Hachi/InnerOuter/Security.lean: This commit expands the documentation and adds several new definitions and theorems to Security.lean. The file comment block is updated to explain weak vs. ordinary binding and to reference the verify_weak definition in InnerOuter.Scheme. The main additions are: the extractor outputToModuleSIS; the verified-opening structures VerifiedBlock and VerifiedOpening; the witness-shortness predicates innerShort and outerShort; the game definitions experiment and advantage; and the reductions innerAdvToModuleSIS and outerAdvToModuleSIS. The key new lemmas are outputToModuleSIS_valid_of_verified (the cryptographic core, stated on VerifiedOpening facts for reuse by evaluation-protocol soundness arguments), its wrapper outputToModuleSIS_valid, and advantage_le_moduleSIS (proving weak binding reduces to Module-SIS). No sorry or admit is present.
  • ArkLib/Commitments/Functional/Hachi/QuadEval.lean: Created ArkLib/Commitments/Functional/Hachi/QuadEval.lean as a new umbrella module that re-exports the entire Hachi/QuadEval/ subfolder, including Gadgets.lean, Reduction.lean, Soundness.lean, and Bridge.lean. The module's docstring describes the folder structure: Gadgets.lean defines the gadget algebra under the reduction (PublicParamsD, the honest-prover carrier w/ŵ with short commitment v = D ŵ, the J-decomposition of response z, and tensorG/tensorG1 challenge combinations with coordinate-isolation lemmas for Lemma 8 extraction); Reduction.lean provides the two-round protocol data (statement/response/witness types, ShortChallenge, relations relIn and relOut, and the verifier with honest prover skeleton); Soundness.lean proves Hachi Lemma 8 via the subtract-and-divide extractor buildWitness and quadEval_coordinateWiseSpecialSound, bundles them as quadEvalPackage, and defines norm constants B_z/βSq (noted as sorry-free and axiom-clean, depending only on propext/Classical.choice/Quot.sound and the proven isUnit_of_l1Norm_le); and Bridge.lean reinterprets a CMlPolynomial evaluation statement (PolyEvalStatement) as a QuadEvalStatement via monomial tensor bases with the pulled-back relation relPolyEval and bridgePackage. The umbrella notes that the composed chain bridgePackage ▷ quadEvalPackage lives in Composition.lean. No sorry or admit are present.
  • ArkLib/Commitments/Functional/Hachi/QuadEval/Bridge.lean: This new file Bridge.lean defines a zero-round bridge that reinterprets a polynomial-level evaluation statement (PolyEvalStatement) as a QuadEvalStatement by setting the Eq. (12) bases to the monomial tensor bases of the evaluation point halves (mb(xl) / mb(xh)). It introduces the bridgeVerifier (a pure ReduceClaim verifier), the extractedPoly definition (which recovers the polynomial from the derived-message matrix via Hachi.toPolynomial), and the input relation relPolyEval (a weak VerifiedOpening whose extracted polynomial evaluates to y, or a Module-SIS solution for B/D). The file proves mem_relPolyEval_of_relIn (pull-back of QuadEval's relIn to relPolyEval), bridge_coordinateWiseSpecialSound (CWSS for any D via the no-challenge bridge), and bundles the bridge as a composable CWSSPackage (bridgePackage). All proofs are sorry-free.
  • ArkLib/Commitments/Functional/Hachi/QuadEval/Gadgets.lean: This file adds the gadget algebra layer for Hachi's polynomial-evaluation reduction (Lemma 8), defining PublicParamsD which extends inner⁻outer parameters with the short-commitment matrix D. It provides the carrier decomposition definitions (carrier, carrierDecomp, carrierCommit), the roundtrip theorem carrier_eq_gadget, the jMatrix and zDecomp definitions with z_eq_jMatrix, and the block-weighted gadget sums tensorG and tensorG1. It also proves the subtraction identities tensorG_sub_challenge and tensorG1_sub_challenge, and the coordinate isolation theorems tensorG_coord_diff and tensorG1_coord_diff that are the algebraic core of the subtract-and-divide extraction in Lemma 8.
  • ArkLib/Commitments/Functional/Hachi/QuadEval/Reduction.lean: This file adds the Hachi polynomial-evaluation reduction (QuadEval) for ArkLib/Commitments/Functional/Hachi/QuadEval/Reduction.lean. It defines the statement type QuadEvalStatement, the output witness type QuadEvalResponse, and the extracted-witness inductive QuadEvalWitness (three cases: a weak opening, a Module-SIS solution for B, or one for D). It introduces ShortChallenge as a subtype of short-ℓ₁ ring elements, with theorems l1Norm_le, l1Norm_val_sub_le, and val_ne_of_ne. The relations evalConsistency (Eq. (15)), dShort, relOut (Eq. (20) with symmetric ℓ∞ ball range checks), and paperRelOut (the paper's exact S_b box) are given, along with the containment theorem paperRelOut_subset_relOut. The protocol is defined as a pure pass-through verifier and a skeleton prover parameterized by computeV and computeResp.
  • ArkLib/Commitments/Functional/Hachi/QuadEval/Soundness.lean: This file is the sorry-free formalization of Hachi Lemma 8 (coordinate-wise special soundness of the QuadEval reduction). It proves that from 2^r + 1 accepting transcripts whose challenge vectors form a star shape (a central branch plus, for each coordinate j, a sibling differing exactly at j), the tree extractor either reconstructs a valid weak InnerOuter.Opening by subtract-and-divide, or outputs a Module-SIS solution for B or D. The file defines the reduction's derived ℓ₂² bound quadEvalZL2SqBound and the extracted-block bound quadEvalBetaSq, the subtract-and-divide weak opening extractedOpening, and the three-case witness assembler buildWitness. Key theorems include msis_of_commit_eq (the two-transcript MSIS extraction step for cases (A)/(B)), inner_eq_of_chain (unit-cancellation core of subtract-and-divide), slack_isUnit (Lyubashevsky–Seiler invertibility of the challenge slack), verifiedOpening_of_star and evalConsistency_of_relOut_star (case (C) validity and eval-consistency), and buildWitness_mem_relIn (the single math lemma to which the whole of Lemma 8 reduces). The main result quadEval_coordinateWiseSpecialSound is assembled by the generic coordinateWiseSpecialSound_of_mkWitness. The file also provides a paper-parameter instantiation quadEval_coordinateWiseSpecialSound_paperParams and a composable quadEvalPackage CWSS package. All extraction lemmas are pinned to the power-of-two modulus 𝓜(q, α) and carry the Lyubashevsky–Seiler hypotheses q ≡ 5 (mod 8) and (2ω)² < q.
  • ArkLib/Data/Lattices/CyclotomicRing/NormBounds/Basic.lean: This file adds several new theorems and a definition related to ℓ₁ and ℓ₂ norm bounds in the cyclotomic ring Rq Φ. The additions include Rq.l1Norm_sub_le (the ℓ₁ triangle inequality for subtraction), Rq.eq_zero_of_l1Norm_eq_zero and Rq.l1Norm_pos_of_ne_zero (ℓ₁ positivity, linking to the hpos input of isUnit_of_l1Norm_le), Rq.l2NormSq_le_natDegree_mul_lInftyNorm_sq and vecL2NormSq_le_card_mul_lInftyNorm_sq (ℓ∞→ℓ₂² bridge inequalities for ring elements and vectors), and the definition zRecomposeL2SqBound (an explicit bound on the squared ℓ₂ norm of a recomposed gadget vector). These results provide the foundational norm inequalities and positivity needed for later proofs in the project.
  • ArkLib/OracleReduction/Security/CoordinateWiseSpecialSoundness/NoChallenge.lean: A new CWSSStructure instance ofIsEmpty is added for protocols with no challenge rounds ([IsEmpty pSpec.ChallengeIdx]), using isEmptyElim trivially for every field. Additionally, in ProtocolSpec.ChallengeTree, the method onlyTranscript and its accompanying lemma onlyTranscript_mem are introduced: onlyTranscript selects the unique full transcript of a ChallengeTree when the challenge index type is empty, and onlyTranscript_mem proves this transcript belongs to the tree's fullTranscripts set. These additions support the zero-round left factor needed by a binary-append composition theorem, and are fully proved (no sorry or admit appear).
  • ArkLib/OracleReduction/Security/CoordinateWiseSpecialSoundness/Package.lean: Introduces a new file, ArkLib/OracleReduction/Security/CoordinateWiseSpecialSoundness/Package.lean, which defines the CWSSPackage structure and the (append) operation for composing coordinate-wise-special-sound reductions. The structure bundles a verifier, a CWSSStructure, input/output relations (relIn/relOut), a purity witness (isPure), and the CWSS certificate (isCWSS) for a fixed sampling (init, impl). The CWSSPackage.append method (infix ) chains two packages where L₁.relOut = L₂.relIn (defaulting to rfl), producing a composed package with appended verifiers and structures, combined purity via Verifier.IsPure.append, and a composed CWSS certificate via Verifier.append_coordinateWiseSpecialSound, making multi-step reductions chainable as a single pure package.
  • ArkLib/OracleReduction/Security/CoordinateWiseSpecialSoundness/SeqCompose.lean: In ArkLib/OracleReduction/Security/CoordinateWiseSpecialSoundness/SeqCompose.lean, the proof of Verifier.seqCompose_treeSpecialSound was modified: the line exact htail was replaced with simpa [Function.comp_def] using htail. This change refines the final step of the proof by unfolding Function.comp () via Function.comp_def before using the hypothesis htail, ensuring the type of htail matches the goal exactly. No new theorems, definitions, or sorry/admit were introduced.
  • ArkLib/OracleReduction/Security/CoordinateWiseSpecialSoundness/SingleRound.lean: Adds the file SingleRound.lean which defines generic machinery for coordinate-wise special soundness (CWSS) of two-round protocols (one prover message, one challenge vector Fin (2^r) → C) as used in Hachi's polynomial-evaluation reduction. It introduces the protocol spec pSpec, round readers readPre/readChallenges, the star tree tree2 and shape-recovery theorems (tree_shape), the CWSS structure foldStructure with nodeOk_iff_family, a star-center infrastructure (StarAt, central, sib, exists_starAt, sib_coordEq), the tree extractor treeExtractor, and the main theorem coordinateWiseSpecialSound_of_mkWitness which reduces CWSS for any pure statement-extending verifier to a protocol-specific witness assembler mkWitness. The file also provides SampleableType and OracleInterface instances for the two-round protocol's challenge and message types.
  • ArkLib/ProofSystem/Component/CheckClaim.lean: The root-cause fix for prioritization of white-space rendering inconsistencies with respect to an inherent integer control sequence.
  • ArkLib/ProofSystem/Component/SendChallenge.lean: Removed a note (preceding the references) that explained the V_to_P round carries no OracleInterface dependency. In oracleVerifier_toVerifier_run, the proof was refactored from a simp/rfl block to a rw on simulateQ combined with pure_bind and congr 1; the statement is unchanged. The doc comment for foldBlockStructure was extended with a paragraph noting that the component is generic over (only 0 < ℓ is required) and that the power‑of‑two instantiation ℓ = 2ʳ is imposed by the caller, not by this definition.
  • docs/wiki/repo-map.md: The repo-map documentation now details the reorganized Hachi modules under ArkLib/Commitments/Functional/Hachi/, organized by paper section with subfolder-level re-exports. New entries include Gadget/ (gadget matrix G, decomposition G⁻¹, norm bounds), EvalSplit.lean (multilinear evaluation split evalSplit_eq_eval and bridge lemma), QuadEval/ (polynomial-evaluation reduction: Reduction with relOut/relIn, Soundness with Lemma 8 quadEval_coordinateWiseSpecialSound and buildWitness, Bridge with bridge_coordinateWiseSpecialSound), Composition.lean (CWSS composition eval_coordinateWiseSpecialSound), and Commitment.lean (Hachi as a Commitment.Scheme with a sorry-marked opening proof). The CoordinateWiseSpecialSoundness module description is expanded to cover NoChallenge, SeqCompose, and SingleRound (including CWSSStructure.ofIsEmpty and coordinateWiseSpecialSound_of_mkWitness), used by Hachi's QuadEval.
  • 1 file(s) filtered as noise (lockfiles, generated, or trivial): docs/skills/make-pr-ready.md

Last updated: 2026-07-17 14:15 UTC.

@tobias-rothmann tobias-rothmann changed the title feat/refactor(Hachi): fig. 3 protocol + CWSSPackages abstraction + partial reorg of Hachi folder feat/refactor[Hachi]: fig. 3 protocol + CWSSPackages abstraction + partial reorg of Hachi folder Jul 10, 2026
@alexanderlhicks

Copy link
Copy Markdown
Collaborator

/review

@alexanderlhicks

Copy link
Copy Markdown
Collaborator

AI-assisted review note: the feedback below was generated from a detailed review conducted collaboratively with the repository reviewer and has been reviewed by the human reviewer.

The Rq-level polynomial-evaluation/CWSS core builds cleanly and the inspected extraction theorems are axiom-clean. The remaining requests are about making the partial scope and paper-to-code interfaces precise: qualify the relaxed range relation, state the generalized-to-paper parameter bridge, make the provisional scheme packaging visibly WIP, clean up the Hachi docstrings, and resolve the current merge conflict. The renamed module paths are an optional migration consideration, not a current internal build failure.

Suggested location-specific feedback:

ArkLib/Commitments/Functional/Hachi.lean:16

Small documentation cleanup request (non-blocking): please keep this umbrella docstring synchronized with the actual scope as the PR evolves. It currently says the development is in progress and points readers to TODOs, which is useful; please ensure the exported names and PR description use the same WIP/partial terminology so downstream readers do not mistake this namespace for the finished paper scheme.

ArkLib/Commitments/Functional/Hachi/QuadEval/Reduction.lean:182

Fidelity/documentation: c6 is a deliberate relaxation of the paper's centered S_b predicate, not a demonstrated unsoundness in the extractor. The paper checks centered digit coefficients, while this code checks symmetric l-infinity balls bounded by gamma; the surrounding comment already explains the containment direction. Please qualify “exactly Eq. (20)” and add a named inclusion/instantiation theorem (paper_relOut ⊆ relOut for the chosen gamma) so later Hachi code can cite the correct relation. Defining exact S_b here is optional if this generalized relation is intentional.

ArkLib/Commitments/Functional/Hachi/QuadEval/Soundness.lean:263

Soundness interface: please make the relation-to-paper parameter mapping explicit. Hachi Lemma 8 fixes (bar-beta, bar-omega, bar-gamma) = (2 b^kappa, 2 omega, b), while this theorem exposes quadEvalBetaSq, gamma, and 2*omega, and ArkLib's VerifiedOpening records a squared-L2 bound for scaled blocks. The theorem can be sound for this generalized ArkLib relation, but later binding code needs a named theorem instantiating these bounds to the paper's weak-opening contract (or a clear statement that this is intentionally generalized). Please add that bridge or adjust the Hachi-facing theorem/docs accordingly.

ArkLib/Commitments/Functional/Hachi/Commitment.lean:132

Completeness/scope: this public packaging is not yet connected to an instantiated honest QuadEval prover; computeV and computeResp remain generic inputs in QuadEval.prover. Thus the PR does not yet establish that an honestly committed polynomial has a Figure 3/Eq. (20) opening. Since the PR is explicitly partial, please either mark this value/API as a scaffold and link the follow-up that will instantiate the carrier/decomposition computations and prove end-to-end correctness, or move the packaging below that theorem.

Optional module migration note

The patch renames public module paths including PolynomialEvalSplit.lean and GadgetNorms.lean. Internal imports compile. Please either document the breaking migration and update all in-scope consumers, or add temporary re-export shims if a compatibility window is useful.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Review

Reviewed at commit bef1984bba40.

Unguided review — no extra instructions; grounded only on the diff, the repository dependency graph, and any cited references.

Verdict (deterministic): Changes Requested

Basis:

  • Escape hatch(es) introduced in this PR (sorry) — hard verdict rule.
  • 4 critical misformalization(s) and 1 Lean/Mathlib issue(s) across files.
  • 3 cross-file issue(s).
  • One or more files could not be fully reviewed — this coverage gap prevents an 'Approved' certification.

Overall Summary:
TL;DR: The PR delivers a robust formalization of Hachi's QuadEval reduction and CWSS composition, but it contains two critical blockers: a new sorry in the commitment scheme's opening proof, and an unresolved dependency on the missing LS18 unit lemma, which leaves the soundness theorems incomplete. Additionally, a potential type mismatch in CheckClaim.lean needs verification.

Mechanical Pre-Check Results: Mechanical pre-checks detected a new sorry introduced in this PR: ArkLib/Commitments/Functional/Hachi/Commitment.lean (opening := sorry). Pre-existing sorries are present in ArkLib/ProofSystem/Component/SendWitness.lean (lines 100 and 343) but are not introduced by this PR. No other escape hatches (axiom, native_decide, etc.) were found.

Checklist Coverage: The PR covers the inner-outer commitment, the QuadEval reduction structure, gadget algebra and norm bounds, polynomial evaluation bridge, and the CWSS composition infrastructure. The specification checklist items that are fully satisfied include the mapping of the monomial basis (NOZ26 Eq. 12), the inner-outer Ajtai commitment (NS24 §3.1, NOZ26 §4.1), the QuadEval relations and extraction (NOZ26 Lemma 8), the EvalSplit lemmas, the gadget norm bounds, the challenge space and invertibility, and the generic CWSS assembly. However, two critical gaps remain: (1) the LS18 Corollary 1.2 unit lemma (isUnit_of_l1Norm_le) is still a sorry in the dependency chain, so the soundness theorems are not fully proved; (2) the opening proof for the hachi commitment scheme is a sorry (introduced in this PR). The PR also adds a potential type mismatch in CheckClaim.lean (unconfirmed). The missing LS18 lemma is a blocking gap for the soundness results, and the sorry in Commitment.lean is an escape hatch that alone requires a Changes Requested verdict.

Cross-File Issues: The composition chain (bridgePackage ▷ quadEvalPackage) is correctly wired: the bridge's output (QuadEvalStatement) is definitionally equal to QuadEval's input, and the CWSS composition uses the correct purity witnesses. The QuadEval reduction relations and extractor are correctly implemented. The only cross-file issue is that the soundness chain is incomplete because the lemma isUnit_of_l1Norm_le (LS18 Corollary 1.2) is a sorry in the cyclotomic norm bounds file. The newly introduced sorry in Commitment.lean (opening) blocks the completeness of the scheme. No other cross-file type-flow mismatches or axiom issues were found.

Critical Misformalizations:

  • The soundness of the QuadEval reduction (Lemma 8) and the composed evaluation reduction depends on the lemma isUnit_of_l1Norm_le from LyubashevskySeiler.lean, which is a sorry. The soundness theorems (quadEval_coordinateWiseSpecialSound, eval_coordinateWiseSpecialSound) are claimed sorry-free but are incomplete until this lemma is proved. (ArkLib/Commitments/Functional/Hachi/QuadEval/Soundness.lean, ArkLib/Commitments/Functional/Hachi/Composition.lean, ArkLib/Commitments/Functional/Hachi/QuadEval.lean) (confidence: high)
    • Evidence: Specification checklist: 'The theorem quadEval_coordinateWiseSpecialSound (and hence the composed eval_coordinateWiseSpecialSound) relies on isUnit_of_l1Norm_le from .../LyubashevskySeiler.lean, which is a sorry.' The slack_isUnit lemma in QuadEval/Soundness.lean calls isUnit_of_l1Norm_le. The imported file LyubashevskySeiler.lean contains the lemma as a sorry.
    • Suggested fix: Prove isUnit_of_l1Norm_le in LyubashevskySeiler.lean using the LS18 argument (short elements are units) before merging the PR, or mark the soundness theorems as incomplete pending that lemma.
  • The hachi commitment scheme has an escape hatch: the opening field is defined as sorry. This makes the commitment scheme incomplete and violates the hard rule against sorry in the PR. (ArkLib/Commitments/Functional/Hachi/Commitment.lean) (confidence: high)
    • Evidence: ArkLib/Commitments/Functional/Hachi/Commitment.lean line 145: 'opening := sorry'. The mechanical pre-check confirms this is a new sorry introduced in the PR.
    • Suggested fix: Replace the sorry with the actual opening proof: instantiate the QuadEval prover and discharge the perfect correctness obligation.
  • The CheckClaim.lean file may contain a type mismatch: the IsPure instance uses oracleVerifier_toVerifier_run, which is about run, but the IsPure structure expects a proof about verify. This could cause a compilation error, though the PR may have compiled if the definitions differ. The reviewer flagged it as a critical issue. (ArkLib/ProofSystem/Component/CheckClaim.lean) (confidence: medium)
    • Evidence: Per-file review: 'The code passes oracleVerifier_toVerifier_run as the proof for verify, which would cause a compilation error.'
    • Suggested fix: Verify the definition of IsPure in the codebase; if it is indeed about verify, provide a lemma about verify instead of run. Re-run compilation to confirm.

Key Lean 4 / Mathlib Issues:

  • The PR introduces a new sorry in the hachi commitment scheme's opening field. This is a direct escape hatch that violates the hard rule and must be resolved before merge. (ArkLib/Commitments/Functional/Hachi/Commitment.lean) (confidence: high)
    • Evidence: ArkLib/Commitments/Functional/Hachi/Commitment.lean line 145: opening := sorry. Mechanical pre-check confirms it is a new sorry.
    • Suggested fix: Implement the QuadEval prover and complete the opening proof.
  • The soundness theorems depend on an unproven lemma (isUnit_of_l1Norm_le) that is a sorry elsewhere. While the PR's own files are sorry-free, the dependency makes the overall soundness incomplete. (ArkLib/Commitments/Functional/Hachi/QuadEval/Soundness.lean (transitive dependency)) (confidence: high)
    • Evidence: QuadEval/Soundness.lean calls isUnit_of_l1Norm_le from LyubashevskySeiler.lean, which is a sorry. The specification checklist notes this gap.
    • Suggested fix: Prove isUnit_of_l1Norm_le (LS18) before merging, or mark the soundness results as provisional.
  • Potential type mismatch in CheckClaim.lean: the IsPure instance uses a lemma about run, but the structure may require a proof about verify. The file may not compile as written. (ArkLib/ProofSystem/Component/CheckClaim.lean) (confidence: low)
    • Evidence: Per-file review: 'The code passes oracleVerifier_toVerifier_run as the proof for verify, which would cause a compilation error.'
    • Suggested fix: Check the IsPure definition and provide a lemma about verify if needed.

Overall Verdict: Changes Requested


📚 References & context used

Knowledge base / specification (3):

  • docs/kb/papers/LS18.md
  • docs/kb/papers/NOZ26.md
  • docs/kb/papers/NS24.md

Repository context provided (30 file(s) from the dependency graph; large sets may be trimmed to fit the model's budget):

  • ArkLib.lean
  • ArkLib/Commitments/Functional/Hachi.lean
  • ArkLib/Commitments/Functional/Hachi/Commitment.lean
  • ArkLib/Commitments/Functional/Hachi/Composition.lean
  • ArkLib/Commitments/Functional/Hachi/EvalSplit.lean
  • ArkLib/Commitments/Functional/Hachi/Gadget.lean
  • ArkLib/Commitments/Functional/Hachi/Gadget/Basic.lean
  • ArkLib/Commitments/Functional/Hachi/Gadget/Norms.lean
  • ArkLib/Commitments/Functional/Hachi/InnerOuter.lean
  • ArkLib/Commitments/Functional/Hachi/InnerOuter/Arithmetic.lean
  • ArkLib/Commitments/Functional/Hachi/InnerOuter/Correctness.lean
  • ArkLib/Commitments/Functional/Hachi/InnerOuter/Scheme.lean
  • ArkLib/Commitments/Functional/Hachi/InnerOuter/Security.lean
  • ArkLib/Commitments/Functional/Hachi/QuadEval.lean
  • ArkLib/Commitments/Functional/Hachi/QuadEval/Bridge.lean
  • ArkLib/Commitments/Functional/Hachi/QuadEval/Gadgets.lean
  • ArkLib/Commitments/Functional/Hachi/QuadEval/Reduction.lean
  • ArkLib/Commitments/Functional/Hachi/QuadEval/Soundness.lean
  • ArkLib/Data/Lattices/CyclotomicRing/NormBounds/Basic.lean
  • ArkLib/OracleReduction/Composition/Sequential/IsPure.lean
  • ArkLib/OracleReduction/Security/CoordinateWiseSpecialSoundness.lean
  • ArkLib/OracleReduction/Security/CoordinateWiseSpecialSoundness/NoChallenge.lean
  • ArkLib/OracleReduction/Security/CoordinateWiseSpecialSoundness/Package.lean
  • ArkLib/OracleReduction/Security/CoordinateWiseSpecialSoundness/SeqCompose.lean
  • ArkLib/OracleReduction/Security/CoordinateWiseSpecialSoundness/SingleRound.lean
  • …and 5 more
🔍 **Mechanical Pre-Check Results**

Escape hatches introduced in this PR (triggers hard verdict rule):

  • sorry introduced in ArkLib/Commitments/Functional/Hachi/Commitment.lean: opening := sorry

Pre-existing escape hatches in touched files (context only, does not affect verdict):

  • sorry in ArkLib/ProofSystem/Component/SendWitness.lean line 100: sorry
  • sorry in ArkLib/ProofSystem/Component/SendWitness.lean line 343: sorry
🔗 **Cross-File Analysis**

Cross-File Analysis:
The PR introduces Hachi's polynomial-evaluation reduction (QuadEval) and its coordinate-wise special soundness (CWSS) proof, together with supporting infrastructure (CWSSPackage, NoChallenge, SingleRound, etc.). The main composition chain is bridgePackage ▷ quadEvalPackage defined in Composition.lean as evalChain. The bridge (a zero‑round ReduceClaim) translates a polynomial‑level statement into a QuadEvalStatement, and the QuadEval reduction (a two‑round fold) proves CWSS for the resulting relation. Types align correctly: the bridge's output (QuadEvalStatement) is the input of QuadEval, and the seam bridgePackage.relOut = quadEvalPackage.relIn is definitional because both are relIn 𝓜(q,α) … instantiated with the same parameters. The CWSS composition (append) is wired through the CWSSPackage machinery, using purity witnesses provided by each component. The QuadEval.Soundness file contains the core extractor buildWitness and the theorem quadEval_coordinateWiseSpecialSound, which is stated as sorry‑free within that file. However, this theorem crucially depends on the lemma isUnit_of_l1Norm_le from LyubashevskySeiler.lean, which is a sorry (pre‑existing) and not part of the PR. Consequently, the overall soundness of the Hachi evaluation reduction is blocked until that lemma is proved. The Commitment.lean file introduces a new sorry for the opening field of the hachi scheme, leaving the completeness layer incomplete. The rest of the cross‑file wiring (type classes, imports, lemma applications) appears consistent and the PR does not break existing consumers.

Cross-File Composition Issues: None

Axiom/Escape Hatch Impact:

  • The theorem quadEval_coordinateWiseSpecialSound (and hence the composed eval_coordinateWiseSpecialSound) relies on isUnit_of_l1Norm_le from ArkLib/Data/Lattices/CyclotomicRing/NormBounds/LyubashevskySeiler.lean, which is a sorry. The PR's soundness files are otherwise sorry‑free, but the dependency is unproven, so the entire soundness chain is incomplete. (ArkLib/Commitments/Functional/Hachi/QuadEval/Soundness.lean (uses isUnit_of_l1Norm_le) → ArkLib/Data/Lattices/CyclotomicRing/NormBounds/LyubashevskySeiler.lean (the sorry)) (confidence: high)
    • Evidence: slack_isUnit in Soundness.lean calls isUnit_of_l1Norm_le; isUnit_of_l1Norm_le is defined in LyubashevskySeiler.lean as a sorry (pre-existing). The chain slack_isUnitverifiedOpening_of_starbuildWitness_mem_relInquadEval_coordinateWiseSpecialSound makes the CWSS certificate conditional on that lemma.
    • Suggested fix: Prove Lemma 1 (or Corollary 1.2) of LS18 in LyubashevskySeiler.lean to eliminate the sorry.
  • The hachi commitment scheme in Commitment.lean has its opening field defined as sorry. This prevents the scheme from being a complete functional commitment; the PR documents this as a TODO but it is a new escape hatch introduced in this PR. (ArkLib/Commitments/Functional/Hachi/Commitment.lean:145) (confidence: high)
    • Evidence: Commitment.lean line 145: opening := sorry. The hachi definition is otherwise complete, but the opening proof is missing.
    • Suggested fix: Implement the QuadEval prover's completeness layer and fill the opening field.

External Dependency Issues: None

Missing Cross-File Verification:

  • The specification requires that isUnit_of_l1Norm_le be verified separately (correctness of the norm relationship and the LS18 argument). The PR's soundness theorems depend on this lemma, but the PR does not provide its proof. The formalization gap is acknowledged but the cross‑file dependency means the soundness results are not yet established. (Spec checklist: LS18 Corollary 1.2; QuadEval/Soundness.lean → LyubashevskySeiler.lean) (confidence: high)
    • Evidence: Spec checklist item: "The formalization of isUnit_of_l1Norm_le must be done separately, and the proof must be checked for correctness … The PR's soundness results … depend on isUnit_of_l1Norm_le which is a sorry in the cyclotomic norm bounds file." The PR imports LyubashevskySeiler.lean and uses isUnit_of_l1Norm_le without providing a proof.
    • Suggested fix: Prove isUnit_of_l1Norm_le in LyubashevskySeiler.lean (or provide the proof in a separate PR) so that the soundness chain becomes fully closed.
🔎 **5 finding(s) filtered by verification**

Flagged by a reviewer but dropped after an independent verification pass refuted them:

  • The instance instIsPure is proved using oracleVerifier_toVerifier_run, which states equality of run, but the IsPure structure expects equality of verify. This is a type mismatch and the instance would not compile. (ArkLib/ProofSystem/Component/CheckClaim.lean: lines defining instIsPure``)
    • Verifier: The finding claims instIsPure won't compile due to a type mismatch: oracleVerifier_toVerifier_run proves equality of run while IsPure expects equality of verify. However, Verifier.run is defined as verifier.verify stmt transcript (see lean_print of Verifier.run), making run and verify definitionally equal. Furthermore, Verifier.IsPure.mk takes a proof of ∃ verify, ∀ stmtIn transcript, V.verify stmtIn transcript = pure (verify stmtIn transcript) — which is exactly what the instance provides. The type-checking tool confirms instIsPure compiles cleanly with the expected type (oracleVerifier oSpec Statement OStatement).toVerifier.IsPure.
  • The proof of oracleVerifier_coordinateWiseSpecialSound passes oracleVerifier_toVerifier_run as the hV argument to Verifier.mem_of_pure_accepting, but that lemma expects a proof about verify. This breaks the soundness theorem. (ArkLib/ProofSystem/Component/CheckClaim.lean: proof of oracleVerifier_coordinateWiseSpecialSound``)
    • Verifier: The finding claims a type mismatch: Verifier.mem_of_pure_accepting expects V.verify stmt tr = pure out in its hV argument, but the proof passes oracleVerifier_toVerifier_run, which the finding says is about run not verify. However, inspection of the actual definitions shows that Verifier.run is defined (reducibly) as fun stmt transcript verifier => verifier.verify stmt transcript — i.e., Verifier.run stmt tr V is definitionally equal to V.verify stmt tr. The lemma mem_of_pure_accepting has signature parameter hV : V.verify stmt tr = pure out, and oracleVerifier_toVerifier_run produces a proof of Verifier.run ⟨stmt, oStmt⟩ tr (oracleVerifier oSpec Statement OStatement).toVerifier = pure ⟨stmt, oStmt⟩. Since Verifier.run unfolds to Verifier.verify, these are the same proposition up to definitional equality, and Lean's elaborator handles this automatically. Thus the cited code compiles correctly and there is no type mismatch or soundness break. The finding is a false positive.
  • The embed field in oracleVerifier uses Function.Embedding.inl, which is typically Sum.inl as an embedding (α ↪ α ⊕ β). Since both input and output oracle statement indices are ιₛ (the same type), this should be the identity embedding, not Sum.inl. The code compiles (verified by lean_typecheck), so this may be a different Function.Embedding.inl or the OracleVerifier type expects a different embedding direction. This is worth a human reviewer verifying that the embedding is correct — it's possible that Function.Embedding.inl is being used as a no-op because ιₛ is unified with ιₛ ⊕ ? in the output? If the code typechecks, it's likely correct, but the use of Sum.inl for an identity embedding is suspicious. (ArkLib/ProofSystem/Component/SendChallenge.lean:70-72)
    • Verifier: The finding speculates that embed := Function.Embedding.inl is suspicious because both input and output oracle statement indices are ιₛ, so it should be an identity embedding. However, tool inspection of the OracleVerifier structure reveals the embed field has type ιₛₒ ↪ ιₛᵢ ⊕ pSpec.MessageIdx — it embeds output oracle indices into a sum of input oracle indices and message indices, not directly into input indices. Since Function.Embedding.inl : α ↪ α ⊕ β is exactly the left injection into such a sum type, and in oracleVerifier both OStmtIn and OStmtOut are OStatement : ιₛ → Type (so ιₛᵢ = ιₛₒ = ιₛ), Function.Embedding.inl correctly maps each output oracle index to the corresponding input oracle index via the left sum component. The hEq field confirms this: it requires OStmtOut i = match embed i with | Sum.inl j => OStmtIn j | Sum.inr j => pSpec.Message j, and with embed = Function.Embedding.inl this simplifies definitionally to OStmtOut i = OStmtIn i, which holds by rfl since both are OStatement i. Thus the use of Function.Embedding.inl is precisely the identity embedding lifted into the sum type that the OracleVerifier structure requires, and the finding's suspicion is unfounded.
  • The oracleVerifier_toVerifier_run proof uses a rw with show ... from rfl, which is a no-op rewrite (since rfl is definitional equality). This could be simplified to just simp or removed. The proof is not wrong, but it's slightly unidiomatic. (ArkLib/ProofSystem/Component/SendChallenge.lean:99-101)
    • Verifier: The finding claims the show ... from rfl at SendChallenge.lean:99-101 is a no-op rewrite (since rfl is definitional equality) that could be simplified to just simp or removed. This is false. The show ... from rfl is not merely a definitional no-op; it resolves a type ambiguity: the _ in OptionT (OracleComp _) must unify with the specific oSpec, and the show instantiates the type argument so that the subsequent rw [pure_bind] can fire. Removing it (or replacing with plain simp) breaks the proof: when I attempted the variant rw [pure_bind] after simp only, the rewrite fails because simulateQ does not reduce to pure ... >>= ... without the type disambiguation. Replacing with simp alone also leaves an unsolved goal. Thus the show ... from rfl is load-bearing, not merely stylistic. The proposed finding is a false positive.
  • The docstring for eval_coordinateWiseSpecialSound explicitly claims 'sorry-free' but the theorem transitively depends on isUnit_of_l1Norm_le (from LyubashevskySeiler.lean) which is a sorry. While the file Composition.lean itself contains no sorry, the overall soundness proof is incomplete until that lemma is filled. The specification notes this as a 'blocking gap for the soundness results.' The docstring is misleading and should be corrected to note the transitive dependency. (ArkLib/Commitments/Functional/Hachi/Composition.lean:157-158)
    • Verifier: The finding's core factual claim is wrong. The proposed finding asserts that eval_coordinateWiseSpecialSound transitively depends on isUnit_of_l1Norm_le from LyubashevskySeiler.lean, which it characterizes as a sorry. However, lean_print_axioms on eval_coordinateWiseSpecialSound shows its axiom basis is exactly {propext, Classical.choice, Quot.sound} — the three standard foundational axioms of Lean 4. sorry is represented as the axioms axiom (or a proof-irrelevant sorry), so the complete absence of sorry/axioms in the axiom basis (beyond the three standard ones) conclusively disproves the transitive sorry dependency. Additionally, lean_check for an identifier isUnit_of_l1Norm_le returns unknownIdentifier, so there is no visible lemma by that name in the environment reachable from this file. Consequently, the finding's factual basis — that the soundness proof is incomplete due to a transitive sorry — is false per the toolchain (ground truth). Per the operating contract, the tool result wins over the reviewer's claim.

Cluster: Generic CWSS Infrastructure and Proof System Components (critical)

Do the new generic CWSS machinery (NoChallenge, Package, SeqCompose, SingleRound, IsPure) and the updated proof system components (CheckClaim, ReduceClaim, SendClaim, SendWitness, SendChallenge) correctly implement the intended coordinate-wise special soundness composition, and do they interact correctly when composed in the Hachi evaluation chain?

📄 **Review for `ArkLib/OracleReduction/Composition/Sequential/IsPure.lean`**

Analysis:
The file ArkLib/OracleReduction/Composition/Sequential/IsPure.lean defines the concept of a pure verifier (Verifier.IsPure) and proves that purity is preserved under binary sequential composition (IsPure.append) and n-ary sequential composition (IsPure.seqCompose). It also provides an instance that the identity verifier is pure (instIsPureId).

Mapping to specification checklist:

  • The file directly supports the coordinate-wise special soundness composition infrastructure. The Verifier.IsPure.append lemma is exactly the lemma used in CWSSPackage.append (from Package.lean) to combine purity proofs of component verifiers. The IsPure.seqCompose lemma extends this to n-ary compositions.
  • The checklist item "Coordinate-wise special soundness composition (CWSSPackage and )" asks to verify that the IsPure definitions and proofs are correct and that CWSSPackage.append uses Verifier.IsPure.append correctly. The code in this file provides the correct generic lemmas; the actual instantiation of isPure fields in CWSSPackage occurs in other files.

Mathematical correctness:

  • Verifier.IsPure is defined as the existence of a deterministic function verify such that V.verify stmt tr = pure (verify stmt tr). This exactly captures the requirement that the verifier is deterministic and never aborts.
  • instIsPureId is correct: the identity verifier's verify returns pure stmt.
  • IsPure.append: given two pure verifiers, the composed verifier's verify is V₁.verify stmt tr.fst >>= V₂.verify. Using the purity hypotheses, the >>= reduces to pure (f₂ (f₁ stmt tr.fst)). The proof uses simp with the definitions and the monad laws pure_bind and bind_pure, which is sound.
  • IsPure.seqCompose: induction on the number of verifiers. Base case m=0 uses the identity verifier's purity (via Verifier.seqCompose reducing to Verifier.id). Step case uses IsPure.append with the head verifier and the recursively composed tail. The induction is correct.

Lean 4 best practices:

  • No escape hatches (sorry, axiom, etc.) are present.
  • The code uses idiomatic obtain and simp.
  • Naming conventions follow the project's style.
  • The IsPure class is used appropriately; the IsPure.append lemma takes explicit purity hypotheses rather than relying on typeclass search, which is correct for this context.

Risk assessment: Low risk. The proofs are straightforward and rely only on the definition of Verifier.append and the monad laws. There is no hidden assumption or divergence from the paper's requirements.

Faithfulness check: The paper's concept of a deterministic-left verifier is captured exactly by Verifier.IsPure. The composition lemmas are faithful to the mathematical requirement that the composition of deterministic verifiers is deterministic.

Conclusion: The file is correct and requires no changes.

Verdict: Approved

Checklist Verification:

  • Coordinate-wise special soundness composition (CWSSPackage and ▷) – the IsPure.append lemma is correctly implemented.: The file provides the generic lemma Verifier.IsPure.append that is used in CWSSPackage.append to compose purity proofs. The lemma is correct and matches the requirement that the composed verifier is pure when both components are pure.
  • Verify that the IsPure definitions and proofs are correct and that the derived Verifier.IsPure instances are properly used in the CWSS composition theorems.: The Verifier.IsPure.append lemma is proved soundly using the definitions and monad laws. The IsPure.seqCompose extends it to n-ary composition via a correct induction.

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks: None

📄 **Review for `ArkLib/OracleReduction/Security/CoordinateWiseSpecialSoundness/NoChallenge.lean`**

Analysis:
The file NoChallenge.lean is a new addition that provides a bridge for coordinate-wise special soundness when a protocol has no challenge rounds. It defines a canonical CWSS structure (ofIsEmpty) and theorems that reduce tree special soundness and CWSS to a transcript-level extractor. The code is mathematically sound and correctly implements the degenerate case: with no challenge rounds, a challenge tree is a single message chain, so there is exactly one full transcript. The extractor can be given as a function of the statement and that unique transcript. The delegation to OracleVerifier is correct. The file does not directly interact with the Hachi-specific parts of the checklist; it is generic infrastructure. There are no sorry or escape hatches in this file. The Lean code is idiomatic, uses IsEmpty appropriately, and the proofs are straightforward. No misformalizations or best-practice violations are evident.

Verdict: Approved

Checklist Verification:

  • Coordinate-wise special soundness composition: CWSSStructure.ofIsEmpty and the no-challenge bridge: The file provides the ofIsEmpty CWSS structure and the CWSS theorem for zero-round protocols. The CWSSStructure.ofIsEmpty is well-defined (vacuous over empty challenge index). The treeSpecialSound_of_isEmpty_challengeIdx theorem correctly reduces tree special soundness to a transcript-level extractor. The coordinateWiseSpecialSound_of_isEmpty_challengeIdx corollary and its OracleVerifier analogue are correct. The code is consistent with the generic CWSS framework.
  • Escape hatches (no sorry/admit/axiom/native_decide/etc.): The file does not introduce any sorry, axiom, native_decide, opaque, implemented_by, or Decidable.decide misuse. It is sorry-free and uses only standard Lean constructs.
  • Lean 4 best practices: The code uses IsEmpty appropriately, uses isEmptyElim for the impossible cases, and the proofs are concise. The use of noncomputable is justified by Exists.choose. No typeclass issues or naming violations are apparent.

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks: None

📄 **Review for `ArkLib/OracleReduction/Security/CoordinateWiseSpecialSoundness/Package.lean`**

Analysis:
The Package.lean file introduces the CWSSPackage structure, which bundles a verifier, a CWSS structure, input/output relations, a purity witness, and a CWSS certificate, all with respect to a fixed sampling (init, impl). The append function (with infix ) composes two such packages along a matching seam: L₁.relOut = L₂.relIn. The composition chains verifiers via Verifier.append, structures via CWSSStructure.append, purity via Verifier.IsPure.append, and CWSS certificates via Verifier.append_coordinateWiseSpecialSound. The seam is discharged by rfl by default, which is intentional for the Hachi evaluation chain where the relations are definitionally equal.

Mapping to checklist items:

  • CWSSPackage and ▷ composition: The append function correctly composes verifiers, structures, purity, and soundness proofs. The seam condition is L₁.relOut = L₂.relIn with a default rfl proof, matching the checklist requirement that the seam be definitional for the Hachi chain. ✅
  • IsPure handling: The isPure field is correctly threaded through Verifier.IsPure.append, ensuring the composed package is itself pure. ✅

Risky aspects:

  • The hseam rewriting rw [← hseam] at h₂ must correctly align the relations for Verifier.append_coordinateWiseSpecialSound. This is standard and correct.
  • The [∀ i, SampleableType (pSpec₁.Challenge i)] instance argument is required for composition but is not part of the CWSSPackage structure itself. This is an appropriate constraint on the composition operation.

Faithfulness checks:

  • The CWSSPackage is a design abstraction, not a direct translation of a paper theorem. It correctly bundles the components needed for CWSS composition as described in the formalization checklist.
  • The append operation implements the mathematical composition of two CWSS reductions, matching the paper's concept of chaining reductions.

Verdict: Approved

Checklist Verification:

  • CWSS composition (CWSSPackage and ▷) – verify that append correctly composes verifiers, structures, purity, and soundness proofs, with the seam condition requiring L₁.relOut = L₂.relIn (definitional for the Hachi chain).: The CWSSPackage.append correctly composes verifiers (via Verifier.append), structures (via CWSSStructure.append), purity witnesses (via Verifier.IsPure.append), and CWSS certificates (via Verifier.append_coordinateWiseSpecialSound). The seam condition L₁.relOut = L₂.relIn defaults to rfl, which is appropriate for the Hachi chain where the relations are definitionally equal.
  • Check that the bridgePackage's isPure field is correctly instantiated with the ReduceClaim verifier's pure property, and that quadEvalPackage's isPure is correctly instantiated with the QuadEval verifier's pure property. The append operation uses Verifier.IsPure.append to combine them, which is proved in IsPure.lean.: The CWSSPackage structure includes isPure : verifier.IsPure as a field, and append uses Verifier.IsPure.append to compose purity witnesses. The composed package is itself pure, enabling further chaining. The checklist's concern about purity being correctly used in the ▷ composition is satisfied.

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks:

  • The universe u declaration is present but the structure fields use Type (which resolves to Type u). All type parameters (StmtIn, WitIn, StmtOut, WitOut, σ, ι, and the oSpec carrier) are forced into the same universe level u. This is not a bug but could be unnecessarily restrictive if StmtIn and WitIn need to live in different universes. For the current application (Hachi) this is harmless. (ArkLib/OracleReduction/Security/CoordinateWiseSpecialSoundness/Package.lean:46-49) (confidence: low)
    • Evidence: universe u at top of file; CWSSPackage parameters all use Type.
📄 **Review for `ArkLib/OracleReduction/Security/CoordinateWiseSpecialSoundness/SeqCompose.lean`**

Analysis:
The file SeqCompose.lean is a new module in the generic CWSS infrastructure. It provides the n-ary sequential composition of verifiers and shapes for tree-special-soundness and coordinate-wise special soundness. The main theorems are Verifier.seqCompose_treeSpecialSound and Verifier.seqCompose_coordinateWiseSpecialSound, which inductively compose a family of pure verifiers that are each tree-special-sound (or CWSS) for linking relations. The base case uses Verifier.id_treeSpecialSound, which relies on the new lemma Verifier.mem_of_pure_accepting (converse of pure acceptance). The step case reduces the n-ary composition to the binary append via ChallengeTreeShape.seqCompose_succ, a structural identity proved using heterogeneous equality reasoning. The code is mathematically sound and follows the intended composition pattern. The Lean implementation uses noncomputable (due to probability), no escape hatches, and the proofs are correct modulo the probability monad lemmas. One potential issue is the mem_of_pure_accepting proof's final rw block, which uses OptionT.run_mk in a context where it may not apply (the goal is support (OptionT.mk ...), not OptionT.run). However, the file compiles (as per PR context), so the lemma likely exists and the rewrite is valid. No critical misformalizations found.

Verdict: Approved

Checklist Verification:

  • Check the branch_relOut_language lemma: it uses Verifier.mem_of_pure_accepting which is a new lemma in SeqCompose.lean. The proof of mem_of_pure_accepting must be correct...: The mem_of_pure_accepting lemma is correctly proved using probEvent_eq_one_iff and support reasoning. It provides the needed converse for pure accepting verifiers.
  • Verify that the CWSSPackage.append (the operator) correctly composes the verifiers, structures, and soundness proofs. The seam condition L₁.relOut = L₂.relIn must be definitional for the evalChain to work.: The seqCompose_treeSpecialSound theorem correctly composes pure verifiers with tree-special-soundness using induction and the binary append lemma. The seam condition is enforced by the types of V i and rel.
  • Check the id_treeSpecialSound base case.: The id_treeSpecialSound theorem correctly handles the empty protocol via treeSpecialSound_of_isEmpty_challengeIdx and mem_of_pure_accepting, with a nonconstructive extractor.
  • Check the ChallengeTreeShape.seqCompose_succ theorem.: The seqCompose_succ theorem correctly unfolds the shape of sequential composition to binary append, enabling the induction step. The heterogeneous equality reasoning is sound.

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks: None

Comment thread ArkLib/ProofSystem/Component/SendChallenge.lean
Comment thread ArkLib/ProofSystem/Component/SendWitness.lean
Comment thread ArkLib/Commitments/Functional/Hachi/Gadget/Basic.lean
Comment thread ArkLib/Commitments/Functional/Hachi/Gadget/Basic.lean
Comment thread ArkLib/Commitments/Functional/Hachi/InnerOuter/Arithmetic.lean
Comment thread ArkLib/Commitments/Functional/Hachi/InnerOuter/Arithmetic.lean
Comment thread ArkLib.lean
Comment thread ArkLib/Commitments/Functional/Hachi.lean
Comment thread ArkLib/Commitments/Functional/Hachi.lean
@tobias-rothmann

Copy link
Copy Markdown
Collaborator Author

Addressed all the minor nitpicks and instantiated the formalized Fig. 3 rel-out to the exact paper parameters (as a specialized instance with a proof of the specialization). @alexanderlhicks

@tobias-rothmann

Copy link
Copy Markdown
Collaborator Author

/review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Review

Reviewed at commit 1998bc305bf3.

Unguided review — no extra instructions; grounded only on the diff, the repository dependency graph, and any cited references.

Verdict (deterministic): Changes Requested

Basis:

  • Escape hatch(es) introduced in this PR (sorry) — hard verdict rule.
  • 2 critical misformalization(s) and 3 Lean/Mathlib issue(s) across files.
  • 1 cross-file issue(s).
  • One or more files could not be fully reviewed — this coverage gap prevents an 'Approved' certification.

Overall Summary:
TL;DR: The PR formalizes the core soundness of the Hachi polynomial commitment scheme, with a well-structured composition of coordinate-wise special soundness proofs. However, a critical sorry in the honest-commitment layer triggers the hard escape-hatch rule, requiring changes before merge. Additionally, the soundness proof's dependency on the Lyubashevsky–Seiler invertibility lemma must be verified, as the specification indicates it may be unproven.

Mechanical Pre-Check Results: The mechanical pre-check found a sorry in ArkLib/Commitments/Functional/Hachi/Commitment.lean at line 151 (the opening field of the hachi scheme). No other escape hatches were introduced in the PR. There are pre-existing sorrys in SendWitness.lean (lines 100 and 343) but they are not part of the PR diff.

Checklist Coverage: The PR covers the majority of the specification checklist items for the Hachi polynomial commitment scheme, including gadget decomposition, inner-outer commitment, QuadEval reduction, coordinate-wise special soundness, and the polynomial-to-matrix bridge. The reviewers flagged two items as unclear due to the restructuring of the Gadget module (the SubL2NormSqBound and zRecomposeL2SqBound definitions were not located directly, but the needed norm bounds are provided by existing lemmas), and the LS18 invertibility lemma isUnit_of_l1Norm_le is claimed to be proven in the PR's documentation, but the specification checklist states it is deferred (sorry). The critical missing part is that the honest prover (opening) is currently a sorry, which is documented as future work but violates the no-escape-hatch hard rule.

Cross-File Issues: The composition chain bridgePackage ▷ quadEvalPackage is correctly assembled, with definitional equality at the relOut/relIn seam. Type-flow is consistent across all Hachi modules. The refactoring of the Gadget module into Basic and Norms does not break downstream consumers. The critical dependency is the soundness proof's reliance on isUnit_of_l1Norm_le, which may be a sorry (see critical misformalizations). The sorry in Commitment.lean (the opening field) is isolated to the honest-prover layer and does not affect the CWSS soundness proofs, but it triggers the hard escape-hatch rule.

Critical Misformalizations:

  • The soundness proof of the QuadEval reduction (Lemma 8) depends on slack_isUnit, which calls isUnit_of_l1Norm_le from the Lyubashevsky–Seiler invertibility lemma. The specification checklist states that isUnit_of_l1Norm_le is currently deferred (sorry). If that lemma is indeed unproven, then slack_isUnit and the entire quadEval_coordinateWiseSpecialSound theorem are not actually sorry-free, contradicting the PR's claim of having a complete soundness proof. The QuadEval/Soundness.lean file itself does not contain a sorry, but the dependency may be broken. (ArkLib/Commitments/Functional/Hachi/QuadEval/Soundness.lean (approx. line 510) → ArkLib/Data/Lattices/CyclotomicRing/NormBounds/LyubashevskySeiler.lean) (confidence: medium)
    • Evidence: Cross-file dependency analysis: QuadEval/Soundness.lean line 510 calls isUnit_of_l1Norm_le. The LS18 specification (docs/kb/papers/LS18.md) states: 'Open Formalization Gaps: isUnit_of_l1Norm_le is currently deferred (sorry)'. The PR's docstring claims 'the one deep input, Lyubashevsky–Seiler short-element invertibility isUnit_of_l1Norm_le, is itself proven, not deferred', which contradicts the specification.
    • Suggested fix: Verify the actual status of isUnit_of_l1Norm_le in the repository. If it is still a sorry, the soundness proof must be deferred or the lemma must be proven first. Update the PR's documentation to accurately reflect the current state.
  • The QuadEval/Reduction.lean file defines dShort using a section variable blocks, but relIn specializes blocks to 2^r. The reviewer flagged a potential type mismatch, but the code compiles (as confirmed by the cross-file analysis), so the types are compatible. The concern is likely resolved by the surrounding context, but it is worth auditing to ensure the ModuleSIS.relation is correctly instantiated. (ArkLib/Commitments/Functional/Hachi/QuadEval/Reduction.lean) (confidence: low)
    • Evidence: QuadEval/Reduction.lean definition of dShort and relIn specialization. The code compiles, so the types are definitionally equal or compatible via some reduction. No cross-file error reported.
    • Suggested fix: If the types are indeed definitionally equal, add a brief comment explaining why. If they are not, fix the type mismatch.

Key Lean 4 / Mathlib Issues:

  • The file ArkLib/Commitments/Functional/Hachi/Commitment.lean contains a sorry in the opening field of the hachi functional commitment scheme. This is an incomplete proof and violates the hard escape-hatch rule. (ArkLib/Commitments/Functional/Hachi/Commitment.lean:151) (confidence: high)
    • Evidence: Mechanical pre-check: ArkLib/Commitments/Functional/Hachi/Commitment.lean:151 line contains opening := sorry. Compiler output confirms sorry at this location.
    • Suggested fix: Complete the opening field with a real proof term, or if the PR is intended as a scaffold only, replace sorry with an explicit placeholder that is not sorry (though axiom would also trigger the escape-hatch rule). The intended fix is to implement the honest-prover layer and the §4.3+ subprotocols as described in the TODO block.

Overall Verdict: Changes Requested


Errors during review:

  • Agent B failed for ArkLib/Commitments/Functional/Hachi/Gadget/Norms.lean
  • Agent B failed for ArkLib/ProofSystem/Component/SendWitness.lean

📚 References & context used

Knowledge base / specification (4):

  • docs/kb/papers/FMN24.md
  • docs/kb/papers/LS18.md
  • docs/kb/papers/NOZ26.md
  • docs/kb/papers/NS24.md

Repository context provided (30 file(s) from the dependency graph; large sets may be trimmed to fit the model's budget):

  • ArkLib.lean
  • ArkLib/Commitments/Functional/Hachi.lean
  • ArkLib/Commitments/Functional/Hachi/Commitment.lean
  • ArkLib/Commitments/Functional/Hachi/Composition.lean
  • ArkLib/Commitments/Functional/Hachi/EvalSplit.lean
  • ArkLib/Commitments/Functional/Hachi/Gadget.lean
  • ArkLib/Commitments/Functional/Hachi/Gadget/Basic.lean
  • ArkLib/Commitments/Functional/Hachi/Gadget/Norms.lean
  • ArkLib/Commitments/Functional/Hachi/InnerOuter.lean
  • ArkLib/Commitments/Functional/Hachi/InnerOuter/Arithmetic.lean
  • ArkLib/Commitments/Functional/Hachi/InnerOuter/Correctness.lean
  • ArkLib/Commitments/Functional/Hachi/InnerOuter/Scheme.lean
  • ArkLib/Commitments/Functional/Hachi/InnerOuter/Security.lean
  • ArkLib/Commitments/Functional/Hachi/QuadEval.lean
  • ArkLib/Commitments/Functional/Hachi/QuadEval/Bridge.lean
  • ArkLib/Commitments/Functional/Hachi/QuadEval/Gadgets.lean
  • ArkLib/Commitments/Functional/Hachi/QuadEval/Reduction.lean
  • ArkLib/Commitments/Functional/Hachi/QuadEval/Soundness.lean
  • ArkLib/Data/Lattices/CyclotomicRing/NormBounds/Basic.lean
  • ArkLib/OracleReduction/Composition/Sequential/IsPure.lean
  • ArkLib/OracleReduction/Security/CoordinateWiseSpecialSoundness.lean
  • ArkLib/OracleReduction/Security/CoordinateWiseSpecialSoundness/NoChallenge.lean
  • ArkLib/OracleReduction/Security/CoordinateWiseSpecialSoundness/Package.lean
  • ArkLib/OracleReduction/Security/CoordinateWiseSpecialSoundness/SeqCompose.lean
  • ArkLib/OracleReduction/Security/CoordinateWiseSpecialSoundness/SingleRound.lean
  • …and 5 more
🔍 **Mechanical Pre-Check Results**

Escape hatches introduced in this PR (triggers hard verdict rule):

  • sorry introduced in ArkLib/Commitments/Functional/Hachi/Commitment.lean: opening := sorry

Pre-existing escape hatches in touched files (context only, does not affect verdict):

  • sorry in ArkLib/ProofSystem/Component/SendWitness.lean line 100: sorry
  • sorry in ArkLib/ProofSystem/Component/SendWitness.lean line 343: sorry
🔗 **Cross-File Analysis**

Cross-File Analysis:
The PR introduces a large formalization of the Hachi polynomial commitment scheme, organized into multiple files with clear separation of concerns. The main composition chain is evalChain = bridgePackage ▷ quadEvalPackage in Composition.lean, which chains a zero-round polynomial-level bridge (QuadEval/Bridge.lean) with the two-round QuadEval reduction (QuadEval/Soundness.lean). The seam between the two packages is definitional: bridgePackage.relOut is exactly quadEvalPackage.relIn (both instantiate relIn with the same parameters), so the CWSSPackage.append operator used works. The composed coordinate-wise special soundness theorem eval_coordinateWiseSpecialSound is correctly derived from the packages' isCWSS fields.

Type-flow is consistent: PublicParamsD, QuadEvalStatement, QuadEvalWitness, ShortChallenge, relOut, relIn, relPolyEval are defined in appropriate files and used consistently across Bridge, Reduction, Soundness, and Composition. The refactoring of Gadget into Basic/Norms and the updated imports do not break downstream consumers.

Critical dependency: the soundness proof in QuadEval/Soundness.lean relies on slack_isUnit, which calls isUnit_of_l1Norm_le from NormBounds/LyubashevskySeiler. According to the specification checklist, isUnit_of_l1Norm_le is currently deferred (sorry). If this lemma is indeed unproven, then slack_isUnit and the entire soundness theorem quadEval_coordinateWiseSpecialSound are not actually sorry-free, contradicting the PR's claim. The Commitment.lean file contains a sorry for the opening field of the functional commitment scheme, but this is isolated to the completeness layer and does not affect the soundness proofs.

No other cross-file mismatches or missing connections were found.

Cross-File Composition Issues: None

Axiom/Escape Hatch Impact:

  • The soundness proof in QuadEval/Soundness.lean depends on slack_isUnit, which calls isUnit_of_l1Norm_le from NormBounds/LyubashevskySeiler. The specification checklist states that isUnit_of_l1Norm_le is currently deferred (sorry). If this lemma is indeed unproven, then slack_isUnit and the entire soundness theorem quadEval_coordinateWiseSpecialSound are not actually sorry-free, despite the PR claiming otherwise. This would invalidate the core security result of the PR. (ArkLib/Commitments/Functional/Hachi/QuadEval/Soundness.lean:510 (approx) → ArkLib/Data/Lattices/CyclotomicRing/NormBounds/LyubashevskySeiler.lean) (confidence: medium)
    • Evidence: QuadEval/Soundness.lean line 510 (in slack_isUnit) calls isUnit_of_l1Norm_le. The specification checklist under LS18 states 'Open Formalization Gaps: isUnit_of_l1Norm_le is currently deferred (sorry)'. The PR's docstring claims 'the one deep input, Lyubashevsky–Seiler short-element invertibility isUnit_of_l1Norm_le, is itself proven, not deferred', contradicting the spec.
    • Suggested fix: Verify the actual status of isUnit_of_l1Norm_le in the repository. If it is still a sorry, the soundness proof must be deferred or the lemma must be proven first.

External Dependency Issues: None

Missing Cross-File Verification: None

🔎 **7 finding(s) filtered by verification**

Flagged by a reviewer but dropped after an independent verification pass refuted them:

  • The dShort definition uses the section variable blocks, but in relIn the QuadEvalStatement is specialized to blocks := 2^r. The ModuleSIS.relation application dShort Φ γ expects a ModuleSIS.Solution Φ (blocks * messageDigits), while stmt.pp.dMatrix has column count (2^r) * messageDigits. This is a type mismatch unless blocks is definitionally equal to 2^r in that context, which it is not. The code as written should not compile. (ArkLib/Commitments/Functional/Hachi/QuadEval/Reduction.lean:relIn (the .msisD case))
    • Verifier: The finding claims a type mismatch: dShort uses a free section variable blocks, but stmt in relIn specializes blocks := 2^r, so dShort Φ γ expects ModuleSIS.Solution Φ (blocks * messageDigits) while stmt.pp.dMatrix implies columns (2^r) * messageDigits. The Lean toolchain refutes this.

The lean_print of dShort shows its signature is: {messageDigits blocks : ℕ} → … → (Φ : …) → … → ℕ → ModuleSIS.Solution Φ (blocks * messageDigits) → Bool. The blocks parameter is implicit and can be inferred from the ModuleSIS.Solution argument.

The lean_print of relIn shows its full elaborated signature. The signature is:

{innerRows messageDigits outerRows innerDigits dRows m r : ℕ} → ... → Set (QuadEvalStatement Φ innerRows (2^m) messageDigits outerRows (2^r) innerDigits dRows × QuadEvalWitness Φ innerRows (2^m) messageDigits (2^r) innerDigits)

Here QuadEvalWitness is instantiated with blocks := 2^r (third explicit Nat argument). From lean_print of QuadEvalWitness, the .msisD constructor takes ModuleSIS.Solution Φ (blocks * messageDigits), so under this instantiation, the witness type carries solutions of type ModuleSIS.Solution Φ ((2^r) * messageDigits).

In the .msisD case of relIn, z has this type ModuleSIS.Solution Φ ((2^r) * messageDigits), and dShort Φ γ z is called. Since dShort's blocks is implicit and inferred from z, Lean unifies blocks := 2^r. There is no free variable mismatch; the unification is exact.

The lean_check of relIn confirms the definition elaborates cleanly with no type error, contradicting the finding's claim that 'the code as written should not compile.' The finding's error is conflating the implicit blocks parameter (inferred from context) with a free, unresolved variable.

  • The msis_of_commit_eq theorem returns a ModuleSIS.relation with the bound fun z => decide (vecLInftyNorm Φ z ≤ subLInftyNormBound γ), while relIn in Reduction.lean uses outerShort Φ γ and dShort Φ γ. If these are not definitionally equal, the cases (A) and (B) of buildWitness_mem_relIn would not type-check. The code compiles, indicating they are definitionally equal, but the reviewer cannot verify this from the provided material. The dShort definition in the signatures shows it is exactly fun z => decide (vecLInftyNorm Φ z ≤ subLInftyNormBound γ), so dShort matches. The definition of outerShort is not shown but is likely identical. (ArkLib/Commitments/Functional/Hachi/QuadEval/Soundness.lean:buildWitness_mem_relIn)
    • Verifier: The proposed finding speculates that outerShort may not be definitionally equal to the bound fun z => decide (vecLInftyNorm Φ z ≤ subLInftyNormBound γ) used by msis_of_commit_eq, and that this might cause a type-checking issue in buildWitness_mem_relIn. The Lean toolchain confirms both outerShort and dShort are definitionally fun … γ z => decide (Φ.vecLInftyNorm z ≤ subLInftyNormBound γ), exactly matching the bound in msis_of_commit_eq (modulo the curried/implicit parameter representation, which is irrelevant to definitional equality). The finding's own evidence states the code compiles and that dShort matches, while hedging on outerShort being unverified. Toolchain output verifies outerShort is identical to the bound in msis_of_commit_eq. There is no issue.
  • The oracleVerifier_toVerifier_run lemma proves equality of Verifier.run, but the cluster signature for mem_of_pure_accepting suggests it expects V.verify ... = pure out. The code compiles, so the types likely align after unfolding definitions, but the documentation mismatch could cause confusion. This is not a code bug — the code compiles and is correct — but the cluster signature may be inaccurate. (ArkLib/ProofSystem/Component/CheckClaim.lean:215-218)
    • Verifier: The proposed finding claims that mem_of_pure_accepting 'expects V.verify ... = pure out' while the code passes oracleVerifier_toVerifier_run which states Verifier.run ... = pure ..., suggesting a signature mismatch. However, tool inspection confirms this is not a mismatch: Verifier.run unfolds to the verifier's verify field (its definition is StmtIn → FullTranscript → Verifier ... → OptionT (OracleComp oSpec) StmtOut), and mem_of_pure_accepting takes a hypothesis V.verify stmt tr = pure out. The lemma oracleVerifier_toVerifier_run proves (oracleVerifier ...).toVerifier.run ... = pure ..., which after unfolding Verifier.run/OracleVerifier.toVerifier/oracleVerifier is exactly a V.verify ... = pure ... statement. The finding itself concedes that 'the code compiles' and 'the code compiles and is correct' and labels this merely a 'documentation mismatch' that 'could cause confusion'. There is no actual type incompatibility, no signature mismatch, and no code defect. The finding explicitly states it is not a code bug. Since the types align (verified by the toolchain and confirmed by tool inspection of mem_of_pure_accepting's signature), the concern about a 'cluster signature mismatch' is unfounded — the pure out in mem_of_pure_accepting is precisely what oracleVerifier_toVerifier_run provides after definitional unfolding.
  • The oracleVerifier_toVerifier_run proof uses rw with a show ... from rfl block that relies on definitional equality. If the definitions of simulateQ or simOracle2 change such that the equality is no longer definitional, this proof will break. This is a minor robustness concern. (ArkLib/ProofSystem/Component/CheckClaim.lean:207-210)
    • Verifier: The finding describes a generic, theoretical fragility — that rfl-based definitional equalities could break if underlying definitions change. This is not a concrete defect in the code under review. The show ... from rfl at line 207-210 is a standard and perfectly valid Lean 4 proof technique: it proves an equality that holds definitionally at the current definitions of simulateQ and simOracle2. The finding itself acknowledges it is merely a 'minor robustness concern' contingent on hypothetical future changes ('If the definitions... change such that the equality is no longer definitional'). This is a truism applicable to virtually every rfl proof in any Lean codebase and does not identify an actual problem in the PR's code as written. Since the finding does not point to a current, concrete issue grounded in the code under review, it is a false positive.
  • The instIsPure and instIsPureOracle are declared as instance in the ReduceClaim namespace. While this is a common pattern, it could cause typeclass search loops if there are competing IsPure instances for the same verifier head. The risk is low because the namespace limits the scope. (ArkLib/ProofSystem/Component/ReduceClaim.lean:179-180, 387-390)
    • Verifier: The proposed finding flags instIsPure and instIsPureOracle as instance declarations that 'could cause typeclass search loops if there are competing IsPure instances for the same verifier head.' This is speculative and unsupported by the code.
  1. The instances are scoped under namespace ReduceClaim and apply only to the concrete verifier oSpec mapStmt (line 179) and oracleVerifier oSpec mapStmt embedIdx hEq).toVerifier (lines 387–390). They are not generic instances over an arbitrary Verifier head — they target specific definitions from this module.

  2. Verifier.IsPure is a single-parameter class over a Verifier value (confirmed via lean_print):
    class Verifier.IsPure (V : Verifier ...) : Prop with one field is_pure. It is a proposition-valued class (a mixin), so instances are proofs, not data that could generate overlapping/competing search results requiring priority resolution.

  3. The finding itself hedges: 'The risk is low because the namespace limits the scope.' No concrete competing instance is identified, and no evidence of an actual loop is provided. The finding is a speculative concern without grounding.

  4. Type-checking via the toolchain confirms the instances elaborate cleanly and synthesize as expected (#synth Verifier.IsPure (...) resolves to ReduceClaim.instIsPure). There is no evidence of a search loop.

Since there is no concrete evidence that these instances cause or could cause a typeclass search loop — and the class is proposition-valued with no competing instances shown — the finding is not grounded and should be dismissed.

  • The import was changed from Hachi.Gadget to Hachi.Gadget.Basic. The file uses symbols such as gadgetDecompose, gadgetMatrix, DigitDecomposition, and zmodDigitDecomposition that were previously provided by Hachi.Gadget. If Hachi.Gadget.Basic does not re‑export all of these symbols, the file will fail to compile. The toolchain cannot verify this because the new Gadget/Basic file is not loaded. This should be confirmed by compiling the PR. (ArkLib/Commitments/Functional/Hachi/InnerOuter/Scheme.lean:6)

    • Verifier: The finding claims that changing the import from Hachi.Gadget to Hachi.Gadget.Basic may cause compilation failures because symbols like gadgetDecompose and gadgetMatrix might not be re-exported. However, the toolchain confirms these symbols are available with the new import ArkLib.Commitments.Functional.Hachi.Gadget.Basic:
  • #check ArkLib.Lattices.Ajtai.gadgetDecompose elaborates successfully under import ArkLib.Commitments.Functional.Hachi.Gadget.Basic, yielding type ... → PolyVec Φ.Rq (rows * digits).

  • #check ArkLib.Lattices.Ajtai.gadgetMatrix elaborates successfully under the same import.

The file under review uses these symbols in an open context (open ... ArkLib.Lattices.Ajtai), so the unqualified references resolve. The new import provides the needed definitions, so the premise of the finding is false.

  • The old ArkLib.Commitments.Functional.Hachi.Gadget module still exists (typechecks) but is no longer imported in ArkLib.lean, replaced by Gadget.Basic and Gadget.Norms. If the old module contains content not covered by the submodules, downstream users importing ArkLib will lose access to it. (ArkLib.lean:7 (removed import))
    • Verifier: The finding claims that import ArkLib.Commitments.Functional.Hachi.Gadget was removed from ArkLib.lean (location cited as "ArkLib.lean:7 (removed import)"). This is factually incorrect. The full file content provided in the context clearly shows the import is still present on line 7: import ArkLib.Commitments.Functional.Hachi.Gadget. The diff itself shows this line as unchanged context (it has no leading + or -). What was actually removed is import ArkLib.Commitments.Functional.Hachi.GadgetNorms (the old flat-file module), which was replaced by the new subdirectory modules Gadget.Basic and Gadget.Norms. The Gadget parent module was never removed — both import ArkLib.Commitments.Functional.Hachi.Gadget and import ArkLib.Commitments.Functional.Hachi.Gadget.Basic coexist in the new file (lines 7–8). Lean typechecking confirms that import ArkLib.Commitments.Functional.Hachi.Gadget elaborates cleanly with no errors, and since it remains in ArkLib.lean, downstream users importing ArkLib retain access to it. The finding is based on a misreading of the diff.

Cluster: Gadget algebra and norm foundations (critical)

Do the digit decomposition, gadget inverse, and centered norm bounds correctly capture the paper's G/G⁻¹ and the required shortness guarantees for the inner-outer commitment and QuadEval soundness?

📄 **Review for `ArkLib/Commitments/Functional/Hachi/Gadget/Basic.lean`**

Analysis:
The file ArkLib/Commitments/Functional/Hachi/Gadget/Basic.lean defines the Ajtai gadget matrix G = I ⊗ [1, b, …, b^(digits-1)] over a cyclotomic ring Rq Φ, the gadget multiplication (G·v), and the gadget inverse G⁻¹ constructed from an abstract DigitDecomposition of the coefficient ring. It also provides the concrete base‑b digit decomposition over ZMod q (zmodDigitDecomposition) and proves the lawfulness of the gadget decomposition (gadgetDecompose_lawful), i.e., G·G⁻¹(x) = x. The code addresses the paper mapping items for NOZ26 §2.1 (gadget decomposition) and the digit decomposition from the checklist. The definitions are mathematically faithful: DigitDecomposition captures the reconstruction law ∑ bᵉ·digit c e = c, zmodDigitDecomposition uses Nat.digits of the canonical representative, and the lawfulness proof handles the coefficient case when k ≥ Φ.φ.natDegree correctly. There are no Lean escape hatches in this file. However, the PR as a whole contains a sorry in ArkLib/Commitments/Functional/Hachi/Commitment.lean:151, which triggers the hard rule requiring a 'Changes Requested' verdict.

Verdict: Changes Requested

Checklist Verification:

  • Paper result mapping (NOZ26 §2.1 gadget decomposition): The DigitDecomposition structure and zmodDigitDecomposition correctly capture the base‑b digit decomposition of the canonical representative. The reconstruction proof uses Nat.digits, Nat.ofDigits, and the hypothesis q ≤ b^digits. The gadgetDecompose_lawful theorem proves G·G⁻¹(x) = x and handles the k ≥ natDegree case correctly.
  • Boundary conditions and edge cases — digitDecomposition requires digits > 0: The gadgetDecompose_lawful theorem requires 0 < digits, which matches the paper's requirement that the gadget has at least one digit. The case k ≥ natDegree is handled correctly.

Critical Misformalizations:

  • The PR contains a sorry in ArkLib/Commitments/Functional/Hachi/Commitment.lean:151, which is an incomplete proof (escape hatch). This triggers the hard rule requiring a 'Changes Requested' verdict. (ArkLib/Commitments/Functional/Hachi/Commitment.lean:151) (confidence: high)
    • Evidence: Lean Toolchain Analysis: 'Incomplete Proofs (sorry/admit): ArkLib/Commitments/Functional/Hachi/Commitment.lean:151'
    • Suggested fix: Complete the proof or replace the sorry with a proper proof.

Lean 4 / Mathlib Issues: None

Nitpicks: None

📄 **Review for `ArkLib/Commitments/Functional/Hachi/Gadget/Norms.lean`**

An error occurred while analyzing ArkLib/Commitments/Functional/Hachi/Gadget/Norms.lean.

📄 **Review for `ArkLib/Data/Lattices/CyclotomicRing/NormBounds/Basic.lean`**

Analysis:
The diff adds six new items to NormBounds/Basic.lean: (1) Rq.l1Norm_sub_le — ℓ₁ triangle inequality for subtraction; (2) Rq.eq_zero_of_l1Norm_eq_zero — if ℓ₁ norm is zero, the element is zero; (3) Rq.l1Norm_pos_of_ne_zero — nonzero elements have positive ℓ₁ norm; (4) Rq.l2NormSq_le_natDegree_mul_lInftyNorm_sq — ℓ∞ → ℓ₂² bridge for ring elements; (5) vecL2NormSq_le_card_mul_lInftyNorm_sq — ℓ∞ → ℓ₂² bridge for vectors; (6) zRecomposeL2SqBound — a bound expression for recomposition ℓ₂² norm. These are foundational norm lemmas used by the gadget decomposition (Gadget/Norms.lean) and the Lyubashevsky–Seiler invertibility (LyubashevskySeiler.lean). The checklist items addressed are the LS18 short‑element invertibility bridge (items 2‑3 provide the hpos condition) and the ℓ∞ → ℓ₂² aggregation / recomposition bounds (items 4‑6). The proofs are straightforward algebraic manipulations using existing lemmas (valMinAbs_natAbs_le, valMinAbs_sub_natAbs_le, Finset.sum_eq_zero_iff, ZMod.valMinAbs_eq_zero, Int.natAbs_eq_zero, reducedness lemmas). The omitted assumptions (NeZero q, IsCyclotomic Φ) are correctly minimized where possible. The definitions are consistent with their usage in Gadget/Norms.lean. No mathematical errors, missing hypotheses, or Lean 4 best‑practice violations were identified.

Verdict: Approved

Checklist Verification:

  • Paper result mapping (LS18 short‑element invertibility) — the hpos bridge: The ℓ₁ triangle inequality Rq.l1Norm_sub_le is correctly proved using valMinAbs_sub_natAbs_le and sum inequality. It matches the paper's requirement for bounding ‖c̄ⱼ‖₁ ≤ 2ω.
  • Paper result mapping (LS18 short‑element invertibility) — l1Norm_pos_of_ne_zero: Rq.eq_zero_of_l1Norm_eq_zero correctly proves that zero ℓ₁ norm implies zero element, using Finset.sum_eq_zero_iff, ZMod.valMinAbs_eq_zero, Int.natAbs_eq_zero, and reducedness. Rq.l1Norm_pos_of_ne_zero is a direct consequence. These provide the required hpos input for isUnit_of_l1Norm_le.
  • Hidden assumptions and implicit identifications — ℓ∞ → ℓ₂² bridge: Rq.l2NormSq_le_natDegree_mul_lInftyNorm_sq correctly bounds ‖x‖₂² ≤ deg φ · ‖x‖∞² by bounding each of the deg φ terms. vecL2NormSq_le_card_mul_lInftyNorm_sq extends this to vectors. These are used in Gadget/Norms.lean to derive the recomposition bound.
  • Hidden assumptions and implicit identifications — recomposition bound: zRecomposeL2SqBound is defined as cols * (d * ((∑ b^u) * γ)²), matching the required expression. The proof that gadgetMul respects this bound is in Gadget/Norms.lean (gadgetMul_zmod_vecL2NormSq_le).

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks: None

Cluster: QuadEval reduction protocol and soundness (critical)

Does the QuadEval reduction faithfully implement the paper's Figure 3, and is the coordinate‑wise special soundness proof (Lemma 8) correct with respect to the derived norm constants?

📄 **Review for `ArkLib/Commitments/Functional/Hachi/QuadEval/Gadgets.lean`**

Analysis:
The file ArkLib/Commitments/Functional/Hachi/QuadEval/Gadgets.lean provides the gadget algebra supporting the Hachi QuadEval reduction (Lemma 8). It defines:

  1. PublicParamsD: extends inner-outer public parameters (A, B) with the short-commitment matrix D (Hachi Eq. (16)).
  2. Carrier definitions: carrierEntry (aᵀ G sᵢ), carrier (vector of carrier entries), carrierDecomp (ŵ = G⁻¹(w)), carrierCommit (v = D ŵ). The roundtrip theorem carrier_eq_gadget proves w = G·ŵ using gadgetDecompose_lawful.
  3. J gadget: jMatrix (J = I ⊗ [1, base, …]), zDecomp (ẑ = J⁻¹(z)), z_eq_jMatrix (z = J·ẑ).
  4. Block-weighted gadget sums: tensorG ((cᵀ ⊗ G_k) x̂ for Eq. (20) row 5) and tensorG1 ((cᵀ ⊗ G₁) ŵ for row 4).
  5. Key algebraic identities: tensorG_sub_challenge and tensorG1_sub_challenge prove linearity/subtractivity in the challenge vector. tensorG_coord_diff and tensorG1_coord_diff prove coordinate isolation: when c and c' differ only at coordinate j, the difference sum collapses to the single block j. These are the algebraic crux of Lemma 8's subtract-and-divide extraction.

Mapping to checklist items:

  • The file addresses the gadget algebra layer of the QuadEval reduction. It correctly defines the tensorG/tensorG1 sums and their coordinate-isolation properties, which are essential for the CWSS proof in Soundness.lean.
  • The definitions use gadgetMatrix, gadgetDecompose, DigitDecomposition, and gadgetDecompose_lawful from imports. The file does not define these itself but uses them correctly.
  • The CoordEq type from CoordinateWiseSpecialSoundness.Basic is used appropriately for coordinate isolation.

Riskiest aspects:

  1. The file relies on gadgetDecompose_lawful being correctly stated and proved elsewhere. If that theorem has missing hypotheses or incorrect bounds, the roundtrip theorems here would be unsound.
  2. The tensorG_coord_diff and tensorG1_coord_diff proofs use Finset.sum_eq_single which assumes DecidableEq on the index type. This is fine for Fin blocks.
  3. The [DecidableEq R] variable is introduced after some definitions to avoid unusedSectionVars. This is a valid pattern but could be confusing.

Second-order issues:

  • The file depends on CoordEq from CoordinateWiseSpecialSoundness.Basic. The tensorG_coord_diff and tensorG1_coord_diff theorems use CoordEq on PolyVec (Rq Φ) blocks. The CoordEq definition likely requires DecidableEq on the element type Rq Φ. The file has [BEq R] [LawfulBEq R] at the top level, which should provide DecidableEq R. However, Rq Φ is a quotient polynomial ring, and its DecidableEq instance depends on DecidableEq R and DecidableEq for the polynomial representation. This is likely available but should be verified.
  • The tensorG and tensorG1 definitions are in sections that don't explicitly require [DecidableEq R], but the proofs use CoordEq which does. The DecidableEq instance for Rq Φ should be available from the top-level context.

No escape hatches found: The file contains no sorry, axiom, native_decide, implemented_by, opaque, or sorryAx. All proofs are complete.

Overall: The file is mathematically sound and implements the paper's gadget algebra correctly. The proofs are straightforward algebraic manipulations. No critical misformalizations are evident from the diff alone.

Verdict: Approved

Checklist Verification:

  • The tensorG and tensorG1 must be subtractive in the challenge vector and the coordinate isolation must collapse to the single block j: The file defines tensorG and tensorG1 exactly as the block-weighted gadget sums from the paper. The subtractivity and coordinate-isolation theorems (tensorG_sub_challenge, tensorG1_sub_challenge, tensorG_coord_diff, tensorG1_coord_diff) faithfully implement the algebraic identities required for Lemma 8's subtract-and-divide extraction.
  • ⚠️ The definitions of DigitDecomposition, gadgetDecompose, and zmodDigitDecomposition must capture the base-b digit decomposition: The definitions of carrier, carrierDecomp, carrierCommit, jMatrix, zDecomp and their roundtrip theorems correctly use the imported gadgetMatrix, gadgetDecompose, and gadgetDecompose_lawful. The file assumes these are correctly defined elsewhere; it does not define them itself.
  • ⚠️ The gadgetDecompose_lawful theorem must prove G·G⁻¹(x) = x: The roundtrip theorems carrier_eq_gadget and z_eq_jMatrix use gadgetDecompose_lawful with the hypotheses hd : 0 < digits and h1 : 1 ≤ Φ.φ.natDegree. These match the paper's requirements. The file assumes gadgetDecompose_lawful is correctly proved elsewhere.
  • The InnerOuter.Scheme must define the commitment exactly as a two‑layer composition: The PublicParamsD structure correctly extends InnerOuter.PublicParams with the dMatrix field of type Simple.PublicParams Φ dRows (blocks * messageDigits), matching Hachi Eq. (16).
  • The definitions of IsSpecialSoundFamily, CoordEq, CWSSStructure, StarAt, central, sib must match the paper: The CoordEq type from CoordinateWiseSpecialSoundness.Basic is used correctly in the coordinate-isolation theorems. The file does not redefine these concepts.
  • Escape hatches (sorry, axiom, etc.): The file is a new introduction of gadget algebra; no sorry, axiom, or other escape hatches are used. The proofs are complete and use standard tactics.
  • Typeclass assumptions are minimal and correct: The file uses Field R, BEq R, LawfulBEq R as typeclass assumptions. These are minimal for the cyclotomic ring operations. The [DecidableEq R] is introduced only where needed (after pure definitions).
  • Implicit vs. explicit arguments: The carrierDecomp takes base as an implicit argument (pinned by ddCarrier), while carrier and carrierEntry take it explicitly. This is a reasonable design choice and not an error.
  • Simp lemmas: No @[simp] attributes are used. The file defines no simp lemmas, which is appropriate for these definitions.
  • Prop vs. Type: The theorems are placed in Prop, definitions in Type. No misuse found.
  • Universe levels: The file uses Type (Type 0) which is sufficient for the domain. No universe polymorphism is needed.
  • Computability: The definitions are computable; no noncomputable is used.
  • Naming conventions: Names follow the project's conventions: camelCase for definitions, snake_case for theorems, UpperCamelCase for types. The names are descriptive.

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks: None

📄 **Review for `ArkLib/Commitments/Functional/Hachi/QuadEval/Reduction.lean`**

Analysis:
The PR introduces a new file Reduction.lean that formalizes the data layer of Hachi's QuadEval reduction (Figure 3, §4.2 of NOZ26). It defines:

  • QuadEvalStatement, QuadEvalResponse, QuadEvalWitness (the three case extracted witness),
  • ShortChallenge subtype with lemmas (l1Norm_le, l1Norm_val_sub_le, val_ne_of_ne),
  • derivedMsgMatrix, evalConsistency (Eq. 15), dShort,
  • relOut (Eq. 20 linear system + symmetric ℓ∞ ball range checks),
  • InSb, vecInSb, paperRelOut (the paper's exact S_b box), paperRelOut_subset_relOut (containment proof),
  • relIn (extraction disjunction),
  • verifier (pure pass‑through, as required by the CWSS generic layer),
  • prover skeleton.

The code is a faithful rendition of the paper's Figure 3 data, with the deliberate generalization of range checks from the S_b box to the enclosing ℓ∞ ball, and a formal proof that the paper's verifier is contained in this generalization.

I identified one critical issue: the dShort definition uses the section variable blocks, but in relIn the QuadEvalStatement is specialized to blocks := 2^r. The ModuleSIS.relation application dShort Φ γ expects a ModuleSIS.Solution Φ (blocks * messageDigits), while stmt.pp.dMatrix has column count (2^r) * messageDigits. This is a type mismatch unless blocks is definitionally equal to 2^r in that context, which it is not. This would cause a compilation error. However, since the PR is presented as a diff and the file is new, it's possible this compiles in the full project context if there's a typeclass or if ModuleSIS.relation is more flexible, but as written it appears to be a type error. I'll flag this as a critical finding.

Additionally, I noticed a few minor issues:

  • The lInftyNorm_le_of_InSb proof uses omega with a mix of and bounds; while omega can handle this, the proof depends on the definition of Rq.lInftyNorm and the conversion from valMinAbs (in ) to the norm (in ). This is a potential fragility but not a current error.
  • The InSb definition uses a.1.coeff k which relies on the internal representation of Rq Φ. This is a bit fragile but acceptable if Rq is defined as a structure with a polynomial field.
  • The prover definition uses pSpec with r as a parameter, but the protocol is strictly two-round. The r parameter in pSpec might be something else (like the challenge vector size). This is a naming confusion but not an error.

I also note that the Rq.l1Norm identifier was not found by the tool, but this is likely due to namespace issues; the code opens CyclotomicModulus so it should be available.

The main finding is the type mismatch in dShort / relIn. I'll flag this as a critical misformalization.

Verdict: Changes Requested

Checklist Verification:

  • The QuadEval.Reduction module must define the protocol exactly as in Figure 3: The definitions of QuadEvalStatement, QuadEvalResponse, and QuadEvalWitness are present and match the paper's notation. The verifier is a pure pass-through, relOut contains the five equations plus range checks, and the paperRelOut containment is proved. The ShortChallenge subtype is correctly defined.
  • The paperRelOut must capture the paper's exact S_b box range checks: paperRelOut is defined with vecInSb (InSb box), and paperRelOut_subset_relOut is proved for γ ≥ b/2. The InSb definition matches the paper's S_b box.
  • The relIn definition must be the disjunction from Lemma 8: relIn correctly encodes the disjunction: VerifiedOpening + evalConsistency, or MSIS(B), or MSIS(D). dShort is defined as the analogue of outerShort.
  • The verifier is a pure pass-through: verifier is defined as a pure pass-through: verify returns (stmt, round-0 message, round-1 challenge). This satisfies the hpure condition.
  • The dShort definition in relIn must be compatible with the specialized blocks=2^r: dShort is defined with the section variable 'blocks', but in relIn the QuadEvalStatement is specialized to blocks := 2^r. The types ModuleSIS.Solution Φ (blocks * messageDigits) and ModuleSIS.Solution Φ ((2^r) * messageDigits) are not definitionally equal, causing a potential type error. This is a critical issue.

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks:

  • The prover definition uses pSpec parameterized by r, but the protocol is strictly two-round. The r parameter in pSpec might be the challenge vector size (log₂ of blocks), not the number of rounds. This is a naming confusion in the pSpec API but not an error in this file. (ArkLib/Commitments/Functional/Hachi/QuadEval/Reduction.lean:verifier and prover definitions) (confidence: low)
    • Evidence: pSpec (CarrierCom Φ dRows) (ShortChallenge Φ ω) r where r is the section variable from m r : Nat. The docstring says pSpec ⟨!v[.P_to_V, .V_to_P], !v[CarrierCom, Fin 2ʳ → C]⟩.
  • The InSb definition accesses a.1.coeff k which relies on the internal representation of Rq Φ as a structure with a polynomial field. This is fragile but acceptable if Rq is defined as a single-field structure. (ArkLib/Commitments/Functional/Hachi/QuadEval/Reduction.lean:InSb) (confidence: low)
    • Evidence: InSb definition: (a.1.coeff k).valMinAbs.
📄 **Review for `ArkLib/Commitments/Functional/Hachi/QuadEval/Soundness.lean`**

Analysis:
The file ArkLib/Commitments/Functional/Hachi/QuadEval/Soundness.lean is a new file that formalizes the coordinate-wise special soundness (CWSS) of the QuadEval reduction, corresponding to Hachi Lemma 8 (NOZ26 §4.2, Figure 3). This is the soundness proof for the two-round folding protocol.

Mathematical content:
The file defines:

  • quadEvalZL2SqBound and quadEvalBetaSq: the derived norm constants B_z and βSq = 4·B_z for the J-gadget recomposition bound.
  • extractedOpening: the subtract-and-divide weak opening assembled from a star of accepting branches.
  • buildWitness: the three-case extractor (Lemma 8's case analysis): (A) divergent inner decomposition → MSIS(B), (B) divergent carrier decomposition → MSIS(D), (C) otherwise → subtract-and-divide weak opening.
  • quadEvalPackage: a CWSSPackage bundling the verifier with its CWSS certificate for composition.

And proves:

  • evalConsistency_of_star: Eq. (15) consistency for the extracted opening.
  • msis_of_commit_eq: two-transcript MSIS extraction step for cases (A)/(B) — two γ-short openings of the same commitment differ by a 2γ-short kernel vector.
  • inner_eq_of_chain: the unit-cancellation core of subtract-and-divide.
  • ShortChallenge.coordEq_val: lifts coordinate equality from the ShortChallenge subtype to the underlying ring elements.
  • slack_isUnit: the challenge slack is a unit, using Lyubashevsky–Seiler invertibility.
  • verifiedOpening_of_star: the extracted opening is a VerifiedOpening at βSq/γ/2ω.
  • evalConsistency_of_relOut_star: the extracted opening satisfies Eq. (15) eval-consistency.
  • buildWitness_mem_relIn: the witness assembler is correct — the main math lemma reducing Lemma 8.
  • quadEval_coordinateWiseSpecialSound: Hachi Lemma 8 assembled via the generic CWSS framework.
  • quadEval_coordinateWiseSpecialSound_paperParams: paper-parameter instantiation (γ := b).

Mapping to checklist items:
The code addresses all the critical checklist items for NOZ26 §4.2 QuadEval reduction and Lemma 8, FMN24 coordinate-wise special soundness, and LS18 short-element invertibility. The definitions and theorems closely follow the paper's structure.

Riskiest aspects:

  1. The msis_of_commit_eq theorem returns a ModuleSIS.relation with a specific norm bound function fun z => decide (vecLInftyNorm Φ z ≤ subLInftyNormBound γ). The relIn relation expects outerShort Φ γ and dShort Φ γ for the MSIS cases. If these are not definitionally equal to the lambda used in msis_of_commit_eq, the cases (A) and (B) of buildWitness_mem_relIn would not type-check. However, the toolchain confirms the code compiles, so this is likely fine.

  2. The quadEvalBetaSq constant is defined as subL2NormSqBound (quadEvalZL2SqBound ...) = 4·B_z. The gadgetMul_zmod_sub_l2NormSq_le lemma must return a bound of ≤ quadEvalBetaSq (or something that implies it). The code compiles, so the types match. However, if gadgetMul_zmod_sub_l2NormSq_le already gives a bound on the difference (rather than on each vector individually), then quadEvalBetaSq might be 4× larger than necessary, but this is a conservative bound, not an error.

  3. The evalConsistency_of_star lemma uses splitForm from CompPoly. The proof depends on splitForm unfolding to dot b (M *ᵥ a) or similar. This is consistent with the definition of evalConsistency in Reduction.lean.

  4. The verifiedOpening_of_star uses hc2e and hc6te from the central branch's relOut to prove outer_eq and outer_short of the VerifiedOpening. This is correct because the extracted opening's innerDecomp is the central branch's innerDec verbatim, so the central branch's bounds apply directly (no 2γ slack).

Faithfulness checks:

  • Hachi Lemma 8 (paper): The QuadEval reduction is CWSS for (2^r, 2) structure. The extractor either outputs a weak opening or an MSIS solution for B or D.

  • Lean quadEval_coordinateWiseSpecialSound: States exactly this, with relOut = Eq. (20) + range checks, relIn = weak opening ∨ MSIS(B) ∨ MSIS(D). The hypotheses include q ≡ 5 mod 8, (2ω)² < q, and 0 < zDigits. The paper's hypotheses are the same. The conclusion matches the paper's. ✓

  • LS18 Corollary 1.2 (paper): nonzero short elements are units.

  • Lean slack_isUnit: Uses isUnit_of_l1Norm_le with the correct hypotheses. The slack is nonzero (sibling differs at coordinate i), has ℓ₁ norm ≤ 2ω, and (2ω)² < q ensures ℓ₂² < q. ✓

  • FMN24 Definitions 2.9/2.10 (paper): SS(S, ℓ, k) and star-center extraction.

  • Lean: Uses foldStructure, StarAt, sib, central, CoordEq from the CoordinateWise module. The generic theorem coordinateWiseSpecialSound_of_mkWitness from SingleRound.lean handles the tree/extractor/guard obligations. ✓

No escape hatches found: The file is sorry-free (the docstring claims this, and the toolchain doesn't show any sorry in this file). No axiom, native_decide, implemented_by, opaque, or sorryAx are present.

Lean best practices:

  • The noncomputable attribute on extractedOpening and buildWitness is appropriate (uses Ring.inverse which is noncomputable).
  • The open Classical is used for hB.choose and hD.choose in buildWitness, which is fine for a cryptographic extractor.
  • The naming conventions follow the project's style.
  • The typeclass assumptions are minimal and correct.
  • The variable sections are well-organized.

Potential issues found:

  1. The evalConsistency_of_star proof uses splitForm which is not directly visible in the provided context. However, since CompPoly is opened and the code compiles, this is resolved.
  2. The msis_of_commit_eq returns a ModuleSIS.relation with a specific lambda, while relIn expects outerShort/dShort. The definitional equality between these is not verified in the provided material, but the code compiles, indicating they are indeed definitionally equal.

No critical misformalizations found. The formalization appears faithful to the paper.

Verdict: Approved

Checklist Verification:

  • Paper result mapping (NOZ26 §4.2 QuadEval reduction and Lemma 8) — relOut encodes Eq. (20): The relOut relation is defined in QuadEval/Reduction.lean and used correctly in Soundness.lean. The relOut contains all five equations (c1-c5) plus three ℓ∞ range checks (c6a-c6c), matching Eq. (20).
  • Paper result mapping (NOZ26 §4.2 QuadEval reduction and Lemma 8) — paperRelOut_subset_relOut: The paperRelOut_subset_relOut theorem is proved in Reduction.lean and referenced in the docstrings. The containment holds for γ ≥ b/2. The paper's S_b box is modeled as InSb and the containment uses lInftyNorm_le_of_InSb.
  • Paper result mapping (NOZ26 §4.2 QuadEval reduction and Lemma 8) — quadEval_coordinateWiseSpecialSound: The quadEval_coordinateWiseSpecialSound theorem states CWSS for the foldStructure with (ℓ, k) = (2^r, 2), relIn = weak opening ∨ MSIS(B) ∨ MSIS(D), and relOut = Eq. (20) + range checks. The hypotheses include q ≡ 5 mod 8, (2ω)² < q, and 0 < zDigits.
  • Paper result mapping (NOZ26 §4.2 QuadEval reduction and Lemma 8) — buildWitness three-case extractor: The buildWitness function implements the three cases: (A) divergent innerDecomp → MSIS(B), (B) divergent carrierDec → MSIS(D), (C) otherwise → subtract-and-divide opening. The proof buildWitness_mem_relIn handles each case correctly using commitment equalities and norm bounds.
  • Paper result mapping (NOZ26 §4.2 QuadEval reduction and Lemma 8) — verifiedOpening_of_star: The verifiedOpening_of_star lemma proves the extracted opening is a VerifiedOpening at βSq/γ/2ω. The scaled_short proof uses gadgetMul_zmod_sub_l2NormSq_le with the correct parameters. The outer_short is the central branch's γ (not 2γ), and inner_eq uses the coordinate-isolated c5 chain. The slack_isUnit lemma uses LS18 invertibility.
  • Paper result mapping (NOZ26 §4.2 QuadEval reduction and Lemma 8) — evalConsistency_of_relOut_star: The evalConsistency_of_relOut_star lemma proves Eq. (15) consistency using c3, c4, and the coordinate-isolated unit-divided chain. The proof correctly applies tensorG1_coord_diff and tensorG1_sub_challenge.
  • Paper result mapping (LS18 short-element invertibility) — slack_isUnit: The slack_isUnit lemma uses isUnit_of_l1Norm_le from LS18 with the correct hypotheses: q ≡ 5 mod 8, slack is nonzero, ℓ₁ norm ≤ 2ω, and (2ω)² < q. The ring is the power-of-two cyclotomic 𝓜(q, α).
  • Paper result mapping (NOZ26 §4.2 QuadEval reduction and Lemma 8) — buildWitness_mem_relIn: The buildWitness_mem_relIn lemma correctly assembles the three cases. Case (A) uses msis_of_commit_eq with stmt.pp.outerMatrix (B), case (B) uses it with stmt.pp.dMatrix (D), and case (C) produces the VerifiedOpening and evalConsistency. The relIn relation is defined as the disjunction of these three cases.
  • Paper result mapping (FMN24 coordinate-wise special soundness) — CWSS structure: The quadEval_coordinateWiseSpecialSound theorem is assembled using coordinateWiseSpecialSound_of_mkWitness from SingleRound.lean, which handles the generic CWSS tree/extractor/guard obligations. The purity proof fun _ _ => rfl correctly reflects that the verifier is a pure pass-through.
  • Paper result mapping (NOZ26 §4.2 QuadEval reduction and Lemma 8) — quadEvalPackage: The quadEvalPackage bundles the verifier, foldStructure, relIn, relOut, purity proof, and CWSS certificate into a CWSSPackage. The relOut of the package is defined as relOut ... and the relIn as relIn ..., ready for composition with the polynomial-level bridge.

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks:

  • The quadEvalBetaSq constant is documented as subL2NormSqBound B_z = 4·B_z. The quadEvalZL2SqBound is zRecomposeL2SqBound γ b τ d (2^m * δ). If gadgetMul_zmod_sub_l2NormSq_le already gives a bound on the difference J z₁ - J z₂, then quadEvalBetaSq might be 4× larger than the actual bound, making it a looser bound than necessary. This is a conservative bound choice, not an error, but the docstring could be clarified to explain why the factor of 4 is present (triangle inequality for the difference of two vectors, or because subL2NormSqBound is defined as 4·B_z). (ArkLib/Commitments/Functional/Hachi/QuadEval/Soundness.lean:quadEvalBetaSq) (confidence: low)
    • Evidence: The docstring for quadEvalBetaSq says 'the ℓ₂² bound on the extracted c̄ⱼ •ᵥ sⱼ = z_sib − z_central'. The gadgetMul_zmod_sub_l2NormSq_le lemma is used directly in verifiedOpening_of_star, suggesting it already accounts for the difference. The factor of 4 may be redundant if the lemma already bounds the difference.

Cluster: Polynomial‑to‑matrix bridge (high)

Does the bridge correctly convert a multilinear polynomial evaluation claim into a QuadEvalStatement, and is the pull‑back of the Lemma 8 extraction to the polynomial level sound?

📄 **Review for `ArkLib/Commitments/Functional/Hachi/EvalSplit.lean`**

Analysis:
The diff adds toPolynomial (the inverse reshape of toMatrix), three round‑trip/access lemmas, and the bridge lemma splitForm_monomialBasis_eq_eval. These definitions realize the polynomial‑to‑matrix bridge required by NOZ26 §4.2: a matrix M is read back into a CMlPolynomial via toPolynomial, and the split bilinear form splitForm M (mb xl) (mb xh) is proved equal to eval (toPolynomial M) (xl ++ xh). The Bridge.lean code (reviewed in context) uses this lemma to translate the QuadEval‑level consistency condition into a polynomial evaluation claim, exactly as required by the specification checklist.

Every checklist item for this file is satisfied:

  • toPolynomial and its round‑trip lemmas are correctly defined and proved.
  • splitForm_monomialBasis_eq_eval is proved and correctly factors the evaluation.
  • The Bridge.lean usage (mem_relPolyEval_of_relIn) correctly rewrites the matrix condition using the bridge lemma.
  • The bridgePackage is pure and its relOut is definitionally equal to the downstream relIn.

No mathematical errors, missing hypotheses, or Lean 4 anti‑patterns were found. The only existing sorry in the repository is in a different file and is not implicated by this diff.

Verdict: Approved

Checklist Verification:

  • Paper result mapping (NOZ26 §4.2 polynomial‑to‑QuadEval bridge) — matrix reshape toMatrix and its inverse toPolynomial: toMatrix was already defined; toPolynomial is added as its inverse with round‑trip lemmas toMatrix_toPolynomial and toPolynomial_toMatrix.
  • Paper result mapping (NOZ26 §4.2 polynomial‑to‑QuadEval bridge) — splitForm_monomialBasis_eq_eval: splitForm_monomialBasis_eq_eval is proved: splitForm M (mb xl).get (mb xh).get = eval (toPolynomial M) (xl ++ xh). The proof uses evalSplit_eq_eval and toMatrix_toPolynomial, matching the paper's bridge.
  • Paper result mapping (NOZ26 §4.2 polynomial‑to‑QuadEval bridge) — PolyEvalStatement and toQuadEvalStatement: PolyEvalStatement and toQuadEvalStatement exist in Bridge.lean and use mb(xl) and mb(xh) as required.
  • Paper result mapping (NOZ26 §4.2 polynomial‑to‑QuadEval bridge) — relPolyEval and mem_relPolyEval_of_relIn: relPolyEval is defined as the pull‑back of QuadEval's relIn; mem_relPolyEval_of_relIn is proved using the bridge lemma.
  • Paper result mapping (NOZ26 §4.2 polynomial‑to‑QuadEval bridge) — bridge_coordinateWiseSpecialSound: bridge_coordinateWiseSpecialSound and bridgePackage are defined in Bridge.lean; the package is pure and relOut is definitionally QuadEval's relIn.
  • Paper result mapping (FMN24 coordinate‑wise special soundness) — definitions: The foldStructure and related CWSS definitions are in the single‑round module, not in this diff, but the bridge correctly uses them.
  • Hidden assumptions and implicit identifications — index convention consistency: The splitEquiv indexing is little‑endian and consistent with the monomial basis; toMatrix and toPolynomial are inverses.
  • Hidden assumptions and implicit identifications — pure verifier: The bridgePackage is purely a zero‑round ReduceClaim; isPure is proved by rfl.
  • Hidden assumptions and implicit identifications — definitional equality of relOut and relIn: relOut of bridgePackage is relIn Φ base βSq γ κ, which is definitionally equal to the QuadEval package's relIn.

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks: None

📄 **Review for `ArkLib/Commitments/Functional/Hachi/QuadEval/Bridge.lean`**

Analysis:
The file Bridge.lean defines a zero-round polynomial-to-matrix bridge for Hachi's QuadEval reduction. It introduces PolyEvalStatement (the polynomial-level statement with public parameters, commitment, split evaluation point (xl, xh), and claimed value y), toQuadEvalStatement (which maps it to a QuadEvalStatement by taking the evaluation bases to be the monomial tensor bases of the point halves), and bridgeVerifier (a ReduceClaim verifier). The polynomial-level input relation relPolyEval is the pull-back of QuadEval's relIn: either a weak VerifiedOpening whose extracted polynomial evaluates to y, or MSIS solutions for B or D. The main theorem mem_relPolyEval_of_relIn proves that relIn at toQuadEvalStatement implies relPolyEval, using splitForm_monomialBasis_eq_eval from EvalSplit. The CWSS theorem bridge_coordinateWiseSpecialSound is a direct application of the generic ReduceClaim.verifier_coordinateWiseSpecialSound. Finally, bridgePackage bundles everything into a CWSSPackage ready for composition with quadEvalPackage.

Mapping to checklist items:

  • The bridge correctly reinterprets a polynomial-level evaluation claim as a QuadEvalStatement using the monomial tensor bases, matching NOZ26 §4.2's implicit bridge.
  • extractedPoly is toPolynomial (derivedMsgMatrix ...) and toMatrix_extractedPoly gives the round-trip identity, linking the polynomial and matrix views.
  • relPolyEval correctly captures the polynomial-level extraction: VerifiedOpening with eval consistency, or MSIS for B/D.
  • mem_relPolyEval_of_relIn correctly rewrites the matrix-level evalConsistency into the polynomial evaluation using splitForm_monomialBasis_eq_eval.
  • bridge_coordinateWiseSpecialSound correctly uses ReduceClaim.verifier_coordinateWiseSpecialSound.
  • bridgePackage is pure and its relOut is definitionally relIn, satisfying the seam requirement for -composition.

Riskiest aspects:

  • The argument order in evalConsistency vs splitForm and splitForm_monomialBasis_eq_eval is load-bearing and not directly visible in this file, but the proof typechecks and the docstring acknowledges the order. The type system guarantees consistency.
  • The PolyEvalStatement structure fixes 2^m and 2^r in the PublicParamsD type, matching QuadEvalStatement's messageRows and blocks. No off-by-one or exponent confusion.
  • Edge cases r=0 or m=0 are not excluded; they produce valid (though trivial) instances. The proofs do not rely on positivity.

Lean 4 best practices:

  • Typeclass assumptions are minimal and appropriate (Field, BEq, LawfulBEq, NeZero, Fact (Nat.Prime q)).
  • @[simp] lemma toMatrix_extractedPoly is a good simplification rule.
  • omit [NeZero q] is used correctly to avoid unnecessary instance constraints.
  • Naming conventions follow Mathlib style.
  • No escape hatches (sorry, axiom, etc.) are present; the file is sorry-free.
  • Universe polymorphism is not used but the file is consistent with the project's style.

Verdict: The code is mathematically correct, well-documented, and free of Lean issues. It satisfies all relevant checklist items.

Verdict: Approved

Checklist Verification:

  • NOZ26 §4.2 (implicit): Polynomial‑level bridge: zero‑round reduction that reinterprets a CMlPolynomial evaluation claim as a QuadEvalStatement via the monomial tensor bases.: The PolyEvalStatement and toQuadEvalStatement correctly define the polynomial-level statement and its reinterpretation as a QuadEvalStatement with the monomial tensor bases. The EvalSplit module provides the matrix reshape and the bridge lemma splitForm_monomialBasis_eq_eval.
  • relPolyEval definition must be the pull‑back of QuadEval's relIn to the polynomial level: a VerifiedOpening whose extracted polynomial evaluates to y, or MSIS(B), or MSIS(D). The mem_relPolyEval_of_relIn lemma must prove that relIn at toQuadEvalStatement implies relPolyEval.: extractedPoly is defined as toPolynomial (derivedMsgMatrix ...) and toMatrix_extractedPoly proves the round‑trip identity. The relPolyEval relation is the pull‑back of QuadEval's relIn to the polynomial level: VerifiedOpening with eval consistency, or MSIS for B/D.
  • The mem_relPolyEval_of_relIn lemma must prove that relIn at toQuadEvalStatement implies relPolyEval.: mem_relPolyEval_of_relIn correctly rewrites the matrix‑level evalConsistency to the polynomial evaluation using splitForm_monomialBasis_eq_eval. The argument order is consistent with the docstring and the proof typechecks.
  • The bridge_coordinateWiseSpecialSound theorem must prove that the zero‑round ReduceClaim head is CWSS for any D, reducing relPolyEval to QuadEval's relIn. The witness type must be unchanged (QuadEvalWitness).: bridge_coordinateWiseSpecialSound uses ReduceClaim.verifier_coordinateWiseSpecialSound with the correct pull‑back. The witness type is unchanged (QuadEvalWitness).
  • The evalChain composition uses CWSSPackage.append (▷). The left package's relOut must be definitionally equal to the right's relIn. The PR's bridgePackage sets relOut := relIn Φ base βSq γ κ and quadEvalPackage sets relIn := relIn … with the same parameters. This must be rfl.: bridgePackage sets relOut := relIn Φ base βSq γ κ which is definitionally QuadEval's relIn. The isPure field is proven with rfl. The composition seam is rfl.
  • The PolyEvalStatement and toQuadEvalStatement must faithfully represent the paper's evaluation claim: the evaluation point is split into xl (first r variables) and xh (last m variables), and the bases are the monomial tensor bases mb(xl) and mb(xh).: The PolyEvalStatement structure and toQuadEvalStatement correctly split the evaluation point into xl (first r variables) and xh (last m variables), and use the monomial tensor bases mb(xl) and mb(xh) as the bvec and avec respectively. The EvalSplit module's splitForm_monomialBasis_eq_eval uses the same split.
  • The QuadEval verifier is a pure pass‑through, so its verify must be a deterministic function of the transcript. The hpure condition required by coordinateWiseSpecialSound_of_mkWitness must be ∀ s tr, V.verify s tr = pure (s, tr.messages 0, tr.challenges 1). The PR's verifier definition must satisfy this exactly.: The bridgeVerifier is a ReduceClaim.verifier which is pure (deterministic). The isPure field in bridgePackage provides the proof fun _ _ => rfl. The hpure condition is satisfied.
  • Escape hatches: no sorry or admit in this file.: The file contains no sorry, axiom, native_decide, implemented_by, opaque, or sorryAx. All proofs are complete.

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks: None

Cluster: Generic CWSS composition infrastructure (high)

Are the new generic CWSS composition primitives (no‑challenge bridge, CWSSPackage, n‑ary seqCompose, SingleRound assembly) mathematically correct and do they provide the necessary purity and composition theorems for the Hachi proofs?

Comment thread ArkLib/Commitments/Functional/Hachi/Gadget/Basic.lean
Comment thread ArkLib/Commitments/Functional/Hachi/Composition.lean
Comment thread ArkLib/Commitments/Functional/Hachi/Composition.lean
Comment thread ArkLib/Commitments/Functional/Hachi.lean
Comment thread ArkLib/Commitments/Functional/Hachi/Commitment.lean
Comment thread ArkLib/Commitments/Functional/Hachi/QuadEval.lean
@github-actions

Copy link
Copy Markdown
Contributor

AI review continued (part 2/3)

📄 **Review for `ArkLib/OracleReduction/Security/CoordinateWiseSpecialSoundness/NoChallenge.lean`**

Analysis:
I will analyze the new file NoChallenge.lean, which provides the degenerate bridge for coordinate-wise special soundness (CWSS) when the protocol has no challenge rounds (IsEmpty pSpec.ChallengeIdx).

What the code does mathematically:

  1. CWSSStructure.ofIsEmpty – constructs a canonical (trivial) CWSS structure for a challenge-free protocol. Every field is defined by isEmptyElim because there are no challenge indices to describe.
  2. transcripts_eq_singleton / fullTranscripts_eq_singleton – prove that when there are no challenge rounds, every challenge tree has exactly one full transcript. The proof is by induction on the tree; the chalNode case is impossible by IsEmpty.
  3. onlyTranscript / onlyTranscript_mem – extract the unique full transcript of a tree and prove it belongs to the tree's transcripts.
  4. treeSpecialSound_of_isEmpty_challengeIdx – the central bridge: if a protocol has no challenge rounds, tree special soundness reduces to a transcript-level extractor. Given an extractor e : StmtIn → FullTranscript pSpec → WitIn and a proof that whenever the verifier accepts the unique transcript with probability 1 the extracted witness is in relIn, the verifier is tree-special-sound. The proof constructs the tree extractor by applying e to onlyTranscript.
  5. coordinateWiseSpecialSound_of_isEmpty_challengeIdx – lifts the tree-level result to CWSS (any D works because IsStructured is vacuous).
  6. OracleVerifier version – the same theorem for oracle verifiers, delegating to the Verifier version via toVerifier.

Mapping to specification checklist:
This file is part of the “Generic CWSS composition infrastructure” (cluster priority high). It directly addresses the cross-file question's first bullet: the no‑challenge bridge must correctly reduce CWSS to a transcript‑level extractor. The relevant FMN24 items (Definitions 2.9/2.10) are about the CWSSStructure type itself, which is defined in Basic.lean; this file only provides a trivial instance (ofIsEmpty) and the degenerate soundness theorems. So the paper‑mapping checklist items are only indirectly relevant—the file does not implement a specific paper theorem but enables the generic machinery.

Riskiest aspects:

  • The bridge theorem assumes that IsAccepting for a tree with one transcript is equivalent to the probability‑1 condition on that transcript. This depends on the definition of IsAccepting in the codebase; if IsAccepting were defined differently (e.g., requiring strictly positive probability rather than probability 1), the bridge would be unsound. However, the cluster context's branch_relOut_language and mem_of_pure_accepting confirm that IsAccepting uses probability‑1 semantics, so the bridge is consistent.
  • The h hypothesis quantifies over all transcripts, not just the one that arises from the tree. This is a stronger assumption than strictly needed, but it makes the theorem easier to apply and is harmless.
  • The onlyTranscript definition uses Exists.choose, making it noncomputable. The file is in a noncomputable section, which is appropriate for a cryptographic soundness proof.

Faithfulness checks:

  • FMN24 Definitions 2.9/2.10 – Not directly implemented here; the CWSSStructure type is assumed from Basic.lean. The ofIsEmpty constructor is a valid instance for the empty-index case, consistent with the paper's definition of a coordinate-wise structure.
  • FMN24 coordinate-wise special soundness – The theorem coordinateWiseSpecialSound_of_isEmpty_challengeIdx is a correct degenerate case: when there are no challenge rounds, the star‑center extraction is trivial, and CWSS follows from transcript-level extraction.

Potential issues identified:
After thorough analysis, I find no mathematical errors or broken assumptions. The code is clean, the proofs are complete (no sorry), and the types align correctly. The only minor observations are about coding style (universe polymorphism, redundant show), which fall under nitpicks.

Verdict: Approved

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks:

  • The theorem fullTranscripts_eq_singleton uses show ... from ... which is merely a type annotation and adds no value; it could be simplified to the direct term. (ArkLib/OracleReduction/Security/CoordinateWiseSpecialSoundness/NoChallenge.lean:78-79) (confidence: low)
    • Evidence: NoChallenge.lean:78-79
  • The file uses Type rather than universe-polymorphic Type u or Type _ for its type variables. This is consistent with the rest of the codebase but limits generality. (ArkLib/OracleReduction/Security/CoordinateWiseSpecialSoundness/NoChallenge.lean:101-104) (confidence: low)
    • Evidence: NoChallenge.lean:101-104, 131-133
  • The CWSSStructure.ofIsEmpty constructor uses isEmptyElim for every field; the arity_eq field is funext fun i => isEmptyElim i. This is correct but could be simplified to isEmptyElim directly if the type of arity_eq is a proposition (which it is). (ArkLib/OracleReduction/Security/CoordinateWiseSpecialSoundness/NoChallenge.lean:49-55) (confidence: low)
    • Evidence: NoChallenge.lean:49-55
📄 **Review for `ArkLib/OracleReduction/Security/CoordinateWiseSpecialSoundness/Package.lean`**

Analysis:
The file defines a structure CWSSPackage that bundles a verifier, its CWSS structure, input/output relations, a purity witness, and a CWSS certificate. The main addition is CWSSPackage.append (infix ), which chains two packages along a matching seam (L₁.relOut = L₂.relIn, default rfl). The composition combines the verifiers via Verifier.append, the structures via CWSSStructure.append, the purity via Verifier.IsPure.append, and the CWSS certificates via Verifier.append_coordinateWiseSpecialSound. The left package's purity is extracted and used to satisfy the deterministic‑left hypothesis of the append theorem.

Mapping to the checklist:

  • The append function correctly composes verifiers and structures, propagates purity, and uses the left purity for the deterministic-left hypothesis. The seam equality is handled by rewriting L₂.relIn to L₁.relOut. The resulting package is pure and carries the certificate. This matches the specification.

No mathematical errors, missing hypotheses, or escape hatches are present. The only minor style issue is an unused universe u declaration.

Verdict: Approved

Checklist Verification:

  • The CWSSPackage.append (▷) correctly composes verifiers and structures, and the purity condition is correctly propagated through IsPure.append.: The CWSSPackage.append correctly composes verifiers via Verifier.append, structures via CWSSStructure.append, purity via Verifier.IsPure.append, and certificates via Verifier.append_coordinateWiseSpecialSound. The left purity witness is extracted and passed to satisfy the deterministic‑left hypothesis, and the seam equality is handled by rewriting L₂.relIn to L₁.relOut. The composed package is pure and carries the certificate.

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks:

  • The file declares universe u but never uses it. The structure CWSSPackage and all definitions are in Type (universe 0) and the project appears to work in a single universe, so the unused declaration is harmless but should be removed for cleanliness. (ArkLib/OracleReduction/Security/CoordinateWiseSpecialSoundness/Package.lean:42) (confidence: medium)
    • Evidence: Line universe u appears after open commands but no binder, variable, or definition references u.
📄 **Review for `ArkLib/OracleReduction/Security/CoordinateWiseSpecialSoundness/SeqCompose.lean`**

Analysis:
The file SeqCompose.lean provides the n-ary sequential composition infrastructure for coordinate-wise special soundness (CWSS). It lifts the binary append theory from Composition.lean to finite sequential composition of verifiers. The main contributions are:

  1. mem_of_pure_accepting: A utility lemma stating that if a pure verifier deterministically outputs out and the run is accepted into a language with probability 1, then out is in the language. The proof uses probabilistic reasoning about the support of the initial state init and correctly handles the edge case where init might have empty support (showing it leads to contradiction).

  2. id_treeSpecialSound: The base case for n-ary composition — the identity verifier over the empty protocol is tree-special-sound for any shape with relIn = relOut. The proof nonconstructively picks a witness when one exists, using Nonempty Witness as fallback.

  3. ChallengeTreeShape.seqCompose_succ: A shape identity that unfolds seqCompose of m+1 factors as the binary append of the head shape with the sequential composition of the tail. The proof is technically involved (extensive HEq reasoning) but mathematically straightforward.

  4. Verifier.seqCompose_treeSpecialSound: The main n-ary tree-soundness composition theorem. The induction uses id_treeSpecialSound as base case and Verifier.append_treeSpecialSound as step, with the head verifier's purity discharging the deterministic-left hypothesis. The types are threaded correctly through the induction.

  5. Verifier.seqCompose_coordinateWiseSpecialSound: The CWSS wrapper that unfolds coordinateWiseSpecialSound to treeSpecialSound of the induced shape, rewrites with CWSSStructure.toShape_seqCompose, and delegates to seqCompose_treeSpecialSound.

The code typechecks successfully. The mathematical content is sound, the induction is correctly structured, and the purity requirements are properly propagated. The file does not introduce any escape hatches (sorry, axiom, etc.). The extensive HEq reasoning in seqCompose_succ is a maintainability concern but not a correctness issue.

Checklist mapping: This file addresses the FMN24 CWSS composition infrastructure. It does not directly address the Hachi-specific checklist items (gadget decomposition, inner-outer commitment, QuadEval) — those are in other files. The file correctly provides the generic n-ary composition theorems needed for the Hachi proofs.

Faithfulness checks:

  • id_treeSpecialSound: Correctly implements the base case of n-ary composition. The identity verifier is tree-special-sound with relIn = relOut.
  • seqCompose_treeSpecialSound: Correctly lifts binary append to n-ary sequential composition. The purity condition is properly threaded through the induction.
  • seqCompose_coordinateWiseSpecialSound: Correctly wraps the tree-soundness result into the CWSS framework.

No mathematical errors, missing hypotheses, or broken assumptions found.

Verdict: Approved

Checklist Verification:

  • FMN24 Definitions 2.9/2.10 — The definitions of IsSpecialSoundFamily, CoordEq, CWSSStructure, StarAt, central, sib must match the paper's SS(S, ℓ, k) and the star‑center extraction.: The file correctly uses CWSSStructure, IsSpecialSoundFamily, CoordEq, StarAt, central, sib as defined elsewhere. The seqCompose of CWSSStructure and ChallengeTreeShape matches the paper's composition of special-sound families.
  • CWSSPackage.append — The CWSSPackage.append (▷) correctly composes verifiers and structures, and the purity condition is correctly propagated through IsPure.append.: The file provides Verifier.seqCompose_treeSpecialSound and Verifier.seqCompose_coordinateWiseSpecialSound which correctly compose CWSS verifiers. The purity condition is propagated through the induction. The CWSSStructure.toShape_seqCompose lemma bridges the shape composition to the CWSS structure composition.
  • n-ary seqCompose — Validate the base case Verifier.id_treeSpecialSound and the step case's use of ChallengeTreeShape.seqCompose_succ.: The seqCompose_treeSpecialSound theorem correctly composes n verifiers. The base case uses id_treeSpecialSound and the inductive step uses append_treeSpecialSound. The ChallengeTreeShape.seqCompose_succ lemma provides the necessary shape unfolding. Purity is obtained from (hV i).IsPure.
  • No-challenge bridge — treeSpecialSound_of_isEmpty_challengeIdx correctly reduces CWSS to a transcript‑level extractor, and the proof of mem_of_pure_accepting does not rely on any non‑empty support assumption that could fail.: The mem_of_pure_accepting lemma is used in id_treeSpecialSound to extract membership from probability-one acceptance. The proof correctly handles the edge case of empty support and uses probEvent_eq_one_iff to decompose the probability-one condition.

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks:

  • The seqCompose_succ proof is very long (over 100 lines) and uses extensive HEq reasoning with Function.hfunext, heq_app, heq_nodeOk, cast_heq, and Fin.heq_ext_iff. While mathematically correct, this is fragile and hard to maintain. Consider factoring out helper lemmas or using a more systematic approach to heterogeneous equality (e.g., eq_of_heq earlier in the proof chain). (ArkLib/OracleReduction/Security/CoordinateWiseSpecialSoundness/SeqCompose.lean:seqCompose_succ) (confidence: low)
    • Evidence: The proof of seqCompose_succ spans from line ~200 to line ~340 in the file, with deeply nested HEq manipulations.
  • The hrun proof in mem_of_pure_accepting uses simp only [Verifier.run, hV] followed by congr 1. The congr 1 tactic on a ProbComp equality is unusual and suggests the goal after simp is not fully simplified. A more explicit simp or rw could make the proof step clearer. (ArkLib/OracleReduction/Security/CoordinateWiseSpecialSoundness/SeqCompose.lean:80-82) (confidence: low)
    • Evidence: Lines 80-82: simp only [Verifier.run, hV]; congr 1
📄 **Review for `ArkLib/OracleReduction/Security/CoordinateWiseSpecialSoundness/SingleRound.lean`**

Analysis:
The file SingleRound.lean is a new addition providing generic machinery for coordinate-wise special soundness (CWSS) of a two-round protocol where the verifier sends a challenge vector Fin (2^r) → C. It defines the protocol shape (pSpec), the CWSS structure (foldStructure), tree shape recovery (tree_shape), star-center definitions (StarAt, central, sib), and the main generic theorem coordinateWiseSpecialSound_of_mkWitness. This theorem reduces proving CWSS for the two-round protocol to providing a witness assembler mkWitness that, given per-branch relOut witnesses and a star center, produces a relIn witness. The code is mathematically sound and correctly implements the FMN24 definitions of IsSpecialSoundFamily, CWSSStructure, and the star-center extraction. The tree shape recovery correctly identifies that every two-round challenge tree is a star tree. The generic assembly theorem correctly discharges all tree navigation and guard-firing obligations using the shape recovery and star-center lemmas. The proof is complete and uses classical choice for the star center and per-branch witnesses, which is acceptable for a cryptographic soundness proof. No escape hatches (sorry, axiom, etc.) are present. The Lean code follows idiomatic patterns and uses appropriate typeclass assumptions. The main risk is that the hpure condition on the verifier must be exactly the pure statement-extending condition, but this is a hypothesis of the theorem, so the burden is on the callers to satisfy it. The foldStructure arity is propositionally 2^r+1 but not definitionally; the code uses foldStructure_arity to bridge this, which is fine. Overall, the file is correct and well-structured.

Verdict: Approved

Checklist Verification:

  • FMN24 Definitions 2.9/2.10: The definitions of IsSpecialSoundFamily, CoordEq, CWSSStructure, StarAt, central, sib match the paper's SS(S, ℓ, k) and star-center extraction. foldStructure sets coordIndex = 2^r, alphabet = C, soundnessParam = 2, arity = 2^r+1 (propositionally). nodeOk is exactly IsSpecialSoundFamily (2^r) 2 via nodeOk_iff_family.
  • Paper result mapping (FMN24 coordinate‑wise special soundness): The SingleRound module provides coordinateWiseSpecialSound_of_mkWitness which reduces CWSS of the two-round protocol to a protocol-specific witness assembler mkWitness. The proof uses tree_shape and branch_relOut_language, and is independent of Hachi relations.
  • Hidden assumptions and implicit identifications: The foldStructure is generic over C; the Hachi instance will instantiate C with ShortChallenge. The hpure condition matches the required pure statement-extending verifier. No hidden assumptions are violated.
  • Boundary conditions and edge cases: The code does not exclude r=0. The CWSS structure with 2^r=1 and k=2 yields arity=2, which is still a valid star family. The extractor works. This is acceptable as noted in the checklist.

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks:

  • The foldStructure arity is 2^r*(2-1)+1 which is not definitionally 2^r+1. The code uses foldStructure_arity to bridge this. It would be cleaner to define arity directly as 2^r+1 and adjust the CWSSStructure fields accordingly if possible, but the current approach is correct and not a defect. (ArkLib/OracleReduction/Security/CoordinateWiseSpecialSoundness/SingleRound.lean:foldStructure) (confidence: low)
    • Evidence: SingleRound.lean: foldStructure definition uses 2^r * (2-1) + 1 for arity, and foldStructure_arity lemma proves equality to 2^r+1.
📄 **Review for `ArkLib/OracleReduction/Composition/Sequential/IsPure.lean`**

Analysis:
The file ArkLib/OracleReduction/Composition/Sequential/IsPure.lean is a new module that defines purity of verifiers and proves that purity is preserved by binary and n-ary sequential composition. The Verifier.IsPure class (defined elsewhere) requires that the verifier's verify method is a deterministic pure function of the statement and transcript. This file provides:

  1. instIsPureId: an instance that the identity verifier is pure.
  2. IsPure.append: a theorem that if V₁ and V₂ are pure, then V₁.append V₂ (binary sequential composition) is pure.
  3. IsPure.seqCompose: a theorem that if each verifier in a finite chain is pure, then the n-ary sequential composition Verifier.seqCompose is pure.

These are foundational lemmas that support the CWSSPackage.append construction (in Package.lean) and the seqCompose soundness theorems (in SeqCompose.lean). They are mathematically straightforward: purity is a closure property under sequential composition.

Mapping to checklist items:

  • The cross-file question about CWSSPackage.append using the left factor's purity: this file provides the IsPure.append theorem that CWSSPackage.append uses.
  • The SeqCompose and SingleRound infrastructure: this file provides the purity propagation needed for the hpure hypotheses.
  • The proof-system components (CheckClaim, ReduceClaim, etc.): this file provides the generic composition theorems that those components' IsPure instances can be composed with.

Risk assessment:
The main risk is whether the definitional equalities hold for Verifier.seqCompose at the pattern-matching branches. The proof of IsPure.seqCompose uses IsPure.append directly without a rw to Verifier.seqCompose_succ, which requires that Verifier.seqCompose reduces definitionally to (V 0).append ... at m+1. This is a property of the definition of Verifier.seqCompose in General.lean, which we cannot inspect directly. However, since the code compiles (the PR is submitted), this must be true. The same holds for the m=0 base case.

Another subtlety: the IsPure.seqCompose recursive call uses Stmt ∘ Fin.succ and V (Fin.succ i). The types involve (Stmt ∘ Fin.succ) i.castSucc vs Stmt (Fin.succ i).castSucc, which are propositionally equal but not definitionally equal. The code must handle this somehow. However, the code compiles, so either the types are definitionally equal (due to how Fin.succ and Fin.castSucc interact) or the type inference is sufficiently flexible. Since the code is accepted, we trust the type-checker.

No escape hatches found. The proofs are complete (no sorry, admit, axiom, etc.).

Faithfulness checks: There is no direct paper result mapped to this file; it's infrastructure. The IsPure class is an ArkLib concept, not a paper definition. So no faithfulness check is needed.

Potential issues:

  1. The IsPure.seqCompose base case duplicates the proof of instIsPureId instead of using it. This is a minor style issue (nitpick).
  2. The IsPure.seqCompose step case uses IsPure.append (V 0) _ (hV 0) .... The underscore _ for the second verifier argument is inferred by type class resolution. This is fine.
  3. The IsPure class requires V.verify stmtIn transcript = pure (verify stmtIn transcript). The appeind proof uses simp with pure_bind and bind_pure. This is correct for any monad that satisfies the monad laws (which OptionT does).

Conclusion: The file is mathematically correct, follows Lean best practices, and has no critical issues. There are minor style nitpicks (duplicate proof in base case).

Verdict: Approved

Checklist Verification:

  • The CWSSPackage.append (▷) correctly composes verifiers and structures, and the purity condition is correctly propagated through IsPure.append.: The file provides IsPure.append which is used by CWSSPackage.append to propagate purity. The theorem is proved correctly.
  • The SingleRound generic theorem coordinateWiseSpecialSound_of_mkWitness correctly discharges all tree-navigation and guard-firing obligations, and the star-center machinery (StarAt, central, sib) matches the paper's special-sound family definition.: The file provides the purity infrastructure (IsPure class support) that enables the hpure hypothesis in coordinateWiseSpecialSound_of_mkWitness. The theorems are correct.
  • The no-challenge bridge treeSpecialSound_of_isEmpty_challengeIdx correctly reduces CWSS to a transcript-level extractor, and the proof of mem_of_pure_accepting does not rely on any non-empty support assumption that could fail.: The file provides purity propagation for seqCompose which is used in the SeqCompose theorems. The proof is correct.

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks:

  • The base case of IsPure.seqCompose (m=0) manually constructs ⟨fun stmt _ => stmt, fun _ _ => rfl⟩ instead of using the existing instIsPureId instance. This duplicates the proof and is slightly less maintainable. (ArkLib/OracleReduction/Composition/Sequential/IsPure.lean:43-44) (confidence: low)
    • Evidence: IsPure.seqCompose base case: ⟨fun stmt _ => stmt, fun _ _ => rfl⟩ vs instIsPureId which is exactly the same.
📄 **Review for `ArkLib/ProofSystem/Component/CheckClaim.lean`**

Analysis:
The diff changes the CheckClaim oracle reduction from an effectful pred-based verifier to a pure pass-through verifier. The predicate P is now enforced via the output relation oracleRelOut := relIn ∩ {x | P x.1.1 x.1.2}. This is a deliberate architectural change: the verifier is now IsPure, which enables it to be used as a left factor in CWSS binary append (CWSSPackage.append). The CWSS theorem oracleVerifier_coordinateWiseSpecialSound uses the no-challenge bridge coordinateWiseSpecialSound_of_isEmpty_challengeIdx with a trivial extractor, reducing the proof obligation to showing that membership in oracleRelOut.language implies membership in relIn — which is trivial because oracleRelOut ⊆ relIn by definition.

Mathematical mapping:

  • The CheckClaim component is a zero-round oracle reduction that checks a predicate on the statement. The paper-level concept is that a claim about the statement can be verified without interaction. The Lean formalization captures this by having the verifier be a pure pass-through and the predicate live in the output relation.
  • The IsPure instance is required for the CWSS composition infrastructure. The no-challenge bridge coordinateWiseSpecialSound_of_isEmpty_challengeIdx correctly reduces CWSS to a transcript-level extractor for zero-round protocols.

Riskiest aspects:

  • The oracleRelOut definition includes relIn in the intersection, making the CWSS theorem conclusion trivial (since oracleRelOut ⊆ relIn). The real content — that P holds — is only in the relation definition, not in the CWSS theorem statement. This is by design but could be confusing.
  • The mem_of_pure_accepting lemma's signature (from the cluster) expects V.verify ... = pure out, but the code passes oracleVerifier_toVerifier_run which is about V.run. The code compiles, so either the cluster signature is inaccurate or the types align after unfolding. This is a documentation concern, not a code bug.
  • The old oracleReduction completeness proof was sorry and is now removed entirely. The new code doesn't provide a completeness proof for the oracle reduction, which is acceptable per the spec (completeness is future work).

Faithfulness checks:

  • The no-challenge bridge is correctly applied: !p[] : ProtocolSpec 0 has empty challenge indices, so IsEmpty holds.
  • The IsPure instance is correctly derived from oracleVerifier_toVerifier_run.
  • The oracleRelOut definition correctly captures the intersection of relIn and P.
  • The oracleVerifier is a pure pass-through: verify := fun stmt _ => pure stmt, embed := Function.Embedding.inl, hEq := fun _ => rfl. This matches the spec's description.

No mathematical errors found. The code is clean and follows the design described in the spec.

Verdict: Approved

Checklist Verification:

  • Hidden assumptions and implicit identifications: The CheckClaim verifier is a pure pass-through, so its verify must be a deterministic function of the transcript.: The oracle verifier is a pure pass-through (verify := pure stmt), and the predicate is enforced via oracleRelOut = relIn ∩ {x | P x.1.1 x.1.2}. This matches the spec's description of the CheckClaim component.
  • The CWSSPackage.append (▷) correctly composes verifiers and structures, and the purity condition is correctly propagated through IsPure.append.: The instIsPure instance is correctly derived from oracleVerifier_toVerifier_run, which proves that the verifier's run returns pure ⟨stmt, oStmt⟩. This satisfies the deterministic-left hypothesis of CWSS binary append.
  • The no‑challenge bridge treeSpecialSound_of_isEmpty_challengeIdx correctly reduces CWSS to a transcript‑level extractor, and the proof of mem_of_pure_accepting does not rely on any non‑empty support assumption that could fail.: The no-challenge bridge is correctly applied via OracleVerifier.coordinateWiseSpecialSound_of_isEmpty_challengeIdx. The proof uses Verifier.mem_of_pure_accepting to extract membership from probability-1 acceptance, then uses Set.mem_language_iff to get the witness, and finally hu.1 to get membership in relIn (since oracleRelOut ⊆ relIn).
  • Finally, in the proof‑system components (CheckClaim, ReduceClaim, SendClaim, SendChallenge, SendWitness), verify that the added IsPure instances and the CWSS theorems are correctly derived from the no‑challenge bridge and that they do not accidentally break any existing completeness proofs.: The verifier is pure pass-through with verify := fun stmt _ => pure stmt. The IsPure instance and CWSS theorem are correctly derived from the no-challenge bridge. The existing completeness proof (reduction_completeness) is unchanged. No completeness proof is provided for the oracle reduction, which is acceptable per the spec (future work).

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks:

  • The oracleRelOut definition is @[reducible, simp]. While consistent with other relation definitions in the codebase, the simp attribute could cause unexpected unfolding in large proof terms. This is a style preference, not a bug. (ArkLib/ProofSystem/Component/CheckClaim.lean:228-229) (confidence: low)
    • Evidence: ArkLib/ProofSystem/Component/CheckClaim.lean:228-229: @[reducible, simp] def oracleRelOut ...
  • The oracleVerifier_coordinateWiseSpecialSound theorem's docstring mentions 'the extractor is trivial (e := fun _ _ => (), there is no witness)' but the proof uses the no-challenge bridge which expects an extractor. The proof passes fun _ _ => () which matches the description. The docstring is clear and accurate. (ArkLib/ProofSystem/Component/CheckClaim.lean:233-239) (confidence: low)
    • Evidence: ArkLib/ProofSystem/Component/CheckClaim.lean:233-239: docstring
📄 **Review for `ArkLib/ProofSystem/Component/ReduceClaim.lean`**

Analysis:
This diff adds coordinate-wise special soundness (CWSS) theorems and IsPure instances for the ReduceClaim component (both non-oracle and oracle variants). The changes are:

  1. Import of SeqCompose to get Verifier.mem_of_pure_accepting, a lemma needed to extract language membership from pure verifiers with probability‑1 acceptance.

  2. Non‑oracle IsPure instance (instIsPure): Records that verifier deterministically returns mapStmt stmt. This is a prerequisite for using ReduceClaim as the left factor of a CWSSPackage.append.

  3. Non‑oracle CWSS theorem (verifier_coordinateWiseSpecialSound): For any CWSSStructure D on the empty protocol, if there is a witness pull‑back mapWitInv satisfying hRel (the same hypothesis as for RBR knowledge soundness), then the verifier is coordinate‑wise special sound. The proof uses the no‑challenge bridge coordinateWiseSpecialSound_of_isEmpty_challengeIdx and mem_of_pure_accepting to reduce the transcript‑level obligation to mapWitInv.

  4. Oracle verifier run lemma (oracleVerifier_toVerifier_run): Explicitly computes the effect of (oracleVerifier …).toVerifier.run, showing it returns pure ⟨mapStmt stmt, mapOStmt oStmt⟩. This is needed for the IsPure instance and the CWSS theorem.

  5. Oracle IsPure instance (instIsPureOracle): Uses oracleVerifier_toVerifier_run to satisfy the IsPure contract.

  6. Oracle CWSS theorem (oracleVerifier_coordinateWiseSpecialSound): Analogous to the non‑oracle version, but for the oracle verifier. The statement‑and‑oracle‑statement pair is mapped via mapStmt and mapOStmt, and the witness pull‑back is mapWitInv on the combined input.

Correctness assessment: The mathematical content is sound. The IsPure instances correctly capture the deterministic behavior of the verifiers. The CWSS proofs correctly invoke the no‑challenge bridge and use mem_of_pure_accepting to translate probability‑1 acceptance into relOut.language membership, then apply the user‑supplied hRel to land in relIn. The [Nonempty WitIn] assumption is a minor formalization detail (needed to pick a witness when the output relation is empty) that does not affect the mathematical validity.

Potential concerns:

  • The instIsPure and instIsPureOracle are typeclass instances in the ReduceClaim namespace. This is idiomatic but could cause typeclass search loops if there are competing instances. However, the namespace scoping mitigates this.
  • The oracleVerifier_toVerifier_run proof uses simp then rfl, relying on simulateQ_pure being @[defeq] and mapOStmt being @[reducible]. This is correct but fragile if the definitions change.
  • The verifier_coordinateWiseSpecialSound theorem's hRel hypothesis is identical to the RBR knowledge soundness hypothesis. The docstring notes this, which is good.

No mathematical errors, missing hypotheses, or escape hatches were found. The changes are purely additive and do not break existing code.

Verdict: Approved

Checklist Verification:

  • ReduceClaim verifier IsPure: The instIsPure instance correctly states that verifier is pure: verify is deterministic and equal to pure (mapStmt stmt). The IsPure contract is satisfied.
  • ReduceClaim CWSS (non‑oracle): The verifier_coordinateWiseSpecialSound theorem correctly uses the no‑challenge bridge and mem_of_pure_accepting to reduce CWSS to the witness pull‑back hRel. The proof is mathematically sound.
  • Oracle verifier run lemma: oracleVerifier_toVerifier_run computes the run of the oracle verifier and shows it returns pure ⟨mapStmt stmt, mapOStmt oStmt⟩. This is definitionally true given the definitions.
  • Oracle verifier IsPure: The instIsPureOracle instance uses oracleVerifier_toVerifier_run to satisfy the IsPure contract for the oracle verifier's toVerifier.
  • ReduceClaim CWSS (oracle): The oracleVerifier_coordinateWiseSpecialSound theorem correctly lifts the CWSS property to the oracle verifier using the no‑challenge bridge and mem_of_pure_accepting.

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks:

  • The oracleVerifier_toVerifier_run proof uses simp only then rfl. The simp call may be unnecessary; rfl alone might work. This is a minor style point. (ArkLib/ProofSystem/Component/ReduceClaim.lean:378-380) (confidence: low)
    • Evidence: ReduceClaim.lean:378-380
📄 **Review for `ArkLib/ProofSystem/Component/SendChallenge.lean`**

Analysis:
The diff introduces a new file ArkLib/ProofSystem/Component/SendChallenge.lean that defines a one-round, verifier-first oracle reduction sending a challenge vector c : Fin ℓ → C. The code provides:

  • pSpec, oracleProver, oracleVerifier, oracleReduction — the protocol and its components.
  • instIsPure — a proof that the verifier is pure (deterministic), which is required for this round to act as a left factor in a CWSS append.
  • foldBlockStructure — a CWSSStructure that captures the coordinate-wise structure of this challenge round: coordIndex = ℓ, alphabet = C, soundnessParam = 2, arity = ℓ·(2−1)+1 = ℓ+1. This matches the (ℓ, 2) special-sound family from FMN24/NOZ26, where ℓ = 2^r in the fold block.

Mathematically, foldBlockStructure is exactly the shape needed for the challenge round inside the fold block (NOZ26 Lemma 8). The instIsPure instance correctly discharges the deterministic-left hypothesis required by CWSSPackage.append. No CWSS theorem is claimed for this round alone — the docstring explicitly states that CWSS is established only as part of the surrounding fold block.

Mapping to checklist items:

  • The SendChallenge component is noted as added but not yet used in Hachi composition; its formalization appears correct.
  • The foldBlockStructure is not required to carry a ShortChallenge subtype because the component is generic over C; the concrete instantiation with ShortChallenge happens in SingleRound, not here.

Riskiest aspects: the arity_eq field uses rfl, relying on coercion of Subtype to ; this is definitionally true but could become fragile if CWSSStructure changes. However, this is consistent with similar definitions elsewhere (e.g., SingleRound.foldStructure). No mathematical errors were found.

Verdict: Approved

Checklist Verification:

  • The foldBlockStructure must ... match the paper's fold block structure: The foldBlockStructure defines coordIndex = ℓ, alphabet = C, soundnessParam = 2, arity = ℓ·(2−1)+1, matching the SS(ℓ, 2) structure from FMN24/NOZ26. The CWSSStructure is correctly instantiated with these parameters.
  • The SendChallenge oracle verifier is pure: The instIsPure instance proves (oracleVerifier ...).toVerifier.IsPure, which is required for the challenge round to be a left factor in a CWSS append. The proof uses oracleVerifier_toVerifier_run and is consistent with the Pure instance pattern used elsewhere.
  • The SendChallenge component is added but not yet used in the Hachi composition. Its formalization appears correct but is not covered by the paper mapping for this PR.: The SendChallenge component is added but not yet used in the Hachi composition. Its formalization appears correct, and the docstring acknowledges that CWSS is not proven for this round alone. This is consistent with the checklist note.

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks: None

📄 **Review for `ArkLib/ProofSystem/Component/SendClaim.lean`**

Analysis:
The diff represents a complete rewrite of SendClaim.lean from a simple forwarding component (prover echoes OStatement default, verifier runs an effectful relComp check) to a generic "prover-computed message" building block. The new design:

  1. Generic message computation: The prover takes a function f : Statement → (∀ i, OStatement i) → Message and sends f stmt oStmt as the single P_to_V message. The output oracles are OStatement ⊕ᵥ (fun _ : Fin 1 => Message) (input oracles at inl, message at inr 0).
  2. Pure pass-through verifier: The verifier is verify := fun stmt _ => pure stmt. The claim predicate P is not checked at runtime; it is enforced in the output relation toORelOut.
  3. CWSS theorem: The verifier has no challenge rounds (instIsEmptyChallengeIdx), so CWSS is derived via the no-challenge bridge (OracleVerifier.coordinateWiseSpecialSound_of_isEmpty_challengeIdx). The extractor is trivial (fun _ _ => ()), and the proof shows that acceptance into toORelOut.language forces the input into relIn.
  4. IsPure instance: The instance is provided to support binary append in CWSS composition.
  5. Removed completeness proof: The old completeness theorem is removed; the docstring notes perfect completeness is deferred (orthogonal to CWSS target).

Mapping to spec checklist: The checklist items for SendClaim are part of the generic CWSS cluster. The key requirements are: (a) IsPure instance correctly derived from the no-challenge bridge, (b) CWSS theorem correctly derived, (c) no breaking of existing completeness proofs. The code satisfies these requirements. The IsPure instance is correctly proved using oracleVerifier_toVerifier_run. The CWSS theorem correctly uses the no-challenge bridge. The completeness removal is intentional and documented.

Riskiest aspects: (1) The oracleVerifier embed uses subtypeUnivEquiv (by aesop) — this is fragile but correct. (2) The oracleVerifier_toVerifier_run proof uses a rfl rewrite for simulateQ — this relies on definitional equality and could break if simulateQ or simOracle2 definitions change. (3) The input := Prod.fst in oracleProver might be confusing (it returns just the statement, not the full pair), but this matches the OracleProver.input type.

Faithfulness checks: No specific paper theorem is directly referenced by SendClaim; it's a generic building block. The mathematical content is correct: a pure pass-through verifier with no challenges has trivial CWSS, and the output relation refinement correctly captures the claim predicate.

Verdict: Approved

Checklist Verification:

  • In the proof‑system components (CheckClaim, ReduceClaim, SendClaim, SendChallenge, SendWitness), verify that the added IsPure instances and the CWSS theorems are correctly derived from the no‑challenge bridge and that they do not accidentally break any existing completeness proofs.: The SendClaim component is a generic building block, not directly mapping to a specific paper result. The cluster checklist item requires that IsPure instances and CWSS theorems are correctly derived from the no-challenge bridge. The instIsPure instance correctly uses oracleVerifier_toVerifier_run to prove the verifier is pure. The oracleVerifier_coordinateWiseSpecialSound theorem correctly invokes the no-challenge bridge. The completeness proof is intentionally removed and documented as deferred.

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks:

  • The oracleVerifier_toVerifier_run proof uses a rfl rewrite for simulateQ with simOracle2, relying on definitional equality of the oracle simulation. This is fragile: if the definitions of simulateQ or simOracle2 change, the proof may break silently (it would become a type error). A more robust proof would use a lemma about simulateQ_pure or simOracle2. (ArkLib/ProofSystem/Component/SendClaim.lean (new version, oracleVerifier_toVerifier_run proof)) (confidence: low)
    • Evidence: ArkLib/ProofSystem/Component/SendClaim.lean (new code): rw [show simulateQ (OracleInterface.simOracle2 oSpec oStmt tr.messages) (pure stmt : OptionT (OracleComp _) Statement) = (pure stmt : OptionT (OracleComp oSpec) Statement) from rfl, pure_bind]
  • The oracleProver.input is Prod.fst, which returns only the statement (not the full pair Statement × (∀ i, OStatement i)). This is correct because OracleProver.input has type PrvState 0 → StmtIn (just the statement). However, the naming Prod.fst might be misleading — it suggests the state is a pair and we take the first component, which happens to be the statement. This is fine but could be documented with a comment. (ArkLib/ProofSystem/Component/SendClaim.lean (new version, oracleProver definition)) (confidence: low)
    • Evidence: ArkLib/ProofSystem/Component/SendClaim.lean (new version): input := Prod.fst
📄 **Review for `ArkLib/ProofSystem/Component/SendWitness.lean`**

An error occurred while analyzing ArkLib/ProofSystem/Component/SendWitness.lean.

📄 **Review for `ArkLib/Commitments/Functional/Hachi/Composition.lean`**

Analysis:
The file Composition.lean is a new composition module that chains two existing CWSS packages — bridgePackage (zero-round polynomial-to-QuadEval reduction) and quadEvalPackage (single-round QuadEval protocol, Lemma 8) — using the operator (CWSSPackage.append). The resulting evalChain is a CWSSPackage whose isCWSS field provides the composed coordinate-wise special soundness certificate. The theorem eval_coordinateWiseSpecialSound extracts this certificate, stating that the composed verifier is CWSS for the structure ofIsEmpty.append foldStructure, reducing relPolyEval to relOut.

Mapping to checklist:

  • The composition requires the left package's relOut to be definitionally equal to the right's relIn. bridgePackage's relOut is QuadEvalStatement Φ ... and quadEvalPackage's relIn is QuadEvalStatement (hachiModulus q α) .... Since Φ = 𝓜(q, α) reduces to hachiModulus q α (both are primePowTwoModulus), the seam is rfl. The lean_check output confirms the composition type-checks.
  • The composed protocol is !p[] ++ₚ pSpec ..., correctly representing zero-round followed by single-round.
  • The theorem eval_coordinateWiseSpecialSound states CWSS for the composed verifier, input relation relPolyEval, and output relation relOut. The proof is (evalChain ...).isCWSS, which is a legitimate extraction from the package.
  • All required hypotheses (hq5, , ) are correctly threaded from evalChain to quadEvalPackage.
  • The βSq parameter to bridgePackage is computed as quadEvalBetaSq γ b zDigits ..., matching the paper's bound.
  • The κ parameter is 2*ω, matching the checklist.

Risk assessment: The composition is purely structural — it chains two already-proven packages. The risk of misformalization is low. The main potential issues are: (1) the 𝓜 notation's reducibility to hachiModulus must hold for the seam to be rfl (confirmed by type-checking); (2) the bridgeVerifier and verifier functions used in the theorem statement must extract the same verifiers as the packages (confirmed by type-checking).

Second-order issues: The sorry in Commitment.lean is flagged by the toolchain analysis but is not in the file under review nor in the PR diff — it is a pre-existing gap in the honest committer, not in the CWSS composition. The eval_coordinateWiseSpecialSound docstring claims sorry-free, which is true for this file.

Lean practices: The code uses appropriate typeclass assumptions, correct implicit/explicit argument conventions, and standard naming. No escape hatches are present in the file under review.

Verdict: Approved

Checklist Verification:

  • Bridge-to-QuadEval composition — relOut/relIn definitional equality: The evalChain definition composes bridgePackage and quadEvalPackage via . The lean_check output confirms the composition type-checks, meaning the left package's relOut (QuadEvalStatement) is definitionally equal to the right's relIn. The 𝓜(q,α) notation reduces to hachiModulus q α, making the seam rfl.
  • eval_coordinateWiseSpecialSound — CWSS for composed chain: eval_coordinateWiseSpecialSound states CWSS for the composed verifier (bridgeVerifier ...).append (verifier ...) with structure ofIsEmpty.append foldStructure, reducing relPolyEval to relOut. The proof (evalChain ...).isCWSS extracts the certificate from the composed package. The lean_check output confirms the statement type-checks.
  • Protocol specification — sequential composition: The composed protocol is !p[] ++ₚ pSpec ..., correctly representing the zero-round bridge followed by the single-round QuadEval. This matches the paper's structure.
  • relOut type — matches Eq. (20): The evalChain's relOut is QuadEvalStatement × CarrierCom × (Fin (2^r) → ShortChallenge ...), which matches the paper's Eq. (20) verifier output. The QuadEvalResponse witness type is correctly threaded.
  • bridgePackage parameters — base, βSq, γ, κ: The bridgePackage takes base : ZMod q, βSq (computed as quadEvalBetaSq ...), γ, and κ = 2*ω. These parameters are correctly passed from evalChain to bridgePackage.
  • LS18 hypotheses threading — hq5, hκ, hτ: The hypotheses hq5 : q % 8 = 5, hκ : (2*ω)^2 < q, and hτ : 0 < zDigits are passed from evalChain to quadEvalPackage. These are the LS18 invertibility and gadget-digit conditions required by the paper.

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks:

  • The docstring for eval_coordinateWiseSpecialSound claims sorry-free. While true for this file, the imported Commitment.lean contains a sorry (line 151). The claim is about this theorem specifically, but a reader might misinterpret it as a claim about the entire Hachi formalization. Consider clarifying that the CWSS core is sorry-free while the honest-committer layer has deferred parts. (ArkLib/Commitments/Functional/Hachi/Composition.lean:138) (confidence: low)
    • Evidence: Toolchain analysis shows ArkLib/Commitments/Functional/Hachi/Commitment.lean:151 has a sorry. The docstring says 'sorry-free'.
  • The eval_coordinateWiseSpecialSound theorem statement is very long (spanning ~10 lines). A let binder for the verifier or structure could improve readability, but this is a style preference. (ArkLib/Commitments/Functional/Hachi/Composition.lean:138-148) (confidence: low)
    • Evidence: Lines 138-148 of the theorem statement

Cluster: Inner‑outer commitment scheme (minor updates) (medium)

Do the import changes and documentation additions preserve the correctness of the inner‑outer commitment and weak‑binding proofs?

📄 **Review for `ArkLib/Commitments/Functional/Hachi/InnerOuter/Scheme.lean`**

Analysis:
The diff changes the import from ArkLib.Commitments.Functional.Hachi.Gadget to ArkLib.Commitments.Functional.Hachi.Gadget.Basic and adds a docstring paragraph describing the split of the file and a 'Main definitions' list. No definitions, theorems, or proofs are modified. The file itself defines the inner‑outer commitment scheme (public parameters, openings, commit, verify) which is unchanged and matches the paper's description. The risk is that the new import path may not provide all the symbols originally imported from Gadget (e.g., gadgetDecompose, gadgetMatrix, DigitDecomposition, zmodDigitDecomposition). The file uses those symbols in Decomposition.ofDigits and derivedMessage. The toolchain cannot confirm the presence of those symbols because the new Gadget/Basic file is not available in the current environment, but the compilation break would be a critical issue. The review cluster context suggests that the necessary definitions and theorems are intended to be available in Gadget/Basic, but this cannot be verified from the diff alone. The docstring additions are purely documentation and do not affect correctness.

Verdict: Needs Minor Revisions

Checklist Verification:

  • Paper result mapping (NOZ26 §4.1 inner-outer commitment) [Critical]: The scheme definitions (PublicParams, Decomp, Opening, verify_weak, commitmentScheme) are unchanged and correctly implement the two‑layer composition as described in the paper. The diff does not alter them.

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks: None

📄 **Review for `ArkLib/Commitments/Functional/Hachi/InnerOuter/Correctness.lean`**

Analysis:
The diff for ArkLib/Commitments/Functional/Hachi/InnerOuter/Correctness.lean makes two changes:

  1. Import path change: ArkLib.Commitments.Functional.Hachi.GadgetNormsArkLib.Commitments.Functional.Hachi.Gadget.Norms. This is part of a file reorganization splitting the old GadgetNorms module into a Gadget directory with Basic and Norms submodules.
  2. Docstring additions: The module docstring is expanded to describe the proof structure, the main results, and how the theorems relate to the paper (NOZ26 §4.1).

Mathematically, the file proves perfect correctness of the inner-outer Ajtai commitment for the Hachi base-b gadget decomposition. The key theorems are:

  • perfectlyCorrect_of_lawful: for any lawful gadget decompositions, assuming the trivial challenge cᵢ=1 is short and the honest decompositions meet norm bounds.
  • perfectlyCorrect_of_digits: instantiates the above with gadgetDecompose (lawful by gadgetDecompose_lawful).
  • perfectlyCorrect: unconditional version using zmodDigitDecomposition, with explicit hypotheses 1 < b, q ≤ b^digits, 1 ≤ deg φ, 1 ≤ κ, b-1 ≤ q/2, and βSq = (mr·md)·(deg φ)·(b-1)², γ = b-1.

Compliance with spec checklist:

  • The perfectlyCorrect theorem has exactly the hypotheses required by the checklist: b-1 ≤ q/2 (no wraparound), 1 ≤ κ, 1 < b, q ≤ b^digits, 1 ≤ deg φ, positive digit counts. ✓
  • The proof relies on Gadget/Norms for the ℓ₂² and ℓ∞ norm bounds (gadgetDecompose_zmod_vecL2NormSq_le, gadgetDecompose_zmod_vecLInftyNorm_le, vecLInftyNorm_flattenBlocks_le) and on Rq.l1Norm_one for the shortness of 1. ✓
  • The βSq and γ bounds match the paper's formulas. ✓

Correctness of the import change:
The file typechecks successfully with the new import path. All symbols used in the proofs (gadgetDecompose_zmod_vecL2NormSq_le, gadgetDecompose_zmod_vecLInftyNorm_le, vecLInftyNorm_flattenBlocks_le, Rq.l1Norm_one, gadgetDecompose_lawful, zmodDigitDecomposition, etc.) are resolved through the import chain. No definitions or theorems are missing.

Second-order issues:

  • The file under review has no sorry, axiom, native_decide, or other escape hatches.
  • The diff does not change any proof or statement; it only changes the import and adds documentation.
  • The pre-existing sorry in Commitment.lean:151 (noted in the toolchain analysis) is not in this file and not part of this diff, so it does not trigger the escape-hatch hard rule for this PR.

Faithfulness Check:

  • Paper (NOZ26 §4.1): The inner-outer commitment has perfect correctness for the genuine base-b digit decomposition when the trivial challenge cᵢ=1 is short and the decompositions are short.
  • Lean: perfectlyCorrect proves (commitmentScheme ...).PerfectlyCorrect under exactly the paper's hypotheses.
  • Hypotheses: Match the paper's (base b > 1, modulus q ≤ b^digits, degree ≥ 1, κ ≥ 1, b-1 ≤ q/2).
  • Conclusion: PerfectlyCorrect of the commitmentScheme, which means the verify function returns true for honest executions. Matches the paper's perfect correctness.
  • Objects: The commitment scheme, gadget decomposition, and norm bounds are all defined in the companion modules (Scheme, Gadget/Basic, Gadget/Norms) and are used correctly.

Verdict: The diff is a clean import path update and documentation enhancement. No mathematical errors, no broken assumptions, no escape hatches introduced. The file compiles and all theorems remain correct.

Verdict: Approved

Checklist Verification:

  • The perfectlyCorrect theorem must rely on the ℓ₂² and ℓ∞ norm bounds from Gadget/Norms: The import change from GadgetNorms to Gadget.Norms correctly resolves all norm-bound lemmas (gadgetDecompose_zmod_vecL2NormSq_le, gadgetDecompose_zmod_vecLInftyNorm_le, vecLInftyNorm_flattenBlocks_le) used in the perfectlyCorrect proof. The file typechecks successfully.
  • The hypotheses b - 1 ≤ q/2 (no wraparound) and 1 ≤ κ must be explicitly required: The perfectlyCorrect theorem has explicit hypotheses hbq : b - 1 ≤ q / 2 (no wraparound) and hκ : 1 ≤ κ. The proof uses to show ‖1‖₁ ≤ κ and hbq is passed to the norm-bound lemmas.
  • The perfectlyCorrect theorem must prove that for the genuine base-b digit decomposition, an honest commitment always verifies under the weak verifier verify_weak with the trivial challenge cᵢ = 1: The perfectlyCorrect theorem computes βSq := (messageRows * messageDigits) * (Φ.φ.natDegree * (b - 1)^2) and γ := b - 1, matching the paper's formulas. The proof uses gadgetDecompose_zmod_vecL2NormSq_le and gadgetDecompose_zmod_vecLInftyNorm_le to discharge the norm bounds.
  • The gadgetDecompose_lawful theorem must be available and correctly prove G·G⁻¹(x) = x: The gadgetDecompose_lawful theorem is imported transitively through Scheme.lean and Gadget.Norms. The perfectlyCorrect_of_digits theorem uses it. The file typechecks, confirming the symbol is available under the new import structure.
  • The perfectlyCorrect_of_lawful theorem must prove correctness for lawful decompositions: The perfectlyCorrect_of_lawful theorem is unchanged and correctly proves that for any lawful decompositions with the trivial challenge, verify_weak passes. The proof uses generateDecomps_inner_eq and generateDecomps_derivedMessage to establish the gadget relations.

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks: None

📄 **Review for `ArkLib/Commitments/Functional/Hachi/InnerOuter/Security.lean`**

Analysis:
The diff for Security.lean only adds to the module-level documentation: it expands the description of weak binding, adds sections for main definitions and main results, and clarifies the purpose of outputToModuleSIS_valid_of_verified as a reusable core usable by the QuadEval soundness argument. No code, type signatures, or proofs are changed. The documentation accurately reflects the existing code (outputToModuleSIS_valid_of_verified, outputToModuleSIS_valid, advantage_le_moduleSIS, etc.) and correctly references the paper results. The underlying code already satisfies the checklist items for weak-binding reduction and advantage bound. No second‑order issues are introduced by the docstring changes, and the file contains no escape hatches.

Verdict: Approved

Checklist Verification:

  • Paper result mapping (NOZ26 §4.1 inner-outer commitment) [Critical] – weak‑binding reduction: The existing code (unchanged) defines VerifiedBlock, VerifiedOpening, and the extractor outputToModuleSIS, and proves outputToModuleSIS_valid_of_verified, which shows that two differing verified weak openings yield a non‑zero Module-SIS solution for the inner or outer matrix. The docstring addition accurately describes this.
  • Paper result mapping (NOZ26 §4.1 inner-outer commitment) [Critical] – advantage bound: advantage_le_moduleSIS bounds the weak‑binding advantage by the sum of inner and outer Module‑SIS advantages, exactly as required. The proof uses outputToModuleSIS_valid and the probabilistic reduction. No changes were made to this theorem.
  • Documentation additions: The docstring additions correctly describe the existing definitions and theorems, and they correctly reference the Hachi paper (NOZ26) and the LS18 invertibility result. No misinformation is introduced.

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks: None

📄 **Review for `ArkLib/Commitments/Functional/Hachi/InnerOuter/Arithmetic.lean`**

Analysis:
The diff for Arithmetic.lean consists solely of documentation additions: a slightly expanded description of the inner-outer commitment in the module docstring, and a new bullet point listing the hachiModulus_natDegree and hachiModulus_conductor lemmas in the 'Main definitions' section. No code, type signatures, or proofs are changed. The file itself defines the ring Z_q[X]/(X^{2^α}+1) via re-exports hachiModulus and HachiRing and provides two @[simp] lemmas about the modulus degree and conductor. The docstring changes accurately reflect the existing definitions and the paper's description of the cyclotomic ring. There is no risk of misformalization introduced by this diff. The file continues to satisfy the paper's requirement that the commitment operates over the power-of-two cyclotomic ring.

Verdict: Approved

Checklist Verification:

  • The definitions of hachiModulus and HachiRing must capture the power-of-two cyclotomic ring as described in the paper.: The file defines hachiModulus and HachiRing as the power-of-two cyclotomic ring Z_q[X]/(X^{2^α}+1) via re-exports of primePowTwoModulus/PrimePowTwoRing. This matches the paper's ring and is consistent with the LS18 invertibility assumptions. The docstring additions do not alter this.

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks: None

Cluster: Top‑level Hachi integration and functional commitment scaffold (medium)

Is the top‑level Hachi functional commitment correctly wired, and does the ArkLib.lean import list cover all necessary modules without introducing cycles?

📄 **Review for `ArkLib/Commitments/Functional/Hachi.lean`**

Analysis:
This pull request adds a new top-level umbrella module ArkLib/Commitments/Functional/Hachi.lean for the Hachi formalization. The file contains no mathematical definitions, theorems, or proofs — it is purely a documentation module that imports two submodules (Commitment and Composition) and provides a comprehensive docstring describing the folder structure, the paper sections covered, the status of the formalization, and the generic infrastructure it builds on.

What the code does mathematically: Nothing directly. It serves as an organizational entry point and re-export hub for the Hachi development. Users who import ArkLib.Commitments.Functional.Hachi will transitively get Commitment and Composition (and through them, all other submodules that those files import).

Mapping to spec checklist items: No checklist items are directly addressed by this file. All checklist items concern mathematical content (definitions, theorems, proof strategies) that live in the submodules this file imports. The file does not introduce any new formalization, so it cannot violate any mathematical correctness requirement.

Riskiest aspects: The only potential issue is whether the import list is complete for a module that claims to be an umbrella re-export. The docstring describes six submodules (Gadget/, EvalSplit.lean, InnerOuter/, QuadEval/, Composition.lean, Commitment.lean) but only two are directly imported. This is likely intentional — Composition probably transitively imports the others — but it could confuse users who expect a single import to bring everything into scope. This is a minor organizational concern, not a correctness bug.

Second-order issues: The docstring explicitly acknowledges that hachi.opening in Commitment.lean is a sorry. This is transparent and does not affect the correctness of this umbrella file. The sorry is in a different file and is not implicated by this diff beyond being documented.

Faithfulness checks: Not applicable — there are no Lean theorems or definitions referencing paper results in this file.

Tool evidence: lean_typecheck on the import lines succeeded silently, confirming the file compiles and the imports resolve correctly.

Verdict: Approved

Checklist Verification:

  • ⚠️ All checklist items (gadget decomposition, inner-outer commitment, QuadEval reduction, CWSS, LS18 invertibility, etc.): This file is a documentation/import module with no mathematical content. It does not define any of the checklist items. All checklist items are addressed in the submodules this file imports.

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks:

  • The docstring describes this file as an umbrella re-export for the whole folder and lists six submodules, but only two (Commitment and Composition) are directly imported. Users who import Hachi expecting Gadget, EvalSplit, InnerOuter, or QuadEval to be in scope may be surprised. This is likely intentional (Composition transitively imports the others), but the mismatch between the docstring's description and the actual import list could cause confusion. (ArkLib/Commitments/Functional/Hachi.lean:7-8) (confidence: low)
    • Evidence: File docstring at lines 33-56 lists six submodules; lines 7-8 import only two.

@github-actions

Copy link
Copy Markdown
Contributor

AI review continued (part 3/3)

📄 **Review for `ArkLib/Commitments/Functional/Hachi/Commitment.lean`**

Analysis:
The file ArkLib/Commitments/Functional/Hachi/Commitment.lean is a new file that scaffolds the Hachi functional commitment scheme as a Commitment.Scheme. It defines:

  • multilinearEvalOracleInterface: an OracleInterface instance for CMlPolynomial over the cyclotomic ring, providing the eval-oracle semantics.
  • keygen: samples inner/outer/short Ajtai matrices uniformly and returns the PublicParamsD as both committer and verifier key.
  • commit: reshapes a multilinear polynomial into its coefficient matrix, applies the canonical base-b digit decomposition (zmodDigitDecomposition at width Nat.clog b q), and outer-commits via commitWithDecomps.
  • hachi: the Commitment.Scheme value parameterized by the gadget base b and 1 < b. The keygen and commit fields are filled with the above definitions; the opening field is set to sorry.

The file matches the paper's description of the honest committer operations (NOZ26 §2.1/§4.1) and the protocol shape (pSpec is the composed zero-round prefix plus the QuadEval two-round protocol). The opening field is explicitly documented as a placeholder for future work (the §4.3+ subprotocols and honest-prover layer).

Riskiest aspect: The opening := sorry is an escape hatch. According to the Verdict Rules, any sorry in the PR forces a "Changes Requested" verdict regardless of other findings. The code is otherwise well-structured and correctly wired to the existing inner-outer commitment and QuadEval modules.

Checklist mapping: The code addresses the top-level scaffolding of the Hachi functional commitment (NOZ26 §4.1), using the canonical base-b digit decomposition (NOZ26 §2.1). It does not define the decomposition or prove any of the security theorems; those are in other files. The opening gap is acknowledged in the Spec Analyst's checklist as acceptable future work, but the hard rule on sorry overrides that assessment.

Verdict: Changes Requested

Checklist Verification:

  • ⚠️ Paper result mapping (NOZ26 §4.1 inner-outer commitment): The commit function uses the canonical base-b digit decomposition via zmodDigitDecomposition and Decomposition.ofDigits, and outer-commits via commitWithDecomps. This matches the inner-outer commitment structure of NOZ26 §4.1. However, the perfectlyCorrect theorem is not proved here, and the opening field is sorry, so the overall scheme is incomplete.
  • The hachi functional commitment scheme is correctly scaffolded as a Commitment.Scheme with the honest keygen and commit using the canonical base‑b digit decomposition.: The hachi definition correctly sets keygen and commit to the honest operations. The opening field is sorry, which is documented as a placeholder. The scaffold is correctly wired.
  • The opening field is marked as sorry and the TODO block accurately describes the remaining work; no other part of the scheme depends on this sorry.: The opening field is marked sorry and the TODO block accurately describes the remaining work. No other part of this file depends on the opening value.

Critical Misformalizations: None

Lean 4 / Mathlib Issues:

  • The opening field of hachi is defined as sorry, which is an incomplete proof. The Verdict Rules require that any PR containing sorry receive a 'Changes Requested' verdict. (ArkLib/Commitments/Functional/Hachi/Commitment.lean:151) (confidence: high)
    • Evidence: File ArkLib/Commitments/Functional/Hachi/Commitment.lean, line 151: opening := sorry. The compiler also reports sorry at this location.
    • Suggested fix: Complete the opening field with a real proof term, or if the PR is meant as a scaffold only, replace sorry with an explicit axiom-like placeholder that is not sorry (though axiom would also trigger the escape-hatch rule). The intended fix is to implement the honest-prover layer and the §4.3+ subprotocols as described in the TODO block.

Nitpicks: None

📄 **Review for `ArkLib.lean`**

Analysis:
The diff updates the top-level import file ArkLib.lean to reflect the restructuring of the Hachi formalization: the old modules GadgetNorms and PolynomialEvalSplit are renamed to Gadget.Norms and EvalSplit, the single Gadget module is split into Gadget.Basic and Gadget.Norms, and new modules for QuadEval, CWSS composition, and SendChallenge are added. All new imports typecheck successfully. The old removed modules no longer exist as separate olean files, confirming the rename. The file itself is purely a list of imports; the mathematical content lives in the imported modules. However, the PR also introduces ArkLib/Commitments/Functional/Hachi/Commitment.lean, which contains a sorry in the opening field of the hachi scheme. This sorry is imported by the new line import ArkLib.Commitments.Functional.Hachi.Commitment. Per the hard rule on escape hatches, any PR containing a sorry must be marked 'Changes Requested'. The removal of the old Gadget module from the import list while the module still exists is a minor potential issue, but the new submodules likely cover its content.

Verdict: Changes Requested

Checklist Verification:

  • ⚠️ Paper result mapping (NOZ26 §2.1 gadget decomposition) [Critical]: This file is only imports; the actual DigitDecomposition definitions are in the imported modules and cannot be verified from this diff.
  • ⚠️ Paper result mapping (NOZ26 §4.1 inner-outer commitment) [Critical]: The InnerOuter.Scheme module is imported, but the hachi definition in Commitment.lean has opening := sorry, which violates the hard rule on escape hatches. The diff itself does not contain the definition but implicates the sorry.
  • ⚠️ Paper result mapping (NOZ26 §4.2 QuadEval reduction and Lemma 8) [Critical]: The QuadEval modules are newly imported, but their content is not visible in this diff.
  • ⚠️ Paper result mapping (NOZ26 §4.2 polynomial‑to‑QuadEval bridge) [Critical]: The EvalSplit module is imported, but its content is not in this diff.
  • ⚠️ Paper result mapping (FMN24 coordinate‑wise special soundness) [Critical]: The CWSS modules (NoChallenge, Package, SeqCompose, SingleRound) are imported, but their content is not in this diff.
  • ⚠️ Paper result mapping (LS18 short‑element invertibility) [Critical]: The LyubashevskySeiler module is not touched by this diff; it was already imported.
  • ⚠️ Hidden assumptions and implicit identifications [Major]: The new imports include IsPure and SendChallenge, which may be relevant to hidden assumptions; cannot verify from diff alone.
  • ⚠️ Boundary conditions and edge cases [Minor]: Boundary conditions are handled in the imported modules, not in this import file.
  • ⚠️ Completeness and missing parts [Minor]: The hachi scheme's opening is sorry, which is acknowledged as future work but constitutes an escape hatch.

Critical Misformalizations: None

Lean 4 / Mathlib Issues:

  • The PR introduces a sorry in ArkLib/Commitments/Functional/Hachi/Commitment.lean (the opening field of the hachi scheme). This is an escape hatch that violates the hard rule requiring Changes Requested. (ArkLib/Commitments/Functional/Hachi/Commitment.lean:151 (imported via ArkLib.lean:4)) (confidence: high)
    • Evidence: Cluster context signature shows opening := sorry at line 151 of Commitment.lean. The ArkLib.lean diff adds import ArkLib.Commitments.Functional.Hachi.Commitment, making the sorry reachable from the top-level module. Compiler diagnostics confirm sorry at Commitment.lean:151.
    • Suggested fix: Complete the opening definition to remove the sorry. If the opening is not yet formalized, the PR should either remove the hachi scheme definition or mark the entire module as work-in-progress without importing it into the main ArkLib.lean.

Nitpicks: None

Cluster: Unclustered files (low)

Review these files independently.

📄 **Review for `ArkLib/Commitments/Functional/Hachi/Gadget.lean`**

Analysis:
The diff replaces the entire content of ArkLib/Commitments/Functional/Hachi/Gadget.lean — originally a monolithic file containing all gadget-related definitions, theorems, and proofs — with a lightweight umbrella module that imports two new subfiles: Gadget/Basic.lean and Gadget/Norms.lean. The mathematical content (the DigitDecomposition structure, zmodDigitDecomposition, gadgetMatrix, gadgetMul, gadgetDecompose, gadgetDecompose_lawful, and the supporting lemmas) is moved unchanged into the subfiles. The umbrella file now serves only as documentation and a re-export point.

Checklist mapping:

  • The refactoring touches the definitions listed in the checklist items for NOZ26 §2.1 gadget decomposition. The mathematical statements (type signatures of DigitDecomposition, zmodDigitDecomposition, gadgetDecompose, gadgetDecompose_lawful) are preserved exactly — verified by typechecking the post-refactor file to confirm the symbols are accessible with the same types.
  • The gadgetDecompose_lawful theorem retains its hypotheses hd : 0 < digits and h1 : 1 ≤ Φ.φ.natDegree, matching the checklist requirements.
  • The norms subfile (Gadget/Norms.lean) is imported but not modified; its content (including gadgetMul_zmod_vecL2NormSq_le) is pre-existing and satisfies the checklist items about norm bounds.

Riskiest aspects:

  • The original file had two private theorems (ofDigits_eq_sum_range and ofDigits_eq_sum_range_of_len_le) used in the proof of zmodDigitDecomposition.reconstruct. Moving them to Gadget/Basic.lean with private scope is fine if they are only used in that file. If Gadget/Norms.lean also needed them, they would need to be non-private. The code compiles, so this is not a live issue, but it is worth noting that the refactoring could have silently changed accessibility (low confidence without seeing the subfiles).
  • The open and omit directives are gone from the umbrella file; this is harmless because the umbrella has no code and the subfiles handle their own namespace scaffolding.

Faithfulness check: The diff is purely organizational. No Lean theorem statement changed. The paper-to-Lean mapping is unaffected — the same definitions and theorems exist at the same fully qualified names.

Verdict: Approved

Checklist Verification:

  • The definitions of DigitDecomposition, gadgetDecompose, and zmodDigitDecomposition must capture the base-b digit decomposition of the coefficient ring ZMod q as described in the paper: digit e of a coefficient is the e-th base-b digit of the canonical representative, and reconstruction holds when q ≤ b^digits. The zmodDigitDecomposition definition and its reconstruct proof must correspond exactly to the paper's decomposition.: The definitions of DigitDecomposition, gadgetDecompose, and zmodDigitDecomposition are unchanged by the diff; they were moved to Gadget/Basic.lean and remain accessible through the umbrella import. The type signatures match the pre-existing code.
  • The gadgetDecompose_lawful theorem must prove G·G⁻¹(x) = x for the induced gadget inverse, using the coefficient reconstruction law of the DigitDecomposition. The proof must handle the cyclotomic modulus degree Φ.φ.natDegree correctly, especially the case where k ≥ Φ.φ.natDegree (coefficient zero).: The gadgetDecompose_lawful theorem is unchanged; it retains the hypotheses hd: 0 < digits and h1: 1 ≤ Φ.φ.natDegree, and proves IsLawfulGadgetDecomposition. The proof is in Gadget/Basic.lean and was not modified.
  • The InnerOuter.Scheme must define the commitment exactly as a two-layer composition: per-block message gadget-decompose, inner-commit under A, gadget-decompose the inner commitments, flatten, outer-commit under B. The Decomp and Opening types must capture the weak-opening data (sᵢ, t̂ᵢ, cᵢ) with per-block challenges.: The InnerOuter.Scheme and related modules are not in the diff. The refactoring of Gadget.lean does not affect the inner-outer commitment definitions.
  • The perfectlyCorrect theorem must prove that for the genuine base-b digit decomposition, an honest commitment always verifies under the weak verifier verify_weak with the trivial challenge cᵢ = 1. The proof must rely on the ℓ₂² and ℓ∞ norm bounds from Gadget/Norms and the fact that 1 is short (‖1‖₁ ≤ κ). The hypotheses b - 1 ≤ q/2 (no wraparound) and 1 ≤ κ must be explicitly required.: Not in the diff. The refactoring does not touch correctness or security proofs.
  • The weak-binding reduction (outputToModuleSIS_valid_of_verified) must show that two differing weak openings that pass verify_weak yield a non-zero ℓ∞-short Module-SIS solution for either the inner matrix A or the outer matrix B. The proof must use the fact that the difference of two short vectors is short with bound 2·γ and that the commitment equations force the matrix-vector product of the difference to be zero. The advantage_le_moduleSIS theorem must bound the weak-binding advantage by the sum of the two Module-SIS advantages.: Not in the diff. The refactoring does not touch the weak-binding reduction.
  • The QuadEval.Reduction module must define the protocol exactly as in Figure 3: round-0 prover sends carrier commitment v = D ŵ, round-1 verifier sends a challenge vector c ∈ (Fin (2^r) → ShortChallenge), and the verifier checks the five equations of Eq. (20) plus the range checks. The relOut relation must encode these checks, including the ℓ∞ range checks on ŵ, t̂, and ẑ.: Not in the diff. The QuadEval modules are not part of this file refactoring.
  • The paperRelOut must capture the paper's exact S_b box range checks (centered coefficients in [⌈-b/2⌉, ⌈b/2⌉-1]). The proof paperRelOut_subset_relOut must show that for any γ ≥ b/2, every transcript accepted by paperRelOut is also accepted by relOut. This is essential to claim that the CWSS theorem covers the paper's verifier.: Not in the diff. No changes to QuadEval relations.
  • The quadEval_coordinateWiseSpecialSound theorem (Lemma 8) must state coordinate-wise special soundness for the foldStructure (ℓ = 2^r, k = 2). The input relation relIn must be the disjunction: a VerifiedOpening with evalConsistency (Eq. 15), or a Module-SIS solution for B, or a Module-SIS solution for D. The output relation is relOut.: Not in the diff. The CWSS theorem is in a different module.
  • The extractor buildWitness must implement the three-case analysis of Lemma 8: (A) differing inner decompositions → MSIS(B); (B) differing carrier decompositions → MSIS(D); (C) otherwise → subtract-and-divide weak opening. The proof of buildWitness_mem_relIn must correctly handle each case using the commitment equalities and norm bounds.: Not in the diff. The extractor code is in QuadEval/Soundness.lean.
  • The subtract-and-divide opening extractedOpening must be defined using Ring.inverse (total). The verifiedOpening_of_star lemma must prove that under the star-shaped challenge family, the extracted opening is a valid VerifiedOpening with the derived βSq = quadEvalBetaSq and κ = 2ω. The scaled_short condition must be proved using the J-recomposition ℓ₂² bound from Gadget/Norms.: Not in the diff. The subtract-and-divide opening is in QuadEval/Soundness.lean.
  • The evalConsistency_of_relOut_star lemma must prove that the extracted opening satisfies Eq. (15) (bᵀ M a = y). The proof must use the c3 and c4 rows of relOut and the unit-cancellation (slack_isUnit).: Not in the diff. The evalConsistency lemma is in QuadEval/Soundness.lean.
  • The slack_isUnit theorem must use the Lyubashevsky-Seiler invertibility isUnit_of_l1Norm_le with the hypotheses q ≡ 5 mod 8 and (2ω)² < q. The slack c̄ⱼ must be nonzero (from CoordEq), have ℓ₁ norm ≤ 2ω, and the norm-squared bound (2ω)² < q must be sufficient to guarantee ‖c̄ⱼ‖₂² < q (since ℓ₂ ≤ ℓ₁). The ring must be the power-of-two cyclotomic 𝓜(q,α).: Not in the diff. The slack_isUnit theorem is in a different module (likely InnerOuter/Security.lean or QuadEval/Soundness.lean).
  • The EvalSplit module must define the matrix reshape toMatrix and its inverse toPolynomial, and prove splitForm_monomialBasis_eq_eval: the split bilinear form of a matrix M against the monomial bases equals the multilinear evaluation of toPolynomial M at xl ++ xh. This is the bridge lemma connecting the polynomial-level evaluation to the matrix-level QuadEval.: Not in the diff. The EvalSplit module is not part of this file.
  • The PolyEvalStatement and toQuadEvalStatement must faithfully represent the paper's evaluation claim: the evaluation point is split into xl (first r variables) and xh (last m variables), and the bases are the monomial tensor bases mb(xl) and mb(xh).: Not in the diff. PolyEvalStatement is in a different module.
  • The relPolyEval definition must be the pull-back of QuadEval's relIn to the polynomial level: a VerifiedOpening whose extracted polynomial evaluates to y, or MSIS(B), or MSIS(D). The mem_relPolyEval_of_relIn lemma must prove that relIn at toQuadEvalStatement implies relPolyEval.: Not in the diff. relPolyEval is in a different module.
  • The bridge_coordinateWiseSpecialSound theorem must prove that the zero-round ReduceClaim head is CWSS for any D, reducing relPolyEval to QuadEval's relIn. The witness type must be unchanged (QuadEvalWitness).: Not in the diff. The bridge CWSS theorem is in a different module.
  • The definitions of IsSpecialSoundFamily, CoordEq, CWSSStructure, StarAt, central, sib must match the paper's SS(S, ℓ, k) and the star-center extraction. The foldStructure must set coordIndex = 2^r, alphabet = C, soundnessParam = 2, and arity = 2^r + 1. The nodeOk must be exactly IsSpecialSoundFamily (2^r) 2.: Not in the diff. The CWSS definitions are in OracleReduction/Security/CoordinateWiseSpecialSoundness.lean.
  • The SingleRound module must provide the generic theorem coordinateWiseSpecialSound_of_mkWitness that reduces CWSS of the two-round protocol to a protocol-specific witness assembler mkWitness. The proof must rely on the tree shape recovery tree_shape and the branch-acceptance lemma branch_relOut_language. This generic layer must be independent of the concrete Hachi relations.: Not in the diff. The SingleRound module is not in this file.
  • The isUnit_of_l1Norm_le lemma (used by slack_isUnit) must correctly apply Corollary 1.2 of LS18: a nonzero ring element with centered Euclidean norm squared < q is a unit. The lemma must be stated for the power-of-two cyclotomic ring 𝓜(q,α) with q prime, q ≡ 5 mod 8, and deg φ a power of two. The slack_isUnit application must satisfy the norm bound via ‖c̄ⱼ‖₁ ≤ 2ω and (2ω)² < q.: Not in the diff. The invertibility lemma is in a different module (Data/Lattices/CyclotomicRing/NormBounds/LyubashevskySeiler.lean).
  • The QuadEval verifier is a pure pass-through, so its verify must be a deterministic function of the transcript. The hpure condition required by coordinateWiseSpecialSound_of_mkWitness must be ∀ s tr, V.verify s tr = pure (s, tr.messages 0, tr.challenges 1). The PR's verifier definition must satisfy this exactly.: Not in the diff. The QuadEval verifier is defined in a different module.
  • The foldStructure uses alphabet = ShortChallenge Φ ω. The IsSpecialSoundFamily condition must be phrased on the subtype, but the coordinate-wise isolation (CoordEq) must lift to the underlying ring elements for the subtract-and-divide. The ShortChallenge.coordEq_val lemma must provide this lift.: Not in the diff. The foldStructure is defined in a different module.
  • The relOut range check uses vecLInftyNorm Φ resp.carrierDec ≤ γ etc. The paperRelOut uses the box InSb. The containment proof paperRelOut_subset_relOut must be valid for γ ≥ b/2. The definition of InSb must exactly match the paper's S_b box: centered coefficients in [⌈-b/2⌉, ⌈b/2⌉-1].: Not in the diff. The relOut and paperRelOut are in QuadEval/Reduction.lean.
  • ⚠️ The SubL2NormSqBound and zRecomposeL2SqBound definitions must yield a valid bound on ‖z‖₂² given ‖ẑ‖∞ ≤ γ. The gadgetMul_zmod_vecL2NormSq_le lemma must supply the bound cols * (d * ((∑ b^u) * γ)²). The quadEvalBetaSq must be 4 times that bound, matching the paper's βSq = 4·B_z.: The norms file is imported but not modified. The gadgetMul_zmod_vecL2NormSq_le lemma exists and provides the recomposition bound. The zRecomposeL2SqBound is defined in CyclotomicModulus namespace. SubL2NormSqBound was not found as a standalone identifier, but the norm bound is provided through other lemmas. This is pre-existing code not changed by the diff.
  • The evalChain composition uses CWSSPackage.append (▷). The left package's relOut must be definitionally equal to the right's relIn. The PR's bridgePackage sets relOut := relIn Φ base βSq γ κ and quadEvalPackage sets relIn := relIn … with the same parameters. This must be rfl.: Not in the diff. The evalChain composition is in a different module.
  • The foldStructure assumes r is a parameter; the case r = 0 (empty challenge vector) is not explicitly excluded but would make 2^r = 1. The paper's Lemma 8 requires r ≥ 1 meaningfully? The CWSS structure with 2^r = 1 and k = 2 would mean arity = 2, which is still a valid star family. The extractor must still work, but the protocol may become trivial. The PR does not exclude r = 0, which is acceptable but should be noted.: The foldStructure is not in the diff. The r = 0 case is handled by the pre-existing code.
  • The digitDecomposition requires digits > 0 for the gadgetMul_apply lemma. The PR's gadgetDecompose_lawful requires 0 < digits. The QuadEval reduction uses zDigits as the number of digits for the J gadget; the condition hτ: 0 < zDigits is an explicit hypothesis. This matches the paper's requirement that the gadget must have at least one digit.: The gadgetDecompose_lawful theorem retains the hypothesis hd: 0 < digits, matching the checklist requirement.
  • The ShortChallenge subtype requires ‖c‖₁ ≤ ω. The foldStructure's alphabet is ShortChallenge, so the IsSpecialSoundFamily condition applies to vectors of these subtypes. The extractor's slack_isUnit uses the underlying ring element, which is fine because the ℓ₁ bound is preserved.: Not in the diff. The ShortChallenge subtype is defined elsewhere.
  • The honest prover computeV and computeResp are not yet defined; the prover in QuadEval/Reduction is a skeleton taking them as parameters. The PR does not claim to formalize completeness of the reduction, which is out of scope for Lemma 8. The hachi opening field is sorry. This is acceptable as they are marked as future work.: Not in the diff. The honest prover is a skeleton in a different module.
  • The SendChallenge component is added but not yet used in the Hachi composition. Its formalization appears correct but is not covered by the paper mapping for this PR.: Not in the diff. The SendChallenge component is in a different module.

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks:

  • The original file contained two private theorems (ofDigits_eq_sum_range and ofDigits_eq_sum_range_of_len_le) used in the proof of zmodDigitDecomposition.reconstruct. Moving them to Gadget/Basic.lean keeps them private to that file, which is fine if Gadget/Norms.lean does not need them. The code compiles, so this is not a live bug, but the refactoring could silently change accessibility if the norms file later needs the reconstruction lemma. Worth a quick audit. (ArkLib/Commitments/Functional/Hachi/Gadget.lean (removed lines, now in Gadget/Basic.lean)) (confidence: low)
    • Evidence: The private theorems are visible in the removed code block of the diff (lines beginning with 'private theorem ofDigits_eq_sum_range' and 'private theorem ofDigits_eq_sum_range_of_len_le'). They are not mentioned in the new umbrella file's imports or documentation.
  • The checklist item about SubL2NormSqBound and zRecomposeL2SqBound could not be fully verified. The typecheck found zRecomposeL2SqBound at CyclotomicModulus.zRecomposeL2SqBound (different namespace than expected) and did not find SubL2NormSqBound as a standalone identifier. This is pre-existing code not modified by the diff, but the checklist item is marked 'unclear' because the exact naming and location differ from what the checklist expects. (ArkLib/Commitments/Functional/Hachi/Gadget/Norms.lean (imported, not in diff)) (confidence: low)
    • Evidence: Typecheck: CyclotomicModulus.zRecomposeL2SqBound exists; ArkLib.Lattices.Ajtai.SubL2NormSqBound does not exist. The gadgetMul_zmod_vecL2NormSq_le lemma provides the bound directly.
📄 **Review for `ArkLib/Commitments/Functional/Hachi/GadgetNorms.lean`**

Analysis:
The diff deletes the entire file ArkLib/Commitments/Functional/Hachi/GadgetNorms.lean (126 lines). This file provides six theorems that establish centered ℓ∞ and ℓ₂² norm bounds for the Hachi base‑b digit gadget decomposition gadgetDecompose when instantiated with zmodDigitDecomposition. Specifically:

  1. zmodDigit_natAbs_le — each base‑b digit has absolute value ≤ b‑1 (under the no‑wraparound hypothesis b-1 ≤ q/2).
  2. gadgetDecompose_coeff — coefficient‑access lemma for gadget decomposition.
  3. gadgetDecompose_zmod_lInftyNorm_le — per‑block ℓ∞ bound ≤ b‑1.
  4. gadgetDecompose_zmod_vecLInftyNorm_le — full‑vector ℓ∞ bound ≤ b‑1.
  5. gadgetDecompose_zmod_l2NormSq_le — per‑block ℓ₂² bound ≤ (deg φ)·(b‑1)².
  6. gadgetDecompose_zmod_vecL2NormSq_le — full‑vector ℓ₂² bound ≤ rows·digits·(deg φ)·(b‑1)².

These bounds are explicitly required by the Formalization Checklist:

  • The perfectlyCorrect theorem "must rely on the ℓ₂² and ℓ∞ norm bounds from Gadget/Norms".
  • The weak‑binding reduction outputToModuleSIS_valid_of_verified needs the shortness bounds to establish that the extracted Module‑SIS solution is genuinely ℓ∞‑short.

The checklist further states that the QuadEval reduction’s gadgetMul_zmod_vecL2NormSq_le lemma supplies composite bounds that likely depend on these per‑decomposition bounds (or are at least proved in the same style). Deleting this file without providing equivalent bounds elsewhere would break the downstream formalization of inner‑outer commitment correctness and security, and would leave the checklist items unsatisfied. The Lean toolchain confirms that the project does not build after the deletion (GadgetNorms.olean does not exist, and importing InnerOuter.Scheme or InnerOuter.Security fails because the olean is missing).

Risk assessment: The deletion is the highest‑risk change possible — it removes a foundational dependency for the entire Hachi commitment‑layer security argument. Unless the PR simultaneously adds equivalent bounds in a different module (which the diff does not show), this is a blocker. Even if the bounds are moved, the deletion alone would break the build until the downstream imports are updated, which the diff also does not show.

Faithfulness checks: The theorems in the deleted file are mathematically faithful to the paper’s requirements (correct hypotheses, correct bounds). The file itself has no sorry, axiom, or other escape hatches. The issue is purely the removal of essential content.

Verdict: Changes Requested

Checklist Verification:

  • Paper result mapping (NOZ26 §4.1 inner-outer commitment) — perfectlyCorrect must rely on ℓ₂² and ℓ∞ norm bounds from Gadget/Norms.: The deleted file contains the ℓ∞ and ℓ₂² norm bounds that the 'perfectlyCorrect' proof is required to rely upon. Removing these bounds makes it impossible to satisfy the checklist item unless equivalent bounds are provided elsewhere (not shown in the diff).
  • Paper result mapping (NOZ26 §4.1 inner-outer commitment) — weak-binding reduction must show ℓ∞‑short Module‑SIS solution.: The weak-binding reduction needs the ℓ∞ shortness of the gadget decomposition to bound the extracted Module‑SIS solution. The deleted file is the source of those bounds. Without them the checklist item cannot be satisfied.
  • Paper result mapping (NOZ26 §4.2 QuadEval reduction and Lemma 8) — extractor and subtract‑and‑divide opening; gadgetMul_zmod_vecL2NormSq_le.: The norm bounds are essential for the subtract‑and‑divide opening and the ℓ₂² recomposition bound used in Lemma 8. Deleting the file removes the foundational norm‑bound infrastructure.
  • ⚠️ Hidden assumptions and implicit identifications — SubL2NormSqBound and zRecomposeL2SqBound definitions.: The file itself contained no 'sorry' or 'axiom'; the theorems were fully proved. The content was correct and complete for its purpose.

Critical Misformalizations:

  • The PR deletes the entire file GadgetNorms.lean, which contains the ℓ∞ and ℓ₂² norm bounds for the Hachi gadget decomposition that are explicitly required by the Formalization Checklist for the perfectlyCorrect and outputToModuleSIS_valid_of_verified proofs. The deletion removes the mathematical foundation for the inner‑outer commitment correctness and security arguments. The diff does not show any replacement file or updated imports, and the Lean toolchain confirms the project does not build after the deletion. (ArkLib/Commitments/Functional/Hachi/GadgetNorms.lean (entire file, lines 1–126)) (confidence: high)
    • Evidence: Formalization Checklist item 'Paper result mapping (NOZ26 §4.1 inner-outer commitment)' states: 'The perfectlyCorrect theorem must prove that for the genuine base‑b digit decomposition, an honest commitment always verifies … The proof must rely on the ℓ₂² and ℓ∞ norm bounds from Gadget/Norms.' The deleted file is precisely GadgetNorms.lean and provides exactly the six norm‑bound theorems (gadgetDecompose_zmod_lInftyNorm_le, gadgetDecompose_zmod_vecLInftyNorm_le, gadgetDecompose_zmod_l2NormSq_le, gadgetDecompose_zmod_vecL2NormSq_le, etc.) that the checklist references. Toolchain evidence: lean_typecheck on import ArkLib.Commitments.Functional.Hachi.Gadget fails because GadgetNorms.olean does not exist.
    • Suggested fix: Do not delete this file unless the norm bounds are re‑proved in a different module and all downstream imports are updated. If the bounds are being moved, the PR should include both the deletion and the addition (with updated imports) in a single atomic change so the project continues to build.

Lean 4 / Mathlib Issues:

  • Deleting an entire module without updating downstream imports breaks the build. The toolchain confirms that importing ArkLib.Commitments.Functional.Hachi.Gadget, InnerOuter.Scheme, or InnerOuter.Security fails because the olean for GadgetNorms is missing. This is a build‑breaking change. (ArkLib/Commitments/Functional/Hachi/GadgetNorms.lean (deletion)) (confidence: high)
    • Evidence: lean_typecheck: import ArkLib.Commitments.Functional.Hachi.Gadget → error: object file '...GadgetNorms.olean' does not exist. Same error for InnerOuter.Scheme and InnerOuter.Security.
    • Suggested fix: If the file is intentionally removed, all downstream import statements must be updated to import whatever module now provides the same definitions/lemmas. If no replacement exists, the file must not be deleted.

Nitpicks: None

📄 **Review for `ArkLib/Commitments/Functional/Hachi/InnerOuter.lean`**

Analysis:
The diff updates the module docstring of ArkLib/Commitments/Functional/Hachi/InnerOuter.lean. No code changes are made—the file remains a pure umbrella that imports InnerOuter.Correctness and InnerOuter.Security. The new docstring provides a description of the inner‑outer Ajtai commitment, folder structure, and references, accurately reflecting the Greyhound/Hachi papers (NOZ26 §4.1, NS24). The change does not introduce any definitions, theorems, or proofs, so it cannot directly affect the formalization of the checklist items. The documentation is correct and does not contain any misleading statements. Therefore, the PR is safe to approve.

Verdict: Approved

Checklist Verification:

  • ⚠️ Paper result mapping (NOZ26 §2.1 gadget decomposition) [Critical] — The definitions of DigitDecomposition, gadgetDecompose, and zmodDigitDecomposition must capture the base‑b digit decomposition...: The file under review does not contain any implementation of DigitDecomposition or gadget decomposition; it is just an umbrella. The diff only changes the docstring. Cannot verify from this diff.
  • ⚠️ Paper result mapping (NOZ26 §2.1 gadget decomposition) [Critical] — The gadgetDecompose_lawful theorem must prove G·G⁻¹(x)=x...: Same reason: no implementation of gadgetDecompose_lawful in this file, only docstring change.
  • ⚠️ Paper result mapping (NOZ26 §4.1 inner‑outer commitment) [Critical] — The InnerOuter.Scheme must define the commitment exactly as a two‑layer composition...: The file does not contain the InnerOuter.Scheme definition; diff is purely documentation.
  • ⚠️ Paper result mapping (NOZ26 §4.1 inner‑outer commitment) [Critical] — The perfectlyCorrect theorem must prove that for the genuine base‑b digit decomposition...: No perfectlyCorrect theorem in this file; diff is documentation.
  • ⚠️ Paper result mapping (NOZ26 §4.1 inner‑outer commitment) [Critical] — The weak‑binding reduction (outputToModuleSIS_valid_of_verified) must show that two differing weak openings...: No security proofs in this file; diff is documentation.
  • ⚠️ Paper result mapping (NOZ26 §4.2 QuadEval reduction and Lemma 8) [Critical] — The QuadEval.Reduction module must define the protocol exactly as in Figure 3...: QuadEval.Reduction is not in this file; diff is documentation.
  • ⚠️ Paper result mapping (NOZ26 §4.2 QuadEval reduction and Lemma 8) [Critical] — The paperRelOut must capture the paper’s exact S_b box range checks...: paperRelOut not in this file; diff is documentation.
  • ⚠️ Paper result mapping (NOZ26 §4.2 QuadEval reduction and Lemma 8) [Critical] — The quadEval_coordinateWiseSpecialSound theorem (Lemma 8) must state coordinate‑wise special soundness...: quadEval_coordinateWiseSpecialSound not in this file; diff is documentation.
  • ⚠️ Paper result mapping (NOZ26 §4.2 QuadEval reduction and Lemma 8) [Critical] — The extractor buildWitness must implement the three‑case analysis...: buildWitness not in this file; diff is documentation.
  • ⚠️ Paper result mapping (NOZ26 §4.2 QuadEval reduction and Lemma 8) [Critical] — The subtract‑and‑divide opening extractedOpening must be defined using Ring.inverse...: extractedOpening not in this file; diff is documentation.
  • ⚠️ Paper result mapping (NOZ26 §4.2 QuadEval reduction and Lemma 8) [Critical] — The evalConsistency_of_relOut_star lemma must prove that the extracted opening satisfies Eq. (15)...: evalConsistency_of_relOut_star not in this file; diff is documentation.
  • ⚠️ Paper result mapping (NOZ26 §4.2 QuadEval reduction and Lemma 8) [Critical] — The slack_isUnit theorem must use the Lyubashevsky–Seiler invertibility...: slack_isUnit not in this file; diff is documentation.
  • ⚠️ Paper result mapping (NOZ26 §4.2 polynomial‑to‑QuadEval bridge) [Critical] — The EvalSplit module must define the matrix reshape...: EvalSplit not in this file; diff is documentation.
  • ⚠️ Paper result mapping (NOZ26 §4.2 polynomial‑to‑QuadEval bridge) [Critical] — The PolyEvalStatement and toQuadEvalStatement must faithfully represent...: PolyEvalStatement not in this file; diff is documentation.
  • ⚠️ Paper result mapping (NOZ26 §4.2 polynomial‑to‑QuadEval bridge) [Critical] — The relPolyEval definition must be the pull‑back...: relPolyEval not in this file; diff is documentation.
  • ⚠️ Paper result mapping (NOZ26 §4.2 polynomial‑to‑QuadEval bridge) [Critical] — The bridge_coordinateWiseSpecialSound theorem must prove...: bridge_coordinateWiseSpecialSound not in this file; diff is documentation.
  • ⚠️ Paper result mapping (FMN24 coordinate‑wise special soundness) [Critical] — The definitions of IsSpecialSoundFamily, CoordEq...: IsSpecialSoundFamily etc. not in this file; diff is documentation.
  • ⚠️ Paper result mapping (FMN24 coordinate‑wise special soundness) [Critical] — The SingleRound module must provide the generic theorem...: SingleRound module not in this file; diff is documentation.
  • ⚠️ Paper result mapping (LS18 short‑element invertibility) [Critical] — The isUnit_of_l1Norm_le lemma (used by slack_isUnit) must correctly apply Corollary 1.2...: isUnit_of_l1Norm_le not in this file; diff is documentation.
  • ⚠️ Hidden assumptions and implicit identifications [Major] — The QuadEval verifier is a pure pass‑through...: QuadEval verifier not in this file; diff is documentation.
  • ⚠️ Hidden assumptions and implicit identifications [Major] — The foldStructure uses alphabet = ShortChallenge Φ ω...: foldStructure not in this file; diff is documentation.
  • ⚠️ Hidden assumptions and implicit identifications [Major] — The relOut range check uses vecLInftyNorm Φ resp.carrierDec ≤ γ...: relOut range check not in this file; diff is documentation.
  • ⚠️ Hidden assumptions and implicit identifications [Major] — The SubL2NormSqBound and zRecomposeL2SqBound definitions must yield...: SubL2NormSqBound etc. not in this file; diff is documentation.
  • ⚠️ Hidden assumptions and implicit identifications [Major] — The evalChain composition uses CWSSPackage.append...: evalChain composition not in this file; diff is documentation.
  • ⚠️ Boundary conditions and edge cases [Minor] — The foldStructure assumes r is a parameter...: foldStructure r parameter not in this file; diff is documentation.
  • ⚠️ Boundary conditions and edge cases [Minor] — The digitDecomposition requires digits > 0...: digitDecomposition >0 not in this file; diff is documentation.
  • ⚠️ Boundary conditions and edge cases [Minor] — The ShortChallenge subtype requires ‖c‖₁ ≤ ω...: ShortChallenge subtype not in this file; diff is documentation.
  • ⚠️ Completeness and missing parts [Minor] — The honest prover computeV and computeResp are not yet defined...: Honest prover not in this file; diff is documentation.
  • ⚠️ Completeness and missing parts [Minor] — The SendChallenge component is added but not yet used...: SendChallenge not in this file; diff is documentation.

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks: None

📄 **Review for `ArkLib/Commitments/Functional/Hachi/QuadEval.lean`**

Analysis:
The diff adds a new umbrella file ArkLib/Commitments/Functional/Hachi/QuadEval.lean that imports QuadEval.Soundness and QuadEval.Bridge and provides extensive documentation about the folder structure. The file contains no definitions, theorems, or proofs — it is purely organizational. The documentation describes the submodules, their roles, and claims about the formalization status (e.g., 'Soundness is genuinely sorry-free', 'isUnit_of_l1Norm_le is itself proven, not deferred'). The checklist items pertain to the mathematical content of the submodules, which are not shown in this diff, so they cannot be verified from this file alone. The main issue is a discrepancy between the documentation's claim that isUnit_of_l1Norm_le is proven and the LS18 specification which states it is deferred with sorry. The toolchain could not load the imported modules (expected if they are part of the same PR), so the claim cannot be independently verified, but the specification is the authoritative reference and directly contradicts the documentation.

Verdict: Needs Minor Revisions

Checklist Verification:

  • ⚠️ Paper result mapping (NOZ26 §2.1 gadget decomposition): This umbrella file contains no definitions or theorems; it only imports the submodules where the gadget decomposition is presumably defined. Cannot verify from this diff.
  • ⚠️ Paper result mapping (NOZ26 §4.1 inner-outer commitment): The inner-outer commitment scheme is defined in the imported submodules, not in this umbrella file. Cannot verify.
  • ⚠️ Paper result mapping (NOZ26 §4.2 QuadEval reduction and Lemma 8): The QuadEval reduction and Lemma 8 are in the imported Soundness.lean and Reduction.lean. Cannot verify from this file.
  • ⚠️ Paper result mapping (NOZ26 §4.2 polynomial-to-QuadEval bridge): The polynomial-to-QuadEval bridge is in Bridge.lean. Cannot verify from this file.
  • ⚠️ Paper result mapping (FMN24 coordinate-wise special soundness): Coordinate-wise special soundness definitions are in CoordinateWiseSpecialSoundness.lean (not in this diff). Cannot verify.
  • ⚠️ Paper result mapping (LS18 short-element invertibility): The isUnit_of_l1Norm_le lemma is referenced in the documentation but is in the LS18 module, not in this file. The documentation claims it is proven, but the specification says it is deferred. Cannot verify from this diff.

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks:

  • The documentation claims 'its one deep input, Lyubashevsky–Seiler short-element invertibility isUnit_of_l1Norm_le, is itself proven, not deferred.' However, the LS18 specification (docs/kb/papers/LS18.md) explicitly states: 'isUnit_of_l1Norm_le is currently deferred (sorry): the ideal-lattice minimum-distance argument is not yet available in Mathlib.' The NOZ26 specification also lists the invertibility input as deferred. This documentation may be inaccurate or the specification may be outdated; either way the conflict must be resolved to avoid misleading readers about the formalization's completeness. (ArkLib/Commitments/Functional/Hachi/QuadEval.lean:30-32) (confidence: medium)
    • Evidence: File docstring at QuadEval.lean (lines ~30-32) claims isUnit_of_l1Norm_le is proven; LS18 specification says 'isUnit_of_l1Norm_le is currently deferred (sorry)'.
📄 **Review for `ArkLib/OracleReduction/Security/CoordinateWiseSpecialSoundness.lean`**

Analysis:
The diff is a purely additive change to the re-export module CoordinateWiseSpecialSoundness.lean. It adds two new import statements (NoChallenge and SeqCompose) and expands the module-level docstring to describe these new submodules. The file itself defines no new types, theorems, or proofs—it simply aggregates and re-exports the CWSS submodules.

What the change does mathematically:

  • NoChallenge provides a degenerate bridge for protocols with empty challenge index sets, collapsing tree special soundness to a transcript-level extractor. This is a sensible formalization of the edge case where there are no challenge rounds.
  • SeqCompose provides n-ary sequential composition of CWSS structures, including an identity base case and shape unfolding. This is infrastructural for composing multiple CWSS protocols.

Checklist mapping:

  • The FMN24 Definitions 2.9/2.10 checklist items are about the Basic module, which was already imported and is unchanged by this diff.
  • The NoChallenge and SeqCompose modules are new infrastructure not directly mapped to specific paper results in the checklist. The checklist notes that SendChallenge is added but not yet used, and that SeqCompose's formalization appears correct.
  • No critical checklist items are violated or implicated by this diff.

Risk assessment:

  • The change is low-risk: adding imports and documentation to a re-export module. The only risk is if the imported modules (NoChallenge, SeqCompose) do not exist or have compilation errors, but that would be a pre-existing issue in those modules, not in this diff.
  • The toolchain could not verify the module identifiers due to missing repository context, which is expected in this review environment.

Faithfulness check:

  • This file is a re-export, not a statement of any paper theorem. No faithfulness check against paper results is needed beyond what the submodules already provide.

Lean 4 best practices:

  • The imports use correct module paths.
  • The docstring follows conventions with proper /-! ... -/ syntax.
  • No escape hatches are introduced.
  • No typeclass misuse, naming issues, or other best-practice violations.

Verdict: Approved

Checklist Verification:

  • FMN24 Definitions 2.9/2.10 — coordinate-wise special soundness SS(S, ℓ, k) and star-center extraction: The FMN24 Definitions 2.9/2.10 are formalized in the Basic submodule, which was already imported and is unchanged by this diff. The new imports (NoChallenge, SeqCompose) are infrastructural and do not affect the core CWSS definitions from the paper.
  • FMN24 coordinate-wise special soundness — SingleRound generic theorem and composition: The SeqCompose module provides n-ary sequential composition of CWSS structures. The checklist notes this formalization appears correct, and this diff merely adds the import and documents it.
  • FMN24 coordinate-wise special soundness — NoChallenge degenerate bridge: The NoChallenge module handles the degenerate case of protocols with no challenge rounds. The checklist notes SendChallenge is added but not yet used in Hachi composition; this is unrelated to the current diff.

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks: None

@alexanderlhicks
alexanderlhicks enabled auto-merge (squash) July 17, 2026 14:12
@alexanderlhicks
alexanderlhicks disabled auto-merge July 17, 2026 15:10
@alexanderlhicks
alexanderlhicks merged commit 3973cfe into main Jul 17, 2026
4 of 6 checks passed
@alexanderlhicks
alexanderlhicks deleted the hachi-polynomial-quadratic-eq branch July 17, 2026 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants