Composing strict oracle PPT programs #
Strict oracle PPT certificates compose like closed ones: by monadic bind, with captured input,
deterministic pre- and postprocessing, conditionals and bounded adaptive loops. Every rule
quantifies over all shared stateful oracles and arbitrarily long replies, and preserves the
complete joint law of the result and the external oracle state.
Each rule first replaces its premises by clean realizations
(Cslib.Probability.IsOraclePPTOn.isTidyOraclePPTOn), so a later phase never sees partial
requests or stale storage left by an earlier one, and then composes those. Conditionals execute
only the selected branch: an unselected branch makes no external call. The only primitive
external operation is query_take, which returns a charged prefix of one reply; returning a full
unbounded reply is not oracle PPT (ComplexityTests.OraclePPT).
Main results #
Cslib.Probability.IsOraclePPTOn.query_take: one external call returning a reply prefix.Cslib.Probability.IsPPTOn.isOraclePPTOn: closed PPT programs are oracle PPT viasample.Cslib.Probability.IsOraclePPTOn.isPPTOn: conversely, a sampled closed program certified without external channels is closed PPT.Cslib.Probability.IsOraclePPTOn.bind,.bind_with,.pair,.keep_input,.map,.map_with,.preprocess: composition with charged intermediate data.Cslib.Probability.IsOraclePPTOn.cond,.ite,.finite_cases: dispatch to one branch.Cslib.Probability.IsOraclePPTOn.iterate_spec,.iterateWith_spec,.iterateWith_of_bounded_growth,.iterate_of_bounded_growth: bounded adaptive loops.Cslib.Probability.IsOraclePPTOn.query_take',.pair',.preprocess',.map',.map_with',.cond',.ite',.finite_cases',.iterate_spec',.iterateWith_spec',.iterateWith_of_bounded_growth',.iterate_of_bounded_growth': the same rules with plainComputableInPolyTimeside conditions. These primed names are transitional (#608, #862): once the remaining callers migrate, the unprimed names are restated with plain hypotheses and the primed ones are removed.
References #
Adapts the closed composition rules of Computability/Probabilistic/Composition.lean and
Computability/Probabilistic/Adaptive.lean on the cslib crypto branch at
5ff69ca93402e7c947208dc56396d6d86203ccd8 to strict oracle PPT.
One external call on channel op with an efficiently computed request, returning at most an
efficiently computed number of reply bits. Building the request and reading the prefix are
charged; the remainder of an arbitrarily long reply is never read.
Cslib.Probability.IsOraclePPTOn.query_take with plain polynomial-time request and limit.
Sequence two strict oracle PPT programs. The intermediate output length bounds the continuation's clock, and every effect of both phases on the shared oracle is retained.
Retain efficiently computed input data beside an oracle result.
Cslib.Probability.IsOraclePPTOn.pair with a plain polynomial-time certificate.
Keep the original argument available to a later computation, charging its encoded copy.
A continuation may use both the caller's input and the first result.
Efficiently prepare the argument of a strict oracle PPT program.
Cslib.Probability.IsOraclePPTOn.preprocess with a plain polynomial-time preparation.
Efficient deterministic postprocessing of every result preserves strict oracle PPT.
Cslib.Probability.IsOraclePPTOn.map with a plain polynomial-time postprocessing.
A deterministic callback may capture the original argument.
Cslib.Probability.IsOraclePPTOn.map_with with a plain polynomial-time callback.
Select a branch with an efficient Boolean condition. Only the selected branch runs: the other branch makes no external call and cannot change the oracle state.
Cslib.Probability.IsOraclePPTOn.cond with a plain polynomial-time condition.
Select a branch with an efficiently decidable condition, executing only that branch.
Cslib.Probability.IsOraclePPTOn.ite with a plain polynomial-time decision.
A computed finite tag selects one certified branch, which alone is executed.
Cslib.Probability.IsOraclePPTOn.finite_cases with a plain polynomial-time tag.
A bounded adaptive loop is strict oracle PPT when one invariant bounds every reachable state. The invariant holds for every possible result under every stateful oracle, and it is also established for the final state. Every iteration may query the shared oracle.
Cslib.Probability.IsOraclePPTOn.iterate_spec with plain polynomial-time count and initial
state.
The loop body may capture the original input; the invariant describes the changing state.
Cslib.Probability.IsOraclePPTOn.iterateWith_spec with plain polynomial-time count and
initial state.
Captured-input steps may grow by a polynomially bounded amount depending on that input, for every possible next state under every stateful oracle.
Cslib.Probability.IsOraclePPTOn.iterateWith_of_bounded_growth with plain polynomial-time
count and initial state.
A strict oracle PPT step with constant growth can be repeated a polynomial number of times.
Cslib.Probability.IsOraclePPTOn.iterate_of_bounded_growth with plain polynomial-time count
and initial state.
A closed strict PPT program is strict oracle PPT when sampled privately: its machine never uses an external channel, so every external oracle state is preserved.
A sampled closed program certified without external channels is closed strict PPT: the realizing machine has no channels, so it is a closed machine with the same output law.