Documentation

CslibFrontier.Crypto.Protocols.FRI.Soundness.Transcript

Smooth FRI Transcript Accessors, Target Words, Fiber Weights, and Acceptance Predicates #

Defines smooth parameter scaling identities, shared transcript prefix accessors (prefOracle, prefFoldScalar, prefQueryIdxs, prefFinalQueryIdxs), smooth per-round target words and pushed-forward integer fiber weights (friSmoothTargetWord, friSmoothPreWeight, friSmoothOracleFilterWeight, friSmoothNextWeight), and smooth starting-point acceptance predicates (friSmoothPrefixPasses, friSmoothTranscriptSingleAccepts, friSmoothFinalPasses).

Smooth Parameter and Domain Helpers #

theorem Cslib.Crypto.Protocols.FRI.FRISmoothParams.two_pow_cumLog_mul_domainSize {F : Type} [Field F] (params : FRISmoothParams F) {i : ℕ} (hi : i ≤ params.m) :
2 ^ params.cumLog i * params.domainSize i = 2 ^ params.d

Cumulative fiber-size product identity 2 ^ cumLog i * domainSize i = 2 ^ d for i ≤ m.

theorem Cslib.Crypto.Protocols.FRI.FRISmoothParams.two_pow_cumLog_mul_dim {F : Type} [Field F] (params : FRISmoothParams F) {i : ℕ} (hi : i ≤ params.m) :
2 ^ params.cumLog i * params.dim i = params.dim 0

Cumulative dimension scaling identity 2 ^ cumLog i * dim i = dim 0 for i ≤ m.

Every round Reed–Solomon dimension params.dim r is at least 1.

theorem Cslib.Crypto.Protocols.FRI.FRISmoothParams.dim_le_domainSize {F : Type} [Field F] (params : FRISmoothParams F) {r : ℕ} (hr : r ≤ params.m) :
params.dim r ≤ params.domainSize r

Each active round dimension fits inside its active coset size (r ≤ m).

theorem Cslib.Crypto.Protocols.FRI.FRISmoothParams.two_mul_div_add_dim_le {F : Type} [Field F] (params : FRISmoothParams F) {e : ℕ} (huniq : 2 * e + params.dim 0 ≤ 2 ^ params.d) (i : Fin params.m) :
2 * (e / 2 ^ params.cumLog (↑i + 1)) + params.dim (↑i + 1) ≤ params.domainSize (↑i + 1)

Transport the initial unique-decoding bound 2 * e + params.dim 0 ≤ 2 ^ params.d to the scaled round-(i + 1) unique-decoding bound 2 * (e / 2 ^ cumLog (i + 1)) + params.dim (i + 1) ≤ params.domainSize (i + 1).

Shared Transcript Accessors (prefOracle, prefFoldScalar, prefQueryIdxs) #

Read the k-th committed prover oracle from a transcript prefix, defaulting to the zero table if k ≥ pref.length.

def Cslib.Crypto.Protocols.FRI.prefFoldScalar {F : Type} [Field F] {d q : ℕ} (pref : List (BCS.OracleTable d F × FRIChal F d q)) (k : ℕ) :
F

Read the k-th folding challenge scalar from a transcript prefix, defaulting to 0 if k ≥ pref.length.

def Cslib.Crypto.Protocols.FRI.prefQueryIdxs {F : Type} {d q : ℕ} (pref : List (BCS.OracleTable d F × FRIChal F d q)) (k : ℕ) :
Fin q → Fin (2 ^ d)

Read the k-th round's q query starting indices from a transcript prefix, defaulting to 0 if k ≥ pref.length.

@[reducible, inline]
abbrev Cslib.Crypto.Protocols.FRI.prefFinalQueryIdxs {F : Type} [Field F] (params : FRIParams F) (pref : List (BCS.OracleTable params.d F × FRIChal F params.d params.q)) :
Fin params.q → Fin (2 ^ params.d)

Read the final round's q query starting indices from a transcript, defaulting to 0.

theorem Cslib.Crypto.Protocols.FRI.prefOracle_append_left {F : Type} [Field F] {d q : ℕ} (pref extra : List (BCS.OracleTable d F × FRIChal F d q)) {k : ℕ} (hk : k < pref.length) :
prefOracle (pref ++ extra) k = prefOracle pref k

