Documentation

CslibFrontier.Crypto.Computational.Kilian.Extraction

Rewinding compact PCP-table extraction for Kilian's protocol #

This module constructs an explicit, uniform strict probabilistic polynomial-time rewinding extractor kilianTableExtractor for Kilian's succinct interactive argument over any O(log |enc x|)-coin PCP verifier V (CslibFrontier.Crypto.Computational.Kilian) and keyed hash H, paired with a strict-PPT Merkle position-binding reduction kilianExtractorBindingAdversary (CslibFrontier.Crypto.Computational.MerkleTree.Extract).

Given security parameter n, key k, and prover P : KilianProver α:

  1. kilianTableExtractor runs P.commit n k once to obtain cm = { stmt, root, state }.
  2. Enumerating every ρ₀ ∈ BitString.enumList (V.coins cm.stmt) (of polynomial size 2 ^ r under the logarithmic coin bound) and every repetition slot i < n, kilianCollectRuns rewinds P.answer n cm.state T n times with slot i fixed to ρ₀ and independent uniform challenges in the remaining n - 1 slots.
  3. kilianExtractTableFromRuns invokes merkleExtractVector on the verified openings from all accepted transcripts to assemble a compact bit table table of length (V.queryTable cm.stmt).length.

Honest scope ([BG01], Construction 3.4 and Lemma 3.5) #

Locators in [BG01] are not re-verified against the primary PDF in this checkout (locator not re-verified against primary PDF).

Main definitions #

Main results #

References #

Transcript structures and deterministic table extraction #

One verifier challenge tuple paired with the prover's opening response.

