Documentation

CslibFrontier.Crypto.Protocols.BCS.Interactive

Interactive Public-Coin IOP Execution and Round-by-Round Escape Union Bounds #

This module defines sequential adaptive execution for a PublicCoinIOP (CslibFrontier.Crypto.Protocols.BCS.Basic) against an arbitrary (possibly randomized, prefix-dependent) prover InteractiveIOPProver, and proves generic union-bound soundness theorems summing per-round escape probabilities across rounds ([BSCS16]; [CY24]; compare the commit-phase bad-event sum in the proof of Lemma 8.2 in [BenSassonCarmonIshaiKoppartySaraf2020, Section 8.2.1, p. 42] and its combination with query rounds in the proof of Theorem 8.3 on p. 40).

Because this module depends only on PublicCoinIOP and finite uniform distributions, any public-coin IOP can import these interactive soundness combinators without pulling in protocol-specific layers such as FRI coset folding or random-oracle Merkle extraction.

Main definitions #

Main results #

References #

@[reducible, inline]

Adaptive (possibly randomized) cheating IOP prover mapping a transcript prefix of committed oracles and verifier challenges to a distribution over the next committed oracle table.

noncomputable def Cslib.Crypto.Protocols.BCS.InteractiveIOPProver.ofCausal {r d : ℕ} {Sym Chal : Type} [Nonempty Sym] (P : (j : Fin r) → (Fin ↑j → Chal) → OracleTable d Sym) :

Lift a deterministic causal IOP prover P (whose j-th oracle depends only on the preceding j verifier challenges) to an InteractiveIOPProver.

noncomputable def Cslib.Crypto.Protocols.BCS.iopRunRounds {d : ℕ} {Sym Chal : Type} [Fintype Chal] [Nonempty Chal] (P : InteractiveIOPProver d Sym Chal) :
ℕ → List (OracleTable d Sym × Chal) → PMF (List (OracleTable d Sym × Chal))

Execute k sequential public-coin IOP rounds starting from transcript prefix pref: in each round the prover samples π ← P pref' and the verifier draws c uniformly from Chal.

theorem Cslib.Crypto.Protocols.BCS.length_of_mem_support_iopRunRounds {d : ℕ} {Sym Chal : Type} [Fintype Chal] [Nonempty Chal] (P : InteractiveIOPProver d Sym Chal) (k : ℕ) (pref tr : List (OracleTable d Sym × Chal)) :
tr ∈ (iopRunRounds P k pref).support → tr.length = pref.length + k

Every transcript in the support of iopRunRounds P k pref has length pref.length + k.

noncomputable def Cslib.Crypto.Protocols.BCS.iopInteractiveGame {r d : ℕ} {Stmt Wit Sym Chal : Type} [Fintype Chal] [Nonempty Chal] (iop : PublicCoinIOP r d Stmt Wit Sym Chal) (x : Stmt) (P : InteractiveIOPProver d Sym Chal) :

Full r-round interactive public-coin IOP soundness game: runs P against r independent uniform verifier challenges and returns iopVerify iop x chals oracles.

theorem Cslib.Crypto.Protocols.BCS.iopPrefixEscape_le_sum {d : ℕ} {Stmt Sym Chal : Type} [Fintype Chal] [Nonempty Chal] {doomed : Stmt → List (OracleTable d Sym × Chal) → Prop} {goodStep : Stmt → List (OracleTable d Sym × Chal) → OracleTable d Sym → Chal → Prop} {x : Stmt} (hinit : doomed x []) (hstep : ∀ (pref : List (OracleTable d Sym × Chal)) (π : OracleTable d Sym) (c : Chal), doomed x pref → goodStep x pref π c → doomed x (pref ++ [(π, c)])) (k : ℕ) (ε_round : Fin k → ENNReal) (hescape : ∀ (j : Fin k) (pref : List (OracleTable d Sym × Chal)) (π : OracleTable d Sym), pref.length = ↑j → doomed x pref → (Probability.PMF.uniformOfFintype Chal).toOuterMeasure {c : Chal | ¬goodStep x pref π c} ≤ ε_round j) (P : InteractiveIOPProver d Sym Chal) :
(iopRunRounds P k []).toOuterMeasure {tr : List (OracleTable d Sym × Chal) | ¬doomed x tr} ≤ ∑ j : Fin k, ε_round j

Prefix union bound for interactive public-coin IOPs: if the empty transcript is doomed, goodStep preserves doomed, and round j < k escapes goodStep with probability at most ε_round j from any doomed length-j prefix, then after k adaptive interactive rounds the probability of escaping doomed is at most ∑ j : Fin k, ε_round j (abstract first-escape sum underlying the proof of Lemma 8.2 in [BenSassonCarmonIshaiKoppartySaraf2020, Section 8.2.1, p. 42]).

