Documentation

CslibFrontier.Crypto.Computational.Kilian

Kilian's protocol: committing to a PCP proof with a Merkle tree #

Kilian's argument system ([Kil92]; [BG01], Construction 3.4) lets a prover convince a verifier that x ∈ L while sending only a hash-tree root and a few openings of a PCP proof. For a PCP verifier V with logarithmic randomness and a keyed hash H, at security parameter n:

  1. the verifier sends a uniform n-bit hash key k;
  2. the prover sends the statement x and the Merkle root root of its proof table;
  3. the verifier sends n independent PCP random strings ρs, each of V.coins x bits;
  4. for each random string ρ the prover sends one opening per query of V on (x, ρ): the bit at that position of the table and its authentication path;
  5. the verifier accepts when every opening is accepted by merkleVerify and V accepts every repetition on the opened bits (kilianVerify).

Positions. PCP addresses are binary numbers that may be exponentially large, so the committed object is not the PCP proof itself but its compact table: the bits at the addresses of V.queryTable x, the list of all addresses queried on all random strings, as in PCPVerifier.tableVerifier. Address a is stored at position (V.queryTable x).idxOf a, its first occurrence, and the tree has depth Nat.clog 2 (V.queryTable x).length (kilianDepth). The verifier computes positions itself, so a prover cannot choose them. With logarithmic randomness the table has polynomially many entries.

The honest prover (kilianTable, kilianCommit, kilianRespond) takes a table accepted by V.tableVerifier as its witness, normalizes it to the length of V.queryTable x, commits to its bits as one-bit leaves [b], and opens the queried positions with merklePath. Every repetition then passes (kilianVerify_kilianRespond), so the honest execution (kilianHonestGame) accepts with probability one when H k returns k.length bits (eval_kilianHonestGame): perfect completeness. The tables accepted by V.tableVerifier are exactly the witnesses of PCP_log_subset_NP, so for a PCP verifier for L this is the NP relation of L on which the prover is efficient.

Efficiency. The verifier's decision (computableInPolyTime_kilianVerify) and the honest prover's two messages (computableInPolyTime_kilianCommit, computableInPolyTime_kilianRespond) have plain polynomial-time certificates, and sampling the verifier's challenges is strict PPT (isPPTOn_kilianChallenges), for a polynomial-time V with O(log n) random bits and a polynomial-time H with n-bit digests.

Computational soundness, against cheating provers that choose x after seeing the key, is in CslibFrontier.Crypto.Computational.Kilian.Soundness, and the arguments for NP in CslibFrontier.Crypto.Computational.Kilian.NP.

Differences from [BG01], Construction 3.4. The tree is the one of CslibFrontier.Crypto.Computational.MerkleTree (hashed leaves, encPair pairing, sibling-only openings), not Barak and Goldreich's tree over raw proof bits (see the module documentation of CslibFrontier.Crypto.Computational.MerkleTree.Binding). The prover commits to a compact table of polynomial length, which suffices for NP, rather than to an oracle of superpolynomial length. Repetition is explicit (n parallel PCP runs). The hash key is uniform and hashing resists uniform adversaries, as in CollisionResistant.

Main definitions #

Main results #

References #

The verifier #

@[reducible, inline]

The prover's last message: for each repetition, one opening per query of the PCP verifier, each the claimed bit of the table and its authentication path.

The depth of the tree committing to the compact table of x.

def Cslib.Crypto.kilianPosition {α : Type} (V : Complexity.PCPVerifier α) (x : α) (a : ℕ) :

The position of the PCP address a in the compact table of x: its first occurrence in V.queryTable x.

def Cslib.Crypto.kilianCheck {α : Type} (H : List Bool → List Bool → List Bool) (V : Complexity.PCPVerifier α) (k : List Bool) (x : α) (root ρ : List Bool) (answers : List (MerkleOpening Bool)) :

The verifier's decision on one repetition with random string ρ: one opening per query of V on (x, ρ), each accepted (MerkleOpening.verify, one-bit leaves) at the position of its address, and V accepts the opened bits.

def Cslib.Crypto.kilianVerify {α : Type} (H : List Bool → List Bool → List Bool) (V : Complexity.PCPVerifier α) (k : List Bool) (x : α) (root : List Bool) (ρs : List (List Bool)) (response : KilianResponse) :

