Documentation

CslibFrontier.Crypto.Protocols.FRI.Soundness.CurveGap

Smooth FRI Doomed Predicates, Error Budgets, Curve-Gap Contracts, and Unique-Decoding Upgrade #

Defines the smooth round-by-round doomed/good-step predicates (friSmoothCommitDoomed, friSmoothDoomed, friSmoothGoodStep), error budget expressions (friSmoothRoundEscape, friSmoothSumError, friSmoothSupRBRError, friSmoothRBRError), interactive commit-phase game (friSmoothCommitGame), polymorphic per-round degree-(l⁽ⁱ⁾ - 1) curve proximity-gap and escape contracts (WeightedCurveGapPerRound, WeightedCurveGapBound, WeightedCurveEscapePerRound, UniqueCurveGapHypothesis), and the unique-decoding curve-gap upgrade theorems (weightedCurveGapPerRound_of_uniqueCurveGap, weightedCurveGapBound_of_uniqueCurveGap).

Smooth Round-by-Round Predicates, Error Budgets, and Commit Game #

def Cslib.Crypto.Protocols.FRI.friSmoothCommitDoomed {F : Type} [Field F] [DecidableEq F] (params : FRISmoothParams F) (B : ℕ) (stmt : BCS.OracleTable params.d F) (pref : List (BCS.OracleTable params.d F × FRIChal F params.d params.q)) (i : ℕ) (hi : i ≤ params.m) :

Smooth commit-round doomed predicate at round i ≤ m: no codeword in params.rsCode i achieves friSmoothPreWeight-weighted agreement > B with friSmoothTargetWord.

def Cslib.Crypto.Protocols.FRI.friSmoothDoomed {F : Type} [Field F] [DecidableEq F] (params : FRISmoothParams F) (B : ℕ) (stmt : BCS.OracleTable params.d F) (pref : List (BCS.OracleTable params.d F × FRIChal F params.d params.q)) :

Smooth FRI round-by-round doomed-state predicate:

  • For prefixes of length i ≤ m, friSmoothCommitDoomed holds at round i.
  • For complete transcripts of length m + 1, at least one of the q queried starting positions fails friSmoothTranscriptSingleAccepts.
  • For unreachable lengths > m + 1, holds trivially (True).
def Cslib.Crypto.Protocols.FRI.friSmoothGoodStep {F : Type} [Field F] [DecidableEq F] (params : FRISmoothParams F) (B : ℕ) (stmt : BCS.OracleTable params.d F) (pref : List (BCS.OracleTable params.d F × FRIChal F params.d params.q)) (π : BCS.OracleTable params.d F) (c : FRIChal F params.d params.q) :

Smooth FRI round-by-round good-step predicate: for pref.length ≤ m, extending pref by (π, c) preserves friSmoothDoomed; for unreachable lengths > m, holds trivially (True) so the escape event {c | ¬ friSmoothGoodStep ... c} is empty.

noncomputable def Cslib.Crypto.Protocols.FRI.friSmoothRoundEscape {F : Type} [Field F] (params : FRISmoothParams F) (e : ℕ) (ε_commit : Fin params.m → ENNReal) (j : Fin (params.m + 1)) :

Per-round escape budget vector for single-word (m + 1)-round friSmoothIOP: ε_commit i in folding rounds 0 ≤ i < m, and ((2 ^ d - e - 1) / 2 ^ d) ^ q in the final query round m.

noncomputable def Cslib.Crypto.Protocols.FRI.friSmoothSumError {F : Type} [Field F] (params : FRISmoothParams F) (e : ℕ) (ε_commit : Fin params.m → ENNReal) :

Summed interactive smooth FRI soundness error (∑ i : Fin m, ε_commit i) + ((2 ^ d - e - 1) / 2 ^ d) ^ q.

theorem Cslib.Crypto.Protocols.FRI.sum_friSmoothRoundEscape_eq_friSmoothSumError {F : Type} [Field F] (params : FRISmoothParams F) (e : ℕ) (ε_commit : Fin params.m → ENNReal) :
∑ j : Fin (params.m + 1), friSmoothRoundEscape params e ε_commit j = friSmoothSumError params e ε_commit

The sum of friSmoothRoundEscape over all m + 1 rounds equals friSmoothSumError.

noncomputable def Cslib.Crypto.Protocols.FRI.friSmoothSupRBRError {F : Type} [Field F] (params : FRISmoothParams F) (e : ℕ) (ε_commit : Fin params.m → ENNReal) :

Uniform per-round escape error sup_j (friSmoothRoundEscape params e ε_commit j) across all m + 1 rounds of friSmoothIOP.

noncomputable def Cslib.Crypto.Protocols.FRI.friSmoothRBRError {F : Type} [Field F] [Fintype F] (params : FRISmoothParams F) (e B_commit : ℕ) :

Uniform per-round escape error for smooth FRI: the maximum of the commit-round error B_commit / |F| and the batched query-round error ((2 ^ d - e - 1) / 2 ^ d) ^ q.

theorem Cslib.Crypto.Protocols.FRI.friSmoothSupRBRError_const_le_friSmoothRBRError {F : Type} [Field F] [Fintype F] (params : FRISmoothParams F) (e B_commit : ℕ) :
(friSmoothSupRBRError params e fun (x : Fin params.m) => ↑B_commit / ↑(Fintype.card F)) ≤ friSmoothRBRError params e B_commit

For a uniform commit-round error B_commit / |F|, friSmoothSupRBRError is bounded above by friSmoothRBRError.

noncomputable def Cslib.Crypto.Protocols.FRI.friSmoothCommitGame {F : Type} [Field F] [Fintype F] (params : FRISmoothParams F) (B : ℕ) (stmt : BCS.OracleTable params.d F) (P : BCS.InteractiveIOPProver params.d F (FRIChal F params.d params.q)) :

