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 #
Cslib.OracleComp.IsCostBounded.closeTo_runWith: cost-weighted stateful replacement.
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.