Reading oracle k < pref.length from pref ++ extra matches reading it from pref.

theorem Cslib.Crypto.Protocols.FRI.prefOracle_append_self {F : Type} [Field F] {d q : ℕ} (pref : List (BCS.OracleTable d F × FRIChal F d q)) (π : BCS.OracleTable d F) (c : FRIChal F d q) :
prefOracle (pref ++ [(π, c)]) pref.length = π

Reading the newly appended oracle at index pref.length returns π.

theorem Cslib.Crypto.Protocols.FRI.prefFoldScalar_append_left {F : Type} [Field F] {d q : ℕ} (pref extra : List (BCS.OracleTable d F × FRIChal F d q)) {k : ℕ} (hk : k < pref.length) :
prefFoldScalar (pref ++ extra) k = prefFoldScalar pref k

Reading folding scalar k < pref.length from pref ++ extra matches reading it from pref.

theorem Cslib.Crypto.Protocols.FRI.prefFoldScalar_append_self {F : Type} [Field F] {d q : ℕ} (pref : List (BCS.OracleTable d F × FRIChal F d q)) (π : BCS.OracleTable d F) (c : FRIChal F d q) :

Reading the newly appended folding scalar at index pref.length returns c.foldScalar.

theorem Cslib.Crypto.Protocols.FRI.prefFinalQueryIdxs_append_self {F : Type} [Field F] (params : FRIParams F) (pref : List (BCS.OracleTable params.d F × FRIChal F params.d params.q)) (hlen : pref.length = params.m) (π : BCS.OracleTable params.d F) (c : FRIChal F params.d params.q) :
prefFinalQueryIdxs params (pref ++ [(π, c)]) = c.queryIdxs

Reading the final round's query starting indices after appending (π, c) at index m returns c.queryIdxs.

theorem Cslib.Crypto.Protocols.FRI.prefOracle_ofFn {F : Type} [Field F] {m d q : ℕ} (oracles : Fin (m + 1) → BCS.OracleTable d F) (chals : Fin (m + 1) → FRIChal F d q) {k : ℕ} (hk : k < m + 1) :
prefOracle (List.ofFn fun (j : Fin (m + 1)) => (oracles j, chals j)) k = oracles ⟨k, hk⟩

Reading oracle k < m + 1 from a transcript built with List.ofFn yields oracles ⟨k, hk⟩.

theorem Cslib.Crypto.Protocols.FRI.prefFoldScalar_ofFn {F : Type} [Field F] {m d q : ℕ} (oracles : Fin (m + 1) → BCS.OracleTable d F) (chals : Fin (m + 1) → FRIChal F d q) {k : ℕ} (hk : k < m + 1) :
prefFoldScalar (List.ofFn fun (j : Fin (m + 1)) => (oracles j, chals j)) k = (chals ⟨k, hk⟩).foldScalar

Reading folding scalar k < m + 1 from a transcript built with List.ofFn yields (chals ⟨k, hk⟩).foldScalar.

theorem Cslib.Crypto.Protocols.FRI.prefFinalQueryIdxs_ofFn {F : Type} [Field F] (params : FRIParams F) (oracles : Fin (params.m + 1) → BCS.OracleTable params.d F) (chals : Fin (params.m + 1) → FRIChal F params.d params.q) :
prefFinalQueryIdxs params (List.ofFn fun (j : Fin (params.m + 1)) => (oracles j, chals j)) = (chals (Fin.last params.m)).queryIdxs

Reading the final round's query starting indices from a full List.ofFn transcript yields (chals (Fin.last params.m)).queryIdxs.

def Cslib.Crypto.Protocols.FRI.reindexDoubleEquiv {d j : ℕ} (hj : j < d) :
Fin (2 * 2 ^ (d - (j + 1))) ≃ Fin (2 ^ (d - j))

Equivalence between Fin (2 * 2 ^ (d - (j + 1))) and Fin (2 ^ (d - j)) for j < d.

Smooth Transcript State, Target Words, and Weight Filters #

def Cslib.Crypto.Protocols.FRI.friSmoothTargetWord {F : Type} [Field F] (params : FRISmoothParams F) (stmt : BCS.OracleTable params.d F) (pref : List (BCS.OracleTable params.d F × FRIChal F params.d params.q)) (i : ℕ) :
i ≤ params.m → Fin (params.domainSize i) → F

