Documentation

CslibFrontier.Crypto.Computational.Kilian.MicaliSoundness

Soundness of Micali's Computationally Sound Proofs in the Random Oracle Model #

This module proves an explicit soundness bound for an unsalted, two-channel adaptation of Micali's non-interactive random-oracle compilation of Kilian's protocol ([Mic00]; [CY24], Construction 21.1.1 and Theorem 21.2.1, printed pp. 239–242) by combining the straight-line Merkle trace extractor of CslibFrontier/Crypto/Computational/MerkleTree/ROMExtract.lean with a union bound over the Fiat–Shamir challenge queries:

  1. Pure / fixed-trace soundness bridge (micaliVerifyPure_sound_of_traceCollisionFree). Given a deterministic Merkle hash H k (or unkeyed hTree), a Fiat–Shamir oracle hFS, and a recorded Merkle query-answer trace tr : List (List Bool × List Bool): if tr is collision-free (TraceCollisionFree tr) and records every hash evaluation along the openings of proof : MicaliProof (AllOpeningsQueriedInTrace), then whenever micaliVerifyPure accepts (x, proof), the PCP verifier V accepts the single extracted proof micaliExtractProof V tr x proof.root on every challenge string ρ ∈ hFS (x, proof.root) of length V.coins x. Equivalently, an accepting Micali proof whose opened paths lie in tr either exhibits a collision in tr (¬ TraceCollisionFree tr, from which extractTraceCollision extracts a concrete hash collision when TraceConsistentWith (H k) tr) or convinces V on the extracted PCP proof (not_traceCollisionFree_or_accepts_of_micaliVerifyPure, exists_collision_of_micaliVerifyPure_of_rejects).
  2. Fiat–Shamir challenge union bound & two-stage ROM soundness (toOuterMeasure_run_memoize_not_fsTraceSound_le, toOuterMeasure_twoStageMicali_le). For any false statement x ∉ L and any fixed Merkle root rt (which determines the extracted PCP proof micaliExtractProof V tr x rt from tr), a fresh challenge draw ρs ← kilianChallenges V m x makes V accept on all m repetitions with probability at most (1 / 2) ^ m (toOuterMeasure_kilianChallenges_accepts_le, shared with Kilian soundness in CslibFrontier.Crypto.Computational.Kilian.Soundness). Across at most Q_FS queries to the lazy Fiat–Shamir oracle, the probability that any queried (x, rt) with x ∉ L passes all m PCP repetitions against micaliExtractProof V tr x rt is at most Q_FS * (1 / 2) ^ m. Combining this bound with toOuterMeasure_run_memoize_not_traceCollisionFree_le bounds a two-stage execution (a Q_MT-query Merkle phase followed by a (t_FS + 1)-query Fiat–Shamir phase) by (t_FS + 1) * (1 / 2) ^ m + Q_MT * (Q_MT * (1 / 2 ^ σ)).
  3. Full adaptive two-channel ROM soundness (micaliSoundness_bound). When a single-stage cheating prover P : OracleComp (MicaliSpec α) (α × MicaliProof) interleaves Merkle hash queries (Sum.inl) and Fiat–Shamir queries (Sum.inr) arbitrarily, a fresh σ-bit Merkle digest preserves the extracted proof micaliExtractProof V tr x rt of every earlier Fiat–Shamir query (x, rt) unless it collides with an existing Merkle digest, inverts the left or right child of an existing Merkle query, or hits an earlier Fiat–Shamir root rt (micaliExtractProof_cons_of_ne). Bounding this joint bad event across Q_MT Merkle queries and t_FS + 1 Fiat–Shamir queries (the prover's t_FS queries plus the verifier's evaluation query) yields Micali's unconditional ROM soundness bound: micaliSoundnessGame V L P σ m true ≤ (t_FS + 1) * (1 / 2) ^ m + Q_MT * ((3 * Q_MT + (t_FS + 1)) * (1 / 2 ^ σ)).
  4. CS proofs for NP relations and languages (exists_micaliCSProof_of_npRelation, exists_micaliCSProof_of_mem_NP). Combining Micali's construction with the PCP theorem and its witness compiler (exists_pcpVerifier_of_npRelation) gives unconditional non-interactive random-oracle CS proofs with polylogarithmic proof size for any NP relation R : NPRelation enc and every language L ∈ NP, with a polynomial-time map compile sending arbitrary R-witnesses to accepted compact PCP tables (V.tableVerifier).