The verifier's decision: one answer list per random string, each accepted by kilianCheck.

noncomputable def Cslib.Crypto.kilianChallenges {α : Type} (V : Complexity.PCPVerifier α) (n : ℕ) (x : α) :

The verifier's challenge at security parameter n on statement x: n independent uniform random strings of V.coins x bits.

The honest prover #

The leaves committing to a table of bits: each bit as a one-bit leaf.

def Cslib.Crypto.kilianTable {α : Type} (V : Complexity.PCPVerifier α) (x : α) (table : List Bool) :

The honest prover's table: a candidate table normalized to the length of V.queryTable x, missing entries read as false, as PCPVerifier.tableVerifier reads them.

def Cslib.Crypto.kilianCommit {α : Type} (H : List Bool → List Bool → List Bool) (V : Complexity.PCPVerifier α) (k : List Bool) (x : α) (table : List Bool) :

The honest prover's commitment: the Merkle root of its normalized table.

def Cslib.Crypto.kilianOpen {α : Type} (H : List Bool → List Bool → List Bool) (V : Complexity.PCPVerifier α) (k : List Bool) (x : α) (table ρ : List Bool) :

The honest prover's openings for the random string ρ: for each query of V, the bit of the normalized table at its position and the authentication path.

def Cslib.Crypto.kilianRespond {α : Type} (H : List Bool → List Bool → List Bool) (V : Complexity.PCPVerifier α) (k : List Bool) (x : α) (table : List Bool) (ρs : List (List Bool)) :

The honest prover's last message: its openings for each random string.

noncomputable def Cslib.Crypto.kilianHonestGame {α : Type} (H : List Bool → List Bool → List Bool) (V : Complexity.PCPVerifier α) (x : α) (table : List Bool) (n : ℕ) :

The honest execution at security parameter n on statement x with witness table table: the verifier samples a key, the prover commits, the verifier samples challenges, the prover answers, and the verifier decides.

Completeness #

theorem Cslib.Crypto.kilianPosition_lt {α : Type} {V : Complexity.PCPVerifier α} {x : α} {ρ : List Bool} {a : ℕ} (hρ : ρ.length = V.coins x) (ha : a ∈ V.queries (x, ρ)) :

Every address queried on a random string of the right length has a position inside the compact table.

@[simp]
theorem Cslib.Crypto.length_kilianTable {α : Type} {V : Complexity.PCPVerifier α} (x : α) (table : List Bool) :

The normalized table has one entry per address of the address table.

theorem Cslib.Crypto.getD_kilianTable {α : Type} {V : Complexity.PCPVerifier α} {x : α} {table : List Bool} {i : ℕ} (hi : i < (V.queryTable x).length) :
(kilianTable V x table).getD i false = table.getD i false

Below the length of the address table, the normalized table agrees with the candidate.

theorem Cslib.Crypto.kilianCheck_kilianOpen {α : Type} {H : List Bool → List Bool → List Bool} {V : Complexity.PCPVerifier α} {x : α} {table : List Bool} (htable : V.tableVerifier (x, table) = true) (k : List Bool) {ℓ : ℕ} (hlen : ∀ (y : List Bool), (H k y).length = ℓ) {ρ : List Bool} (hρ : ρ.length = V.coins x) :
kilianCheck H V k x (kilianCommit H V k x table) ρ (kilianOpen H V k x table ρ) = true

Honest openings pass: for a table accepted by V.tableVerifier, the honest openings for a random string of the right length pass kilianCheck, when all digests of H k have one length.

theorem Cslib.Crypto.kilianVerify_kilianRespond {α : Type} {H : List Bool → List Bool → List Bool} {V : Complexity.PCPVerifier α} {x : α} {table : List Bool} (htable : V.tableVerifier (x, table) = true) (k : List Bool) {ℓ : ℕ} (hlen : ∀ (y : List Bool), (H k y).length = ℓ) {ρs : List (List Bool)} (hρs : ∀ ρ ∈ ρs, ρ.length = V.coins x) :
kilianVerify H V k x (kilianCommit H V k x table) ρs (kilianRespond H V k x table ρs) = true

Honest responses are accepted: for a table accepted by V.tableVerifier, the honest prover's commitment and openings are accepted on every list of random strings of the right length, when all digests of H k have one length.

