Documentation

CslibFrontier.Computability.Complexity.FineGrained.Randomized

Parameterized randomized runtime rates, error models, rETH, and rSETH #

Fine-grained randomized complexity studies how bounded-error and one-sided-error randomness affect exponential runtime exponents 2 ^ (δ * μ a) · poly(L) [ImpagliazzoPaturi2001; ImpagliazzoPaturiZane2001; CalabroImpagliazzoPaturi2006]. This module packages error orientations explicitly in a documented structure Cslib.Complexity.ErrorModel and develops parameterized promise-problem runtime bounds:

Main definitions #

Main results #

References #

Structured error models for randomized promise solvers #

Error profile of a randomized promise-problem solver: yesErr bounds the false-negative fraction on yes-instances, noErr bounds the false-positive fraction on no-instances, and yesErr + noErr < 1 guarantees a strict separation noErr < 1 - yesErr between no-instance and yes-instance acceptance probabilities.

  • yesErr : ℝ

    Upper bound on the rejection probability on yes-instances.

  • noErr : ℝ

    Upper bound on the acceptance probability on no-instances.

  • yesErr_nonneg : 0 ≤ self.yesErr

    Rejection error bound is nonnegative.

  • noErr_nonneg : 0 ≤ self.noErr

    Acceptance error bound is nonnegative.

  • err_sum_lt_one : self.yesErr + self.noErr < 1

    Sum of yes-instance and no-instance error bounds is strictly below 1.