Single-word smooth FRI commit-phase game: runs m interactive smooth folding rounds and samples the final committed oracle πFinal ← P pref, returning true iff strictly more than B starting points in Fin (2 ^ d) pass friSmoothFinalPasses.

Weighted Curve Gap / Escape Contracts #

def Cslib.Crypto.Protocols.FRI.WeightedCurveGapPerRound {F : Type} [Field F] [DecidableEq F] (params : FRISmoothParams F) (B : ℕ) (B_commit : Fin params.m → ℕ) :

Polymorphic per-round weighted degree-(l⁽ⁱ⁾ - 1) curve proximity-gap contract across all m smooth FRI folding rounds at agreement threshold B and per-round exceptional-scalar budgets B_commit : Fin params.m → ℕ.

theorem Cslib.Crypto.Protocols.FRI.WeightedCurveGapPerRound.mono {F : Type} [Field F] [DecidableEq F] {params : FRISmoothParams F} {B : ℕ} {B₁ B₂ : Fin params.m → ℕ} (hgap : WeightedCurveGapPerRound params B B₁) (hle : ∀ (i : Fin params.m), B₁ i ≤ B₂ i) :

Pointwise monotonicity of WeightedCurveGapPerRound in the per-round scalar budget.

Polymorphic uniform weighted curve proximity-gap contract for all m smooth FRI folding rounds at agreement threshold B and uniform bad-scalar budget B_commit (definitionally equal to WeightedCurveGapPerRound params B (fun _ => B_commit)).

def Cslib.Crypto.Protocols.FRI.WeightedCurveEscapePerRound {F : Type} [Field F] [Fintype F] [DecidableEq F] (params : FRISmoothParams F) (B : ℕ) (ε_commit : Fin params.m → ENNReal) :

Polymorphic per-round weighted curve escape-probability contract across all m smooth FRI folding rounds at agreement threshold B and per-round escape probability budgets ε_commit : Fin params.m → ℝ≥0∞ (matching [BenSassonCarmonIshaiKoppartySaraf2020, Theorem 7.2] with degree-(l⁽ⁱ⁾ - 1) curves).

theorem Cslib.Crypto.Protocols.FRI.WeightedCurveEscapePerRound.mono {F : Type} [Field F] [Fintype F] [DecidableEq F] {params : FRISmoothParams F} {B : ℕ} {ε₁ ε₂ : Fin params.m → ENNReal} (hesc : WeightedCurveEscapePerRound params B ε₁) (hle : ∀ (i : Fin params.m), ε₁ i ≤ ε₂ i) :

Pointwise monotonicity of WeightedCurveEscapePerRound in the per-round escape budget.

theorem Cslib.Crypto.Protocols.FRI.weightedCurveEscapePerRound_of_gapPerRound {F : Type} [Field F] [Fintype F] [DecidableEq F] (params : FRISmoothParams F) {B : ℕ} {B_commit : Fin params.m → ℕ} (hgap : WeightedCurveGapPerRound params B B_commit) :
WeightedCurveEscapePerRound params B fun (i : Fin params.m) => ↑(B_commit i) / ↑(Fintype.card F)

Every integer per-round bad-scalar bound WeightedCurveGapPerRound params B B_commit induces a per-round escape-probability bound ε_commit i = B_commit i / |F|.

Smooth Unique-Decoding Curve-Gap Upgrade #

Unweighted degree-(l⁽ⁱ⁾ - 1) curve proximity-gap hypothesis across all m smooth FRI folding rounds at unique-decoding radii e / 2 ^ cumLog (i + 1) (matching [BenSassonCarmonIshaiKoppartySaraf2020, Theorem 6.1]).

theorem Cslib.Crypto.Protocols.FRI.weightedCurveGapPerRound_of_uniqueCurveGap {F : Type} [Field F] [DecidableEq F] (params : FRISmoothParams F) {e : ℕ} (huniq : 2 * e + params.dim 0 ≤ 2 ^ params.d) (hgap : UniqueCurveGapHypothesis params e) :
WeightedCurveGapPerRound params (2 ^ params.d - e - 1) fun (i : Fin params.m) => (params.arity i - 1) * params.domainSize (↑i + 1)

Conditional step (shrinking per-round smooth unique-decoding weighted upgrade): inside the unique-decoding regime 2 * e + params.dim 0 ≤ 2 ^ d, assuming UniqueCurveGapHypothesis params e yields WeightedCurveGapPerRound via Folding.lean's weighted_agree_of_curve_many with telescoping budget fun i => (params.arity i - 1) * params.domainSize (i.val + 1) (whose sum over all m rounds is 2 ^ d - 2 ^ (d - totalLog) < 2 ^ d). This does not itself prove the unweighted curve proximity-gap theorem.

theorem Cslib.Crypto.Protocols.FRI.weightedCurveGapBound_of_uniqueCurveGap {F : Type} [Field F] [DecidableEq F] (params : FRISmoothParams F) {e : ℕ} (huniq : 2 * e + params.dim 0 ≤ 2 ^ params.d) (hgap : UniqueCurveGapHypothesis params e) :
WeightedCurveGapBound params (2 ^ params.d - e - 1) (2 ^ params.d - 2 ^ (params.d - params.firstStepLog))

Conditional step (uniform smooth unique-decoding weighted upgrade): inside the unique-decoding regime 2 * e + params.dim 0 ≤ 2 ^ d, assuming UniqueCurveGapHypothesis params e yields uniform WeightedCurveGapBound with round-0 budget 2 ^ d - 2 ^ (d - firstStepLog) via FRISmoothParams.arity_sub_one_mul_domainSize_le_first.