theorem Cslib.Crypto.eval_kilianHonestGame {α : Type} (H : List Bool → List Bool → List Bool) (V : Complexity.PCPVerifier α) (hlen : ∀ (k y : List Bool), (H k y).length = k.length) {x : α} {table : List Bool} (htable : V.tableVerifier (x, table) = true) (n : ℕ) :

Perfect completeness of Kilian's protocol: for a hash whose digests have the length of the key, on a statement x with a table accepted by V.tableVerifier, the honest execution accepts with probability one, at every security parameter.

Efficiency #

theorem Cslib.Crypto.encKilianOpening_path_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → MerkleOpening Bool} :
theorem Cslib.Crypto.encKilianOpening_leaf_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → MerkleOpening Bool} :
@[reducible, inline]

The tuple of the fields of encKilianOpening.

theorem Cslib.Crypto.encKilianOpening_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → Bool} {T0 S0 : γ → ℕ} {x1 : γ → List (List Bool)} {T1 S1 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn Turing.MultiTapeTM.encBool T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encBits) T1 S1) :
Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { leaf := x0 x, path := x1 x }) encIn encKilianOpening (fun (x : γ) => T0 x + T1 x) fun (x : γ) => S0 x + S1 x

The encoding of an opening of a bit: the bit, then the authentication path.

theorem Cslib.Crypto.encKilianOpening_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 : γ → Bool} {x1 : γ → List (List Bool)} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn Turing.MultiTapeTM.encBool budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encBits) budget) :
Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { leaf := x0 x, path := x1 x }) encIn encKilianOpening budget
@[reducible, inline]

The encoding of the prover's last message.

What the verifier holds after the commitment: its hash key, the statement and the root that the prover committed to.

  • key : List Bool

    The hash key.

  • stmt : α

    The statement.

  • root : List Bool

    The committed Merkle root.

The verifier's view of a run, the input of kilianVerify: the claim, the random strings and the prover's response.

The honest prover's input: the hash key, the statement and its witness table.

  • key : List Bool

    The hash key.

  • stmt : α

    The statement.

  • table : List Bool

    The witness table.

The encoding of a claim: the framed key, the framed statement, then the root.

