Documentation

CslibFrontier.Crypto.Protocols.FRI.BatchProtocol

Batched Multi-Round Smooth and 2-to-1 FRI as a Public-Coin Interactive Oracle Proof #

This module instantiates the batched Fast Reed–Solomon Interactive Oracle Proof of Proximity (FRI) of [BSCI+23] (accepted Journal of the ACM 2023 manuscript, Section 8.2, printed pp. 36–38: affine batching Eq. (8.3) on p. 37 and batched QUERY steps (1)–(4) on p. 38) for arbitrary per-round strict 2-smooth folding schedules l⁽ⁱ⁾ = 2 ^ stepLog i ≥ 2 (FRISmoothParams, friSmoothBatchIOP) together with the fixed 2-to-1 specialization (FRIParams, friBatchIOP) directly as a (params.m + 2)-round Cslib.Crypto.Protocols.BCS.PublicCoinIOP delegating its folding and query phases to friSmoothIOP / friIOP ([BSBHR18]; [BSCS16]), proves perfect IOP / BCS / random-oracle completeness together with exact committed-opening counts and direct-read schedule locality, and defines the tuple correlated-agreement languages and real-to-integer threshold bridges used in the setting of Lemma 8.2 and Theorem 8.3 (printed pp. 38–39).

Protocol layout and causal delegation #

Given params : FRISmoothParams F (or params : FRIParams F, embedded via FRIParams.toSmooth with friBatchIOP_eq_friSmoothBatchIOP), batch size t : ℕ, and an affine batch statement stmt : FRIBatchStmt F params.d t representing (t + 1) initial words f₀⁽⁰⁾ = stmt.base and f₁⁽⁰⁾, …, f_t⁽⁰⁾ = stmt.terms on the coset of size 2 ^ d (with homogeneous linear batching f₀⁽⁰⁾ = 0 given by FRIBatchStmt.linear):

Main definitions #

Main results #

References #

(t + 1)-word affine batch statement f₀⁽⁰⁾, f₁⁽⁰⁾, …, f_t⁽⁰⁾ : Fin (2 ^ d) → F for batched FRI ([BSCI+23], Section 8.2, Eq. (8.3) on printed p. 37).

