Documentation

CslibFrontier.Crypto.Protocols.PolynomialCommitment.LigeroProximity

Ligero interleaved proximity and evaluation soundness against arbitrary provers #

CslibFrontier.Crypto.Protocols.PolynomialCommitment.Basic formalizes single-column consistency of the Ligero matrix-code check (LigeroMatrixIOP.columnReduction_sound) only for the honest claim v = ligeroRowComb r U, leaving cheating prover responses v ≠ ligeroRowComb r U and proximity of M to an interleaved code unbounded. This module closes both gaps by connecting LigeroMatrixIOP's generator-matrix operations (ligeroRowComb, ligeroColumnCheck, ligeroEval, ligeroEvalCheck) to Cslib.Code.interleavedLinear and Cslib.Code.reedSolomon as a step toward #643 and #5968 (after [AHIV17] and [BSCI+23]; locator for [AHIV17] not re-verified against primary PDF):

  1. Generator-matrix codes and Reed–Solomon Vandermonde bridge (codeOfGenerator, reedSolomonGenerator, codeOfGenerator_reedSolomonGenerator, vecMul_reedSolomonGenerator_injective): the row-space code of the k × n Vandermonde matrix reedSolomonGenerator α k equals Cslib.Code.reedSolomon α k without duplicating the Reed–Solomon code definition, and encoding v ↦ v ᵥ* reedSolomonGenerator α k is injective whenever α is injective and k ≤ n.
  2. Ligero interleaved proximity reduction (ligeroProximityReduction): on input M : Matrix (Fin m) (Fin n) F, the verifier samples a uniform row-combination vector r : Fin m → F, receives a purported pre-encoded combination v : Fin l → F from the prover, samples q independent uniform column indices Q : Fin q → Fin n, and checks ligeroColumnCheck G M r v (Q t) for all t : Fin q (reading only the q queried columns of M, ligeroProximityReduction_outputOn_congr). Honest encodings M = U * G are accepted with error 0 (ligeroProximityReduction_complete). Against every prover strategy, any matrix M whose column-indexed transpose Function.swap M has column-Hamming distance > e from interleavedLinear (Fin m) (codeOfGenerator G) is rejected except with round-by-round and plain-model soundness error:
  3. Cheating-prover linear-evaluation soundness under unique decoding (toOuterMeasure_ligeroEvalCheck_false_le): when 2 * (e : ℕ∞) < minDist (codeOfGenerator G), encoding · ᵥ* G is injective, hammingDist (Function.swap M) (Function.swap (U * G)) ≤ e, and a claimed linear evaluation is false (ligeroEval U b c ≠ w), every prover vector v : Fin l → F passes q uniform column checks ligeroEvalCheck G M b c w v (Q t) with probability at most ((n - (e + 1)) / n) ^ q.

Prover-committed column oracles with straight-line witness extraction, quadratic constraint checks, zero-knowledge row masking, and BCS random-oracle compilation remain open under #643.

Main definitions #

Main results #

References #

Generator-matrix codes and Vandermonde Reed–Solomon bridge #

def Cslib.Crypto.Protocols.codeOfGenerator {F : Type u_1} [CommSemiring F] {l n : ℕ} (G : Matrix (Fin l) (Fin n) F) :
Submodule F (Fin n → F)

The linear code Submodule F (Fin n → F) spanned by the rows of G : Matrix (Fin l) (Fin n) F, consisting of all encoded words v ᵥ* G (v : Fin l → F).

@[simp]
theorem Cslib.Crypto.Protocols.mem_codeOfGenerator {F : Type u_1} [CommSemiring F] {l n : ℕ} {G : Matrix (Fin l) (Fin n) F} {w : Fin n → F} :
w ∈ codeOfGenerator G ↔ ∃ (v : Fin l → F), Matrix.vecMul v G = w

Membership in codeOfGenerator G means being of the form v ᵥ* G.

theorem Cslib.Crypto.Protocols.vecMul_mem_codeOfGenerator {F : Type u_1} [CommSemiring F] {l n : ℕ} (G : Matrix (Fin l) (Fin n) F) (v : Fin l → F) :

Every vector v : Fin l → F encodes to a codeword v ᵥ* G ∈ codeOfGenerator G.

def Cslib.Crypto.Protocols.reedSolomonGenerator {F : Type u_1} [Semiring F] {n : ℕ} (α : Fin n → F) (k : ℕ) :
Matrix (Fin k) (Fin n) F