theorem Cslib.Crypto.encKilianClaim_mk_budget {α : Type} (enc : α ↪ List Bool) {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 : γ → List Bool} {x1 : γ → α} {x2 : γ → List Bool} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn Turing.MultiTapeTM.encBits budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn enc budget) (h2 : Turing.MultiTapeTM.ComputableInSpace x2 encIn Turing.MultiTapeTM.encBits budget) :
Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { key := x0 x, stmt := x1 x, root := x2 x }) encIn (encKilianClaim enc) budget
theorem Cslib.Crypto.encKilianClaim_stmt_polyTime {α : Type} (enc : α ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {g✝ : γ✝ → KilianClaim α} :
Turing.MultiTapeTM.ComputableInPolyTime g✝ encIn✝ (encKilianClaim enc) → Turing.MultiTapeTM.ComputableInPolyTime (fun (c : γ✝) => (g✝ c).stmt) encIn✝ enc
theorem Cslib.Crypto.encKilianClaim_key_polyTime {α : Type} (enc : α ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {g✝ : γ✝ → KilianClaim α} :
theorem Cslib.Crypto.encKilianClaim_mk_inO {α : Type} (enc : α ↪ List Bool) {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → List Bool} {T0 S0 : γ → ℕ} {x1 : γ → α} {T1 S1 : γ → ℕ} {x2 : γ → List Bool} {T2 S2 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn Turing.MultiTapeTM.encBits T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn enc T1 S1) (h2 : Turing.MultiTapeTM.ComputableInO x2 encIn Turing.MultiTapeTM.encBits T2 S2) :
Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { key := x0 x, stmt := x1 x, root := x2 x }) encIn (encKilianClaim enc) (fun (x : γ) => T0 x + (T1 x + T2 x)) fun (x : γ) => S0 x + (S1 x + S2 x)
theorem Cslib.Crypto.encKilianClaim_root_polyTime {α : Type} (enc : α ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {g✝ : γ✝ → KilianClaim α} :
theorem Cslib.Crypto.encKilianClaim_mk_polyTime {α : Type} (enc : α ↪ List Bool) {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → List Bool} {x1 : γ → α} {x2 : γ → List Bool} (h0 : Turing.MultiTapeTM.ComputableInPolyTime x0 encIn Turing.MultiTapeTM.encBits) (h1 : Turing.MultiTapeTM.ComputableInPolyTime x1 encIn enc) (h2 : Turing.MultiTapeTM.ComputableInPolyTime x2 encIn Turing.MultiTapeTM.encBits) :
Turing.MultiTapeTM.ComputableInPolyTime (fun (x : γ) => { key := x0 x, stmt := x1 x, root := x2 x }) encIn (encKilianClaim enc)
theorem Cslib.Crypto.encKilianClaim_key_budget {α : Type} (enc : α ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → KilianClaim α} :
Turing.MultiTapeTM.ComputableInSpace g✝ encIn✝ (encKilianClaim enc) S✝ → Turing.MultiTapeTM.ComputableInSpace (fun (c : γ✝) => (g✝ c).key) encIn✝ Turing.MultiTapeTM.encBits S✝
theorem Cslib.Crypto.encKilianClaim_root_budget {α : Type} (enc : α ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → KilianClaim α} :
theorem Cslib.Crypto.encKilianClaim_mk_deg {α : Type} (enc : α ↪ List Bool) :
Turing.MultiTapeTM.ComputableInDegree (fun (p : List Bool × α × List Bool) => { key := p.1, stmt := p.2.1, root := p.2.2 }) (encKilianClaimFields enc) (encKilianClaim enc) 1 1
@[reducible, inline]

The tuple of the fields of encKilianClaim.

theorem Cslib.Crypto.encKilianClaim_stmt_budget {α : Type} (enc : α ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → KilianClaim α} :
Turing.MultiTapeTM.ComputableInSpace g✝ encIn✝ (encKilianClaim enc) S✝ → Turing.MultiTapeTM.ComputableInSpace (fun (c : γ✝) => (g✝ c).stmt) encIn✝ enc S✝
theorem Cslib.Crypto.encKilianView_toKilianClaim_budget {α : Type} (enc : α ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → KilianView α} :
Turing.MultiTapeTM.ComputableInSpace g✝ encIn✝ (encKilianView enc) S✝ → Turing.MultiTapeTM.ComputableInSpace (fun (c : γ✝) => (g✝ c).toKilianClaim) encIn✝ (encKilianClaim enc) S✝
theorem Cslib.Crypto.encKilianView_mk_deg {α : Type} (enc : α ↪ List Bool) :
Turing.MultiTapeTM.ComputableInDegree (fun (p : KilianClaim α × List (List Bool) × KilianResponse) => { toKilianClaim := p.1, challenges := p.2.1, response := p.2.2 }) (encKilianViewFields enc) (encKilianView enc) 1 1
theorem Cslib.Crypto.encKilianView_mk_polyTime {α : Type} (enc : α ↪ List Bool) {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → KilianClaim α} {x1 : γ → List (List Bool)} {x2 : γ → KilianResponse} (h0 : Turing.MultiTapeTM.ComputableInPolyTime x0 encIn (encKilianClaim enc)) (h1 : Turing.MultiTapeTM.ComputableInPolyTime x1 encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encBits)) (h2 : Turing.MultiTapeTM.ComputableInPolyTime x2 encIn encKilianResponse) :
Turing.MultiTapeTM.ComputableInPolyTime (fun (x : γ) => { toKilianClaim := x0 x, challenges := x1 x, response := x2 x }) encIn (encKilianView enc)
@[reducible, inline]

The tuple of the fields of encKilianView.

theorem Cslib.Crypto.encKilianView_mk_inO {α : Type} (enc : α ↪ List Bool) {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → KilianClaim α} {T0 S0 : γ → ℕ} {x1 : γ → List (List Bool)} {T1 S1 : γ → ℕ} {x2 : γ → KilianResponse} {T2 S2 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn (encKilianClaim enc) T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encBits) T1 S1) (h2 : Turing.MultiTapeTM.ComputableInO x2 encIn encKilianResponse T2 S2) :
Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { toKilianClaim := x0 x, challenges := x1 x, response := x2 x }) encIn (encKilianView enc) (fun (x : γ) => T0 x + (T1 x + T2 x)) fun (x : γ) => S0 x + (S1 x + S2 x)
theorem Cslib.Crypto.encKilianView_response_budget {α : Type} (enc : α ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → KilianView α} :
Turing.MultiTapeTM.ComputableInSpace g✝ encIn✝ (encKilianView enc) S✝ → Turing.MultiTapeTM.ComputableInSpace (fun (c : γ✝) => (g✝ c).response) encIn✝ encKilianResponse S✝
theorem Cslib.Crypto.encKilianView_response_polyTime {α : Type} (enc : α ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {g✝ : γ✝ → KilianView α} :

The encoding of the verifier's view: the claim as one framed word, the framed random strings, then the response.

theorem Cslib.Crypto.encKilianView_toKilianClaim_polyTime {α : Type} (enc : α ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {g✝ : γ✝ → KilianView α} :
theorem Cslib.Crypto.encKilianView_challenges_budget {α : Type} (enc : α ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → KilianView α} :
theorem Cslib.Crypto.encKilianView_mk_budget {α : Type} (enc : α ↪ List Bool) {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 : γ → KilianClaim α} {x1 : γ → List (List Bool)} {x2 : γ → KilianResponse} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn (encKilianClaim enc) budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encBits) budget) (h2 : Turing.MultiTapeTM.ComputableInSpace x2 encIn encKilianResponse budget) :
Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { toKilianClaim := x0 x, challenges := x1 x, response := x2 x }) encIn (encKilianView enc) budget
theorem Cslib.Crypto.encKilianProverInput_mk_polyTime {α : Type} (enc : α ↪ List Bool) {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → List Bool} {x1 : γ → α} {x2 : γ → List Bool} (h0 : Turing.MultiTapeTM.ComputableInPolyTime x0 encIn Turing.MultiTapeTM.encBits) (h1 : Turing.MultiTapeTM.ComputableInPolyTime x1 encIn enc) (h2 : Turing.MultiTapeTM.ComputableInPolyTime x2 encIn Turing.MultiTapeTM.encBits) :
Turing.MultiTapeTM.ComputableInPolyTime (fun (x : γ) => { key := x0 x, stmt := x1 x, table := x2 x }) encIn (encKilianProverInput enc)
@[reducible, inline]