Instances For
    theorem Cslib.Crypto.encKilianChallengeRun_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 : γ → List (List Bool)} {x1 : γ → KilianResponse} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encBits) budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn encKilianResponse budget) :
    Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { challenges := x0 x, response := x1 x }) encIn encKilianChallengeRun budget
    theorem Cslib.Crypto.encKilianChallengeRun_response_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → KilianChallengeRun} :

    Encoding of a KilianChallengeRun: framed challenges followed by the prover response.

    theorem Cslib.Crypto.encKilianChallengeRun_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → List (List Bool)} {T0 S0 : γ → ℕ} {x1 : γ → KilianResponse} {T1 S1 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encBits) T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn encKilianResponse T1 S1) :
    Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { challenges := x0 x, response := x1 x }) encIn encKilianChallengeRun (fun (x : γ) => T0 x + T1 x) fun (x : γ) => S0 x + S1 x

    The output of rewinding extraction: the chosen statement, committed Merkle root, and reconstructed compact PCP bit table.

    • stmt : α

      The statement output by the prover's first stage.

    • root : List Bool

      The Merkle root committed by the prover's first stage.

    • table : List Bool

      The extracted compact table indexed by V.queryTable stmt.

    Instances For
      theorem Cslib.Crypto.KilianExtractedTable.ext {α : Type} {x y : KilianExtractedTable α} (stmt : x.stmt = y.stmt) (root : x.root = y.root) (table : x.table = y.table) :
      x = y
      @[instance_reducible]
      theorem Cslib.Crypto.encKilianExtractedTable_stmt_polyTime {α : Type} (enc : α ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {g✝ : γ✝ → KilianExtractedTable α} :
      Turing.MultiTapeTM.ComputableInPolyTime g✝ encIn✝ (encKilianExtractedTable enc) → Turing.MultiTapeTM.ComputableInPolyTime (fun (c : γ✝) => (g✝ c).stmt) encIn✝ enc
      @[reducible, inline]

      The tuple of the fields of encKilianExtractedTable.

      Encoding of KilianExtractedTable: the statement, Merkle root, and compact table.

      theorem Cslib.Crypto.encKilianExtractedTable_mk_polyTime {α : Type} (enc : α ↪ List Bool) {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → α} {x1 x2 : γ → List Bool} (h0 : Turing.MultiTapeTM.ComputableInPolyTime x0 encIn enc) (h1 : Turing.MultiTapeTM.ComputableInPolyTime x1 encIn Turing.MultiTapeTM.encBits) (h2 : Turing.MultiTapeTM.ComputableInPolyTime x2 encIn Turing.MultiTapeTM.encBits) :
      Turing.MultiTapeTM.ComputableInPolyTime (fun (x : γ) => { stmt := x0 x, root := x1 x, table := x2 x }) encIn (encKilianExtractedTable enc)
      theorem Cslib.Crypto.encKilianExtractedTable_mk_inO {α : Type} (enc : α ↪ List Bool) {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → α} {T0 S0 : γ → ℕ} {x1 : γ → List Bool} {T1 S1 : γ → ℕ} {x2 : γ → List Bool} {T2 S2 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn enc T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn Turing.MultiTapeTM.encBits T1 S1) (h2 : Turing.MultiTapeTM.ComputableInO x2 encIn Turing.MultiTapeTM.encBits T2 S2) :
      Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { stmt := x0 x, root := x1 x, table := x2 x }) encIn (encKilianExtractedTable enc) (fun (x : γ) => T0 x + (T1 x + T2 x)) fun (x : γ) => S0 x + (S1 x + S2 x)
      theorem Cslib.Crypto.encKilianExtractedTable_stmt_budget {α : Type} (enc : α ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → KilianExtractedTable α} :
      Turing.MultiTapeTM.ComputableInSpace g✝ encIn✝ (encKilianExtractedTable enc) S✝ → Turing.MultiTapeTM.ComputableInSpace (fun (c : γ✝) => (g✝ c).stmt) encIn✝ enc S✝
      theorem Cslib.Crypto.encKilianExtractedTable_mk_deg {α : Type} (enc : α ↪ List Bool) :
      Turing.MultiTapeTM.ComputableInDegree (fun (p : α × List Bool × List Bool) => { stmt := p.1, root := p.2.1, table := p.2.2 }) (encKilianExtractedTableFields enc) (encKilianExtractedTable enc) 1 1
      theorem Cslib.Crypto.encKilianExtractedTable_root_budget {α : Type} (enc : α ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → KilianExtractedTable α} :
      theorem Cslib.Crypto.encKilianExtractedTable_table_budget {α : Type} (enc : α ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → KilianExtractedTable α} :
      theorem Cslib.Crypto.encKilianExtractedTable_mk_budget {α : Type} (enc : α ↪ List Bool) {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 : γ → α} {x1 x2 : γ → List Bool} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn enc budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn Turing.MultiTapeTM.encBits budget) (h2 : Turing.MultiTapeTM.ComputableInSpace x2 encIn Turing.MultiTapeTM.encBits budget) :
      Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { stmt := x0 x, root := x1 x, table := x2 x }) encIn (encKilianExtractedTable enc) budget
      noncomputable def Cslib.Crypto.kilianAcceptGame {α : Type} (H : List Bool → List Bool → List Bool) (V : Complexity.PCPVerifier α) (P : KilianProver α) (n : ℕ) :

      Single-run prover acceptance game (without checking stmt ∉ L): sample a uniform n-bit hash key, commit with P.commit, sample n PCP challenges, run P.answer, and verify.

      Collect all verified Merkle openings from accepted KilianChallengeRuns, converted to MerkleIndexedOpenings below (V.queryTable x).length.

      Reconstruct a compact PCP table from runs by collecting verified openings from accepted runs via merkleExtractVector.

      Extract a MerkleBindingOutput from any conflicting pair of verified openings in runs.

      theorem Cslib.Crypto.accepts_kilianExtractTableFromRuns_or_breaksBinding {α : Type} {H : List Bool → List Bool → List Bool} {V : Complexity.PCPVerifier α} {n : ℕ} {k : List Bool} {x : α} {root : List Bool} {runs : List KilianChallengeRun} :
      merkleBreaksBinding H (fun (x : ℕ) (leaf : List Bool) => leaf.length == 1) n k (kilianRunsBindingOutput H V k x root runs) = true ∨ ∀ run ∈ runs, kilianVerify H V k x root run.challenges run.response = true → ∀ ρ ∈ run.challenges, ρ.length = V.coins x → V.accepts x (V.proofOfTable x (kilianExtractTableFromRuns H V k x root runs)) ρ = true

      Deterministic transcript-extraction dichotomy: for any list of runs, either kilianRunsBindingOutput breaks merkleBreaksBinding, or every accepted run's valid-length challenges accept the proof V.proofOfTable x (kilianExtractTableFromRuns ...).

      Rewinding table extractor and strict-PPT certificates #

      noncomputable def Cslib.Crypto.kilianPlantedRun {α : Type} (V : Complexity.PCPVerifier α) (P : KilianProver α) (n : ℕ) (cm : KilianCommitment α) (ρ₀ : List Bool) (i : ℕ) :

      Run P.answer once on n challenges with coordinate i fixed to ρ₀ and the other n - 1 coordinates sampled independently from BitString.sampleList (V.coins cm.stmt).

      noncomputable def Cslib.Crypto.kilianCollectRuns {α : Type} (V : Complexity.PCPVerifier α) (P : KilianProver α) (T : ℕ → ℕ) (n : ℕ) (cm : KilianCommitment α) :

      Rewind P.answer across all V.coins cm.stmt-bit PCP coins ρ₀, all n slots i ∈ List.range n, and T n fresh trials per (ρ₀, i).

      noncomputable def Cslib.Crypto.kilianTableExtractor {α : Type} (H : List Bool → List Bool → List Bool) (V : Complexity.PCPVerifier α) (P : KilianProver α) (T : ℕ → ℕ) (n : ℕ) (k : List Bool) :

      Uniform strict-PPT rewinding table extractor for Kilian's protocol: commits once with P.commit, collects rewound transcripts via kilianCollectRuns, and reconstructs a compact PCP table via kilianExtractTableFromRuns.

      Binding adversary paired with kilianTableExtractor: executes the identical rewinding collection and emits any conflicting pair of accepted openings found in the transcripts.

      noncomputable def Cslib.Crypto.kilianExtractionFracGame {α : Type} (H : List Bool → List Bool → List Bool) (V : Complexity.PCPVerifier α) (P : KilianProver α) (T : ℕ → ℕ) (num den n : ℕ) :

      Strict-fraction table-extraction experiment: runs kilianTableExtractor and returns true iff the expanded proof V.proofOfTable ext.stmt ext.table passes strictly more than num / den fraction of all 2 ^ V.coins ext.stmt PCP coins.

      Uniform strict-PPT efficiency of kilianTableExtractor: when H, V, P, and the rewind count T are polynomial-time / strict PPT (and V uses O(log |enc x|) coins), kilianTableExtractor is uniform strict PPT.

      Uniform strict-PPT efficiency of kilianExtractorBindingAdversary: the conflict-emitting binding adversary paired with kilianTableExtractor is uniform strict PPT under the same hypotheses.

      Exact finite-parameter rewinding extraction bound #

      theorem Cslib.Crypto.succProbability_kilianAcceptGame_le_extracted {α : Type} {H : List Bool → List Bool → List Bool} {V : Complexity.PCPVerifier α} {P : KilianProver α} (T : ℕ → ℕ) (num den n M : ℕ) {θ : ℝ} (hden : 0 < den) (hθ0 : 0 ≤ θ) (hθ1 : θ ≤ 1) (hM : ∀ (k : List Bool), k.length = n → ∀ cm ∈ (P.commit n k).eval.support, 2 ^ V.coins cm.stmt ≤ M) :
      ((kilianAcceptGame H V P n).eval true).toReal ≤ (↑num / ↑den) ^ n + ↑n * θ + ↑M * (1 - θ) ^ T n + ((merkleBindingGame H (fun (x : ℕ) (leaf : List Bool) => leaf.length == 1) (kilianExtractorBindingAdversary H V P T) n).eval true).toReal + ((kilianExtractionFracGame H V P T num den n).eval true).toReal

      Exact finite-parameter rewinding extraction bound for Kilian's protocol: for any rational threshold num / den (0 < den), per-coin attempt budget T n, per-instance acceptance threshold θ ∈ (0, 1], and coin-space bound 2 ^ V.coins cm.stmt ≤ M, the prover's single-run acceptance probability is bounded by (num / den) ^ n + n * θ + M * (1 - θ) ^ T n plus the binding error of kilianExtractorBindingAdversary and the probability that kilianTableExtractor extracts a compact table whose expanded proof accepts strictly more than a num / den fraction of PCP coins.

      Asymptotic weak knowledge extraction and NP witness consequence #

      Rewinding compact PCP-table extraction theorem for Kilian's protocol under any collision-resistant HashFamily and O(log |enc x|)-coin PCP verifier V (a step toward [BG01], Construction 3.4 and Lemma 3.5, uniform strict-PPT compact-table counterpart; locator not re-verified against primary PDF): for any prover P : KilianProver α, any strict rational acceptance threshold num / den < 1, and any polynomial inverse slack (p n + 1)⁻¹, there exists a polynomial-time attempt budget T such that kilianTableExtractor H V P T runs in uniform strict PPT and succeeds in extracting a compact PCP table passing > (num / den) * 2 ^ V.coins ext.stmt coins with probability at least Pr[P accepts] - 1 / (p n + 1) - ν n for negligible ν. No NP witness w is extracted.

      theorem Cslib.Crypto.kilianExtract_mem_of_isPCP {α : Type} {enc : α ↪ List Bool} {r q : ℕ → ℕ} {V : Complexity.PCPVerifier α} {L : Set α} (hpcp : Complexity.IsPCPVerifier enc r q V L) (ext : KilianExtractedTable α) (hfrac : 1 * 2 ^ V.coins ext.stmt < 2 * Complexity.acceptCount (fun (y : α × List Bool) => V.accepts y.1 (V.proofOfTable ext.stmt ext.table) y.2) ext.stmt (V.coins ext.stmt)) :
      ext.stmt ∈ L

      PCP soundness witness consequence for extracted compact tables: whenever V is a PCP verifier for L with soundness error ≤ 1 / 2 and an extracted KilianExtractedTable satisfies the strict half-coin acceptance predicate (1 * 2 ^ V.coins ext.stmt < 2 * acceptCount ...), the committed statement belongs to L.

      theorem Cslib.Crypto.HashFamily.kilianTableExtraction_npRelation {α : Type} {H : List Bool → List Bool → List Bool} (hH : HashFamily H) (enc : α ↪ List Bool) (R : Complexity.NPRelation enc) :

      Rewinding compact PCP-table extraction for arbitrary NP relations: under a collision- resistant HashFamily, every R : NPRelation enc admits a polynomial-time O(log n)-coin PCP verifier V and witness compiler compile (from the PCP completeness bridge) such that every uniform strict PPT prover's acceptance probability is upper-bounded by the 1 / 2-coin table extraction probability up to arbitrary inverse-polynomial slack and negligible cryptographic error. No NP witness w is extracted constructively by kilianTableExtractor; the existential guarantee ∃ w, R.IsWitness ext.stmt w is a non-constructive PCP-soundness consequence of ext.stmt ∈ R.language via kilianExtract_mem_of_isPCP.