The cited construction includes privacy parameters and a salt in the Fiat–Shamir query; here that query is (x, root). Our explicit error expression counts all Merkle queries in the prover and verifier execution, including queries on malformed paths, and is not the source's literal multi-extraction bound. The separate-budget corollary requires a verifier bound only for outputs in P.support. Native ROM-oracle verifier runtime and truncation of oversized proofs are not established here.

Main definitions #

Main results #

References #

Part 1: Pure / Fixed-Trace Soundness Bridge #

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

Every Merkle authentication path in response for challenge strings ρs on statement x has all of its hash steps recorded in tr.

Instances For
    @[instance_reducible]
    instance Cslib.Crypto.instDecidableAllOpeningsQueriedInTrace {α : Type} (H : List Bool → List Bool → List Bool) (k : List Bool) (V : Complexity.PCPVerifier α) (tr : List (List Bool × List Bool)) (x : α) (ρs : List (List Bool)) (response : KilianResponse) :
    Decidable (AllOpeningsQueriedInTrace H k V tr x ρs response)

    Extract the compact bit table (of length 2 ^ kilianDepth V x) committed under Merkle root rt from a recorded hash query-answer trace tr, taking the first bit (headD false) of each extracted leaf.

    Extract the full PCP proof (indexed by PCP addresses a) committed under Merkle root rt from a recorded hash query-answer trace tr.

    theorem Cslib.Crypto.kilianVerify_sound_of_traceCollisionFree {α : Type} {H : List Bool → List Bool → List Bool} {k : List Bool} {V : Complexity.PCPVerifier α} {tr : List (List Bool × List Bool)} {x : α} {rt : List Bool} {ρs : List (List Bool)} {response : KilianResponse} (hfree : TraceCollisionFree tr) (hpaths : AllOpeningsQueriedInTrace H k V tr x ρs response) (hver : kilianVerify H V k x rt ρs response = true) {ρ : List Bool} (hρ : ρ ∈ ρs) (hlen : ρ.length = V.coins x) :
    V.accepts x (micaliExtractProof V tr x rt) ρ = true

    Fixed-trace soundness of kilianVerify: if tr is collision-free and records all hash steps of every opening in response, then kilianVerify H V k x rt ρs response = true implies that the PCP verifier V accepts the single extracted proof micaliExtractProof V tr x rt on every challenge string ρ ∈ ρs of length V.coins x.

    theorem Cslib.Crypto.micaliVerifyPure_sound_of_traceCollisionFree {α : Type} {hTree : List Bool → List Bool} {hFS : α × List Bool → List (List Bool)} {V : Complexity.PCPVerifier α} {tr : List (List Bool × List Bool)} {x : α} {proof : MicaliProof} (hfree : TraceCollisionFree tr) (hpaths : AllOpeningsQueriedInTrace (fun (x : List Bool) => hTree) [] V tr x (hFS (x, proof.root)) proof.response) (hver : micaliVerifyPure hTree hFS V x proof = true) {ρ : List Bool} (hρ : ρ ∈ hFS (x, proof.root)) (hlen : ρ.length = V.coins x) :
    V.accepts x (micaliExtractProof V tr x proof.root) ρ = true

    Pure / fixed-trace soundness bridge for Micali verification ([CY24], Lemma 18.5.7 and Theorem 21.2.1): if tr is collision-free and records all hash steps of the openings in proof : MicaliProof, then micaliVerifyPure hTree hFS V x proof = true implies that the PCP verifier V accepts the extracted proof micaliExtractProof V tr x proof.root on every challenge string ρ ∈ hFS (x, proof.root) of length V.coins x.

    theorem Cslib.Crypto.not_traceCollisionFree_or_accepts_of_micaliVerifyPure {α : Type} {hTree : List Bool → List Bool} {hFS : α × List Bool → List (List Bool)} {V : Complexity.PCPVerifier α} {tr : List (List Bool × List Bool)} {x : α} {proof : MicaliProof} (hpaths : AllOpeningsQueriedInTrace (fun (x : List Bool) => hTree) [] V tr x (hFS (x, proof.root)) proof.response) (hver : micaliVerifyPure hTree hFS V x proof = true) :
    ¬TraceCollisionFree tr ∨ ∀ ρ ∈ hFS (x, proof.root), ρ.length = V.coins x → V.accepts x (micaliExtractProof V tr x proof.root) ρ = true

    Disjunctive fixed-trace soundness of micaliVerifyPure: if micaliVerifyPure accepts proof and all opened paths are in tr, then either tr contains a hash collision (¬ TraceCollisionFree tr) or V accepts the extracted proof micaliExtractProof V tr x proof.root on every challenge string of length V.coins x in hFS (x, proof.root).

    theorem Cslib.Crypto.exists_collision_of_micaliVerifyPure_of_rejects {α : Type} {H : List Bool → List Bool → List Bool} {k : List Bool} {hFS : α × List Bool → List (List Bool)} {V : Complexity.PCPVerifier α} {tr : List (List Bool × List Bool)} {x : α} {proof : MicaliProof} (hcons : TraceConsistentWith (H k) tr) (hpaths : AllOpeningsQueriedInTrace H k V tr x (hFS (x, proof.root)) proof.response) (hver : micaliVerifyPure (H k) hFS V x proof = true) {ρ : List Bool} (hρ : ρ ∈ hFS (x, proof.root)) (hlen : ρ.length = V.coins x) (hrej : V.accepts x (micaliExtractProof V tr x proof.root) ρ = false) :
    ∃ q₁ ∈ List.map Prod.fst tr, ∃ q₂ ∈ List.map Prod.fst tr, q₁ ≠ q₂ ∧ H k q₁ = H k q₂

    Dual collision extraction for micaliVerifyPure: if tr is consistent with H k and records all opened paths of a proof accepted by micaliVerifyPure (H k) hFS V x proof, yet V rejects the extracted proof micaliExtractProof V tr x proof.root on some challenge ρ ∈ hFS (x, proof.root) of length V.coins x, then tr contains two distinct queries with the same hash under H k.

    Part 2: Fiat–Shamir Challenge Union Bound & Two-Stage ROM Soundness #

    def Cslib.Crypto.FSTraceSound {α : Type} (V : Complexity.PCPVerifier α) (L : Set α) (tr : List (List Bool × List Bool)) (tr_FS : List ((α × List Bool) × List (List Bool))) :

    A Fiat–Shamir query-answer trace tr_FS has no accepting false-statement entry relative to the Merkle trace tr if for every recorded ((x, rt), ρs) ∈ tr_FS with x ∉ L, the PCP verifier V rejects micaliExtractProof V tr x rt on at least one challenge ρ ∈ ρs.

    @[simp]
    theorem Cslib.Crypto.toOuterMeasure_run_memoize_not_fsTraceSound_le {α : Type} [BEq α] {β : Type} (V : Complexity.PCPVerifier α) (L : Set α) (m : ℕ) (tr : List (List Bool × List Bool)) (hsound : ∀ x ∉ L, ∀ (π : List Bool), 2 * Complexity.acceptCount (fun (y : α × List Bool) => V.accepts y.1 π y.2) x (V.coins x) ≤ 2 ^ V.coins x) {prog : OracleComp (MicaliFSSpec α) β} {Q_FS : ℕ} (hQ : prog.IsQueryBounded Q_FS) :
    ((OracleComp.interpret (memoize fun (q : α × List Bool) => (kilianChallenges V m q.1).eval) prog).run []).toOuterMeasure {out : β × List ((α × List Bool) × List (List Bool)) | ¬FSTraceSound V L tr out.2} ≤ ↑Q_FS * (1 / 2) ^ m

    Fiat–Shamir challenge union bound: any program making at most Q_FS queries to the lazy Fiat–Shamir oracle starting from the empty trace violates FSTraceSound V L tr with probability at most Q_FS * (1 / 2) ^ m.

    @[reducible, inline]

    List-cache state for the two-channel Micali random oracle: a Merkle hash trace and a Fiat–Shamir challenge trace.

    Good-state invariant of the two-channel Micali ROM state (tr_MT, tr_FS): the Merkle trace tr_MT is collision-free and the Fiat–Shamir trace tr_FS has no accepting false-statement entry relative to tr_MT.

    theorem Cslib.Crypto.toOuterMeasure_twoStageMicali_le {α : Type} [BEq α] {γ β : Type} (V : Complexity.PCPVerifier α) (L : Set α) (σ m : ℕ) (hsound : ∀ x ∉ L, ∀ (π : List Bool), 2 * Complexity.acceptCount (fun (y : α × List Bool) => V.accepts y.1 π y.2) x (V.coins x) ≤ 2 ^ V.coins x) {mtProg : OracleComp MerkleHashSpec γ} {fsProg : γ → OracleComp (MicaliFSSpec α) β} {Q_MT t_FS : ℕ} (hMT : mtProg.IsQueryBounded Q_MT) (hFS : ∀ (st : γ), (fsProg st).IsQueryBounded (t_FS + 1)) :
    (((OracleComp.interpret (memoize fun (x : List Bool) => BitString.uniformList σ) mtProg).run []).bind fun (x : γ × List (List Bool × List Bool)) => match x with | (st, tr) => PMF.map (fun (x : β × List ((α × List Bool) × List (List Bool))) => match x with | (res, tr_FS) => (res, tr, tr_FS)) ((OracleComp.interpret (memoize fun (q : α × List Bool) => (kilianChallenges V m q.1).eval) (fsProg st)).run [])).toOuterMeasure {out : β × List (List Bool × List Bool) × List ((α × List Bool) × List (List Bool)) | ¬MicaliGoodState V L out.2} ≤ ↑(t_FS + 1) * (1 / 2) ^ m + ↑Q_MT * (↑Q_MT * (1 / 2 ^ σ))

    Two-stage ROM soundness bound (combining toOuterMeasure_run_memoize_not_traceCollisionFree_le with toOuterMeasure_run_memoize_not_fsTraceSound_le): if a first stage mtProg makes at most Q_MT queries to a uniform σ-bit Merkle random oracle (producing a state st and Merkle trace tr) and a second stage fsProg st makes at most t_FS + 1 queries to the Fiat–Shamir random oracle (producing a Fiat–Shamir trace tr_FS), then the probability that the final trace state (tr, tr_FS) is not a MicaliGoodState (tr has a collision or tr_FS violates FSTraceSound V L tr) is at most (t_FS + 1) * (1 / 2) ^ m + Q_MT * (Q_MT * (1 / 2 ^ σ)).

    Part 3: Full Adaptive Two-Channel ROM Soundness #

    Invariance of trace extraction under non-inverting Merkle additions #

    theorem Cslib.Crypto.micaliExtractProof_cons_of_ne {α : Type} (V : Complexity.PCPVerifier α) (tr : List (List Bool × List Bool)) (q : List Bool) {ans rt : List Bool} (x : α) (hrt : ans ≠ rt) (hchildren : ∀ p ∈ tr, ans ≠ Turing.MultiTapeTM.unframe p.1 ∧ ans ≠ Turing.MultiTapeTM.dropFrame p.1) :
    micaliExtractProof V ((q, ans) :: tr) x rt = micaliExtractProof V tr x rt

    Prepending (q, ans) to tr leaves micaliExtractProof at rt unchanged whenever ans ≠ rt and ans does not equal unframe p.1 or dropFrame p.1 for any p ∈ tr.

    Two-channel query costs, good-state invariant, and accumulated bad-state lemma #

    Cost of a Micali oracle call on the Merkle hash channel (Sum.inl).

    Cost of a Micali oracle call on the Fiat–Shamir channel (Sum.inr).

    The Micali soundness execution as an OracleComp (MicaliSpec α) program: run the cheating prover P to obtain (x, proof), run micaliVerify V x proof, and return true when x ∉ L and the verifier accepts.

    If the cheating prover P makes at most t_FS Fiat–Shamir queries, then micaliSoundnessProg V L P makes at most t_FS + 1 Fiat–Shamir queries.

    If P makes at most t_MT Merkle hash queries and micaliVerify V x proof makes at most q_V Merkle hash queries for every (x, proof) that P can output, then micaliSoundnessProg V L P makes at most t_MT + q_V Merkle hash queries.

    noncomputable def Cslib.Crypto.micaliSoundnessGame {α : Type} [DecidableEq α] (V : Complexity.PCPVerifier α) (L : Set α) (P : OracleComp (MicaliSpec α) (α × MicaliProof)) (σ m : ℕ) :

    The Micali ROM soundness experiment with σ-bit Merkle digests and m PCP repetitions: runs micaliSoundnessProg V L P against the shared lazy random oracle RandomOracle.answer (micaliOracleDist V σ m) starting from an empty cache.

    @[reducible, inline]
    noncomputable abbrev Cslib.Crypto.micaliMemoize {α : Type} [BEq α] (V : Complexity.PCPVerifier α) (σ m : ℕ) (q : List Bool ⊕ α × List Bool) :

    Two-channel association-list handler implementing RandomOracle.answer (micaliOracleDist V σ m): Merkle queries are memoized in the first trace and Fiat–Shamir queries in the second.

    Support invariants of memoize, kilianVerifyProg and micaliVerify #

    theorem Cslib.Crypto.micaliSoundness_bound {α : Type} [DecidableEq α] (V : Complexity.PCPVerifier α) (L : Set α) (σ m : ℕ) (hsound : ∀ x ∉ L, ∀ (π : List Bool), 2 * Complexity.acceptCount (fun (y : α × List Bool) => V.accepts y.1 π y.2) x (V.coins x) ≤ 2 ^ V.coins x) {P : OracleComp (MicaliSpec α) (α × MicaliProof)} {t_FS Q_MT : ℕ} (hFS : OracleComp.IsCostBounded micaliFSCost P t_FS) (hMT : OracleComp.IsCostBounded micaliMTCost (micaliSoundnessProg V L P) Q_MT) :
    (micaliSoundnessGame V L P σ m) true ≤ ↑(t_FS + 1) * (1 / 2) ^ m + ↑Q_MT * (↑(3 * Q_MT + (t_FS + 1)) * (1 / 2 ^ σ))

    Adaptive ROM soundness for the unsalted two-channel variant (compare [Mic00]; [CY24], Theorem 21.2.1, printed pp. 241–242): for any PCP verifier V whose soundness error on statements outside L is at most 1 / 2 per repetition, and any cheating prover P making at most t_FS Fiat–Shamir queries such that the combined execution micaliSoundnessProg V L P makes at most Q_MT Merkle hash queries, the probability that P outputs (x, proof) with x ∉ L accepted by micaliVerify is at most (t_FS + 1) * (1 / 2) ^ m + Q_MT * ((3 * Q_MT + (t_FS + 1)) * (1 / 2 ^ σ)).

    theorem Cslib.Crypto.micaliSoundness_bound_of_prover_verifier {α : Type} [DecidableEq α] (V : Complexity.PCPVerifier α) (L : Set α) (σ m : ℕ) (hsound : ∀ x ∉ L, ∀ (π : List Bool), 2 * Complexity.acceptCount (fun (y : α × List Bool) => V.accepts y.1 π y.2) x (V.coins x) ≤ 2 ^ V.coins x) {P : OracleComp (MicaliSpec α) (α × MicaliProof)} {t_MT t_FS q_V : ℕ} (hMT : OracleComp.IsCostBounded micaliMTCost P t_MT) (hFS : OracleComp.IsCostBounded micaliFSCost P t_FS) (hV : ∀ (x : α) (proof : MicaliProof), (x, proof) ∈ P.support → OracleComp.IsCostBounded micaliMTCost (micaliVerify V x proof) q_V) :
    (micaliSoundnessGame V L P σ m) true ≤ ↑(t_FS + 1) * (1 / 2) ^ m + ↑(t_MT + q_V) * (↑(3 * (t_MT + q_V) + (t_FS + 1)) * (1 / 2 ^ σ))

    Micali's ROM Soundness Theorem (separate prover/verifier Merkle budgets): if the cheating prover P makes at most t_MT Merkle hash queries and at most t_FS Fiat–Shamir queries, and micaliVerify V x proof makes at most q_V Merkle hash queries for outputs in P.support, then micaliSoundnessGame accepts a false statement with probability at most (t_FS + 1) * (1 / 2) ^ m + (t_MT + q_V) * ((3 * (t_MT + q_V) + (t_FS + 1)) * (1 / 2 ^ σ)).

    Part 4: Succinctness of Micali Proofs and CS-Proofs for NP #

    The payload bits of a non-interactive Micali proof: the Merkle root and the opening responses.

    theorem Cslib.Crypto.micaliProofBits_micaliProvePure_le {α : Type} {hTree : List Bool → List Bool} {hFS : α × List Bool → List (List Bool)} {V : Complexity.PCPVerifier α} {σ m : ℕ} (hlen : ∀ (y : List Bool), (hTree y).length = σ) {x : α} {table : List Bool} (hm : (hFS (x, kilianCommit (fun (x : List Bool) => hTree) V [] x table)).length = m) (hρs : ∀ ρ ∈ hFS (x, kilianCommit (fun (x : List Bool) => hTree) V [] x table), ρ.length = V.coins x) {q : ℕ} (hq : ∀ (ρ : List Bool), ρ.length = V.coins x → (V.queries (x, ρ)).length ≤ q) :
    micaliProofBits (micaliProvePure hTree hFS V x table) ≤ σ + m * (q * (1 + (V.coins x + Nat.clog 2 q) * σ))

    Honest Micali proof size in the PCP parameters: with σ-bit Merkle digests and m Fiat–Shamir challenge strings of r = V.coins x bits, the honest proof micaliProvePure has at most σ + m * (q * (1 + (r + ⌈log₂ q⌉) * σ)) payload bits.

    theorem Cslib.Crypto.micaliProofBits_micaliProvePure_le_log {α : Type} {enc : α ↪ List Bool} {c : ℕ} {hTree : List Bool → List Bool} {hFS : α × List Bool → List (List Bool)} {V : Complexity.PCPVerifier α} {σ m : ℕ} (hlen : ∀ (y : List Bool), (hTree y).length = σ) {x : α} {table : List Bool} (hm : (hFS (x, kilianCommit (fun (x : List Bool) => hTree) V [] x table)).length = m) (hρs : ∀ ρ ∈ hFS (x, kilianCommit (fun (x : List Bool) => hTree) V [] x table), ρ.length = V.coins x) {q : ℕ} (hq : ∀ (ρ : List Bool), ρ.length = V.coins x → (V.queries (x, ρ)).length ≤ q) (hcoins : V.coins x ≤ c * (Nat.log 2 (enc x).length + 1)) :
    micaliProofBits (micaliProvePure hTree hFS V x table) ≤ (1 + q + q * c + q * Nat.clog 2 q) * (σ + m + 1) ^ 2 * (Nat.log 2 (enc x).length + 1)

    Polylogarithmic Micali proof size: for a verifier with at most c * (log₂ |enc x| + 1) random bits and at most q queries per random string, the honest proof micaliProvePure with σ-bit Merkle digests and m repetitions has at most (1 + q + q * c + q * ⌈log₂ q⌉) * (σ + m + 1) ^ 2 * (log₂ |enc x| + 1) payload bits.

    theorem Cslib.Crypto.exists_micaliCSProof_of_npRelation {α : Type} [DecidableEq α] {enc : α ↪ List Bool} (R : Complexity.NPRelation enc) :
    ∃ (V : Complexity.PCPVerifier α) (compile : α × List Bool → List Bool) (c : ℕ) (d : ℕ), Complexity.PCPVerifier.PolyTime enc V ∧ (∀ (x : α), V.coins x ≤ c * (Nat.log 2 (enc x).length + 1)) ∧ (∀ (x : α) (ρ : List Bool), ρ.length = V.coins x → (V.queries (x, ρ)).length ≤ d) ∧ Turing.MultiTapeTM.ComputableInPolyTime compile (Turing.MultiTapeTM.encPair enc Turing.MultiTapeTM.encBits) Turing.MultiTapeTM.encBits ∧ (∀ (x : α), x ∈ R.language ↔ ∃ (table : List Bool), V.tableVerifier (x, table) = true) ∧ (∀ (x : α) (w : List Bool), R.IsWitness x w → V.tableVerifier (x, compile (x, w)) = true) ∧ (∀ (x : α) (w : List Bool), R.IsWitness x w → ∀ (σ m : ℕ), micaliHonestGame V x (compile (x, w)) σ m = PMF.pure true) ∧ (∀ (P : OracleComp (MicaliSpec α) (α × MicaliProof)) (t_FS Q_MT σ m : ℕ), OracleComp.IsCostBounded micaliFSCost P t_FS → OracleComp.IsCostBounded micaliMTCost (micaliSoundnessProg V R.language P) Q_MT → (micaliSoundnessGame V R.language P σ m) true ≤ ↑(t_FS + 1) * (1 / 2) ^ m + ↑Q_MT * (↑(3 * Q_MT + (t_FS + 1)) * (1 / 2 ^ σ))) ∧ ∃ (C : ℕ), ∀ (σ m : ℕ) (hTree : List Bool → List Bool) (hFS : α × List Bool → List (List Bool)) (x : α) (table : List Bool), (∀ (y : List Bool), (hTree y).length = σ) → (hFS (x, kilianCommit (fun (x : List Bool) => hTree) V [] x table)).length = m → (∀ ρ ∈ hFS (x, kilianCommit (fun (x : List Bool) => hTree) V [] x table), ρ.length = V.coins x) → micaliProofBits (micaliProvePure hTree hFS V x table) ≤ C * (σ + m + 1) ^ 2 * (Nat.log 2 (enc x).length + 1)

    Micali's CS Proofs for arbitrary NP relations in the Random Oracle Model ([Mic00]; compare [CY24], Construction 21.1.1 and Theorem 21.2.1): every NP relation R : NPRelation enc has a polynomial-time PCP verifier V with O(log n) random bits and at most d queries per random string together with a polynomial-time witness compiler compile : α × List Bool → List Bool such that:

    • compile turns every R-witness into a table accepted by V.tableVerifier, and the honest Micali ROM protocol accepts compile (x, w) with probability 1 for every R.IsWitness x w (micaliHonestGame_eq_pure_true),
    • the protocol satisfies the unconditional ROM soundness bound micaliSoundness_bound against any cheating prover P with Fiat–Shamir budget t_FS and total Merkle budget Q_MT, and
    • honest proofs have O((σ + m + 1)² · (log₂ |enc x| + 1)) payload bits.
    theorem Cslib.Crypto.exists_micaliCSProof_of_mem_NP {α : Type} [DecidableEq α] {enc : α ↪ List Bool} {L : Set α} (hL : L ∈ Complexity.NP enc) :
    ∃ (V : Complexity.PCPVerifier α) (c : ℕ) (d : ℕ), Complexity.PCPVerifier.PolyTime enc V ∧ (∀ (x : α), V.coins x ≤ c * (Nat.log 2 (enc x).length + 1)) ∧ (∀ (x : α) (ρ : List Bool), ρ.length = V.coins x → (V.queries (x, ρ)).length ≤ d) ∧ (∀ (x : α), x ∈ L ↔ ∃ (table : List Bool), V.tableVerifier (x, table) = true) ∧ (∀ (x : α) (table : List Bool), V.tableVerifier (x, table) = true → ∀ (σ m : ℕ), micaliHonestGame V x table σ m = PMF.pure true) ∧ (∀ (P : OracleComp (MicaliSpec α) (α × MicaliProof)) (t_FS Q_MT σ m : ℕ), OracleComp.IsCostBounded micaliFSCost P t_FS → OracleComp.IsCostBounded micaliMTCost (micaliSoundnessProg V L P) Q_MT → (micaliSoundnessGame V L P σ m) true ≤ ↑(t_FS + 1) * (1 / 2) ^ m + ↑Q_MT * (↑(3 * Q_MT + (t_FS + 1)) * (1 / 2 ^ σ))) ∧ ∃ (C : ℕ), ∀ (σ m : ℕ) (hTree : List Bool → List Bool) (hFS : α × List Bool → List (List Bool)) (x : α) (table : List Bool), (∀ (y : List Bool), (hTree y).length = σ) → (hFS (x, kilianCommit (fun (x : List Bool) => hTree) V [] x table)).length = m → (∀ ρ ∈ hFS (x, kilianCommit (fun (x : List Bool) => hTree) V [] x table), ρ.length = V.coins x) → micaliProofBits (micaliProvePure hTree hFS V x table) ≤ C * (σ + m + 1) ^ 2 * (Nat.log 2 (enc x).length + 1)

    Micali's CS Proofs for NP in the Random Oracle Model ([Mic00]; compare [CY24], Construction 21.1.1 and Theorem 21.2.1): every language L ∈ NP has a polynomial-time PCP verifier V with O(log n) random bits and a constant number of queries whose accepted compact tables (V.tableVerifier) characterize L, such that Micali's non-interactive ROM protocol over V:

    • accepts the honest prover with probability 1 on every accepted compact table (micaliHonestGame_eq_pure_true),
    • satisfies the unconditional ROM soundness bound micaliSoundness_bound against any cheating prover P with Fiat–Shamir budget t_FS and total Merkle budget Q_MT, and
    • produces honest proofs of O((σ + m + 1)² · (log₂ |enc x| + 1)) payload bits.