theorem Cslib.Crypto.Protocols.BCS.iopCommitPhase_map_true_le_sum {d : ℕ} {Stmt Sym Chal : Type} [Fintype Chal] [Nonempty Chal] {doomed : Stmt → List (OracleTable d Sym × Chal) → Prop} {goodStep : Stmt → List (OracleTable d Sym × Chal) → OracleTable d Sym → Chal → Prop} {x : Stmt} (hinit : doomed x []) (hstep : ∀ (pref : List (OracleTable d Sym × Chal)) (π : OracleTable d Sym) (c : Chal), doomed x pref → goodStep x pref π c → doomed x (pref ++ [(π, c)])) (k : ℕ) (ε_round : Fin k → ENNReal) (hescape : ∀ (j : Fin k) (pref : List (OracleTable d Sym × Chal)) (π : OracleTable d Sym), pref.length = ↑j → doomed x pref → (Probability.PMF.uniformOfFintype Chal).toOuterMeasure {c : Chal | ¬goodStep x pref π c} ≤ ε_round j) (P : InteractiveIOPProver d Sym Chal) (badFinal : List (OracleTable d Sym × Chal) → OracleTable d Sym → Bool) (hfinal : ∀ (pref : List (OracleTable d Sym × Chal)) (πFinal : OracleTable d Sym), pref.length = k → doomed x pref → badFinal pref πFinal = false) :
((iopRunRounds P k []).bind fun (pref : List (OracleTable d Sym × Chal)) => PMF.map (badFinal pref) (P pref)) true ≤ ∑ j : Fin k, ε_round j

Commit-phase-plus-final-oracle union bound (abstract template for the commit-phase bound of [BenSassonCarmonIshaiKoppartySaraf2020, Lemma 8.2, pp. 38–39], proved via the bad-event sum in Section 8.2.1, p. 42): if every doomed length-k prefix forces badFinal pref πFinal = false for all final oracle tables πFinal, then running k commit rounds and sampling πFinal ← P pref produces badFinal pref πFinal = true with probability at most ∑ j : Fin k, ε_round j.

theorem Cslib.Crypto.Protocols.BCS.iopInteractiveGame_le_sum {r d : ℕ} {Stmt Wit Sym Chal : Type} [Fintype Chal] [Nonempty Chal] {iop : PublicCoinIOP r d Stmt Wit Sym Chal} {lang : Set Stmt} {doomed : Stmt → List (OracleTable d Sym × Chal) → Prop} {goodStep : Stmt → List (OracleTable d Sym × Chal) → OracleTable d Sym → Chal → Prop} (hrbr : IOPRoundByRoundSoundness iop lang doomed goodStep) (ε_round : Fin r → ENNReal) (hescape : ∀ x ∉ lang, ∀ (j : Fin r) (pref : List (OracleTable d Sym × Chal)) (π : OracleTable d Sym), pref.length = ↑j → doomed x pref → (Probability.PMF.uniformOfFintype Chal).toOuterMeasure {c : Chal | ¬goodStep x pref π c} ≤ ε_round j) {x : Stmt} (hx : x ∉ lang) (P : InteractiveIOPProver d Sym Chal) :
(iopInteractiveGame iop x P) true ≤ ∑ j : Fin r, ε_round j

Summed interactive soundness for PublicCoinIOP from IOPRoundByRoundSoundness and per-round escape budgets ε_round : Fin r → ℝ≥0∞: for every x ∉ lang and adaptive (possibly randomized) prover P, the acceptance probability iopInteractiveGame iop x P true is at most ∑ j : Fin r, ε_round j.

theorem Cslib.Crypto.Protocols.BCS.iopInteractiveGame_ofCausal_eq {r d : ℕ} {Stmt Wit Sym Chal : Type} [Fintype Chal] [Nonempty Chal] [Nonempty Sym] (iop : PublicCoinIOP r d Stmt Wit Sym Chal) (x : Stmt) (P : (j : Fin r) → (Fin ↑j → Chal) → OracleTable d Sym) :
iopInteractiveGame iop x (InteractiveIOPProver.ofCausal P) = PMF.map (fun (chals : Fin r → Chal) => iopVerify iop x chals fun (j : Fin r) => P j fun (i : Fin ↑j) => chals ⟨↑i, ⋯⟩) (Probability.PMF.uniformOfFintype (Fin r → Chal))

For a deterministic causal prover P, the sequential iopInteractiveGame coincides with evaluating iopVerify under a single uniform draw of chals : Fin r → Chal.

theorem Cslib.Crypto.Protocols.BCS.iopEscape_le_sup_of_perRound {r d : ℕ} {Stmt Sym Chal : Type} [Fintype Chal] [Nonempty Chal] {lang : Set Stmt} {doomed : Stmt → List (OracleTable d Sym × Chal) → Prop} {goodStep : Stmt → List (OracleTable d Sym × Chal) → OracleTable d Sym → Chal → Prop} (ε_round : Fin r → ENNReal) (hescape : ∀ x ∉ lang, ∀ (j : Fin r) (pref : List (OracleTable d Sym × Chal)) (π : OracleTable d Sym), pref.length = ↑j → doomed x pref → (Probability.PMF.uniformOfFintype Chal).toOuterMeasure {c : Chal | ¬goodStep x pref π c} ≤ ε_round j) (hlong : ∀ x ∉ lang, ∀ (pref : List (OracleTable d Sym × Chal)) (π : OracleTable d Sym) (c : Chal), r ≤ pref.length → goodStep x pref π c) (x : Stmt) :
x ∉ lang → ∀ (pref : List (OracleTable d Sym × Chal)) (π : OracleTable d Sym), doomed x pref → (Probability.PMF.uniformOfFintype Chal).toOuterMeasure {c : Chal | ¬goodStep x pref π c} ≤ Finset.univ.sup ε_round

Bridge from per-round escape budgets ε_round : Fin r → ℝ≥0∞ to the uniform all-prefix escape bound ≤ Finset.univ.sup ε_round consumed by Cslib.Crypto.Protocols.BCS.bcsROMSoundness_bound when prefixes of length ≥ r trivially satisfy goodStep.