Oracle reductions with explicit query and answer lengths #
Cslib.Complexity.PolyTimeTuringReducible
(CslibFrontier/Computability/Complexity/Reduction/Turing.lean) and
Cslib.Complexity.ComputableInPolyTimeWithOracle
(CslibFrontier/Computability/Complexity/Classes/Oracle.lean) quantify over adaptive
deterministic WordQueryComp programs certified by IsOraclePPTOn against one-bit language
oracles. Fine-grained and exact exponential complexity require explicit quantitative accounting of
the oracle interaction across both decision and multi-bit function oracles:
Cslib.Complexity.OracleCallBound: anenc_structure-backed record tracking four explicit quantities on each inputa:Cslib.Complexity.BoundedOracleProgram: a#4391structurepackaging a deterministic adaptiveWordQueryCompprogram, itsIsOraclePPTOncertificate, an explicitOracleCallBoundprofile respected againstoracle : List Bool → List Bool, and a polynomial-time unary answer-length allowancealenCapenabling open handler substitution.Cslib.Complexity.BoundedOracleReduction: the specialization to typed decision problems(A, encA)and(B, encB)againstlanguageOracle (encB '' B)(alen ≤ 1).
In addition to identity, zero-query polynomial-time lifts, single-query many-one/function lifts,
and bridges to PolyTimeTuringReducible and PWithOracleQueries, this module extends
Turing.MultiTapePTM simulation from one-bit receiveBit to arbitrary word replies receiveWord,
proving:
- Composition (
BoundedOracleProgram.comp,BoundedOracleReduction.trans): explicit worst-case composition viawordMaxand sharper lineartotalQlencomposition when the inner total query length is affine in the outer query length. - Polynomial-time and polynomial-space multi-bit oracle transfer
(
BoundedOracleProgram.computableInPolyTime,BoundedOracleProgram.exists_computableInO_polySpace): simulator workspace is bounded in terms of input length, clock, answer-length cap, and simulated oracle workspace — never as a polynomial in simulated oracle running time. - Parameterized exponential and subexponential time transfer
(
BoundedOracleReduction.decidableInExpTime,BoundedOracleReduction.decidableInSubexpTime): guarding oracle calls by a polynomial-time validity/length predicate that holds alongqueriesWithtransfers2 ^ (δ * μB)deciders to2 ^ (scale * δ * μA)with polynomial overhead absorbing query count and construction cost.
Main definitions #
Cslib.Complexity.OracleCallBound,Cslib.Complexity.OracleCallBound.Respects: explicit(qcount, qlen, totalQlen, alen)call budget and run satisfaction predicate.Turing.MultiTapePTM.receiveWord: multi-bit reply installation onFiniteConfig.Cslib.Complexity.BoundedOracleProgram: multi-bit functional oracle program with explicit query and answer length accounting.Cslib.Complexity.BoundedOracleReduction: language oracle reduction with explicit query and answer length accounting.
Main results #
Turing.MultiTapePTM.computableInPolyTime_run_word,Turing.MultiTapePTM.exists_computableInO_run_word: multi-bit clocked oracle machine simulation in polynomial time and in polynomial workspace.Cslib.Complexity.BoundedOracleProgram.id,.ofPolyTime,.ofSingleQuery,.comp,.compAffine,.totalQueryLength_comp_affine,.computableInPolyTime,.exists_computableInO_polySpace,.computableInPolySpace.Cslib.Complexity.BoundedOracleReduction.refl,.ofPolyTime,.ofSizeSensitive,.transDecoded,.trans,.polyTimeTuringReducible,.mem_PWithOracleQueries,.ofPWithOracleQueries,.mem_P,.mem_PSPACE,.decidableInExpTime,.decidableInSubexpTime.
References #
Multi-bit oracle simulation on Turing.MultiTapePTM #
Install a multi-bit word reply to the pending query on p.1; leave p.1 unchanged when no
query is pending.
Against any word oracle oracle : List Bool → List Bool, one answerStep either installs
oracle (machine.pendingRequest cfg) via receiveWord or executes localStep.
When every reply to a request of length at most steps has length at most answerSize, one
answerStep advances FiniteConfig.SpaceBound from steps to steps + 1 with the same
answerSize.
Independent time and space of one multi-bit oracle instruction.
Charges Tg and Sg only when (machine.pendingQuery cfg).isSome = true.
A clocked multi-bit oracle run against a polynomial-time word oracle is polynomial-time.
A clocked multi-bit oracle run against a polynomial-space word oracle runs in polynomial
workspace, with explicit time O(poly(|a|) + (clock a + 1) * (poly(|a|) + wordMax Tg (clock a)))
charging Tg only up to the clock and bounding space solely by input, simulated space, and
counters (never by simulated time Tg).
Explicit quantitative profile of an oracle call budget on a single input:
qcount queries, each of bit-length at most qlen, with total bit-length at most totalQlen,
and each answer of bit-length at most alen.
- qcount : ℕ
Maximum number of oracle queries issued along the run.
- qlen : ℕ
Maximum bit-length of any single query word issued along the run.
- totalQlen : ℕ
Maximum sum of bit-lengths of all query words issued along the run.
- alen : ℕ
Maximum bit-length of any oracle answer read along the run.
Instances For
Framed binary encoding of OracleCallBound.
Single-query profile (1, ql, ql, al) for a query of length ≤ ql and reply of length ≤ al.
Coordinatewise dominance between OracleCallBound profiles.
prog respects b against the word oracle oracle : List Bool → List Bool: along the
deterministic run queriesWith (fun q => oracle q.2) prog, query count is ≤ b.qcount, each query
has length ≤ b.qlen, total query length is ≤ b.totalQlen, and each reply has length ≤ b.alen.
Composed call bound when an outer run with bound b₁ answers each query w (|w| ≤ b₁.qlen)
using an inner oracle program with profile b₂ w.
Deterministic adaptive oracle program with explicit query and answer length bounds.
Packages a WordQueryComp program computing f : α → β relative to oracle : List Bool → List Bool, certified by IsOraclePPTOn, together with an explicit OracleCallBound profile bound a
and a polynomial-time unary reply-length allowance alenCap a ((bound a).alen ≤ alenCap a) used
when composing open oracle handlers.
- program : α → WordQueryComp Unit β
Deterministic adaptive word-query program.
- bound : α → OracleCallBound
Explicit
(qcount, qlen, totalQlen, alen)profile on each input. - alenCap : α → ℕ
Polynomial-time unary upper allowance on reply lengths along the run.
- isOraclePPTOn : Probability.IsOraclePPTOn encA encB fun (a : α) => OracleComp.interpret ProbOracleComp.query (self.program a)
Strict oracle-PPT machine realization across all stateful handlers.
- computableInPolyTime_alenCap : Turing.MultiTapeTM.ComputableInPolyTime self.alenCap encA Turing.MultiTapeTM.encUnary
Polynomial-time certificate for
alenCapin unary. - eval_eq (a : α) : OracleComp.interpret (fun (q : Unit × List Bool) => oracle q.2) (self.program a) = f a
Functional correctness against
oracle. Every run respects
bound a.
Weaken the OracleCallBound profile of R to any coordinatewise larger bound'.
A plain polynomial-time function f : α → β lifts to a 0-query BoundedOracleProgram with
OracleCallBound.zero relative to every word oracle.
Polynomial-time postprocessing g : β → γ preserves bound and alenCap.
Polynomial-time preprocessing p : γ → α pulls back bound and alenCap along p.
Single-query oracle call with explicit request generator req : α → List Bool, unary
answer-length cap alenCap : α → ℕ, and polynomial-time reply decoder decode : α × List Bool → β. Issues 1 query of length (req a).length and reads at most alenCap a reply bits.
Identity word-oracle program on List Bool given a polynomial-time unary bound alenCap
on (oracle w).length: makes 1 query w of length w.length and returns oracle w.
Polynomial reply-length allowance for BoundedOracleProgram.comp.
Composition of BoundedOraclePrograms with explicit query and answer length accounting.
Substitutes R₂ : BoundedOracleProgram encBits encBits oracle₂ oracle₁ for each query of
R₁ : BoundedOracleProgram encA encB oracle₁ f, truncating replies to R₁.alenCap a so open
machine realization (IsOraclePPTOn.interpret_preprocess_open') holds against every stateful
external oracle while OracleCallBound.comp records the composed (qcount, qlen, totalQlen, alen)
budget (with alen additionally capped by the polynomial machine reply bound).
Sharper affine totalQlen bound under composition: when R₂.totalQlen w ≤ scale * |w| + offset, the actual sum of inner query lengths along (R₁.comp R₂).program a is bounded by
scale * R₁.totalQlen a + offset * R₁.qcount a, preserving total-query-length sparsity rather than
multiplying qcount * qlen.
Composed BoundedOracleProgram refining comp with the sharper linear totalQlen budget
scale * R₁.totalQlen a + offset * R₁.qcount a when R₂.totalQlen is affine in query length.
Polynomial-time transfer for multi-bit word oracles: if oracle : List Bool → List Bool is
computable in polynomial time, any BoundedOracleProgram relative to oracle is computable in
polynomial time.
Explicit ComputableInO transfer in polynomial workspace for multi-bit word oracles:
simulating R against ComputableInO oracle encBits encBits Tg Sg uses polynomial workspace
(depending only on input length, machine clock, answer-length growth, and Sg — never on Tg)
and charges Tg at most once per step up to the polynomial clock.
Polynomial-space transfer for multi-bit word oracles: if oracle : List Bool → List Bool is
computable in polynomial space, any BoundedOracleProgram relative to oracle is computable in
polynomial space.
BoundedOracleReduction: language oracle reductions with explicit call profiles #
Deterministic adaptive oracle reduction between decision problems (A, encA) and (B, encB)
with explicit (qcount, qlen, totalQlen, alen) call accounting.
Deterministic adaptive word-query decider program.
- bound : α → OracleCallBound
Explicit
(qcount, qlen, totalQlen, alen)call profile on each input. - isOraclePPTOn : Probability.IsOraclePPTOn encA Turing.MultiTapeTM.encBool fun (a : α) => OracleComp.interpret ProbOracleComp.query (self.program a)
Strict oracle-PPT machine realization across all stateful handlers.
- decides (a : α) : a ∈ A ↔ OracleComp.interpret (languageOracle (⇑encB '' B)) (self.program a) = true
Decision correctness relative to
encB '' B. - respects_bound (a : α) : OracleCallBound.Respects (encodedDecisionOracle encB B) (self.program a) (self.bound a)
Every run against
encB '' Brespectsbound a.
Weaken the call bound of a BoundedOracleReduction to any coordinatewise larger profile.
Build a BoundedOracleReduction from a BoundedOracleProgram computing a decider f for A
against encodedDecisionOracle encB B.
View a BoundedOracleReduction as a BoundedOracleProgram computing fun a => decide (a ∈ A)
with unary answer-length cap 1.
A problem in P has a 0-query BoundedOracleReduction to every problem B.
Single-query lift from SizeSensitiveReduction: a many-one SizeSensitiveReduction lifts
to a 1-query BoundedOracleReduction with qlen = totalQlen = |encB (R.toFun a)| and alen = 1.
Identity / reflexivity (refl) of BoundedOracleReduction: 1 query of length |encA a|
and 1-bit reply.
Complement the source language Aᶜ without changing the OracleCallBound profile.
Every language's complement reduces to the language itself via 1 query (Aᶜ ≤ B for B = A).
Lift a typed BoundedOracleReduction encB encC B C to a word-level BoundedOracleProgram
answering encodedDecisionOracle encB B via a total polynomial-time D : Decoder encB:
non-canonical words (encB (D.decode w) ≠ w) are rejected in 0 queries, while canonical
encodings run R₂.
Transitivity (transDecoded) across any typed intermediate language (B, encB) equipped
with D : Decoder encB, tracking explicit (qcount, qlen, totalQlen, alen) composition.
Transitivity (trans) across word-encoded intermediate languages (B, encBits).
Bridges to PolyTimeTuringReducible, PWithOracleQueries, P, and PSPACE #
Every BoundedOracleReduction witnesses PolyTimeTuringReducible (A ≤ᵖ_T B).
If R.qcount a ≤ r (encA a).length for all a, then R places A in
PWithOracleQueries (encB '' B) r encA.
Conversely, any membership witness A ∈ PWithOracleQueries (encB '' B) r encA yields a
BoundedOracleReduction encA encB A B with qcount a = r |encA a|, polynomial qlen,
totalQlen = qcount * qlen, and alen = 1.
Polynomial-time transfer (mem_P) across BoundedOracleReduction when D : Decoder encB
and B ∈ P encB.
Polynomial-space transfer (mem_PSPACE) across BoundedOracleReduction when
D : Decoder encB and B ∈ PSPACE encB.
Parameterized exponential and subexponential oracle transfer #
Parameterized exponential-time transfer across BoundedOracleReduction:
when D : Decoder encB decodes canonical encB-words in polynomial time, μA and μB are
polynomial-time computable, and every query q issued by R.program a against encB '' B
with encB b = q.2 satisfies μB b ≤ scale * μA a + offset, any 2 ^ (δ * μB b) * poly(|b|)
decider for B transfers to a 2 ^ ((scale * δ) * μA a) * poly(|a|) decider for A — with
polynomial overhead absorbing both query count and query construction cost.
Parameterized subexponential-time transfer across BoundedOracleReduction.