The tuple of the fields of encKilianProverInput.

theorem Cslib.Crypto.encKilianProverInput_key_budget {α : Type} (enc : α ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → KilianProverInput α} :
theorem Cslib.Crypto.encKilianProverInput_table_budget {α : Type} (enc : α ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → KilianProverInput α} :
theorem Cslib.Crypto.encKilianProverInput_mk_deg {α : Type} (enc : α ↪ List Bool) :
Turing.MultiTapeTM.ComputableInDegree (fun (p : List Bool × α × List Bool) => { key := p.1, stmt := p.2.1, table := p.2.2 }) (encKilianProverInputFields enc) (encKilianProverInput enc) 1 1
theorem Cslib.Crypto.encKilianProverInput_stmt_polyTime {α : Type} (enc : α ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {g✝ : γ✝ → KilianProverInput α} :
Turing.MultiTapeTM.ComputableInPolyTime g✝ encIn✝ (encKilianProverInput enc) → Turing.MultiTapeTM.ComputableInPolyTime (fun (c : γ✝) => (g✝ c).stmt) encIn✝ enc

The encoding of the honest prover's input: the framed key, the framed statement, then the table.

theorem Cslib.Crypto.encKilianProverInput_key_polyTime {α : Type} (enc : α ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {g✝ : γ✝ → KilianProverInput α} :
theorem Cslib.Crypto.encKilianProverInput_mk_inO {α : Type} (enc : α ↪ List Bool) {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → List Bool} {T0 S0 : γ → ℕ} {x1 : γ → α} {T1 S1 : γ → ℕ} {x2 : γ → List Bool} {T2 S2 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn Turing.MultiTapeTM.encBits T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn enc T1 S1) (h2 : Turing.MultiTapeTM.ComputableInO x2 encIn Turing.MultiTapeTM.encBits T2 S2) :
Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { key := x0 x, stmt := x1 x, table := x2 x }) encIn (encKilianProverInput enc) (fun (x : γ) => T0 x + (T1 x + T2 x)) fun (x : γ) => S0 x + (S1 x + S2 x)
theorem Cslib.Crypto.encKilianProverInput_stmt_budget {α : Type} (enc : α ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → KilianProverInput α} :
Turing.MultiTapeTM.ComputableInSpace g✝ encIn✝ (encKilianProverInput enc) S✝ → Turing.MultiTapeTM.ComputableInSpace (fun (c : γ✝) => (g✝ c).stmt) encIn✝ enc S✝
theorem Cslib.Crypto.encKilianProverInput_table_polyTime {α : Type} (enc : α ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {g✝ : γ✝ → KilianProverInput α} :
theorem Cslib.Crypto.encKilianProverInput_mk_budget {α : Type} (enc : α ↪ List Bool) {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 : γ → List Bool} {x1 : γ → α} {x2 : γ → List Bool} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn Turing.MultiTapeTM.encBits budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn enc budget) (h2 : Turing.MultiTapeTM.ComputableInSpace x2 encIn Turing.MultiTapeTM.encBits budget) :
Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { key := x0 x, stmt := x1 x, table := x2 x }) encIn (encKilianProverInput enc) budget

