Documentation

CslibFrontier.Computability.Probabilistic.Oracle.Traverse

Strict oracle PPT list traversal #

Running an oracle PPT program on each element of an efficiently computed list is strict oracle PPT when every encoded result has an efficiently computed length bound from the original input. The traversal maintains the remaining items and the results in order. Its state grows by at most one framed result per step, including under arbitrary oracle replies. Sending a list of queries and keeping a prefix of each reply is a specialization.

Main results #

theorem Cslib.Probability.IsOraclePPTOn.mapM_with_of_bounded_output {Operation α Item Result : Type} [DecidableEq Operation] {input : α ↪ List Bool} {item : Item ↪ List Bool} {output : Result ↪ List Bool} (fallback : Item) {list : α → List Item} {program : α → Item → WordOracleComp Operation Result} {bound : α → ℕ} (hlist : Turing.MultiTapeTM.ComputableInPolyTime list input (Turing.MultiTapeTM.encList item)) (hprogram : IsOraclePPTOn (Turing.MultiTapeTM.encPair input item) output (Function.uncurry program)) (hbound : Turing.MultiTapeTM.ComputableInPolyTime bound input Turing.MultiTapeTM.encUnary) (houtput : ∀ (a : α) (x : Item), ∀ r ∈ OracleComp.support (program a x), (output r).length ≤ bound a) :
IsOraclePPTOn input (Turing.MultiTapeTM.encList output) fun (a : α) => List.mapM (program a) (list a)

Traverse an efficiently computed list with a strict oracle PPT program that can read the original input. An efficiently computed bound covers every supported encoded result, including under arbitrary oracle replies. The fallback only totalizes the loop body.

theorem Cslib.Probability.IsOraclePPTOn.mapM_query_take {Operation α : Type} [DecidableEq Operation] {input : α ↪ List Bool} [Finite Operation] (op : Operation) {list : α → List (List Bool)} {limit : α → ℕ} (hlist : Turing.MultiTapeTM.ComputableInPolyTime list input (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encBits)) (hlimit : Turing.MultiTapeTM.ComputableInPolyTime limit input Turing.MultiTapeTM.encUnary) :

Querying channel op on each word of an efficiently computed list, in order, and keeping the first limit a bits of each reply is strict oracle PPT.