Instances For
    theorem Cslib.Crypto.Protocols.FRI.FRIBatchStmt.ext {F : Type} {d t : ℕ} {x y : FRIBatchStmt F d t} (base : x.base = y.base) (terms : x.terms = y.terms) :
    x = y

    Homogeneous linear batching statement (f₀⁽⁰⁾ = 0, [BSCI+23], Section 8.2, printed p. 37).

    def Cslib.Crypto.Protocols.FRI.FRIBatchStmt.eval {F : Type} [Semiring F] {d t : ℕ} (stmt : FRIBatchStmt F d t) (x : Fin t → F) :

    Affine combination word f₀⁽⁰⁾ + ∑ j : Fin t, x j • f_{j+1}⁽⁰⁾ evaluated at batching challenge x : Fin t → F ([BSCI+23], Eq. (8.3)).

    @[simp]
    theorem Cslib.Crypto.Protocols.FRI.FRIBatchStmt.eval_apply {F : Type} [Semiring F] {d t : ℕ} (stmt : FRIBatchStmt F d t) (x : Fin t → F) (s : Fin (2 ^ d)) :
    stmt.eval x s = stmt.base s + ∑ j : Fin t, x j * stmt.terms j s
    @[simp]
    theorem Cslib.Crypto.Protocols.FRI.FRIBatchStmt.eval_linear {F : Type} [Semiring F] {d t : ℕ} (terms : Fin t → BCS.OracleTable d F) (x : Fin t → F) :
    (linear terms).eval x = ∑ j : Fin t, x j • terms j
    @[simp]
    theorem Cslib.Crypto.Protocols.FRI.FRIBatchStmt.eval_zero {F : Type} [Semiring F] {d : ℕ} (stmt : FRIBatchStmt F d 0) (x : Fin 0 → F) :
    stmt.eval x = stmt.base

    Equivalence between FRIBatchStmt F d t and OracleTable d F × (Fin t → OracleTable d F).

    @[instance_reducible]

    Public-coin verifier challenge per round of (params.m + 2)-round friBatchIOP:

    • batchCoeffs : Fin t → F

      Batching challenge scalars (x₁, …, x_t) ∈ F^t used in round 0.

    • foldScalar : F

      Folding challenge scalar z⁽ⁱ⁾ ∈ F used in folding rounds 1, …, m.

    • queryIdxs : Fin q → Fin (2 ^ d)

      Batch of q query starting indices used in the final round m + 1.

    Instances For
      theorem Cslib.Crypto.Protocols.FRI.FRIBatchChal.ext {F : Type} {d q t : ℕ} {x y : FRIBatchChal F d q t} (batchCoeffs : x.batchCoeffs = y.batchCoeffs) (foldScalar : x.foldScalar = y.foldScalar) (queryIdxs : x.queryIdxs = y.queryIdxs) :
      x = y

      Project a batched FRI challenge to the underlying single-word FRIChal F d q.

      Equivalence between FRIBatchChal F d q t and (Fin t → F) × FRIChal F d q, with first projection batchCoeffs and second projection toFRIChal definitionally.

      @[instance_reducible]
      theorem Cslib.Crypto.Protocols.FRI.card_friBatchChal {F : Type} [Fintype F] (d q t : ℕ) :
      Fintype.card (FRIBatchChal F d q t) = Fintype.card F ^ (t + 1) * (2 ^ d) ^ q

      Exact cardinality of FRIBatchChal F d q t: |F| ^ (t + 1) * (2 ^ d) ^ q.

      @[reducible, inline]

      Honest completeness relation for batched FRI relative to an initial linear code C : Submodule F (OracleTable d F): both stmt.base and all t generator words stmt.terms j belong to C.

      theorem Cslib.Crypto.Protocols.FRI.eval_mem_of_friBatchCompletenessRel {F : Type} [Field F] {d t : ℕ} {C : Submodule F (BCS.OracleTable d F)} {stmt : FRIBatchStmt F d t} (hrel : friBatchCompletenessRel C t stmt ()) (x : Fin t → F) :
      stmt.eval x ∈ C

      Every affine combination stmt.eval x of an honest batch statement lies in C.

      @[reducible, inline]

      Integer-threshold tuple correlated-agreement language for (t + 1)-word batched FRI relative to an initial linear code C: stmt.base and all t words stmt.terms j simultaneously agree with codewords in C on a common subset D' ⊆ Fin (2 ^ d) of cardinality at least 2 ^ d - e ([BSCI+23], Theorem 1.6 and Section 8.2).

      @[reducible, inline]

      Real-density tuple correlated-agreement language for (t + 1)-word batched FRI relative to an initial linear code C: stmt.base and all t words stmt.terms j simultaneously agree with codewords in C on a common domain D' ⊆ Fin (2 ^ d) of relative density α ≤ (#D' : ℝ) / 2 ^ d ([BSCI+23], Theorem 8.3 on printed p. 39).

      Any statement satisfying friBatchCompletenessRel C t belongs to friBatchProximityLang C t e for every e : ℕ (witnessed on D' = Finset.univ).

      theorem Cslib.Crypto.Protocols.FRI.lt_two_pow_of_not_mem_friBatchProximityLang {F : Type} [Field F] {d t e : ℕ} {C : Submodule F (BCS.OracleTable d F)} {stmt : FRIBatchStmt F d t} (hnot : stmt ∉ friBatchProximityLang C t e) :
      e < 2 ^ d

      Contrapositively, stmt ∉ friBatchProximityLang C t e implies e < 2 ^ d.

      At batch size t = 0, tuple correlated agreement friBatchProximityLang C 0 e coincides with single-word Hamming proximity ∃ c ∈ C, hammingDist stmt.base c ≤ e.

      Exact ceiling Set equality (α ≤ 1): for e = 2 ^ d - ⌈α * 2 ^ d⌉₊, friBatchCorrAgreeLang C t α = friBatchProximityLang C t e.

      theorem Cslib.Crypto.Protocols.FRI.friBatchCeilThreshold_bounds (d : ℕ) {α : ℝ} (hα_pos : 0 < α) (hα_le : α ≤ 1) :
      have e := 2 ^ d - ⌈α * 2 ^ d⌉₊; e < 2 ^ d ∧ ↑(2 ^ d - e - 1) / 2 ^ d < α ∧ ↑e / 2 ^ d ≤ 1 - α

      Ceiling threshold bounds (0 < α ≤ 1) for domain size 2 ^ d.

      theorem Cslib.Crypto.Protocols.FRI.friBatchFloorThreshold_bounds {F : Type} [Field F] {d : ℕ} (C : Submodule F (BCS.OracleTable d F)) (t : ℕ) (stmt : FRIBatchStmt F d t) {α : ℝ} (hα_nn : 0 ≤ α) (hα_lt : α < 1) :
      have B := ⌊α * 2 ^ d⌋₊; have e := 2 ^ d - 1 - B; ((∀ (D' : Finset (Fin (2 ^ d))), ∀ v₀ ∈ C, ∀ (v : Fin t → BCS.OracleTable d F), (∀ (j : Fin t), v j ∈ C) → (∀ s ∈ D', stmt.base s = v₀ s ∧ ∀ (j : Fin t), stmt.terms j s = v j s) → ↑D'.card / 2 ^ d ≤ α) ↔ stmt ∉ friBatchProximityLang C t e) ∧ B < 2 ^ d ∧ 2 ^ d - e - 1 = B ∧ ↑B / 2 ^ d ≤ α ∧ ↑e / 2 ^ d < 1 - α

      Floor threshold bounds (0 ≤ α < 1) relative to an initial linear code C ([BSCI+23], Lemma 8.2, printed pp. 38–39, Eq. (8.5)).

      @[reducible, inline]

      Honest completeness relation for smooth batched FRI (friBatchCompletenessRel on params.initialCode).

      @[reducible, inline]
      noncomputable abbrev Cslib.Crypto.Protocols.FRI.FRISmoothParams.batchProximityLang {F : Type} [Field F] (params : FRISmoothParams F) (t e : ℕ) :
      Set (FRIBatchStmt F params.d t)

      Integer-threshold tuple correlated-agreement language for (t + 1)-word smooth batched FRI (friBatchProximityLang on params.initialCode).

      @[reducible, inline]
      noncomputable abbrev Cslib.Crypto.Protocols.FRI.FRISmoothParams.batchCorrAgreeLang {F : Type} [Field F] (params : FRISmoothParams F) (t : ℕ) (α : ℝ) :
      Set (FRIBatchStmt F params.d t)

      Real-density tuple correlated-agreement language for (t + 1)-word smooth batched FRI (friBatchCorrAgreeLang on params.initialCode).

      @[reducible, inline]

      Full direct-read schedule / input-symbol budget (t + 1) * q across stmt.base and stmt.terms: friSmoothBatchInputQueries lists q scheduled input positions, with multiplicity, with t + 1 input symbols sufficient at each (friSmoothBatchDecide_congr_inputQueries). Because friSmoothBatchDecide can reject on answer-list length before accessing stmt, repetitions short-circuit on earlier failures, and query challenges may repeat indices, (t + 1) * q is a schedule / upper-bound budget.

      @[reducible, inline]

      Combined word-query budget batchInputWordReads t + proofOracleQueries = kFinal + q * (aritySum + m + t + 3).

      theorem Cslib.Crypto.Protocols.FRI.FRISmoothParams.batchTotalWordQueries_eq {F : Type} [Field F] (params : FRISmoothParams F) (t : ℕ) :
      params.batchTotalWordQueries t = params.kFinal + params.q * (params.aritySum + params.m + t + 3)
      @[reducible, inline]

      Honest completeness relation for batched FRI (friBatchCompletenessRel on params.initialCode).

      theorem Cslib.Crypto.Protocols.FRI.FRIParams.eval_mem_initialCode {F : Type} [Field F] (params : FRIParams F) {t : ℕ} {stmt : FRIBatchStmt F params.d t} (hrel : params.batchCompletenessRel t stmt ()) (x : Fin t → F) :
      stmt.eval x ∈ params.initialCode

      Every affine combination stmt.eval x of an honest batch statement lies in params.initialCode.

      @[reducible, inline]
      noncomputable abbrev Cslib.Crypto.Protocols.FRI.FRIParams.batchProximityLang {F : Type} [Field F] (params : FRIParams F) (t e : ℕ) :
      Set (FRIBatchStmt F params.d t)

      Integer-threshold tuple correlated-agreement language for (t + 1)-word batched FRI (friBatchProximityLang on params.initialCode).

      @[reducible, inline]
      noncomputable abbrev Cslib.Crypto.Protocols.FRI.FRIParams.batchCorrAgreeLang {F : Type} [Field F] (params : FRIParams F) (t : ℕ) (α : ℝ) :
      Set (FRIBatchStmt F params.d t)

      Real-density tuple correlated-agreement language for (t + 1)-word batched FRI (friBatchCorrAgreeLang on params.initialCode).

      @[reducible, inline]

      Full direct-read schedule / input-symbol budget (t + 1) * q across stmt.base and stmt.terms 0, …, stmt.terms (t - 1): friBatchInputQueries lists q scheduled input positions, with multiplicity, with t + 1 input symbols sufficient at each (friBatchDecide_congr_inputQueries). Because friBatchDecide can reject on answer-list length before accessing stmt, repetitions short-circuit on earlier failures, and query challenges may repeat indices, (t + 1) * q is a schedule / upper-bound budget.

      @[reducible, inline]

      Combined word-query budget batchInputWordReads t + proofOracleQueries = kFinal + q * (3 * m + t + 3), pairing the full (t + 1) * q direct-read schedule with the exact committed-proof-oracle opening list length proofOracleQueries.

      theorem Cslib.Crypto.Protocols.FRI.FRIParams.batchTotalWordQueries_eq {F : Type} [Field F] (params : FRIParams F) (t : ℕ) :
      params.batchTotalWordQueries t = params.kFinal + params.q * (3 * params.m + t + 3)
      theorem Cslib.Crypto.Protocols.FRI.FRIParams.mem_batchProximityLang_of_batchCompletenessRel {F : Type} [Field F] (params : FRIParams F) {t : ℕ} (e : ℕ) {stmt : FRIBatchStmt F params.d t} (hrel : params.batchCompletenessRel t stmt ()) :
      stmt ∈ params.batchProximityLang t e

      Any statement satisfying batchCompletenessRel belongs to batchProximityLang t e for every e : ℕ (specialization of mem_friBatchProximityLang_of_completenessRel).

      theorem Cslib.Crypto.Protocols.FRI.FRIParams.lt_two_pow_of_not_mem_batchProximityLang {F : Type} [Field F] (params : FRIParams F) {t e : ℕ} {stmt : FRIBatchStmt F params.d t} (hnot : stmt ∉ params.batchProximityLang t e) :
      e < 2 ^ params.d

      Contrapositively, stmt ∉ params.batchProximityLang t e implies e < 2 ^ params.d (specialization of lt_two_pow_of_not_mem_friBatchProximityLang).

      theorem Cslib.Crypto.Protocols.FRI.mem_batchProximityLang_zero_iff {F : Type} [Field F] [DecidableEq F] (params : FRIParams F) (e : ℕ) (stmt : FRIBatchStmt F params.d 0) :
      stmt ∈ params.batchProximityLang 0 e ↔ stmt.base ∈ params.proximityLang e

      At batch size t = 0, tuple correlated agreement batchProximityLang 0 e coincides with the single-word proximityLang e on stmt.base (specialization of mem_friBatchProximityLang_zero_iff).

      theorem Cslib.Crypto.Protocols.FRI.batchCorrAgreeLang_eq_batchProximityLang {F : Type} [Field F] (params : FRIParams F) (t : ℕ) {α : ℝ} (hα_le : α ≤ 1) :
      params.batchCorrAgreeLang t α = params.batchProximityLang t (2 ^ params.d - ⌈α * 2 ^ params.d⌉₊)

      Exact ceiling Set equality (α ≤ 1) (specialization of friBatchCorrAgreeLang_eq_proximityLang).

      theorem Cslib.Crypto.Protocols.FRI.batchCeilThreshold_bounds {F : Type} [Field F] (params : FRIParams F) {α : ℝ} (hα_pos : 0 < α) (hα_le : α ≤ 1) :
      have e := 2 ^ params.d - ⌈α * 2 ^ params.d⌉₊; e < 2 ^ params.d ∧ ↑(2 ^ params.d - e - 1) / 2 ^ params.d < α ∧ ↑e / 2 ^ params.d ≤ 1 - α

      Ceiling threshold bounds (0 < α ≤ 1) (specialization of friBatchCeilThreshold_bounds).

      theorem Cslib.Crypto.Protocols.FRI.batchFloorThreshold_bounds {F : Type} [Field F] (params : FRIParams F) (t : ℕ) (stmt : FRIBatchStmt F params.d t) {α : ℝ} (hα_nn : 0 ≤ α) (hα_lt : α < 1) :
      have B := ⌊α * 2 ^ params.d⌋₊; have e := 2 ^ params.d - 1 - B; ((∀ (D' : Finset (Fin (2 ^ params.d))), ∀ v₀ ∈ params.initialCode, ∀ (v : Fin t → BCS.OracleTable params.d F), (∀ (j : Fin t), v j ∈ params.initialCode) → (∀ s ∈ D', stmt.base s = v₀ s ∧ ∀ (j : Fin t), stmt.terms j s = v j s) → ↑D'.card / 2 ^ params.d ≤ α) ↔ stmt ∉ params.batchProximityLang t e) ∧ B < 2 ^ params.d ∧ 2 ^ params.d - e - 1 = B ∧ ↑B / 2 ^ params.d ≤ α ∧ ↑e / 2 ^ params.d < 1 - α

      Floor threshold bounds (0 ≤ α < 1) (specialization of friBatchFloorThreshold_bounds).

      def Cslib.Crypto.Protocols.FRI.friTailChals {F : Type} {d q t r : ℕ} (chals : Fin (r + 1) → FRIBatchChal F d q t) :
      Fin r → FRIChal F d q

      Project an (r + 1)-round batched challenge vector to its r-round single-word FRIChal tail (rounds 1, …, r).

      def Cslib.Crypto.Protocols.FRI.friSmoothBatchQueries {F : Type} [Field F] (params : FRISmoothParams F) (t : ℕ) (chals : Fin (params.m + 2) → FRIBatchChal F params.d params.q t) :
      List (Fin (params.m + 2) × Fin (2 ^ params.d))

      Committed-proof-oracle opening list of the smooth batched FRI verifier: shifts every query (j, idx) of friSmoothQueries params (friTailChals chals) to (j.succ, idx) in Fin (params.m + 2).

      theorem Cslib.Crypto.Protocols.FRI.round_ne_zero_of_mem_friSmoothBatchQueries {F : Type} [Field F] (params : FRISmoothParams F) (t : ℕ) (chals : Fin (params.m + 2) → FRIBatchChal F params.d params.q t) {p : Fin (params.m + 2) × Fin (2 ^ params.d)} (hp : p ∈ friSmoothBatchQueries params t chals) :
      p.1 ≠ 0

      No query in friSmoothBatchQueries ever opens the round-0 announcement table.

      theorem Cslib.Crypto.Protocols.FRI.length_friSmoothBatchQueries {F : Type} [Field F] (params : FRISmoothParams F) (t : ℕ) (chals : Fin (params.m + 2) → FRIBatchChal F params.d params.q t) :
      def Cslib.Crypto.Protocols.FRI.friSmoothBatchInputQueries {F : Type} [Field F] (params : FRISmoothParams F) (t : ℕ) (chals : Fin (params.m + 2) → FRIBatchChal F params.d params.q t) :
      List (Fin (2 ^ params.d))

      Schedule of q scheduled input positions, with multiplicity, at which agreement of the t + 1 input words (stmt.base, stmt.terms) suffices to determine friSmoothBatchDecide.

      theorem Cslib.Crypto.Protocols.FRI.length_friSmoothBatchInputQueries {F : Type} [Field F] (params : FRISmoothParams F) (t : ℕ) (chals : Fin (params.m + 2) → FRIBatchChal F params.d params.q t) :
      (friSmoothBatchInputQueries params t chals).length = params.q
      def Cslib.Crypto.Protocols.FRI.friSmoothBatchDecide {F : Type} [Field F] [DecidableEq F] (params : FRISmoothParams F) (t : ℕ) (stmt : FRIBatchStmt F params.d t) (chals : Fin (params.m + 2) → FRIBatchChal F params.d params.q t) (answers : List F) :

      Smooth batched FRI verifier decision procedure: delegates directly to friSmoothDecide on stmt.eval (chals 0).batchCoeffs and friTailChals chals.

      theorem Cslib.Crypto.Protocols.FRI.friSmoothBatchDecide_congr_inputQueries {F : Type} [Field F] [DecidableEq F] (params : FRISmoothParams F) (t : ℕ) {stmt₁ stmt₂ : FRIBatchStmt F params.d t} (chals : Fin (params.m + 2) → FRIBatchChal F params.d params.q t) (hagree : ∀ s ∈ friSmoothBatchInputQueries params t chals, stmt₁.base s = stmt₂.base s ∧ ∀ (j : Fin t), stmt₁.terms j s = stmt₂.terms j s) (answers : List F) :
      friSmoothBatchDecide params t stmt₁ chals answers = friSmoothBatchDecide params t stmt₂ chals answers

      Input-query locality for smooth batched FRI: agreement of (stmt.base, stmt.terms) at the q scheduled positions in friSmoothBatchInputQueries guarantees the same decision.

      def Cslib.Crypto.Protocols.FRI.friSmoothBatchIOP {F : Type} [Field F] [DecidableEq F] (params : FRISmoothParams F) (t : ℕ) :
      BCS.PublicCoinIOP (params.m + 2) params.d (FRIBatchStmt F params.d t) Unit F (FRIBatchChal F params.d params.q t)

      Batched multi-round smooth 2^{sᵢ}-to-1 FRI as a (params.m + 2)-round PublicCoinIOP ([BSCI+23], Section 8.2, printed pp. 37–38).

      theorem Cslib.Crypto.Protocols.FRI.length_friSmoothBatchIOP_queries {F : Type} [Field F] [DecidableEq F] (params : FRISmoothParams F) (t : ℕ) (stmt : FRIBatchStmt F params.d t) (chals : Fin (params.m + 2) → FRIBatchChal F params.d params.q t) :
      ((friSmoothBatchIOP params t).queries stmt chals).length = params.proofOracleQueries

      Exact committed-proof-oracle opening count of friSmoothBatchIOP: params.proofOracleQueries = kFinal + q * (aritySum + m + 2).

      @[simp]
      theorem Cslib.Crypto.Protocols.FRI.iopProverOracles_friSmoothBatchIOP_zero {F : Type} [Field F] [DecidableEq F] (params : FRISmoothParams F) (t : ℕ) (stmt : FRIBatchStmt F params.d t) (chals : Fin (params.m + 2) → FRIBatchChal F params.d params.q t) :
      BCS.iopProverOracles (friSmoothBatchIOP params t) stmt () chals 0 = fun (x : Fin (2 ^ params.d)) => 0
      @[simp]
      theorem Cslib.Crypto.Protocols.FRI.iopProverOracles_friSmoothBatchIOP_succ {F : Type} [Field F] [DecidableEq F] (params : FRISmoothParams F) (t : ℕ) (stmt : FRIBatchStmt F params.d t) (chals : Fin (params.m + 2) → FRIBatchChal F params.d params.q t) (j : Fin (params.m + 1)) :
      BCS.iopProverOracles (friSmoothBatchIOP params t) stmt () chals j.succ = BCS.iopProverOracles (friSmoothIOP params) (stmt.eval (chals 0).batchCoeffs) () (friTailChals chals) j
      theorem Cslib.Crypto.Protocols.FRI.iopVerify_friSmoothBatchIOP_eq_iopVerify_friSmoothIOP {F : Type} [Field F] [DecidableEq F] (params : FRISmoothParams F) (t : ℕ) (stmt : FRIBatchStmt F params.d t) (chals : Fin (params.m + 2) → FRIBatchChal F params.d params.q t) (oracles : Fin (params.m + 2) → BCS.OracleTable params.d F) :
      BCS.iopVerify (friSmoothBatchIOP params t) stmt chals oracles = BCS.iopVerify (friSmoothIOP params) (stmt.eval (chals 0).batchCoeffs) (friTailChals chals) fun (j : Fin (params.m + 1)) => oracles j.succ

      Exact verification reduction from friSmoothBatchIOP to single-word friSmoothIOP.

      def Cslib.Crypto.Protocols.FRI.friSmoothBatchSingleAccepts {F : Type} [Field F] (params : FRISmoothParams F) (t : ℕ) (stmt : FRIBatchStmt F params.d t) (chals : Fin (params.m + 2) → FRIBatchChal F params.d params.q t) (oracles : Fin (params.m + 2) → BCS.OracleTable params.d F) (s : Fin (2 ^ params.d)) :

      Pointwise acceptance predicate for a single smooth batched FRI query repetition starting at s : Fin (2 ^ d).

      theorem Cslib.Crypto.Protocols.FRI.iopVerify_friSmoothBatchIOP_eq_true_iff {F : Type} [Field F] [DecidableEq F] (params : FRISmoothParams F) (t : ℕ) (stmt : FRIBatchStmt F params.d t) (chals : Fin (params.m + 2) → FRIBatchChal F params.d params.q t) (oracles : Fin (params.m + 2) → BCS.OracleTable params.d F) :
      BCS.iopVerify (friSmoothBatchIOP params t) stmt chals oracles = true ↔ ∀ (a : Fin params.q), friSmoothBatchSingleAccepts params t stmt chals oracles ((chals (Fin.last (params.m + 1))).queryIdxs a)

      Exact characterization of smooth batched FRI IOP verification.

      Perfect completeness of the smooth batched FRI IOP.

      theorem Cslib.Crypto.Protocols.FRI.friSmoothBatchBCS_verify_prove_eq_true {F : Type} [Field F] [DecidableEq F] (params : FRISmoothParams F) (t : ℕ) (H : List Bool → List Bool → List Bool) (k : List Bool) {ℓ : ℕ} (hlen : ∀ (y : List Bool), (H k y).length = ℓ) (encSym : F → List Bool) (hFS : FRIBatchStmt F params.d t → List (List Bool) → FRIBatchChal F params.d params.q t) {stmt : FRIBatchStmt F params.d t} (hrel : params.batchCompletenessRel t stmt ()) :
      BCS.bcsVerify (friSmoothBatchIOP params t) H k encSym hFS stmt (BCS.bcsProve (friSmoothBatchIOP params t) H k encSym hFS stmt ()) = true

      Perfect deterministic BCS completeness for smooth batched FRI.

      theorem Cslib.Crypto.Protocols.FRI.friSmoothBatchBCS_honestROMGame_eq_pure_true {F : Type} [Field F] [DecidableEq F] [Fintype F] (params : FRISmoothParams F) (t : ℕ) (encSym : F → List Bool) {stmt : FRIBatchStmt F params.d t} (hrel : params.batchCompletenessRel t stmt ()) (σ : ℕ) :

      Perfect BCS ROM completeness for smooth batched FRI.

      theorem Cslib.Crypto.Protocols.FRI.isCostBounded_bcsMTCost_friSmoothBatchVerifyROM {F : Type} [Field F] [DecidableEq F] (params : FRISmoothParams F) (t : ℕ) (encSym : F → List Bool) (stmt : FRIBatchStmt F params.d t) (prf : BCS.BCSProof (params.m + 2) F) {L_path : ℕ} (hops : ∀ op ∈ prf.openings, op.path.length ≤ L_path) :

      Succinct verifier Merkle query cost bound for BCS-compiled smooth batched FRI.

      def Cslib.Crypto.Protocols.FRI.friBatchQueries {F : Type} [Field F] (params : FRIParams F) (t : ℕ) (chals : Fin (params.m + 2) → FRIBatchChal F params.d params.q t) :
      List (Fin (params.m + 2) × Fin (2 ^ params.d))

      Committed-proof-oracle opening list of the batched FRI verifier (derived directly from friSmoothBatchQueries params.toSmooth). Round 0 is never opened; all params.proofOracleQueries = kFinal + q * (3 * m + 2) openings target the committed prover tables f⁽⁰⁾, …, f⁽ᵐ⁾ in rounds 1, …, m + 1.

      theorem Cslib.Crypto.Protocols.FRI.round_ne_zero_of_mem_friBatchQueries {F : Type} [Field F] (params : FRIParams F) (t : ℕ) (chals : Fin (params.m + 2) → FRIBatchChal F params.d params.q t) {p : Fin (params.m + 2) × Fin (2 ^ params.d)} (hp : p ∈ friBatchQueries params t chals) :
      p.1 ≠ 0

      No query in friBatchQueries ever opens the round-0 announcement table (corollary of round_ne_zero_of_mem_friSmoothBatchQueries).

      theorem Cslib.Crypto.Protocols.FRI.length_friBatchQueries {F : Type} [Field F] (params : FRIParams F) (t : ℕ) (chals : Fin (params.m + 2) → FRIBatchChal F params.d params.q t) :
      (friBatchQueries params t chals).length = params.proofOracleQueries
      def Cslib.Crypto.Protocols.FRI.friBatchInputQueries {F : Type} [Field F] (params : FRIParams F) (t : ℕ) (chals : Fin (params.m + 2) → FRIBatchChal F params.d params.q t) :
      List (Fin (2 ^ params.d))

      Schedule of q scheduled input positions, with multiplicity, at which agreement of the t + 1 input words (stmt.base, stmt.terms 0, …, stmt.terms (t - 1)) suffices to determine friBatchDecide outside PublicCoinIOP.queries (derived directly from friSmoothBatchInputQueries params.toSmooth).

      theorem Cslib.Crypto.Protocols.FRI.length_friBatchInputQueries {F : Type} [Field F] (params : FRIParams F) (t : ℕ) (chals : Fin (params.m + 2) → FRIBatchChal F params.d params.q t) :
      (friBatchInputQueries params t chals).length = params.q
      def Cslib.Crypto.Protocols.FRI.friBatchDecide {F : Type} [Field F] [DecidableEq F] (params : FRIParams F) (t : ℕ) (stmt : FRIBatchStmt F params.d t) (chals : Fin (params.m + 2) → FRIBatchChal F params.d params.q t) (answers : List F) :

      Batched FRI verifier decision procedure (derived directly from friSmoothBatchDecide params.toSmooth).

      theorem Cslib.Crypto.Protocols.FRI.friBatchDecide_congr_inputQueries {F : Type} [Field F] [DecidableEq F] (params : FRIParams F) (t : ℕ) {stmt₁ stmt₂ : FRIBatchStmt F params.d t} (chals : Fin (params.m + 2) → FRIBatchChal F params.d params.q t) (hagree : ∀ s ∈ friBatchInputQueries params t chals, stmt₁.base s = stmt₂.base s ∧ ∀ (j : Fin t), stmt₁.terms j s = stmt₂.terms j s) (answers : List F) :
      friBatchDecide params t stmt₁ chals answers = friBatchDecide params t stmt₂ chals answers

      Input-query locality (corollary of friSmoothBatchDecide_congr_inputQueries).

      def Cslib.Crypto.Protocols.FRI.friBatchIOP {F : Type} [Field F] [DecidableEq F] (params : FRIParams F) (t : ℕ) :
      BCS.PublicCoinIOP (params.m + 2) params.d (FRIBatchStmt F params.d t) Unit F (FRIBatchChal F params.d params.q t)

      Batched multi-round 2-to-1 FRI as a (params.m + 2)-round PublicCoinIOP ([BSCI+23], Section 8.2, printed pp. 37–38).

      Exact batched IOP equality: binary 2-to-1 friBatchIOP params t coincides identically with friSmoothBatchIOP params.toSmooth t.

      theorem Cslib.Crypto.Protocols.FRI.length_friBatchIOP_queries {F : Type} [Field F] [DecidableEq F] (params : FRIParams F) (t : ℕ) (stmt : FRIBatchStmt F params.d t) (chals : Fin (params.m + 2) → FRIBatchChal F params.d params.q t) :
      ((friBatchIOP params t).queries stmt chals).length = params.proofOracleQueries

      Exact committed-proof-oracle opening count of friBatchIOP (corollary of length_friSmoothBatchIOP_queries).

      @[simp]
      theorem Cslib.Crypto.Protocols.FRI.iopProverOracles_friBatchIOP_zero {F : Type} [Field F] [DecidableEq F] (params : FRIParams F) (t : ℕ) (stmt : FRIBatchStmt F params.d t) (chals : Fin (params.m + 2) → FRIBatchChal F params.d params.q t) :
      BCS.iopProverOracles (friBatchIOP params t) stmt () chals 0 = fun (x : Fin (2 ^ params.d)) => 0
      @[simp]
      theorem Cslib.Crypto.Protocols.FRI.iopProverOracles_friBatchIOP_succ {F : Type} [Field F] [DecidableEq F] (params : FRIParams F) (t : ℕ) (stmt : FRIBatchStmt F params.d t) (chals : Fin (params.m + 2) → FRIBatchChal F params.d params.q t) (j : Fin (params.m + 1)) :
      BCS.iopProverOracles (friBatchIOP params t) stmt () chals j.succ = BCS.iopProverOracles (friIOP params) (stmt.eval (chals 0).batchCoeffs) () (friTailChals chals) j
      theorem Cslib.Crypto.Protocols.FRI.iopVerify_friBatchIOP_eq_iopVerify_friIOP {F : Type} [Field F] [DecidableEq F] (params : FRIParams F) (t : ℕ) (stmt : FRIBatchStmt F params.d t) (chals : Fin (params.m + 2) → FRIBatchChal F params.d params.q t) (oracles : Fin (params.m + 2) → BCS.OracleTable params.d F) :
      BCS.iopVerify (friBatchIOP params t) stmt chals oracles = BCS.iopVerify (friIOP params) (stmt.eval (chals 0).batchCoeffs) (friTailChals chals) fun (j : Fin (params.m + 1)) => oracles j.succ

      Exact verification reduction from friBatchIOP to single-word friIOP (corollary of iopVerify_friSmoothBatchIOP_eq_iopVerify_friSmoothIOP).

      def Cslib.Crypto.Protocols.FRI.friBatchSingleAccepts {F : Type} [Field F] (params : FRIParams F) (t : ℕ) (stmt : FRIBatchStmt F params.d t) (chals : Fin (params.m + 2) → FRIBatchChal F params.d params.q t) (oracles : Fin (params.m + 2) → BCS.OracleTable params.d F) (s : Fin (2 ^ params.d)) :

      Pointwise acceptance predicate for a single batched FRI query repetition starting at s : Fin (2 ^ d).

      theorem Cslib.Crypto.Protocols.FRI.friBatchSingleAccepts_iff_friSmoothBatchSingleAccepts {F : Type} [Field F] (params : FRIParams F) (t : ℕ) (stmt : FRIBatchStmt F params.d t) (chals : Fin (params.m + 2) → FRIBatchChal F params.d params.q t) (oracles : Fin (params.m + 2) → BCS.OracleTable params.d F) (s : Fin (2 ^ params.d)) :
      friBatchSingleAccepts params t stmt chals oracles s ↔ friSmoothBatchSingleAccepts params.toSmooth t stmt chals oracles s

      Exact equivalence between binary friBatchSingleAccepts and smooth friSmoothBatchSingleAccepts params.toSmooth.

      theorem Cslib.Crypto.Protocols.FRI.iopVerify_friBatchIOP_eq_true_iff {F : Type} [Field F] [DecidableEq F] (params : FRIParams F) (t : ℕ) (stmt : FRIBatchStmt F params.d t) (chals : Fin (params.m + 2) → FRIBatchChal F params.d params.q t) (oracles : Fin (params.m + 2) → BCS.OracleTable params.d F) :
      BCS.iopVerify (friBatchIOP params t) stmt chals oracles = true ↔ ∀ (a : Fin params.q), friBatchSingleAccepts params t stmt chals oracles ((chals (Fin.last (params.m + 1))).queryIdxs a)

      Exact characterization of batched FRI IOP verification (corollary of iopVerify_friSmoothBatchIOP_eq_true_iff).

      Perfect completeness of the batched FRI IOP (corollary of friSmoothBatchIOP_complete).

      theorem Cslib.Crypto.Protocols.FRI.friBatchBCS_verify_prove_eq_true {F : Type} [Field F] [DecidableEq F] (params : FRIParams F) (t : ℕ) (H : List Bool → List Bool → List Bool) (k : List Bool) {ℓ : ℕ} (hlen : ∀ (y : List Bool), (H k y).length = ℓ) (encSym : F → List Bool) (hFS : FRIBatchStmt F params.d t → List (List Bool) → FRIBatchChal F params.d params.q t) {stmt : FRIBatchStmt F params.d t} (hrel : params.batchCompletenessRel t stmt ()) :
      BCS.bcsVerify (friBatchIOP params t) H k encSym hFS stmt (BCS.bcsProve (friBatchIOP params t) H k encSym hFS stmt ()) = true

      Perfect deterministic BCS completeness for batched FRI (corollary of friSmoothBatchBCS_verify_prove_eq_true).

      theorem Cslib.Crypto.Protocols.FRI.friBatchBCS_honestROMGame_eq_pure_true {F : Type} [Field F] [DecidableEq F] [Fintype F] (params : FRIParams F) (t : ℕ) (encSym : F → List Bool) {stmt : FRIBatchStmt F params.d t} (hrel : params.batchCompletenessRel t stmt ()) (σ : ℕ) :
      BCS.bcsHonestROMGame (friBatchIOP params t) encSym stmt () σ = PMF.pure true

      Perfect BCS ROM completeness for batched FRI (corollary of friSmoothBatchBCS_honestROMGame_eq_pure_true).

      theorem Cslib.Crypto.Protocols.FRI.isCostBounded_bcsMTCost_friBatchVerifyROM {F : Type} [Field F] [DecidableEq F] (params : FRIParams F) (t : ℕ) (encSym : F → List Bool) (stmt : FRIBatchStmt F params.d t) (prf : BCS.BCSProof (params.m + 2) F) {L_path : ℕ} (hops : ∀ op ∈ prf.openings, op.path.length ≤ L_path) :

      Succinct verifier Merkle query cost bound for BCS-compiled batched FRI (corollary of isCostBounded_bcsMTCost_friSmoothBatchVerifyROM).