The k × n Vandermonde generator matrix for Cslib.Code.reedSolomon α k at evaluation points α : Fin n → F, with entry (d, j) equal to α j ^ (d : ℕ).

@[simp]
theorem Cslib.Crypto.Protocols.reedSolomonGenerator_apply {F : Type u_1} [Semiring F] {n : ℕ} (α : Fin n → F) (k : ℕ) (d : Fin k) (j : Fin n) :
reedSolomonGenerator α k d j = α j ^ ↑d

Vandermonde generator bridge: the row-space code of reedSolomonGenerator α k is Cslib.Code.reedSolomon α k.

theorem Cslib.Crypto.Protocols.vecMul_reedSolomonGenerator_injective {F : Type u_1} [Field F] {n k : ℕ} {α : Fin n → F} (hα : Function.Injective α) (hkn : k ≤ n) :

Encoding v ↦ v ᵥ* reedSolomonGenerator α k is injective when α is injective and k ≤ n.

Column-query soundness and the Ligero interleaved proximity reduction #

theorem Cslib.Crypto.Protocols.toOuterMeasure_ligeroColumnCheck_all_le {F : Type} [Semiring F] [DecidableEq F] {m l n q e : ℕ} [NeZero n] (G : Matrix (Fin l) (Fin n) F) (M : Matrix (Fin m) (Fin n) F) (r : Fin m → F) (v : Fin l → F) (hfar : e < hammingDist (Matrix.vecMul r M) (Matrix.vecMul v G)) :
(Probability.PMF.uniformOfFintype (Fin q → Fin n)).toOuterMeasure {Q : Fin q → Fin n | ∀ (t : Fin q), ligeroColumnCheck G M r v (Q t) = true} ≤ (↑(n - (e + 1)) / ↑n) ^ q

Column-query escape bound: if r ᵥ* M and v ᵥ* G disagree on strictly more than e columns (e < hammingDist (r ᵥ* M) (v ᵥ* G)), then q independent uniform column queries Q : Fin q → Fin n all pass ligeroColumnCheck G M r v (Q t) with probability at most ((n - (e + 1)) / n) ^ q.

def Cslib.Crypto.Protocols.ligeroCodewordRel {F : Type} [Semiring F] (m : ℕ) {l n : ℕ} (G : Matrix (Fin l) (Fin n) F) :
Matrix (Fin m) (Fin n) F → Matrix (Fin m) (Fin l) F → Prop

Honest Ligero encoding relation: M is the row-wise encoding U * G of witness matrix U.

def Cslib.Crypto.Protocols.ligeroProximityLang {F : Type} [CommSemiring F] [DecidableEq F] (m : ℕ) {l n : ℕ} (G : Matrix (Fin l) (Fin n) F) (e : ℕ) :
Set (Matrix (Fin m) (Fin n) F)

Interleaved e-proximity language for G: m × n matrices M whose column-indexed transpose Function.swap M lies within column-Hamming distance e of interleavedLinear (Fin m) (codeOfGenerator G).

theorem Cslib.Crypto.Protocols.mem_ligeroProximityLang_of_rel {F : Type} [CommSemiring F] [DecidableEq F] {m l n : ℕ} {G : Matrix (Fin l) (Fin n) F} {M : Matrix (Fin m) (Fin n) F} {U : Matrix (Fin m) (Fin l) F} (hrel : ligeroCodewordRel m G M U) (e : ℕ) :

Every honestly encoded matrix M = U * G belongs to ligeroProximityLang m G e for all e.

@[reducible, inline]

Round specification of the Ligero interleaved proximity test: uniform row-combination challenge r : Fin m → F, prover response v : Fin l → F, and q uniform column queries Q : Fin q → Fin n.

Ligero interleaved proximity reduction: tests proximity of M : Matrix (Fin m) (Fin n) F to interleavedLinear (Fin m) (codeOfGenerator G) by checking q uniformly sampled columns of a random row linear combination r ᵥ* M against v ᵥ* G.