The verifier's decision is efficient: kilianVerify on the key, the statement, the root, the random strings and the response takes polynomial time, for a polynomial-time PCP verifier with O(log n) random bits and a polynomial-time hash with n-bit digests. Malformed responses are charged for their length.

theorem Cslib.Crypto.computableInTimeAndSpace_kilianVerify_of_bound {α : Type} {H : List Bool → List Bool → List Bool} {V : Complexity.PCPVerifier α} {enc : α ↪ List Bool} {c : ℕ} (hH : Turing.MultiTapeTM.ComputableInPolyTime (fun (p : List Bool × List Bool) => H p.1 p.2) (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits Turing.MultiTapeTM.encBits) Turing.MultiTapeTM.encBits) (hlen : ∀ (k x : List Bool), (H k x).length = k.length) (hV : Complexity.PCPVerifier.PolyTime enc V) (hcoins : ∀ (a : α), V.coins a ≤ c * (Nat.log 2 (enc a).length + 1)) (P : KilianView α → Prop) (param : KilianView α → ℕ) (inBound : ℕ → ℕ) (hin : PolynomiallyBounded inBound) (hlenView : ∀ (view : KilianView α), P view → ((encKilianView enc) view).length ≤ inBound (param view)) :
∃ (k : ℕ) (State : Type) (_ : Finite State) (tm : Turing.MultiTapeTM k Bool State) (t : ℕ → ℕ) (s : ℕ → ℕ) (tBound : ℕ → ℕ) (sBound : ℕ → ℕ), PolynomiallyBounded t ∧ PolynomiallyBounded s ∧ PolynomiallyBounded tBound ∧ PolynomiallyBounded sBound ∧ (tm.ComputesFunInTimeAndSpace (encKilianView enc) Turing.MultiTapeTM.encBool (fun (v : KilianView α) => kilianVerify H V v.key v.stmt v.root v.challenges v.response) (fun (v : KilianView α) => t ((encKilianView enc) v).length) fun (v : KilianView α) => s ((encKilianView enc) v).length) ∧ ∀ (view : KilianView α), P view → t ((encKilianView enc) view).length ≤ tBound (param view) ∧ s ((encKilianView enc) view).length ≤ sBound (param view) ∧ tm.ComputesInTimeAndSpace ((encKilianView enc) view) (Turing.MultiTapeTM.encBool (kilianVerify H V view.key view.stmt view.root view.challenges view.response)) (tBound (param view)) (sBound (param view))

Bounded-view machine runtime and space for kilianVerify: given any polynomially bounded upper bound inBound (param view) on the encoded views in a subclass P, the machine computing kilianVerify runs in monotone polynomial time and space on all KilianView α and within polynomially bounded functions of param view on every view satisfying P.

The honest commitment is efficient: the root of the honest prover's tree takes polynomial time in the key, the statement and the witness table.

The honest response is efficient: the honest prover's openings take polynomial time in the key, the statement, the witness table and the random strings.

Sampling the challenges is efficient: drawing n random strings of V.coins x bits is strict PPT in the unary security parameter and the statement, for a polynomial-time PCP verifier with O(log n) random bits.