Expected round-i word along a smooth transcript prefix pref: stmt at round 0, and the l⁽ⁱ⁻¹⁾-to-1 coset folding foldWord of prefOracle pref (i - 1) at prefFoldScalar pref (i - 1) for round i ≥ 1.

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

Pre-filter integer fiber weight W̃_i : Fin (params.domainSize i) → ℕ along a smooth transcript prefix pref, prior to applying the round-i oracle consistency check π_i = friSmoothTargetWord: identically 1 at i = 0, and for i ≥ 1 the pushWeight fiberwise sum of the round-(i - 1) filtered weight.

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

Filtered smooth round-i weight for an explicit prover oracle π: retains friSmoothPreWeight on coordinates where π agrees with friSmoothTargetWord, and zeroes all other coordinates.

def Cslib.Crypto.Protocols.FRI.friSmoothNextWeight {F : Type} [Field F] [DecidableEq F] (params : FRISmoothParams F) (stmt : BCS.OracleTable params.d F) (pref : List (BCS.OracleTable params.d F × FRIChal F params.d params.q)) (i : ℕ) (hi : i < params.m) (π : BCS.OracleTable params.d F) :
Fin (params.domainSize (i + 1)) → ℕ

Pushed smooth round-(i + 1) weight induced by an explicit prover oracle π at round i (independent of the round-i verifier challenge).

Smooth Starting-Point Acceptance Predicates #

def Cslib.Crypto.Protocols.FRI.friSmoothPrefixPasses {F : Type} [Field F] (params : FRISmoothParams F) (stmt : BCS.OracleTable params.d F) (pref : List (BCS.OracleTable params.d F × FRIChal F params.d params.q)) (i : ℕ) (s : Fin (2 ^ params.d)) :

Smooth prefix acceptance predicate for a starting index s : Fin (2 ^ d) through folding rounds 0, ..., i - 1 along a transcript pref: round-0 binding π_0(s) = stmt(s) plus l⁽ᵏ⁾-to-1 fiber folding checks for every k < i.

Instances For
    def Cslib.Crypto.Protocols.FRI.friSmoothTranscriptSingleAccepts {F : Type} [Field F] (params : FRISmoothParams F) (stmt : BCS.OracleTable params.d F) (pref : List (BCS.OracleTable params.d F × FRIChal F params.d params.q)) (s : Fin (2 ^ params.d)) :

    Full single-query acceptance predicate evaluated on a smooth transcript list pref at starting index s : Fin (2 ^ d).

    def Cslib.Crypto.Protocols.FRI.friSmoothFinalPasses {F : Type} [Field F] (params : FRISmoothParams F) (stmt : BCS.OracleTable params.d F) (pref : List (BCS.OracleTable params.d F × FRIChal F params.d params.q)) (πFinal : BCS.OracleTable params.d F) (s : Fin (2 ^ params.d)) :

    Smooth final-round acceptance predicate for a length-m prefix pref and final oracle πFinal (manifestly independent of the final round's verifier challenge c).

    Instances For
      @[instance_reducible]
      instance Cslib.Crypto.Protocols.FRI.instDecidableFriSmoothPrefixPasses {F : Type} [Field F] [DecidableEq F] (params : FRISmoothParams F) (stmt : BCS.OracleTable params.d F) (pref : List (BCS.OracleTable params.d F × FRIChal F params.d params.q)) (i : ℕ) (s : Fin (2 ^ params.d)) :
      Decidable (friSmoothPrefixPasses params stmt pref i s)

      Decidability of the smooth prefix-acceptance predicate friSmoothPrefixPasses.

      @[instance_reducible]
      instance Cslib.Crypto.Protocols.FRI.instDecidableFriSmoothFinalPasses {F : Type} [Field F] [DecidableEq F] (params : FRISmoothParams F) (stmt : BCS.OracleTable params.d F) (pref : List (BCS.OracleTable params.d F × FRIChal F params.d params.q)) (πFinal : BCS.OracleTable params.d F) (s : Fin (2 ^ params.d)) :
      Decidable (friSmoothFinalPasses params stmt pref πFinal s)

      Decidability of the final-round smooth acceptance predicate friSmoothFinalPasses.