Documentation

CslibFrontier.Computability.Complexity.Classes.Oracle.Function

Composition of deterministic oracle functions #

These rules retain one fixed language oracle and one uniform strict polynomial-time program. Adaptive composition charges the intermediate encoding, subsequent requests, and final output. The strict certificate already bounds output length polynomially.

Main results #

theorem Cslib.Complexity.ComputableInPolyTimeWithOracle.comp {α β γ : Type} {A : Set (List Bool)} {input : α ↪ List Bool} {middle : β ↪ List Bool} {output : γ ↪ List Bool} {f : β → γ} {g : α → β} (hf : ComputableInPolyTimeWithOracle A f middle output) (hg : ComputableInPolyTimeWithOracle A g input middle) :
ComputableInPolyTimeWithOracle A (fun (a : α) => f (g a)) input output

Sequential composition against one fixed oracle. Later requests may depend on the first result; both programs have a uniform clock even against arbitrary stateful replies.

theorem Cslib.Complexity.ComputableInPolyTimeWithOracle.comp_with {α β γ : Type} {A : Set (List Bool)} {input : α ↪ List Bool} {middle : β ↪ List Bool} {output : γ ↪ List Bool} {f : α × β → γ} {g : α → β} (hf : ComputableInPolyTimeWithOracle A f (Turing.MultiTapeTM.encPair input middle) output) (hg : ComputableInPolyTimeWithOracle A g input middle) :
ComputableInPolyTimeWithOracle A (fun (a : α) => f (a, g a)) input output

Retain the input for an adaptive second computation, charging its encoded copy.