Documentation

CslibFrontier.Computability.Complexity.FineGrained.RandomizedPowerTime

Randomized time bounds with a power in the exponent #

The power-exponential time bound for seeded promise solvers uses the same parameter and encoded-length factors as the deterministic bound.

Main definitions #

Main results #

def Cslib.Complexity.SolvesWithErrorInPowerExpTime {α : Type} (Q : PromiseProblem α) (enc : α ↪ List Bool) (E : ErrorModel) (μ : α → ℕ) (p : ℝ) :

A solver with error profile E runs in time 2 ^ (C * (μ a + 1) ^ p) * (L + 1) ^ e up to constant factors for some C,e : ℕ, where L is the encoded input length. The time bound holds on every seed.

def Cslib.Complexity.ComputesWithErrorInPowerExpTime {α β : Type} [DecidableEq β] (f : α → β) (enc : α ↪ List Bool) (encOut : β ↪ List Bool) (ε : ℝ) (μ : α → ℕ) (p : ℝ) :

Exact-output randomized computation with time exponential in the p-th power of μ a + 1 and polynomial in the original encoded input length.

theorem Cslib.Complexity.SolvesWithErrorInPowerExpTime.mono_error {α : Type} {enc : α ↪ List Bool} {μ : α → ℕ} {p : ℝ} {Q : PromiseProblem α} {E₁ E₂ : ErrorModel} (h : SolvesWithErrorInPowerExpTime Q enc E₁ μ p) (hE : E₁ ≤ E₂) :

Relaxing the error profile preserves the power-exponential running time.

theorem Cslib.Complexity.SolvesWithErrorInPowerExpTime.of_seededVerifier {α : Type} {enc : α ↪ List Bool} {μ : α → ℕ} {p : ℝ} {Q : PromiseProblem α} {E : ErrorModel} (hμ : Turing.MultiTapeTM.ComputableInPolyTime μ enc Turing.MultiTapeTM.encUnary) (hp : p < 1) {V : α × List Bool → Bool} (hV : ComputableInPowerExpTime V (Turing.MultiTapeTM.encPair enc Turing.MultiTapeTM.encBits) Turing.MultiTapeTM.encBool (μ ∘ Prod.fst) p) (A e : ℕ) (hyes : ∀ a ∈ Q.yes, ∀ (n : ℕ), 2 ^ (↑A * (↑(μ a) + 1) ^ p) * (↑(enc a).length + 1) ^ e ≤ ↑n → ↑(acceptCount (fun (x : α × List Bool) => !V x) a n) ≤ E.yesErr * 2 ^ n) (hno : ∀ a ∈ Q.no, ∀ (n : ℕ), 2 ^ (↑A * (↑(μ a) + 1) ^ p) * (↑(enc a).length + 1) ^ e ≤ ↑n → ↑(acceptCount V a n) ≤ E.noErr * 2 ^ n) :
∃ (q : ℝ), p < q ∧ 0 < q ∧ q < 1 ∧ SolvesWithErrorInPowerExpTime Q enc E μ q

A verifier whose error guarantees hold at every seed length above a power-exponential threshold yields a seeded solver. The chosen seed length is computable in unary, and the solver accounts for generating it and running on the full framed input at a power below one.

theorem Cslib.Complexity.ComputesWithErrorInPowerExpTime.of_seededVerifier {α : Type} {enc : α ↪ List Bool} {μ : α → ℕ} {p : ℝ} {β : Type} [DecidableEq β] {f : α → β} {encOut : β ↪ List Bool} {ε : ℝ} (hμ : Turing.MultiTapeTM.ComputableInPolyTime μ enc Turing.MultiTapeTM.encUnary) (hp : p < 1) {V : α × List Bool → β} (hV : ComputableInPowerExpTime V (Turing.MultiTapeTM.encPair enc Turing.MultiTapeTM.encBits) encOut (μ ∘ Prod.fst) p) (A e : ℕ) (herror : ∀ (a : α) (n : ℕ), 2 ^ (↑A * (↑(μ a) + 1) ^ p) * (↑(enc a).length + 1) ^ e ≤ ↑n → ↑(acceptCount (fun (x : α × List Bool) => V x != f x.1) a n) ≤ ε * 2 ^ n) :
∃ (q : ℝ), p < q ∧ 0 < q ∧ q < 1 ∧ ComputesWithErrorInPowerExpTime f enc encOut ε μ q

