Documentation

CslibFrontier.Computability.Interactive.Security.Oracle

Statistical error under stateful oracle replacement #

Replacing a handler costs at most the program's query budget times the per-unit statistical error. The hypothesis compares joint reply/state laws from every identical starting state; the conclusion retains the complete joint result/final-state law. No coupling, finite state space or independence between calls is required. This is the identity-relation case of OracleComp.closeTo_run_interpret_simulation, which also relates the two states through a probabilistic map.

The existing OracleComp.IsCostBounded allows calls that cost zero. Such calls may still change the shared state, but their handlers must be statistically identical. For example, charging only signing calls leaves shared hash-cache operations uncharged without removing their effects.

Main results #

theorem Cslib.OracleComp.IsCostBounded.closeTo_runWith {ι α σ : Type} {spec : OracleSpec ι} {cost : ι → ℕ} {program : OracleComp spec α} {n : ℕ} (h : IsCostBounded cost program n) {left right : (q : ι) → StateT σ PMF (spec q)} {ε : ENNReal} (hstep : ∀ (q : ι) (s : σ), Probability.CloseTo (left q s) (right q s) (↑(cost q) * ε)) (s : σ) :
Probability.CloseTo (runWith left program s) (runWith right program s) (↑n * ε)

Pointwise replacement of joint reply/state laws accumulates error according to the existing query-cost budget. The premise holds for every query and every starting state, including states outside either execution's support. The final state is retained in the conclusion.