theorem Cslib.Crypto.Protocols.ligeroProximityReduction_outputOn {F : Type} [Field F] [Fintype F] [DecidableEq F] (m : ℕ) {l n : ℕ} [NeZero n] (G : Matrix (Fin l) (Fin n) F) (q : ℕ) (M : Matrix (Fin m) (Fin n) F) (r : Fin m → F) (v : Fin l → F) (Q : Fin q → Fin n) :
theorem Cslib.Crypto.Protocols.ligeroProximityReduction_outputOn_congr {F : Type} [Field F] [Fintype F] [DecidableEq F] (m : ℕ) {l n : ℕ} [NeZero n] (G : Matrix (Fin l) (Fin n) F) (q : ℕ) {M₁ M₂ : Matrix (Fin m) (Fin n) F} (r : Fin m → F) (v : Fin l → F) (Q : Fin q → Fin n) (hcols : ∀ (t : Fin q) (i : Fin m), M₁ i (Q t) = M₂ i (Q t)) :

Query locality: the verifier's output depends on M only through the q queried columns Q t (t : Fin q).

Completeness of the Ligero proximity reduction: every honestly encoded matrix M = U * G is accepted with error 0.

theorem Cslib.Crypto.Protocols.ligeroProximityReduction_rbrSound_of_three_mul_lt_minDist {F : Type} [Field F] [Fintype F] [DecidableEq F] (m : ℕ) {l n q e : ℕ} [NeZero n] {G : Matrix (Fin l) (Fin n) F} (hmin : 3 * ↑e < Code.minDist ↑(codeOfGenerator G)) :
(ligeroProximityReduction m G q).verifier.RbrSound (ligeroProximityLang m G e) Set.univ (↑(e + 1) / ↑(Fintype.card F), (↑(n - (e + 1)) / ↑n) ^ q, ())

Step toward #643 and #5968 after [AHIV17] (locator not re-verified against primary PDF; round-by-round soundness of ligeroProximityReduction within d / 3 against all prover strategies): when 3 * (e : ℕ∞) < minDist (codeOfGenerator G), the row-combination round has escape error at most (e + 1) / |F| and the q-column query round has escape error at most ((n - (e + 1)) / n) ^ q.

Plain-model soundness of the Ligero proximity reduction within d / 3 against every (unbounded, adaptive) prover strategy.

theorem Cslib.Crypto.Protocols.ligeroProximityReduction_reedSolomon_rbrSound {F : Type} [Field F] [Fintype F] [DecidableEq F] (m : ℕ) {k n q e : ℕ} [NeZero n] {α : Fin n → F} (hα : Function.Injective α) (hunique : 2 * e + k ≤ n) :

Round-by-round soundness of the Reed–Solomon Ligero proximity reduction across the full unique-decoding radius (2 * e + k ≤ n, derived via [BenSassonCarmonIshaiKoppartySaraf2020, Theorem 1.6 / eq. (1.2)]): the row-combination round has escape error at most n / |F| and the q-column query round has escape error at most ((n - (e + 1)) / n) ^ q.

Plain-model soundness of the Reed–Solomon Ligero proximity reduction across the full unique-decoding radius (2 * e + k ≤ n) against every prover strategy.

Cheating-prover soundness of ligeroEvalCheck under unique decoding #

theorem Cslib.Crypto.Protocols.toOuterMeasure_ligeroEvalCheck_false_le {F : Type} [CommRing F] [DecidableEq F] {m l n q e : ℕ} [NeZero n] (G : Matrix (Fin l) (Fin n) F) (hmin : 2 * ↑e < Code.minDist ↑(codeOfGenerator G)) (hinj : Function.Injective fun (v : Fin l → F) => Matrix.vecMul v G) {M : Matrix (Fin m) (Fin n) F} {U : Matrix (Fin m) (Fin l) F} (hclose : hammingDist (Function.swap M) (Function.swap (U * G)) ≤ e) (b : Fin m → F) (c : Fin l → F) (w : F) (hfalse : ligeroEval U b c ≠ w) (v : Fin l → F) :
(Probability.PMF.uniformOfFintype (Fin q → Fin n)).toOuterMeasure {Q : Fin q → Fin n | ∀ (t : Fin q), ligeroEvalCheck G M b c w v (Q t) = true} ≤ (↑(n - (e + 1)) / ↑n) ^ q

Cheating-prover linear-evaluation soundness: suppose 2 * (e : ℕ∞) < minDist (codeOfGenerator G), encoding · ᵥ* G is injective, and Function.swap M lies within column-Hamming distance e of Function.swap (U * G). If a claimed bilinear evaluation is false (ligeroEval U b c ≠ w), then every prover response v : Fin l → F (not only the honest ligeroRowComb b U) passes q uniform column checks ligeroEvalCheck G M b c w v (Q t) with probability at most ((n - (e + 1)) / n) ^ q.