An exact-output verifier with error at most ε at every seed width above a power-exponential threshold yields a native solver. Preparing the unary seed width and running the verifier on the whole framed input keep the exponent power below one.

theorem Cslib.Complexity.SolvesWithErrorInPowerExpTime.exists_amplifiedVerifier {α : Type} {enc : α ↪ List Bool} {μ : α → ℕ} {p : ℝ} {Q : PromiseProblem α} {target : α → ℕ} (htarget : Turing.MultiTapeTM.ComputableInPolyTime target enc Turing.MultiTapeTM.encUnary) (h : SolvesWithErrorInPowerExpTime Q enc ErrorModel.bounded μ p) :
∃ (width : α → ℕ) (verify : α × List Bool → Bool), ComputableInPowerExpTime width enc Turing.MultiTapeTM.encUnary μ p ∧ ComputableInPowerExpTime verify (Turing.MultiTapeTM.encPair enc Turing.MultiTapeTM.encBits) Turing.MultiTapeTM.encBool (μ ∘ Prod.fst) p ∧ (∀ a ∈ Q.yes, ↑(acceptCount (fun (x : α × List Bool) => !verify x) a (width a)) ≤ 1 / 3 / 2 ^ target a * 2 ^ width a) ∧ ∀ a ∈ Q.no, ↑(acceptCount verify a (width a)) ≤ 1 / 3 / 2 ^ target a * 2 ^ width a

A polynomial-time unary schedule target can lower bounded two-sided error to (1 / 3) / 2 ^ target a by strict majority. Both the amplified unary seed length and the verifier retain the solver's power in the exponent. The verifier's bound charges the length of the whole framed seed input and applies even to seeds of a different length.

theorem Cslib.Complexity.ComputesWithErrorInPowerExpTime.exists_amplifiedVerifier {α : Type} {enc : α ↪ List Bool} {μ : α → ℕ} {p : ℝ} {β : Type} [DecidableEq β] {f : α → β} {encOut : β ↪ List Bool} {target : α → ℕ} (htarget : Turing.MultiTapeTM.ComputableInPolyTime target enc Turing.MultiTapeTM.encUnary) (h : ComputesWithErrorInPowerExpTime f enc encOut (1 / 3) μ p) :
∃ (width : α → ℕ) (verify : α × List Bool → β), ComputableInPowerExpTime width enc Turing.MultiTapeTM.encUnary μ p ∧ ComputableInPowerExpTime verify (Turing.MultiTapeTM.encPair enc Turing.MultiTapeTM.encBits) encOut (μ ∘ Prod.fst) p ∧ ∀ (a : α), ↑(acceptCount (fun (x : α × List Bool) => verify x != f x.1) a (width a)) ≤ 1 / 3 / 2 ^ target a * 2 ^ width a

Plurality of independent runs amplifies exact output at error 1 / 3 to (1 / 3) / 2 ^ target a for a polynomial-time unary schedule. Both the new seed width and the verifier retain the original power in the exponent. The verifier's time bound applies to every supplied tape, and the error bound uses a uniform tape of the prescribed width.

theorem Cslib.Complexity.ComputesWithErrorInPowerExpTime.combine_polyTime {α : Type} {enc : α ↪ List Bool} {μ : α → ℕ} {p : ℝ} {β γ : Type} [DecidableEq β] [DecidableEq γ] {encB : β ↪ List Bool} {encOut : γ ↪ List Bool} {f₀ f₁ : α → β} {g : β × β → γ} (hp : 0 ≤ p) (h₀ : ComputesWithErrorInPowerExpTime f₀ enc encB (1 / 3) μ p) (h₁ : ComputesWithErrorInPowerExpTime f₁ enc encB (1 / 3) μ p) (hg : Turing.MultiTapeTM.ComputableInPolyTime g (Turing.MultiTapeTM.encPair encB encB) encOut) :
ComputesWithErrorInPowerExpTime (fun (a : α) => g (f₀ a, f₁ a)) enc encOut (1 / 3) μ p

Two exact-output solvers with error at most one third can be combined by a polynomial-time function of their answers at the same exponent power and error bound. Amplify each solver to error at most one sixth and give it a prefix of a common uniform seed. The prefixes may overlap since the error analysis only needs a union bound.

Zero-error seeded solvers of a language and deterministic deciders have the same power bound. The polynomial factor can absorb the cost of reading the encoded input.

