Documentation

CslibFrontier.Crypto.Protocols.FRI.DeepALI

Coset-Folding Correlated Agreement, Out-of-Domain DEEP Quotienting, and DEEP-ALI Soundness #

This module connects the Reed–Solomon proximity-gap and batched FRI IOP developments of CslibFrontier.Crypto.Protocols.FRI to algebraic constraint linking and out-of-domain ("sampling outside the box") polynomial protocols across three layers:

  1. General a-to-1 coset-folding correlated-agreement soundness (FoldSoundness): CslibFrontier.Crypto.Protocols.FRI.Folding defines arbitrary-arity fiberwise coset folding foldWord g ω f z : Fin N → F for any a ≥ 1 with (a : F) ≠ 0 and proves fiberwise lifting (exists_mem_reedSolomon_weighted_agree_lift), while FRI.Soundness / FRI.JohnsonSoundness specialize folding soundness to power-of-two schedules 2 ^ stepLog i. Here we establish standalone single-step folding soundness bounds directly on foldWord g ω f z for arbitrary positive arity a (including odd and composite radices) in both the unique-decoding regime (toOuterMeasure_foldWord_reedSolomon_close_le_unique) and the integer-weighted Guruswami–Sudan Johnson regime (toOuterMeasure_foldWord_reedSolomon_weighted_agree_le_johnson_exact).

  2. Out-of-domain DEEP quotienting, degree restoration, and Johnson list bounds (DeepQuotient): formalizes polynomial quotienting deepQuotientPoly p z = p /ₘ (X - C z) and word-level virtual quotienting deepQuotientWord α f z y = fun s => (f s - y) / (α s - z) following the DEEP (Domain Extending for Eliminating Pretenders) technique of [BSGKS20]. Proves Reed–Solomon closure (deepQuotientWord_mem_reedSolomon), exact degree restoration and out-of-domain evaluation pinning from correlated agreement on any subset D' avoiding z (exists_poly_of_deepQuotientWord_agree), unique interpolation on D' (eq_of_degree_lt_of_eval_eq_on), and finite candidate-polynomial list bounds agreePolyList across both the unique-decoding radius (card_agreePolyList_le_one_of_unique) and the exact integer Johnson radius |ι| * (k - 1) < a ^ 2 (card_agreePolyList_le_of_johnson, via [Joh62]).

  3. DEEP-ALI (Algebraic Linking IOP with Out-of-Domain Sampling) & Batched FRI Bridge (DeepALI): formalizes multi-column masked polynomial constraint systems DeepALISystem (with monic zerofiers Z_m(X), multiplicative trace shifts maskShift u * X, split composition-quotient chunks via polyDegreeChunk, and an out-of-domain sampling set oodDom), the interactive protocol game deepALIGame delegating low-degree testing of all mask and quotient-chunk DEEP words to a single (m + 2)-round friSmoothBatchIOP execution ([BSCI+23], Section 8.2), the honest prover honestDeepALIProver with perfect completeness (deepALIGame_honest_eq_pure_true), deterministic correlated-agreement witness extraction (exists_polys_of_batchStmt_mem_proximityLang), and unconditional adaptive interactive soundness in both the unique-decoding regime (deepALIGame_le_of_unique) and the 1 - √ρ - η Johnson list-decoding regime (deepALIGame_le_of_johnson_eta, using this library's explicit Siegel constants for batched FRI; internal theorem and page locators of [BSGKS20] were not re-verified against the primary PDF). Binary 2-to-1 FRIParams corollaries follow via FRIParams.toSmooth (deepALIGame_ofBinary_le_of_johnson_eta).

Main definitions #

Main results #

References #

Part 1: Standalone a-to-1 Coset-Folding Correlated-Agreement Soundness Bridge #

theorem Cslib.Crypto.Protocols.FRI.toOuterMeasure_foldWord_reedSolomon_close_le_unique {F : Type u_1} [Field F] [Fintype F] [DecidableEq F] {g ω : F} {a N k e : ℕ} (hg : g ≠ 0) (ha : ↑a ≠ 0) (hN : 0 < N) (hω : IsPrimitiveRoot ω (a * N)) (huniq : 2 * (e / a) + k ≤ N) {f : Fin (a * N) → F} (hfar : ∀ c ∈ Code.reedSolomon (cosetPoint g ω (a * N)) (a * k), e < hammingDist f c) :
(Probability.PMF.uniformOfFintype F).toOuterMeasure {z : F | ∃ c' ∈ Code.reedSolomon (cosetPoint (g ^ a) (ω ^ a) N) k, hammingDist (foldWord g ω f z) c' ≤ e / a} ≤ ↑((a - 1) * N) / ↑(Fintype.card F)

Standalone a-to-1 coset-folding soundness in the unique-decoding regime (2 * (e / a) + k ≤ N, derived from [BenSassonCarmonIshaiKoppartySaraf2020, Theorems 1.5 and 6.1] and exists_mem_reedSolomon_weighted_agree_lift): for any field F, nonzero coset offset g, positive folding arity a with (a : F) ≠ 0, target size N > 0, and primitive (a * N)-th root of unity ω, if f : Fin (a * N) → F has Hamming distance strictly greater than e from reedSolomon (cosetPoint g ω (a * N)) (a * k), then foldWord g ω f z lies within Hamming distance e / a of reedSolomon (cosetPoint (g ^ a) (ω ^ a) N) k with probability at most ((a - 1) * N) / |F| over uniform z : F.

theorem Cslib.Crypto.Protocols.FRI.toOuterMeasure_foldWord_reedSolomon_weighted_agree_le_johnson_exact {F : Type u_1} [Field F] [Fintype F] [DecidableEq F] {g ω : F} {a N k m_GS D M₀ W_tot B : ℕ} (hg : g ≠ 0) (ha : ↑a ≠ 0) (hN : 0 < N) (hω : IsPrimitiveRoot ω (a * N)) (hk : 1 ≤ k) (hm_GS : 1 ≤ m_GS) (hM₀ : 0 < M₀) {W : Fin (a * N) → ℕ} (hW_le : ∀ (i : Fin (a * N)), W i ≤ M₀) (hW_sum : ∑ i : Fin (a * N), W i ≤ W_tot) (hk_le : k ≤ (B + 1 + a * M₀ - 1) / (a * M₀)) (hinterp : N * (m_GS * (m_GS + 1) / 2) < (Code.Sudan.monomials (k - 1) D).card) (hroot : D < m_GS * ((B + 1 + a * M₀ - 1) / (a * M₀))) {f : Fin (a * N) → F} (hfar : ∀ c ∈ Code.reedSolomon (cosetPoint g ω (a * N)) (a * k), ∑ i : Fin (a * N) with f i = c i, W i ≤ B) :
(Probability.PMF.uniformOfFintype F).toOuterMeasure {z : F | ∃ c' ∈ Code.reedSolomon (cosetPoint (g ^ a) (ω ^ a) N) k, B < ∑ j : Fin N with foldWord g ω f z j = c' j, pushWeight W j} ≤ ↑(Code.ProximityGap.johnsonCurveBound N m_GS (k - 1) D (a - 1) W_tot) / ↑(Fintype.card F)

Standalone integer-weighted a-to-1 coset-folding correlated-agreement bound in the Guruswami–Sudan Johnson regime (in the setting of [BenSassonCarmonIshaiKoppartySaraf2020, Theorems 1.5, 6.2, and 7.2]): for arbitrary folding arity a ≥ 1 with (a : F) ≠ 0, weights W : Fin (a * N) → ℕ bounded pointwise by M₀ > 0 with sum at most W_tot, and Guruswami–Sudan parameters (m_GS, D) at fiber cap a * M₀, if no codeword in reedSolomon (cosetPoint g ω (a * N)) (a * k) achieves W-weighted agreement > B with f, then foldWord g ω f z achieves (pushWeight W)-weighted agreement > B with a codeword in reedSolomon (cosetPoint (g ^ a) (ω ^ a) N) k with probability at most johnsonCurveBound N m_GS (k - 1) D (a - 1) W_tot / |F|.

Part 2: Out-of-Domain DEEP Quotienting, Degree Restoration, and List Size Bounds #

noncomputable def Cslib.Crypto.Protocols.FRI.deepQuotientPoly {F : Type u_1} [Field F] (p : Polynomial F) (z : F) :

Out-of-domain DEEP polynomial quotient: divides p by the monic linear factor X - C z ((p - C (p.eval z)) / (X - C z)), lowering the degree by 1 while recording p.eval z.

Exact polynomial division identity for deepQuotientPoly: (X - C z) * deepQuotientPoly p z + C (p.eval z) = p.

theorem Cslib.Crypto.Protocols.FRI.degree_deepQuotientPoly_lt {F : Type u_1} [Field F] {p : Polynomial F} {k : ℕ} (hp : p.degree < ↑(k + 1)) (z : F) :

Degree drop of deepQuotientPoly: if deg(p) < k + 1, then deg(deepQuotientPoly p z) < k.

def Cslib.Crypto.Protocols.FRI.deepQuotientWord {F : Type u_1} {ι : Type u_2} [Field F] (α f : ι → F) (z y : F) :
ι → F

Word-level DEEP quotient oracle: virtual evaluation word s ↦ (f s - y) / (α s - z) testing simultaneously that f comes from a low-degree polynomial p and that p.eval z = y ([BSGKS20]).

theorem Cslib.Crypto.Protocols.FRI.deepQuotientWord_eval_eq {F : Type u_1} {ι : Type u_2} [Field F] {α : ι → F} (p : Polynomial F) {z : F} (hz : ∀ (s : ι), α s ≠ z) :
deepQuotientWord α (fun (s : ι) => Polynomial.eval (α s) p) z (Polynomial.eval z p) = fun (s : ι) => Polynomial.eval (α s) (deepQuotientPoly p z)

On any domain α : ι → F avoiding z, deepQuotientWord of an honest evaluation word s ↦ p.eval (α s) at y = p.eval z coincides pointwise with evaluating deepQuotientPoly p z.

theorem Cslib.Crypto.Protocols.FRI.deepQuotientWord_mem_reedSolomon {F : Type u_1} {ι : Type u_2} [Field F] {α : ι → F} {p : Polynomial F} {k : ℕ} (hp : p.degree < ↑(k + 1)) {z : F} (hz : ∀ (s : ι), α s ≠ z) :
deepQuotientWord α (fun (s : ι) => Polynomial.eval (α s) p) z (Polynomial.eval z p) ∈ Code.reedSolomon α k

Reed–Solomon completeness of DEEP quotienting: if deg(p) < k + 1 and z lies outside the evaluation domain α, then deepQuotientWord α (fun s => p.eval (α s)) z (p.eval z) belongs to reedSolomon α k.

theorem Cslib.Crypto.Protocols.FRI.exists_poly_of_deepQuotientWord_agree {F : Type u_1} {ι : Type u_2} [Field F] {α f v : ι → F} {z y : F} {k : ℕ} {D' : Finset ι} (hz : ∀ s ∈ D', α s ≠ z) (hv : v ∈ Code.reedSolomon α k) (hagree : ∀ s ∈ D', deepQuotientWord α f z y s = v s) :
∃ (p : Polynomial F), p.degree < ↑(k + 1) ∧ Polynomial.eval z p = y ∧ ∀ s ∈ D', f s = Polynomial.eval (α s) p

DEEP correlated-agreement degree restoration and evaluation pinning: if z avoids α '' D' and deepQuotientWord α f z y agrees on D' with a codeword v ∈ reedSolomon α k, then there exists a polynomial p of degree < k + 1 that evaluates to y at z and agrees with f on all of D'.

theorem Cslib.Crypto.Protocols.FRI.eq_of_degree_lt_of_eval_eq_on {F : Type u_1} {ι : Type u_2} [Field F] {α : ι → F} (hα : Function.Injective α) {k : ℕ} {D' : Finset ι} (hcard : k ≤ D'.card) {p₁ p₂ : Polynomial F} (hp₁ : p₁.degree < ↑k) (hp₂ : p₂.degree < ↑k) (heq : ∀ s ∈ D', Polynomial.eval (α s) p₁ = Polynomial.eval (α s) p₂) :
p₁ = p₂

Two polynomials of degree < k that agree on D' of size ≥ k along an injective domain map α : ι → F are identical.

noncomputable def Cslib.Crypto.Protocols.FRI.agreePolyList {F : Type u_1} {ι : Type u_2} [Field F] [Fintype F] [DecidableEq F] [Fintype ι] (α : ι → F) (k : ℕ) (w : ι → F) (a : ℕ) :

Finite list of all polynomials p : F[X] of degree < k agreeing with w : ι → F on at least a coordinates of α : ι → F.

@[simp]
theorem Cslib.Crypto.Protocols.FRI.mem_agreePolyList {F : Type u_1} {ι : Type u_2} [Field F] [Fintype F] [DecidableEq F] [Fintype ι] {α : ι → F} {k a : ℕ} {w : ι → F} {p : Polynomial F} :
p ∈ agreePolyList α k w a ↔ p.degree < ↑k ∧ a ≤ {s : ι | Polynomial.eval (α s) p = w s}.card

Membership in agreePolyList α k w a characterizes p.degree < k with agreement ≥ a.

theorem Cslib.Crypto.Protocols.FRI.card_agreePolyList_le_one_of_unique {F : Type u_1} {ι : Type u_2} [Field F] [Fintype F] [DecidableEq F] [Fintype ι] {α : ι → F} (hα : Function.Injective α) {k a : ℕ} (huniq : Fintype.card ι + k ≤ 2 * a) (w : ι → F) :
(agreePolyList α k w a).card ≤ 1

Unique-decoding list-size bound (#agreePolyList ≤ 1): when Fintype.card ι + k ≤ 2 * a, at most one polynomial of degree < k agrees with w on ≥ a points.

theorem Cslib.Crypto.Protocols.FRI.card_agreePolyList_le_of_johnson {F : Type u_1} {ι : Type u_2} [Field F] [Fintype F] [DecidableEq F] [Fintype ι] {α : ι → F} (hα : Function.Injective α) {k a : ℕ} (hk : 1 ≤ k) (hjohnson : Fintype.card ι * (k - 1) < a ^ 2) (w : ι → F) :
(agreePolyList α k w a).card ≤ Fintype.card ι * (a - (k - 1)) / (a ^ 2 - Fintype.card ι * (k - 1))

Exact integer Johnson list-size bound for agreePolyList ([Joh62], via Cslib.Code.card_mul_sub_le_of_le_card_of_card_inter_le): for 1 ≤ k and |ι| * (k - 1) < a ^ 2, the number of polynomials of degree < k agreeing with w on at least a points of α is at most (|ι| * (a - (k - 1))) / (a ^ 2 - |ι| * (k - 1)).

Part 3: DEEP-ALI Protocol & Correlated-Agreement Soundness Bridge to Batched FRI #

noncomputable def Cslib.Crypto.Protocols.FRI.constraintDegBound {F : Type u_1} [CommSemiring F] {M : ℕ} (p : MvPolynomial (Option (Fin M)) F) (k : ℕ) :

Tight univariate natDegree upper bound on a multivariate constraint polynomial p : MvPolynomial (Option (Fin M)) F when none substitutes X and some u substitutes a masked polynomial of natDegree ≤ k.

noncomputable def Cslib.Crypto.Protocols.FRI.polyDegreeChunk {F : Type u_1} [Semiring F] (B : ℕ) (p : Polynomial F) (j : ℕ) :

Extract the j-th degree-B chunk ∑_{t < B} coeff(p, j * B + t) X^t of p : F[X].

theorem Cslib.Crypto.Protocols.FRI.degree_polyDegreeChunk_lt {F : Type u_1} [Semiring F] (k : ℕ) (p : Polynomial F) (j : ℕ) :
(polyDegreeChunk (k + 1) p j).degree < ↑(k + 1)

Every chunk polyDegreeChunk (k + 1) p j has degree strictly less than k + 1.

theorem Cslib.Crypto.Protocols.FRI.sum_X_pow_mul_polyDegreeChunk {F : Type u_1} [Semiring F] {numChunks k : ℕ} {p : Polynomial F} (hp : p.degree < ↑(numChunks * (k + 1))) :
∑ j : Fin numChunks, Polynomial.X ^ (↑j * (k + 1)) * polyDegreeChunk (k + 1) p ↑j = p

Exact degree-chunk decomposition: any polynomial p of degree < numChunks * (k + 1) equals ∑ j : Fin numChunks, X ^ (j * (k + 1)) * polyDegreeChunk (k + 1) p j.

structure Cslib.Crypto.Protocols.FRI.DeepALISystem (F : Type) [Field F] (w M c_num q_extra : ℕ) :

Masked Algebraic Constraint System for DEEP-ALI: specifies smooth FRI parameters params (fixing initial Reed–Solomon dimension k = params.dim 0 and trace/chunk degree bound < k + 1), w trace columns, M multiplicative trace mask entries (maskCol u, maskShift u), c_num polynomial constraints constraintPoly m with monic zerofier divisors zerofier m, q_extra + 1 composition-quotient chunks satisfying the tight degree budget hquot_deg, and a nonempty out-of-domain sampling set oodDom disjoint from the FRI coset, its inverse mask shifts, and the zerofier roots.

def Cslib.Crypto.Protocols.FRI.DeepALISystem.evalDom {F : Type} [Field F] {w M c_num q_extra : ℕ} (sys : DeepALISystem F w M c_num q_extra) :
Fin (2 ^ sys.params.d) → F

Initial FRI evaluation coset L₀ : Fin (2 ^ d) → F of sys.

theorem Cslib.Crypto.Protocols.FRI.DeepALISystem.evalDom_injective {F : Type} [Field F] {w M c_num q_extra : ℕ} (sys : DeepALISystem F w M c_num q_extra) :

Injectivity of sys.evalDom.

noncomputable def Cslib.Crypto.Protocols.FRI.DeepALISystem.evalConstraintPoint {F : Type} [Field F] {w M c_num q_extra : ℕ} (sys : DeepALISystem F w M c_num q_extra) (m : Fin c_num) (x : F) (y_mask : Fin M → F) :
F

Pointwise evaluation C_m(x, y_mask) of constraint m at point x and mask values y_mask.

noncomputable def Cslib.Crypto.Protocols.FRI.DeepALISystem.evalMaskPoly {F : Type} [Field F] {w M c_num q_extra : ℕ} (sys : DeepALISystem F w M c_num q_extra) (m : Fin c_num) (P : Fin w → Polynomial F) :

Univariate polynomial C_m(X, P_{maskCol 0}(maskShift 0 · X), …) obtained by substituting the shifted trace polynomials P : Fin w → F[X] into constraint m.

theorem Cslib.Crypto.Protocols.FRI.DeepALISystem.eval_evalMaskPoly {F : Type} [Field F] {w M c_num q_extra : ℕ} (sys : DeepALISystem F w M c_num q_extra) (m : Fin c_num) (P : Fin w → Polynomial F) (x : F) :
Polynomial.eval x (sys.evalMaskPoly m P) = sys.evalConstraintPoint m x fun (u : Fin M) => Polynomial.eval (sys.maskShift u * x) (P (sys.maskCol u))

Evaluating sys.evalMaskPoly m P at x : F coincides with sys.evalConstraintPoint m x on the shifted evaluations u ↦ (P (maskCol u)).eval (maskShift u * x).

theorem Cslib.Crypto.Protocols.FRI.DeepALISystem.natDegree_evalMaskPoly_le {F : Type} [Field F] {w M c_num q_extra : ℕ} (sys : DeepALISystem F w M c_num q_extra) (m : Fin c_num) {P : Fin w → Polynomial F} (hP : ∀ (i : Fin w), (P i).degree < ↑(sys.params.dim 0 + 1)) :

Tight univariate degree bound for evalMaskPoly: when every P i has degree < sys.params.dim 0 + 1, (sys.evalMaskPoly m P).natDegree is at most constraintDegBound (sys.constraintPoly m) (sys.params.dim 0).

theorem Cslib.Crypto.Protocols.FRI.DeepALISystem.prod_X_sub_C_dvd_evalMaskPoly_iff {F : Type} [Field F] {w M c_num q_extra : ℕ} (sys : DeepALISystem F w M c_num q_extra) (m : Fin c_num) (H : Finset F) (hZ : sys.zerofier m = ∏ x ∈ H, (Polynomial.X - Polynomial.C x)) (P : Fin w → Polynomial F) :
sys.zerofier m ∣ sys.evalMaskPoly m P ↔ ∀ x ∈ H, (sys.evalConstraintPoint m x fun (u : Fin M) => Polynomial.eval (sys.maskShift u * x) (P (sys.maskCol u))) = 0

Pointwise root-set characterization of zerofier divisibility: when zerofier m = ∏ x ∈ H, (X - C x) for a subset H : Finset F, divisibility zerofier m ∣ evalMaskPoly m P holds if and only if the algebraic constraint vanishes at every x ∈ H.

def Cslib.Crypto.Protocols.FRI.DeepALISystem.IsValidWitness {F : Type} [Field F] {w M c_num q_extra : ℕ} (sys : DeepALISystem F w M c_num q_extra) (P : Fin w → Polynomial F) :

A polynomial tuple P : Fin w → F[X] is a valid witness for sys when each P i has degree < params.dim 0 + 1 and every constraint evalMaskPoly m P is divisible by zerofier m.

def Cslib.Crypto.Protocols.FRI.DeepALISystem.Satisfiable {F : Type} [Field F] {w M c_num q_extra : ℕ} (sys : DeepALISystem F w M c_num q_extra) :

Algebraic satisfiability of sys: existence of a low-degree polynomial tuple satisfying all constraints.

def Cslib.Crypto.Protocols.FRI.DeepALISystem.linkDegBound {F : Type} [Field F] {w M c_num q_extra : ℕ} (sys : DeepALISystem F w M c_num q_extra) :

Explicit algebraic-linking degree bound D_ALI = (q_extra + 1) * (params.dim 0 + 1) - 1 + ∑ m, (zerofier m).natDegree governing the out-of-domain DEEP soundness error.

noncomputable def Cslib.Crypto.Protocols.FRI.DeepALISystem.johnsonListBound {F : Type} [Field F] {w M c_num q_extra : ℕ} (sys : DeepALISystem F w M c_num q_extra) (α : ℝ) :

Exact integer Johnson list-size bound `max 1 ((2 ^ d * (⌈α * 2 ^ d⌉₊ - k)) / ((⌈α * 2 ^ d⌉₊) ^ 2

  • 2 ^ d * k)) for degree-< k + 1trace and quotient-chunk polynomials at relative agreement thresholdα`.

Prover's out-of-domain evaluation claims in DEEP-ALI: maskVals u claims P_{maskCol u}(maskShift u * z) and quotVals j claims Q_j(z).

  • maskVals : Fin M → F

    Claimed evaluations at the M shifted out-of-domain points maskShift u * z.

  • quotVals : Fin (q_extra + 1) → F

    Claimed evaluations of the q_extra + 1 composition-quotient chunks at z.

theorem Cslib.Crypto.Protocols.FRI.DeepALIOpening.ext {F : Type} {M q_extra : ℕ} {x y : DeepALIOpening F M q_extra} (maskVals : x.maskVals = y.maskVals) (quotVals : x.quotVals = y.quotVals) :
x = y
noncomputable def Cslib.Crypto.Protocols.FRI.DeepALISystem.linkCheck {F : Type} [Field F] {w M c_num q_extra : ℕ} [DecidableEq F] (sys : DeepALISystem F w M c_num q_extra) (β : Fin c_num → F) (z : F) (op : DeepALIOpening F M q_extra) :

Boolean algebraic linking check at out-of-domain challenge z and constraint weights β: verifies ∑ m, β_m * C_m(z, maskVals) / Z_m(z) = ∑ j, z ^ (j * (k + 1)) * quotVals j.

def Cslib.Crypto.Protocols.FRI.DeepALISystem.batchStmt {F : Type} [Field F] {w M c_num q_extra : ℕ} (sys : DeepALISystem F w M c_num q_extra) (T : Fin w → BCS.OracleTable sys.params.d F) (Q_orc : Fin (q_extra + 1) → BCS.OracleTable sys.params.d F) (z : F) (op : DeepALIOpening F M q_extra) :
FRIBatchStmt F sys.params.d (M + q_extra)

Virtual (M + q_extra)-term FRIBatchStmt produced by DEEP quotienting:

  • base is the 0-th composition-quotient chunk's DEEP word (Q_orc 0 s - quotVals 0) / (α s - z).
  • terms packs the M mask DEEP words (T (maskCol u) s - maskVals u) / (α s - maskShift u * z) followed by the q_extra higher composition-quotient DEEP words.
structure Cslib.Crypto.Protocols.FRI.DeepALIProver {F : Type} [Field F] {w M c_num q_extra : ℕ} (sys : DeepALISystem F w M c_num q_extra) :

Adaptive (possibly randomized) cheating prover for DeepALISystem:

  1. commits trace evaluation tables T : Fin w → OracleTable d F,
  2. upon receiving random constraint-linking scalars β : Fin c_num → F, commits composition-quotient chunk tables Q_orc : Fin (q_extra + 1) → OracleTable d F, and
  3. upon receiving out-of-domain sample z ∈ oodDom, outputs claimed evaluations DeepALIOpening together with an adaptive interactive prover for friSmoothBatchIOP.
noncomputable def Cslib.Crypto.Protocols.FRI.deepALIGame {F : Type} [Field F] [Fintype F] [DecidableEq F] {w M c_num q_extra : ℕ} (sys : DeepALISystem F w M c_num q_extra) (adv : DeepALIProver sys) :

Interactive DEEP-ALI + Smooth Batched FRI Game: runs adv across trace commitment, uniform constraint linking β : Fin c_num → F, quotient commitment, uniform out-of-domain sampling z ∈ sys.oodDom, the algebraic linking check sys.linkCheck β z op, and the (m + 2)-round batched smooth FRI IOP friSmoothBatchIOP sys.params (M + q_extra).

noncomputable def Cslib.Crypto.Protocols.FRI.honestCombinedQuot {F : Type} [Field F] {w M c_num q_extra : ℕ} (sys : DeepALISystem F w M c_num q_extra) (P : Fin w → Polynomial F) (β : Fin c_num → F) :

Honest combined composition-quotient polynomial ∑ m, C (β m) * (evalMaskPoly m P /ₘ zerofier m) formed from a polynomial tuple P : Fin w → F[X].

noncomputable def Cslib.Crypto.Protocols.FRI.honestDeepALIProver {F : Type} [Field F] [DecidableEq F] {w M c_num q_extra : ℕ} (sys : DeepALISystem F w M c_num q_extra) (P : Fin w → Polynomial F) :

Honest DEEP-ALI prover given any polynomial tuple P : Fin w → F[X]: commits the coset evaluations of P, commits the (q_extra + 1) degree-(k + 1) chunks of honestCombinedQuot, opens their exact evaluations at z, and executes the honest causal friSmoothBatchIOP prover.

theorem Cslib.Crypto.Protocols.FRI.deepALIGame_honest_eq_pure_true {F : Type} [Field F] [Fintype F] [DecidableEq F] {w M c_num q_extra : ℕ} (sys : DeepALISystem F w M c_num q_extra) {P : Fin w → Polynomial F} (hP : sys.IsValidWitness P) :

Perfect completeness of DEEP-ALI + Smooth Batched FRI: for every valid witness P (sys.IsValidWitness P), deepALIGame sys (honestDeepALIProver sys P) outputs true with probability 1.

noncomputable def Cslib.Crypto.Protocols.FRI.traceColCandList {F : Type} [Field F] [Fintype F] [DecidableEq F] {w M c_num q_extra : ℕ} (sys : DeepALISystem F w M c_num q_extra) (T : Fin w → BCS.OracleTable sys.params.d F) (a : ℕ) (i : Fin w) :

Candidate polynomial list for trace column i : Fin w at agreement threshold a: equals agreePolyList sys.evalDom (k + 1) (T i) a when column i is referenced by at least one mask entry, and {0} otherwise.

theorem Cslib.Crypto.Protocols.FRI.exists_polys_of_batchStmt_mem_proximityLang {F : Type} [Field F] [Fintype F] [DecidableEq F] {w M c_num q_extra e : ℕ} (sys : DeepALISystem F w M c_num q_extra) {T : Fin w → BCS.OracleTable sys.params.d F} {Q_orc : Fin (q_extra + 1) → BCS.OracleTable sys.params.d F} {z : F} (hz : z ∈ sys.oodDom) {op : DeepALIOpening F M q_extra} (hinterp_card : sys.params.dim 0 + 1 ≤ 2 ^ sys.params.d - e) (hmem : sys.batchStmt T Q_orc z op ∈ sys.params.batchProximityLang (M + q_extra) e) :
∃ (P : Fin w → Polynomial F) (Q_poly : Fin (q_extra + 1) → Polynomial F), P ∈ Fintype.piFinset (traceColCandList sys T (2 ^ sys.params.d - e)) ∧ (Q_poly ∈ Fintype.piFinset fun (j : Fin (q_extra + 1)) => agreePolyList sys.evalDom (sys.params.dim 0 + 1) (Q_orc j) (2 ^ sys.params.d - e)) ∧ (∀ (i : Fin w), (P i).degree < ↑(sys.params.dim 0 + 1)) ∧ (∀ (j : Fin (q_extra + 1)), (Q_poly j).degree < ↑(sys.params.dim 0 + 1)) ∧ (∀ (u : Fin M), Polynomial.eval (sys.maskShift u * z) (P (sys.maskCol u)) = op.maskVals u) ∧ ∀ (j : Fin (q_extra + 1)), Polynomial.eval z (Q_poly j) = op.quotVals j

Deterministic correlated-agreement extraction bridge from batchStmt ∈ batchProximityLang to candidate trace and quotient-chunk polynomials: whenever z ∈ sys.oodDom, sys.params.dim 0 + 1 ≤ 2 ^ d - e, and sys.batchStmt T Q_orc z op ∈ sys.params.batchProximityLang (M + q_extra) e, there exist:

  1. a trace polynomial tuple P : Fin w → F[X] with P i ∈ traceColCandList sys T (2 ^ d - e) i, deg(P i) < k + 1, and (P (maskCol u)).eval (maskShift u * z) = op.maskVals u for all u, and
  2. a quotient-chunk tuple Q_poly : Fin (q_extra + 1) → F[X] with Q_poly j ∈ agreePolyList sys.evalDom (k + 1) (Q_orc j) (2 ^ d - e), deg(Q_poly j) < k + 1, and (Q_poly j).eval z = op.quotVals j for all j.
theorem Cslib.Crypto.Protocols.FRI.deepALIGame_le_of_unique {F : Type} [Field F] [Fintype F] [DecidableEq F] {w M c_num q_extra e : ℕ} (sys : DeepALISystem F w M c_num q_extra) (hunsat : ¬sys.Satisfiable) (huniq : 2 * e + (sys.params.dim 0 + 1) ≤ 2 ^ sys.params.d) (adv : DeepALIProver sys) :
(deepALIGame sys adv) true ≤ 1 / ↑(Fintype.card F) + ↑sys.linkDegBound / ↑sys.oodDom.card + (↑(2 * 2 ^ sys.params.d - 2 ^ (sys.params.d - sys.params.totalLog)) / ↑(Fintype.card F) + (↑(2 ^ sys.params.d - e - 1) / 2 ^ sys.params.d) ^ sys.params.q)

Unconditional adaptive soundness of DEEP-ALI + Smooth Batched FRI across the unique-decoding radius (2 * e + (sys.params.dim 0 + 1) ≤ 2 ^ d): if sys is unsatisfiable, every adaptive prover adv convinces the verifier with probability at most 1 / |F| + sys.linkDegBound / #sys.oodDom + (2 * 2^d - 2^(d - totalLog)) / |F| + ((2^d - e - 1) / 2^d) ^ q.

theorem Cslib.Crypto.Protocols.FRI.deepALIGame_le_of_johnson_eta {F : Type} [Field F] [Fintype F] [DecidableEq F] {w M c_num q_extra : ℕ} {η α : ℝ} (sys : DeepALISystem F w M c_num q_extra) (hunsat : ¬sys.Satisfiable) (hη : 0 < η) (hα_ge : √(↑(sys.params.dim 0) / 2 ^ sys.params.d) + η ≤ α) (hα_le : α ≤ 1) (hinterp_card : sys.params.dim 0 + 1 ≤ ⌈α * 2 ^ sys.params.d⌉₊) (hjohnson : 2 ^ sys.params.d * sys.params.dim 0 < ⌈α * 2 ^ sys.params.d⌉₊ ^ 2) (adv : DeepALIProver sys) :
have L := sys.johnsonListBound α; (deepALIGame sys adv) true ≤ ↑(L ^ w) / ↑(Fintype.card F) + ↑(L ^ (w + (q_extra + 1)) * sys.linkDegBound) / ↑sys.oodDom.card + ENNReal.ofReal (friSmoothBatchJohnsonEtaCommitError sys.params η + α ^ sys.params.q)

Unconditional adaptive soundness of DEEP-ALI + Smooth Batched FRI up to the Johnson bound (√ρ + η ≤ α ≤ 1, k + 1 ≤ ⌈α * 2 ^ d⌉₊, 2 ^ d * k < (⌈α * 2 ^ d⌉₊) ^ 2): if sys is unsatisfiable, every adaptive prover adv convinces the verifier with probability at most (L ^ w) / |F| + (L ^ (w + q_extra + 1) * sys.linkDegBound) / #sys.oodDom + ENNReal.ofReal (friSmoothBatchJohnsonEtaCommitError sys.params η + α ^ q), where L = sys.johnsonListBound α (using this library's explicit Siegel constants for batched FRI).

theorem Cslib.Crypto.Protocols.FRI.deepALIGame_ofBinary_le_of_johnson_eta {F : Type} [Field F] [Fintype F] [DecidableEq F] {w M c_num q_extra : ℕ} {η α : ℝ} (binParams : FRIParams F) (sys : DeepALISystem F w M c_num q_extra) (hsys : sys.params = binParams.toSmooth) (hunsat : ¬sys.Satisfiable) (hη : 0 < η) (hα_ge : √(↑(binParams.dim 0) / 2 ^ binParams.d) + η ≤ α) (hα_le : α ≤ 1) (hinterp_card : binParams.dim 0 + 1 ≤ ⌈α * 2 ^ binParams.d⌉₊) (hjohnson : 2 ^ binParams.d * binParams.dim 0 < ⌈α * 2 ^ binParams.d⌉₊ ^ 2) (adv : DeepALIProver sys) :
have L := sys.johnsonListBound α; (deepALIGame sys adv) true ≤ ↑(L ^ w) / ↑(Fintype.card F) + ↑(L ^ (w + (q_extra + 1)) * sys.linkDegBound) / ↑sys.oodDom.card + ENNReal.ofReal (friBatchJohnsonEtaCommitError binParams η + α ^ binParams.q)

Binary 2-to-1 FRIParams specialization of deepALIGame_le_of_johnson_eta (when sys.params = binParams.toSmooth).