Instances For
    theorem Cslib.Complexity.ErrorModel.ext {x y : ErrorModel} (yesErr : x.yesErr = y.yesErr) (noErr : x.noErr = y.noErr) :
    x = y
    @[simp]
    theorem Cslib.Complexity.ErrorModel.le_def {E₁ E₂ : ErrorModel} :
    E₁ ≤ E₂ ↔ E₁.yesErr ≤ E₂.yesErr ∧ E₁.noErr ≤ E₂.noErr

    Zero error on both yes-instances and no-instances (deterministic solvers).

    def Cslib.Complexity.ErrorModel.twoSided (ε : ℝ) (h0 : 0 ≤ ε) (h1 : ε < 1 / 2) :

    Symmetric two-sided error ε ∈ [0, 1 / 2).

    Standard bounded two-sided error 1 / 3 (BPP / PromiseBPP).

    def Cslib.Complexity.ErrorModel.oneSidedRP (ε : ℝ) (h0 : 0 ≤ ε) (h1 : ε < 1) :

    One-sided RP error ε ∈ [0, 1): false-negative bound ε on yes-instances and zero false positives on no-instances.

    Standard RP error (yesErr = 1 / 2, noErr = 0).

    def Cslib.Complexity.ErrorModel.oneSidedCoRP (ε : ℝ) (h0 : 0 ≤ ε) (h1 : ε < 1) :

    One-sided coRP error ε ∈ [0, 1): zero false negatives on yes-instances and false-positive bound ε on no-instances.

    Standard coRP error (yesErr = 0, noErr = 1 / 2).

    Dual error profile under promise-problem complement (Qᶜ).

    @[simp]
    theorem Cslib.Complexity.ErrorModel.symm_oneSidedRP (ε : ℝ) (h0 : 0 ≤ ε) (h1 : ε < 1) :
    (oneSidedRP ε h0 h1).symm = oneSidedCoRP ε h0 h1
    @[simp]
    theorem Cslib.Complexity.ErrorModel.symm_oneSidedCoRP (ε : ℝ) (h0 : 0 ≤ ε) (h1 : ε < 1) :
    (oneSidedCoRP ε h0 h1).symm = oneSidedRP ε h0 h1
    theorem Cslib.Complexity.ErrorModel.oneSidedRP_le_twoSided {ε ε' : ℝ} {h0 : 0 ≤ ε} {h1 : ε < 1} {h0' : 0 ≤ ε'} {h1' : ε' < 1 / 2} (hle : ε ≤ ε') :
    oneSidedRP ε h0 h1 ≤ twoSided ε' h0' h1'

    One-sided RP error ε refines two-sided error ε' whenever ε ≤ ε'.

    theorem Cslib.Complexity.ErrorModel.oneSidedCoRP_le_twoSided {ε ε' : ℝ} {h0 : 0 ≤ ε} {h1 : ε < 1} {h0' : 0 ≤ ε'} {h1' : ε' < 1 / 2} (hle : ε ≤ ε') :
    oneSidedCoRP ε h0 h1 ≤ twoSided ε' h0' h1'

    One-sided coRP error ε refines two-sided error ε' whenever ε ≤ ε'.

    Deterministic parameterized promise-problem bounds #

    def Cslib.Complexity.SolvesPromiseInTimeO {α : Type} (Q : PromiseProblem α) (enc : α ↪ List Bool) (T : α → ℝ) :

    Q is solved deterministically within time O(T a) when a Boolean function computable within O(T a) answers true on Q.yes and false on Q.no.

    def Cslib.Complexity.SolvesPromiseInExpTime {α : Type} (Q : PromiseProblem α) (enc : α ↪ List Bool) (μ : α → ℕ) (δ : ℝ) :

    Q is solved deterministically within time 2 ^ (δ * μ a) · poly(L).

    def Cslib.Complexity.SolvesPromiseInSubexpTime {α : Type} (Q : PromiseProblem α) (enc : α ↪ List Bool) (μ : α → ℕ) :

    Q is solved deterministically in subexponential time in μ.

    theorem Cslib.Complexity.SolvesPromiseInTimeO.mono {α : Type} {enc : α ↪ List Bool} {Q : PromiseProblem α} {T T' : α → ℝ} (h : SolvesPromiseInTimeO Q enc T) (c : ℕ) (hT : ∀ (a : α), T a ≤ ↑c * T' a + ↑c) (hT' : ∀ (a : α), 0 ≤ T' a) :

    Weakening the deterministic runtime bound up to constants.

    theorem Cslib.Complexity.SolvesPromiseInExpTime.mono {α : Type} {enc : α ↪ List Bool} {Q : PromiseProblem α} {μ : α → ℕ} {δ δ' : ℝ} (h : SolvesPromiseInExpTime Q enc μ δ) (hδ : δ ≤ δ') :

    Larger exponents allow more deterministic promise solvers.

    theorem Cslib.Complexity.SolvesPromiseInExpTime.mono_measure {α : Type} {enc : α ↪ List Bool} {Q : PromiseProblem α} {μ μ' : α → ℕ} {c : ℕ} (hμ : ∀ (a : α), μ a ≤ c * μ' a + c) {δ : ℝ} (hδ : 0 ≤ δ) (h : SolvesPromiseInExpTime Q enc μ δ) :
    SolvesPromiseInExpTime Q enc μ' (↑c * δ)

    Rescaling the parameter linearly rescales the deterministic exponential rate.

    theorem Cslib.Complexity.SolvesPromiseInSubexpTime.mono_measure {α : Type} {enc : α ↪ List Bool} {Q : PromiseProblem α} {μ μ' : α → ℕ} {c : ℕ} (hμ : ∀ (a : α), μ a ≤ c * μ' a + c) (h : SolvesPromiseInSubexpTime Q enc μ) :

    Subexponential deterministic promise solving transfers along linear parameter bounds.

    theorem Cslib.Complexity.SolvesPromiseInExpTime.of_promiseReduction {α β : Type} {enc : α ↪ List Bool} {encB : β ↪ List Bool} {X : PromiseProblem α} {Y : PromiseProblem β} {μA : α → ℕ} {μB : β → ℕ} {r : α → β} (hr : Turing.MultiTapeTM.ComputableInPolyTime r enc encB) (hyes : ∀ a ∈ X.yes, r a ∈ Y.yes) (hno : ∀ a ∈ X.no, r a ∈ Y.no) {c : ℕ} (hμ : ∀ (a : α), μB (r a) ≤ c * μA a + c) {δ : ℝ} (hδ : 0 ≤ δ) (hY : SolvesPromiseInExpTime Y encB μB δ) :
    SolvesPromiseInExpTime X enc μA (↑c * δ)

    Transfer of SolvesPromiseInExpTime along a linear-parameter polynomial-time promise reduction.

    theorem Cslib.Complexity.SolvesPromiseInSubexpTime.of_promiseReduction {α β : Type} {enc : α ↪ List Bool} {encB : β ↪ List Bool} {X : PromiseProblem α} {Y : PromiseProblem β} {μA : α → ℕ} {μB : β → ℕ} {r : α → β} (hr : Turing.MultiTapeTM.ComputableInPolyTime r enc encB) (hyes : ∀ a ∈ X.yes, r a ∈ Y.yes) (hno : ∀ a ∈ X.no, r a ∈ Y.no) {c : ℕ} (hμ : ∀ (a : α), μB (r a) ≤ c * μA a + c) (hY : SolvesPromiseInSubexpTime Y encB μB) :

    Transfer of SolvesPromiseInSubexpTime along a linear-parameter promise reduction.

    On PromiseProblem.ofSet A, SolvesPromiseInTimeO agrees with DecidableInTimeO.

    theorem Cslib.Complexity.solvesPromiseInExpTime_ofSet_iff {α : Type} {enc : α ↪ List Bool} {A : Set α} {μ : α → ℕ} {δ : ℝ} :

    On PromiseProblem.ofSet A, SolvesPromiseInExpTime agrees with DecidableInExpTime.

    On PromiseProblem.ofSet A, SolvesPromiseInSubexpTime agrees with DecidableInSubexpTime.

    theorem Cslib.Complexity.mem_PromiseP_iff_exists_solvesPromiseInTimeO {α : Type} {enc : α ↪ List Bool} {Q : PromiseProblem α} :
    Q ∈ PromiseP enc ↔ ∃ (d : ℕ), SolvesPromiseInTimeO Q enc fun (a : α) => (↑(enc a).length + 1) ^ d

    PromiseP is polynomial-degree SolvesPromiseInTimeO.

    theorem Cslib.Complexity.SolvesPromiseInExpTime.of_mem_PromiseP {α : Type} {enc : α ↪ List Bool} {Q : PromiseProblem α} {μ : α → ℕ} (hQ : Q ∈ PromiseP enc) :

    Any PromiseP solver has deterministic exponential rate 0 in any parameter μ.

    Seeded randomized promise-problem bounds #

    def Cslib.Complexity.SolvesWithErrorInTimeO {α : Type} (Q : PromiseProblem α) (enc : α ↪ List Bool) (E : ErrorModel) (T : α → ℝ) :

    Q is solved with error profile E within time O(T a) when a unary coin-length function ℓ : α → ℕ and a deterministic seeded verifier V : α × List Bool → Bool run together in time O(T a) across all seeds of length ℓ a, rejecting at most an E.yesErr fraction of seeds on yes-instances and accepting at most an E.noErr fraction of seeds on no-instances.

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

    A seeded multitape computation of f returns an encoded value. Its unary seed-length program and output program fit a common O(T a) bound on every seed of the chosen length. At most an ε fraction of those seeds return a value different from f a.

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

    Q is solved with error profile E within time 2 ^ (δ * μ a) · poly(L).

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

    Q is solved with error profile E in subexponential time in μ.

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

    Relaxing the error bounds preserves SolvesWithErrorInTimeO.

    theorem Cslib.Complexity.SolvesWithErrorInTimeO.mono {α : Type} {enc : α ↪ List Bool} {Q : PromiseProblem α} {E : ErrorModel} {T T' : α → ℝ} (h : SolvesWithErrorInTimeO Q enc E T) (c : ℕ) (hT : ∀ (a : α), T a ≤ ↑c * T' a + ↑c) (hT' : ∀ (a : α), 0 ≤ T' a) :

    Weakening the runtime bound up to constants preserves SolvesWithErrorInTimeO.

    theorem Cslib.Complexity.SolvesWithErrorInExpTime.mono {α : Type} {enc : α ↪ List Bool} {Q : PromiseProblem α} {E : ErrorModel} {μ : α → ℕ} {δ δ' : ℝ} (h : SolvesWithErrorInExpTime Q enc E μ δ) (hδ : δ ≤ δ') :

    Larger exponents allow more randomized promise solvers.

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

    Relaxing the error bounds preserves SolvesWithErrorInExpTime.

    theorem Cslib.Complexity.SolvesWithErrorInExpTime.mono_measure {α : Type} {enc : α ↪ List Bool} {Q : PromiseProblem α} {E : ErrorModel} {μ μ' : α → ℕ} {c : ℕ} (hμ : ∀ (a : α), μ a ≤ c * μ' a + c) {δ : ℝ} (hδ : 0 ≤ δ) (h : SolvesWithErrorInExpTime Q enc E μ δ) :
    SolvesWithErrorInExpTime Q enc E μ' (↑c * δ)

    Rescaling the parameter linearly rescales the randomized exponential rate.

    theorem Cslib.Complexity.SolvesWithErrorInSubexpTime.mono_measure {α : Type} {enc : α ↪ List Bool} {Q : PromiseProblem α} {E : ErrorModel} {μ μ' : α → ℕ} {c : ℕ} (hμ : ∀ (a : α), μ a ≤ c * μ' a + c) (h : SolvesWithErrorInSubexpTime Q enc E μ) :

    Subexponential randomized promise solving transfers along linear parameter bounds.

    Negating the verifier solves Qᶜ with the symmetric error profile E.symm.

    theorem Cslib.Complexity.solvesWithErrorInTimeO_deterministic_iff {α : Type} {enc : α ↪ List Bool} {Q : PromiseProblem α} {T : α → ℝ} (hL : ∀ (a : α), ↑(enc a).length ≤ T a) :

    Deterministic vs. zero-error randomized solvers. When the target time bound is at least the encoded input length ((enc a).length ≤ T a), SolvesWithErrorInTimeO at ErrorModel.deterministic is equivalent to SolvesPromiseInTimeO.

    Deterministic vs. zero-error exponential rates. For δ ≥ 0, SolvesWithErrorInExpTime at ErrorModel.deterministic is equivalent to SolvesPromiseInExpTime.

    theorem Cslib.Complexity.SolvesPromiseInExpTime.solvesWithErrorInExpTime {α : Type} {enc : α ↪ List Bool} {Q : PromiseProblem α} {μ : α → ℕ} {δ : ℝ} (hδ : 0 ≤ δ) (h : SolvesPromiseInExpTime Q enc μ δ) (E : ErrorModel) :

    Every deterministic 2 ^ (δ * μ a) · poly(L) promise solver (δ ≥ 0) solves Q under any error profile E.

    theorem Cslib.Complexity.SolvesWithErrorInTimeO.of_promiseReduction {α β : Type} {enc : α ↪ List Bool} {encB : β ↪ List Bool} {X : PromiseProblem α} {Y : PromiseProblem β} {E : ErrorModel} {r : α → β} {P XTime : α → ℝ} {YTime : β → ℝ} {e : ℕ} {C : ℝ} (hr : ComputableInTimeO r enc encB P) (hyes : ∀ a ∈ X.yes, r a ∈ Y.yes) (hno : ∀ a ∈ X.no, r a ∈ Y.no) (hP : ∀ (a : α), ↑(enc a).length + 1 ≤ P a) (hX : ∀ (a : α), 1 ≤ XTime a) (hC : 0 ≤ C) (hXY : ∀ (a : α), YTime (r a) ≤ C * XTime a) (hY : SolvesWithErrorInTimeO Y encB E fun (b : β) => YTime b * (↑(encB b).length + 1) ^ e) :
    SolvesWithErrorInTimeO X enc E fun (a : α) => XTime a * P a ^ (e + 1)

    A deterministic promise reduction preserves the error profile. If the reduction takes time O(P a), and YTime b bounds the target solver's non-polynomial factor, a bound YTime (r a) ≤ C * XTime a gives source time O(XTime a * (P a) ^ (e + 1)); e is the polynomial degree in the target encoded input length.

    theorem Cslib.Complexity.ComputesWithErrorInTimeO.of_reduction {α β : Type} {enc : α ↪ List Bool} {encB : β ↪ List Bool} {γ : Type} [DecidableEq γ] {encOut : γ ↪ List Bool} {f : β → γ} {r : α → β} {P XTime : α → ℝ} {YTime : β → ℝ} {e : ℕ} {C ε : ℝ} (hr : ComputableInTimeO r enc encB P) (hP : ∀ (a : α), ↑(enc a).length + 1 ≤ P a) (hX : ∀ (a : α), 1 ≤ XTime a) (hC : 0 ≤ C) (hXY : ∀ (a : α), YTime (r a) ≤ C * XTime a) (hY : ComputesWithErrorInTimeO f encB encOut ε fun (b : β) => YTime b * (↑(encB b).length + 1) ^ e) :
    ComputesWithErrorInTimeO (f ∘ r) enc encOut ε fun (a : α) => XTime a * P a ^ (e + 1)

    Deterministic preprocessing preserves the error of an exact-output solver. The time includes evaluating the map and reading the unchanged seed. The polynomial degree e charges the length of the reduced instance.

    theorem Cslib.Complexity.SolvesWithErrorInExpTime.of_promiseReduction {α β : Type} {enc : α ↪ List Bool} {encB : β ↪ List Bool} {X : PromiseProblem α} {Y : PromiseProblem β} {E : ErrorModel} {μA : α → ℕ} {μB : β → ℕ} {r : α → β} (hr : Turing.MultiTapeTM.ComputableInPolyTime r enc encB) (hyes : ∀ a ∈ X.yes, r a ∈ Y.yes) (hno : ∀ a ∈ X.no, r a ∈ Y.no) {c : ℕ} (hμ : ∀ (a : α), μB (r a) ≤ c * μA a + c) {δ : ℝ} (hδ : 0 ≤ δ) (hY : SolvesWithErrorInExpTime Y encB E μB δ) :
    SolvesWithErrorInExpTime X enc E μA (↑c * δ)

    Transfer of SolvesWithErrorInExpTime along a linear-parameter polynomial-time promise reduction.

    theorem Cslib.Complexity.SolvesWithErrorInSubexpTime.of_promiseReduction {α β : Type} {enc : α ↪ List Bool} {encB : β ↪ List Bool} {X : PromiseProblem α} {Y : PromiseProblem β} {E : ErrorModel} {μA : α → ℕ} {μB : β → ℕ} {r : α → β} (hr : Turing.MultiTapeTM.ComputableInPolyTime r enc encB) (hyes : ∀ a ∈ X.yes, r a ∈ Y.yes) (hno : ∀ a ∈ X.no, r a ∈ Y.no) {c : ℕ} (hμ : ∀ (a : α), μB (r a) ≤ c * μA a + c) (hY : SolvesWithErrorInSubexpTime Y encB E μB) :

    Transfer of SolvesWithErrorInSubexpTime along a linear-parameter promise reduction.

    Bridges to MultiTapePTM, PromiseBPP, PromiseRP, and PromiseCoRP #

    theorem Cslib.Complexity.exists_ptm_of_solvesWithErrorInTimeO {α : Type} {enc : α ↪ List Bool} {Q : PromiseProblem α} {E : ErrorModel} {T : α → ℝ} (hT : ∀ (a : α), 0 ≤ T a) (h : SolvesWithErrorInTimeO Q enc E T) :
    ∃ (c : ℕ) (clock : α → ℕ) (k : ℕ) (State : Type) (_ : Finite State) (machine : Turing.MultiTapePTM k Bool State), (∀ (a : α), ↑(clock a) ≤ ↑c * T a + ↑c) ∧ (∀ (a : α), ∀ final ∈ (machine.runClosedConfigFrom (clock a) (Turing.MultiTapeMachine.initialConfig machine (enc a))).eval.support, final.tapes.state = none) ∧ (∀ a ∈ Q.yes, 1 - E.yesErr ≤ ((machine.runClosed (clock a) (enc a)).eval [true]).toReal ∧ ((machine.runClosed (clock a) (enc a)).eval [false]).toReal ≤ E.yesErr) ∧ ∀ a ∈ Q.no, ((machine.runClosed (clock a) (enc a)).eval [true]).toReal ≤ E.noErr

    Native MultiTapePTM compilation. Every SolvesWithErrorInTimeO Q enc E T solver (with 0 ≤ T a) compiles to a closed fair-coin multi-tape machine that halts on every run within clock O(T a) and outputs [true] / [false] achieving error profile E.

    theorem Cslib.Complexity.exists_solvesWithErrorInTimeO_poly_iff {α : Type} {enc : α ↪ List Bool} {Q : PromiseProblem α} {E : ErrorModel} :
    (∃ (d : ℕ), SolvesWithErrorInTimeO Q enc E fun (a : α) => (↑(enc a).length + 1) ^ d) ↔ ∃ (p : Polynomial ℕ) (V : α × List Bool → Bool), Turing.MultiTapeTM.ComputableInPolyTime V (Turing.MultiTapeTM.encPair enc Turing.MultiTapeTM.encBits) Turing.MultiTapeTM.encBool ∧ (∀ a ∈ Q.yes, ↑(acceptCount (fun (q : α × List Bool) => !V q) a (Polynomial.eval (enc a).length p)) ≤ E.yesErr * 2 ^ Polynomial.eval (enc a).length p) ∧ ∀ a ∈ Q.no, ↑(acceptCount V a (Polynomial.eval (enc a).length p)) ≤ E.noErr * 2 ^ Polynomial.eval (enc a).length p

    Polynomial-time sample-and-verify characterization for arbitrary ErrorModels. Q is solved at error profile E within polynomial time ((enc a).length + 1) ^ d for some d if and only if there exist a polynomial coin-count bound p : Polynomial ℕ and a polynomial-time verifier V : α × List Bool → Bool achieving error profile E on p.eval (enc a).length random bits.

    PromiseBPP in terms of SolvesWithErrorInTimeO. A promise problem lies in PromiseBPP if and only if it is solved at ErrorModel.bounded (1 / 3) within polynomial time ((enc a).length + 1) ^ d.

    theorem Cslib.Complexity.mem_PromiseRP_iff_exists_solvesWithErrorInTimeO {α : Type} {enc : α ↪ List Bool} {Q : PromiseProblem α} :
    Q ∈ PromiseRP enc ↔ ∃ (d : ℕ), SolvesWithErrorInTimeO Q enc ErrorModel.rp fun (a : α) => (↑(enc a).length + 1) ^ d

    PromiseRP in terms of SolvesWithErrorInTimeO. A promise problem lies in PromiseRP if and only if it is solved at ErrorModel.rp (yesErr = 1 / 2, noErr = 0) within polynomial time ((enc a).length + 1) ^ d.

    PromiseCoRP in terms of SolvesWithErrorInTimeO.

    Rate-preserving error amplification (O(T a) and exact rate δ) #

    theorem Cslib.Complexity.SolvesWithErrorInTimeO.amplify_twoSided {α : Type} {enc : α ↪ List Bool} {Q : PromiseProblem α} {T : α → ℝ} (hT : ∀ (a : α), 0 ≤ T a) {ε₁ ε₂ : ℝ} {h0₁ : 0 ≤ ε₁} {h1₁ : ε₁ < 1 / 2} (h0₂ : 0 < ε₂) (h1₂ : ε₂ < 1 / 2) (h : SolvesWithErrorInTimeO Q enc (ErrorModel.twoSided ε₁ h0₁ h1₁) T) :

    Rate-preserving two-sided error amplification. Repeating a two-sided ε₁-error solver 2 r times and taking strict majority reduces the error to (4 * ε₁ * (1 - ε₁)) ^ r ≤ ε₂ while preserving O(T a) up to a constant factor.

    theorem Cslib.Complexity.solvesWithErrorInTimeO_twoSided_iff {α : Type} {enc : α ↪ List Bool} {Q : PromiseProblem α} {T : α → ℝ} (hT : ∀ (a : α), 0 ≤ T a) {ε₁ ε₂ : ℝ} (h0₁ : 0 < ε₁) (h1₁ : ε₁ < 1 / 2) (h0₂ : 0 < ε₂) (h1₂ : ε₂ < 1 / 2) :

    Two-sided threshold invariance. Any two error bounds ε₁, ε₂ ∈ (0, 1 / 2) yield the exact same SolvesWithErrorInTimeO predicate (for 0 ≤ T a).

    theorem Cslib.Complexity.SolvesWithErrorInTimeO.amplify_oneSidedRP {α : Type} {enc : α ↪ List Bool} {Q : PromiseProblem α} {T : α → ℝ} (hT : ∀ (a : α), 0 ≤ T a) {ε₁ ε₂ : ℝ} {h0₁ : 0 ≤ ε₁} {h1₁ : ε₁ < 1} (h0₂ : 0 < ε₂) (h1₂ : ε₂ < 1) (h : SolvesWithErrorInTimeO Q enc (ErrorModel.oneSidedRP ε₁ h0₁ h1₁) T) :

    Rate-preserving one-sided RP error amplification. Taking the disjunction of m runs reduces false-negative error from ε₁ ∈ [0, 1) to ε₁ ^ m ≤ ε₂ while keeping zero false-positive error and runtime O(T a).

    theorem Cslib.Complexity.solvesWithErrorInTimeO_oneSidedRP_iff {α : Type} {enc : α ↪ List Bool} {Q : PromiseProblem α} {T : α → ℝ} (hT : ∀ (a : α), 0 ≤ T a) {ε₁ ε₂ : ℝ} (h0₁ : 0 < ε₁) (h1₁ : ε₁ < 1) (h0₂ : 0 < ε₂) (h1₂ : ε₂ < 1) :

    One-sided RP threshold invariance. Any two error bounds ε₁, ε₂ ∈ (0, 1) yield the exact same SolvesWithErrorInTimeO predicate (for 0 ≤ T a).

    theorem Cslib.Complexity.solvesWithErrorInTimeO_oneSidedCoRP_iff {α : Type} {enc : α ↪ List Bool} {Q : PromiseProblem α} {T : α → ℝ} (hT : ∀ (a : α), 0 ≤ T a) {ε₁ ε₂ : ℝ} (h0₁ : 0 < ε₁) (h1₁ : ε₁ < 1) (h0₂ : 0 < ε₂) (h1₂ : ε₂ < 1) :

    One-sided coRP threshold invariance.

    theorem Cslib.Complexity.SolvesWithErrorInTimeO.oneSidedRP_to_twoSided {α : Type} {enc : α ↪ List Bool} {Q : PromiseProblem α} {T : α → ℝ} (hT : ∀ (a : α), 0 ≤ T a) {ε₁ ε₂ : ℝ} {h0₁ : 0 ≤ ε₁} {h1₁ : ε₁ < 1} (h0₂ : 0 < ε₂) (h1₂ : ε₂ < 1 / 2) (h : SolvesWithErrorInTimeO Q enc (ErrorModel.oneSidedRP ε₁ h0₁ h1₁) T) :

    Any one-sided RP solver (ε₁ ∈ [0, 1)) amplifies to any two-sided threshold ε₂ ∈ (0, 1 / 2) at the exact same O(T a) runtime.

    theorem Cslib.Complexity.solvesWithErrorInExpTime_twoSided_iff {α : Type} {enc : α ↪ List Bool} {Q : PromiseProblem α} {μ : α → ℕ} {δ ε₁ ε₂ : ℝ} (h0₁ : 0 < ε₁) (h1₁ : ε₁ < 1 / 2) (h0₂ : 0 < ε₂) (h1₂ : ε₂ < 1 / 2) :
    SolvesWithErrorInExpTime Q enc (ErrorModel.twoSided ε₁ ⋯ h1₁) μ δ ↔ SolvesWithErrorInExpTime Q enc (ErrorModel.twoSided ε₂ ⋯ h1₂) μ δ

    Exponential-rate invariance for any two-sided thresholds ε₁, ε₂ ∈ (0, 1 / 2).

    theorem Cslib.Complexity.solvesWithErrorInExpTime_oneSidedRP_iff {α : Type} {enc : α ↪ List Bool} {Q : PromiseProblem α} {μ : α → ℕ} {δ ε₁ ε₂ : ℝ} (h0₁ : 0 < ε₁) (h1₁ : ε₁ < 1) (h0₂ : 0 < ε₂) (h1₂ : ε₂ < 1) :
    SolvesWithErrorInExpTime Q enc (ErrorModel.oneSidedRP ε₁ ⋯ h1₁) μ δ ↔ SolvesWithErrorInExpTime Q enc (ErrorModel.oneSidedRP ε₂ ⋯ h1₂) μ δ

    Exponential-rate invariance for any one-sided RP thresholds ε₁, ε₂ ∈ (0, 1).

    Input-dependent seeded amplification #

    theorem Cslib.Complexity.computableInO_amplifySeededMajority {α : Type} {enc : α ↪ List Bool} {ℓ r : α → ℕ} {V : α × List Bool → Bool} {Tℓ Sℓ Tr Sr R : α → ℕ} {Tv Sv : α × List Bool → ℕ} (hℓ : Turing.MultiTapeTM.ComputableInO ℓ enc Turing.MultiTapeTM.encUnary Tℓ Sℓ) (hr : Turing.MultiTapeTM.ComputableInO r enc Turing.MultiTapeTM.encUnary Tr Sr) (hV : Turing.MultiTapeTM.ComputableInO V (Turing.MultiTapeTM.encPair enc Turing.MultiTapeTM.encBits) Turing.MultiTapeTM.encBool Tv Sv) (hR : ∀ (a : α) (w : List Bool), w.length = ℓ a → Tv (a, w) ≤ R a) :
    have amplified := fun (p : α × List Bool) => BitString.listStrictMajority (repeatVotes (2 * r p.1) (ℓ p.1) V p); ∃ (d : ℕ) (e : ℕ) (f : ℕ) (Sseed : α → ℕ) (Sverify : α × List Bool → ℕ), Turing.MultiTapeTM.ComputableInO (fun (a : α) => 2 * r a * ℓ a) enc Turing.MultiTapeTM.encUnary (fun (a : α) => (enc a).length + 2 * Tr a + Tℓ a + (4 * r a + ℓ a + 2) ^ d) Sseed ∧ Turing.MultiTapeTM.ComputableInO amplified (Turing.MultiTapeTM.encPair enc Turing.MultiTapeTM.encBits) Turing.MultiTapeTM.encBool (fun (p : α × List Bool) => (2 * r p.1 + 1) * ((4 * ((Turing.MultiTapeTM.encPair enc Turing.MultiTapeTM.encBits) p).length + 2 * Tr p.1 + Tℓ p.1 + 1) ^ e + R p.1) + (2 * r p.1 + 1) ^ f) Sverify ∧ ∀ (a : α) (truth : Bool) {ε : ℝ}, 0 ≤ ε → ε < 1 / 2 → ↑(acceptCount (fun (p : α × List Bool) => V p != truth) a (ℓ a)) ≤ ε * 2 ^ ℓ a → ↑(acceptCount (fun (p : α × List Bool) => amplified p != truth) a (2 * r a * ℓ a)) ≤ (4 * ε * (1 - ε)) ^ r a * 2 ^ (2 * r a * ℓ a)

    Certify the seed length and verifier for strict majority of 2 * r a independent runs. The unary repetition schedule and seed width depend on the instance alone. The verifier clock needs a bound only on seeds of the original width. For either expected answer, the fraction of wrong amplified answers is at most (4 * ε * (1 - ε)) ^ r a whenever a single run errs with probability at most ε < 1 / 2.

    Randomized k-SAT exponents, rETH, and rSETH #

    Width transfer for randomized k-SAT solvers: a solver for KSAT k' with k ≤ k' yields a solver for KSAT k at the same rate δ ≥ 0 and error profile E.

    noncomputable def Cslib.Complexity.rSatExponent (k : ℕ) :

    The bounded-error randomized k-SAT exponent s^r_k: the infimum (Cslib.rateExponent) of δ ≥ 0 for which KSAT k is solved with bounded two-sided error within time 2 ^ (δ * n) · poly(L).

    noncomputable def Cslib.Complexity.rpSatExponent (k : ℕ) :

    The one-sided (RP) randomized k-SAT exponent s^{RP}_k: the infimum (Cslib.rateExponent) of δ ≥ 0 for which KSAT k is solved with RP error (yesErr = 1 / 2, noErr = 0) within time 2 ^ (δ * n) · poly(L).

    rETH (the randomized exponential time hypothesis): for some δ > 0, 3-SAT cannot be solved with bounded two-sided error within time 2 ^ (δ * n) · poly(L).

    rSETH (the randomized strong exponential time hypothesis): for every ε > 0 there is a width k such that k-SAT cannot be solved with bounded two-sided error within time 2 ^ ((1 - ε) * n) · poly(L).

    rSatExponent k is independent of the choice of two-sided error threshold ε ∈ (0, 1 / 2).

    rpSatExponent k is independent of the choice of one-sided RP threshold ε ∈ (0, 1).

    Exhaustive search solves KSAT k in randomized time 2 ^ n * poly(L) under any error profile.

    rSatExponent k is bounded by every attainable bounded-error rate δ ≥ 0.

    rpSatExponent k is bounded by every attainable RP rate δ ≥ 0.

    One-sided RP vs. deterministic exponent: rpSatExponent k ≤ satExponent k.

    Two-sided vs. deterministic exponent: rSatExponent k ≤ satExponent k.

    theorem Cslib.Complexity.iSup_ge_rSatExponent_eq_iSup (K : ℕ) :
    ⨆ (k : { k : ℕ // K ≤ k }), rSatExponent ↑k = ⨆ (k : ℕ), rSatExponent k

    Dropping any finite prefix k < K leaves ⨆ k, rSatExponent k unchanged.

    rSETH holds iff ⨆ k : ℕ, rSatExponent k = 1.

    rSETH holds iff ⨆ k ≥ 3, rSatExponent k = 1.

    Randomized ETH implies deterministic ETH (rETH → ETH).

    Randomized SETH implies deterministic SETH (rSETH → SETH).