theorem Cslib.Complexity.SolvesWithErrorInPowerExpTime.of_promiseReduction {α : Type} {enc : α ↪ List Bool} {μ : α → ℕ} {p : ℝ} {β : Type} {encB : β ↪ List Bool} {A : PromiseProblem α} {B : PromiseProblem β} {E : ErrorModel} {μB : β → ℕ} {r : α → β} {q b : ℝ} (hr : ComputableInPowerExpTime r enc encB μ q) (hyes : ∀ a ∈ A.yes, r a ∈ B.yes) (hno : ∀ a ∈ A.no, r a ∈ B.no) {K : ℕ} (hsize : ∀ (a : α), ↑(μB (r a)) + 1 ≤ (↑K + 1) * (↑(μ a) + 1) ^ b) (hp : 0 ≤ p) (hB : SolvesWithErrorInPowerExpTime B encB E μB p) :
SolvesWithErrorInPowerExpTime A enc E μ (max q (b * p))

A deterministic promise reduction of power q with parameter blowup O((μA + 1) ^ b) transports a target solver of power p ≥ 0 to power max q (b * p), preserving its error profile. The reduction's time also bounds the length it writes.

theorem Cslib.Complexity.ComputesWithErrorInPowerExpTime.of_reduction {α : Type} {enc : α ↪ List Bool} {μ : α → ℕ} {p : ℝ} {β γ : Type} [DecidableEq γ] {encB : β ↪ List Bool} {encOut : γ ↪ List Bool} {f : β → γ} {r : α → β} {μB : β → ℕ} {q b ε : ℝ} (hr : ComputableInPowerExpTime r enc encB μ q) {K : ℕ} (hsize : ∀ (a : α), ↑(μB (r a)) + 1 ≤ (↑K + 1) * (↑(μ a) + 1) ^ b) (hp : 0 ≤ p) (hB : ComputesWithErrorInPowerExpTime f encB encOut ε μB p) :
ComputesWithErrorInPowerExpTime (f ∘ r) enc encOut ε μ (max q (b * p))

Deterministic input reduction with power q and parameter blowup O((μ + 1) ^ b) preserves the exact-output error and gives power max q (b * p).

theorem Cslib.Complexity.ComputesWithErrorInPowerExpTime.of_polyTime_reduction {α : Type} {enc : α ↪ List Bool} {μ : α → ℕ} {p : ℝ} {β γ : Type} [DecidableEq γ] {encB : β ↪ List Bool} {encOut : γ ↪ List Bool} {f : β → γ} {r : α → β} {μB : β → ℕ} {b ε : ℝ} (hr : Turing.MultiTapeTM.ComputableInPolyTime r enc encB) {K : ℕ} (hsize : ∀ (a : α), ↑(μB (r a)) + 1 ≤ (↑K + 1) * (↑(μ a) + 1) ^ b) (hb : 0 ≤ b) (hp : 0 ≤ p) (hB : ComputesWithErrorInPowerExpTime f encB encOut ε μB p) :
ComputesWithErrorInPowerExpTime (f ∘ r) enc encOut ε μ (b * p)

Polynomial-time deterministic preprocessing with parameter blowup O((μ + 1) ^ b) preserves the exact-output error and multiplies the exponent power by b.

theorem Cslib.Complexity.SolvesWithErrorInPowerExpTime.of_polyTime_promiseReduction {α : Type} {enc : α ↪ List Bool} {μ : α → ℕ} {p : ℝ} {β : Type} {encB : β ↪ List Bool} {A : PromiseProblem α} {B : PromiseProblem β} {E : ErrorModel} {μB : β → ℕ} {r : α → β} {b : ℝ} (hr : Turing.MultiTapeTM.ComputableInPolyTime r enc encB) (hyes : ∀ a ∈ A.yes, r a ∈ B.yes) (hno : ∀ a ∈ A.no, r a ∈ B.no) {K : ℕ} (hsize : ∀ (a : α), ↑(μB (r a)) + 1 ≤ (↑K + 1) * (↑(μ a) + 1) ^ b) (hb : 0 ≤ b) (hp : 0 ≤ p) (hB : SolvesWithErrorInPowerExpTime B encB E μB p) :

A polynomial-time promise reduction with parameter blowup O((μA + 1) ^ b) transports power p to b * p with the same error profile.