Documentation

CslibFrontier.Computability.Probabilistic.Oracle.Replay

Efficient saved-coin replay of oracle-PPT programs #

A native machine's replay receives its coins and ordinary input as one encoded pair. Its native certificate charges decoding, tape preparation, and all replay instructions. Oracle requests and replies retain their original channels and costs.

Every IsOraclePPTOn program consequently has a polynomial-length saved-coin representation whose replay itself satisfies IsOraclePPTOn. Averaging those fixed-coin interactions recovers the joint encoded output and external state for every stateful handler. This is a replay certificate; a signature ROM reduction must still implement its query encodings, cache, signing, and freshness.

Main results #

References #

An original application of the native saved-coin compiler and the existing pre-sampling law MultiTapePTM.run_interpret_runConfigFrom_eq_coins.

theorem Turing.MultiTapePTM.isOraclePPTOn_runCoins {k : ℕ} {Control Operation : Type} [Finite Control] [Finite Operation] [DecidableEq Operation] (machine : MultiTapePTM k Bool Control Operation) :

Saved-coin replay is oracle-PPT in the complete encoded pair, including preparation.

theorem Cslib.Probability.IsOraclePPTOn.exists_savedCoins {Operation α β : Type} [DecidableEq Operation] {input : α ↪ List Bool} {output : β ↪ List Bool} {program : α → WordOracleComp Operation β} (h : IsOraclePPTOn input output program) :
∃ (k : ℕ) (Control : Type) (_ : Finite Control) (machine : Turing.MultiTapePTM k Bool Control Operation) (c : ℕ) (d : ℕ), (IsOraclePPTOn (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits Turing.MultiTapeTM.encBits) Turing.MultiTapeTM.encBits fun (p : List Bool × List Bool) => machine.runCoins (fun (op : Operation) (word : List Bool) => ProbOracleComp.query (op, word)) p.1 p.2) ∧ ∀ (a : α) (Store : Type) (oracle : Operation × List Bool → StateT Store PMF (List Bool)) (s : Store), ProbOracleComp.runWith oracle (⇑output <$> program a) s = (BitString.uniformList (c * ((input a).length + 1) ^ d)).bind fun (coins : List Bool) => ProbOracleComp.runWith oracle (machine.runCoins (fun (op : Operation) (word : List Bool) => ProbOracleComp.query (op, word)) coins (input a)) s

Every certified oracle-PPT program has an efficient saved-coin realization. The coin tape has polynomial length in the original encoded input. Replay fixes one coin per native instruction and performs only the original external requests; averaging retains both output and handler state.