Documentation

CslibFrontier.Computability.Complexity.Classes.SharpP.OracleReplay

Unsigned certificate counts for oracle replay #

Each instruction-indexed transcript receives the product of its oracle certificate counts. A query contributes the count supporting its guessed answer; a local or halted instruction contributes 1 for the canonical padding bit false and 0 for true. Positive path counts therefore characterize the canonical oracle transcript, and counts bounded by one preserve unambiguity. These are the common certificates used by the decision and counting lowness proofs. Weighting each transcript's path count by a #P function of its replayed output and summing over all transcripts of the clock length gives the #P function used by those proofs.

Main definitions #

Main results #

def Cslib.Complexity.replayPathCount {α : Type} {k : ℕ} {Control Operation : Type} [DecidableEq Operation] (machine : Turing.MultiTapePTM k Bool Control Operation) (input : α → List Bool) (fYes fNo : List Bool → ℕ) (x : α × List Bool) :

The #P product certifying all instructions of transcript x.2 on instance x.1.

theorem Cslib.Complexity.replayPathCount_mem_SharpP {α : Type} {enc : α ↪ List Bool} {k : ℕ} {Control Operation : Type} [DecidableEq Operation] [Finite Control] [Finite Operation] (machine : Turing.MultiTapePTM k Bool Control Operation) {input : α → List Bool} {fYes fNo : List Bool → ℕ} (hinput : Turing.MultiTapeTM.ComputableInPolyTime input enc Turing.MultiTapeTM.encBits) (hYes : fYes ∈ SharpP Turing.MultiTapeTM.encBits) (hNo : fNo ∈ SharpP Turing.MultiTapeTM.encBits) :

The product of the instruction certificate counts is in #P.

theorem Cslib.Complexity.replayPathCount_pos_iff {α : Type} {k : ℕ} {Control Operation : Type} [DecidableEq Operation] (machine : Turing.MultiTapePTM k Bool Control Operation) (input : α → List Bool) {fYes fNo : List Bool → ℕ} {g : List Bool → Bool} (hYes : ∀ (q : List Bool), g q = true ↔ 0 < fYes q) (hNo : ∀ (q : List Bool), g q = false ↔ 0 < fNo q) (a : α) (answers : List Bool) :
0 < replayPathCount machine input fYes fNo (a, answers) ↔ answers = machine.oracleReplies g answers.length (input a)

A path count is positive exactly on the canonical instruction-indexed oracle transcript.

theorem Cslib.Complexity.replayPathCount_le_one {α : Type} {k : ℕ} {Control Operation : Type} [DecidableEq Operation] (machine : Turing.MultiTapePTM k Bool Control Operation) (input : α → List Bool) {fYes fNo : List Bool → ℕ} (hYes_le : ∀ (q : List Bool), fYes q ≤ 1) (hNo_le : ∀ (q : List Bool), fNo q ≤ 1) (x : α × List Bool) :
replayPathCount machine input fYes fNo x ≤ 1

Unambiguous oracle certificate counts give an unambiguous transcript certificate.

Weighted sums over all transcripts #

def Cslib.Complexity.replayWeightedSum {α : Type} {k : ℕ} {Control Operation : Type} [DecidableEq Operation] (machine : Turing.MultiTapePTM k Bool Control Operation) (input : α → List Bool) (T : α → ℕ) (fYes fNo : List Bool → ℕ) (F : α × List Bool → ℕ) (a : α) :

The sum, over all transcripts of length T a, of the transcript's path count times the weight F of the instance and the replayed output.

theorem Cslib.Complexity.replayWeightedSum_mem_SharpP {α : Type} {enc : α ↪ List Bool} {k : ℕ} {Control Operation : Type} [DecidableEq Operation] [Finite Control] [Finite Operation] (machine : Turing.MultiTapePTM k Bool Control Operation) {input : α → List Bool} {T : α → ℕ} {fYes fNo : List Bool → ℕ} {F : α × List Bool → ℕ} (hinput : Turing.MultiTapeTM.ComputableInPolyTime input enc Turing.MultiTapeTM.encBits) (hT : Turing.MultiTapeTM.ComputableInPolyTime T enc Turing.MultiTapeTM.encUnary) (hYes : fYes ∈ SharpP Turing.MultiTapeTM.encBits) (hNo : fNo ∈ SharpP Turing.MultiTapeTM.encBits) (hF : F ∈ SharpP (Turing.MultiTapeTM.encPair enc Turing.MultiTapeTM.encBits)) :
replayWeightedSum machine input T fYes fNo F ∈ SharpP enc

Polynomial-time replay, #P oracle certificate counts and a #P weight give a #P weighted sum.

theorem Cslib.Complexity.replayWeightedSum_pos_iff {α : Type} {k : ℕ} {Control Operation : Type} [DecidableEq Operation] (machine : Turing.MultiTapePTM k Bool Control Operation) (input : α → List Bool) (T : α → ℕ) {fYes fNo : List Bool → ℕ} {g : List Bool → Bool} (hYes : ∀ (q : List Bool), g q = true ↔ 0 < fYes q) (hNo : ∀ (q : List Bool), g q = false ↔ 0 < fNo q) (F : α × List Bool → ℕ) (a : α) :
0 < replayWeightedSum machine input T fYes fNo F a ↔ 0 < F (a, machine.replayOutput (input a) (machine.oracleReplies g (T a) (input a)))

The weighted sum is positive exactly when the weight of the canonical replay is: positive path counts characterize the canonical transcript.

theorem Cslib.Complexity.replayWeightedSum_eq_of_le_one {α : Type} {k : ℕ} {Control Operation : Type} [DecidableEq Operation] (machine : Turing.MultiTapePTM k Bool Control Operation) (input : α → List Bool) (T : α → ℕ) {fYes fNo : List Bool → ℕ} {g : List Bool → Bool} (hYes_le : ∀ (q : List Bool), fYes q ≤ 1) (hNo_le : ∀ (q : List Bool), fNo q ≤ 1) (hYes : ∀ (q : List Bool), g q = true ↔ 0 < fYes q) (hNo : ∀ (q : List Bool), g q = false ↔ 0 < fNo q) (F : α × List Bool → ℕ) (a : α) :
replayWeightedSum machine input T fYes fNo F a = F (a, machine.replayOutput (input a) (machine.oracleReplies g (T a) (input a)))

For unambiguous oracle certificate counts the weighted sum is the weight of the canonical replay: the canonical transcript has path count 1 and every other transcript 0.