Documentation

CslibFrontier.Computability.Complexity.Classes.ValiantVazirani

The Valiant–Vazirani theorem #

Valiant and Vazirani showed that deciding satisfiability reduces in randomized polynomial time to deciding it on formulas with at most one satisfying assignment [Valiant and Vazirani] [VV86], Arora and Barak, Section 17.4.

The randomized isolation reduction ValiantVazirani.reduce and its amplification bound ValiantVazirani.two_pow_le_two_mul_card_exists_row are developed in CslibFrontier.Computability.Complexity.Classes.ValiantVazirani.Reduction and re-exported here.

The class form #

RPWithOracle A enc is RP relative to the oracle language A: Cslib.Complexity.RP with ComputableInPolyTime replaced by Cslib.Complexity.ComputableInPolyTimeWithOracle A, as PWithOracle relativizes P. For an oracle that is a promise problem, RPWithPromiseOracle Q encQ enc asks for one algorithm that is correct against every language solving Q, whose answers outside the promise are arbitrary. Every problem in NP lies in RP relative to PromiseUSAT (NP_subset_RPWithPromiseOracle_PromiseUSAT): after the Cook–Levin reduction, the algorithm runs the Valiant–Vazirani reduction on 11 (N + 3) independent blocks of random bits, where N bounds the number of variable occurrences, asks the oracle about each reduced formula (queryAny), and accepts when it answers yes once. On a no-instance every reduced formula is unsatisfiable, so the oracle answers no; on a yes-instance some reduced formula is uniquely satisfiable except with probability at most (1 - 3 / (32 (N + 3))) ^ (11 (N + 3)) ≤ 1 / 2 (ValiantVazirani.two_pow_le_two_mul_card_exists_row, from the repeated-trials bound Fintype.half_le_dens_filter_exists_apply_mem). In particular NP ⊆ RP^USAT (NP_subset_RPWithOracle_USAT); this form is weak, since USAT as a language is coNP-hard, and the promise version carries the Valiant–Vazirani content.

Main definitions #

Main results #

References #

Randomized polynomial time relative to an oracle #

def Cslib.Complexity.RPWithOracle {α : Type} (A : Set (List Bool)) (enc : α ↪ List Bool) :
Set (Set α)

The problems decided with one-sided error by polynomial-time machines with oracle A reading polynomially long random strings: Cslib.Complexity.RP with ComputableInPolyTime replaced by ComputableInPolyTimeWithOracle A, as PWithOracle relativizes P.

Instances For
    theorem Cslib.Complexity.RP_subset_RPWithOracle {α : Type} (A : Set (List Bool)) (enc : α ↪ List Bool) :
    RP enc ⊆ RPWithOracle A enc

    Every problem in RP is in RP relative to every oracle.

    RP relative to an oracle lies inside NP relative to the same oracle: an accepted random string is a certificate.

    def Cslib.Complexity.RPWithPromiseOracle {α β : Type} (Q : PromiseProblem β) (encQ : β ↪ List Bool) (enc : α ↪ List Bool) :
    Set (Set α)

    The problems decided with one-sided error by a single polynomial-time oracle algorithm against every oracle language that solves the promise problem Q under the encoding encQ: RP relative to a promise problem. The algorithm is fixed before the oracle, and the oracle's answers outside the promise are arbitrary.

    Instances For
      theorem Cslib.Complexity.RP_subset_RPWithPromiseOracle {α β : Type} (Q : PromiseProblem β) (encQ : β ↪ List Bool) (enc : α ↪ List Bool) :
      RP enc ⊆ RPWithPromiseOracle Q encQ enc

      Every problem in RP is in RP relative to every promise problem: its algorithm makes no request.

      theorem Cslib.Complexity.RPWithPromiseOracle_subset_RPWithOracle {α β : Type} {Q : PromiseProblem β} {encQ : β ↪ List Bool} {A : Set (List Bool)} (hA : Q.SolvedBy fun (b : β) => decide (encQ b ∈ A)) (enc : α ↪ List Bool) :
      RPWithPromiseOracle Q encQ enc ⊆ RPWithOracle A enc

      RP relative to a promise problem lies inside RP relative to every oracle language solving the promise problem.

      Asking every word of a list #

      One step of queryAny: ask the first remaining word, and record whether its reply begins with true.

      Instances For

        Ask the oracle every word of the list, in order, and accept when some reply begins with true.

        Instances For
          theorem Cslib.Complexity.interpret_queryAny (A : Set (List Bool)) (words : List (List Bool)) :
          OracleComp.interpret (languageOracle A) (queryAny words) = words.any fun (word : List Bool) => decide (word ∈ A)

          Against a language oracle, queryAny accepts exactly when some word is in the language.

          Whether some word of a list is in A is computable in polynomial time relative to A.

          NP is in RP relative to PromiseUSAT #

          Valiant–Vazirani: NP ⊆ RP^PromiseUSAT. Every problem in NP is decided with one-sided error by one polynomial-time oracle algorithm against every language solving PromiseUSAT. The algorithm reduces the instance to SAT by the Cook–Levin theorem, runs the Valiant–Vazirani reduction on 11 (N + 3) independent blocks of (N + 2) ^ 2 random bits, where N bounds the number of variable occurrences, asks the oracle about each reduced formula, and accepts when it answers yes once. On a no-instance every reduced formula is unsatisfiable, so the oracle always answers no.

          NP ⊆ RP^A for every language A solving PromiseUSAT.

          NP ⊆ RP^USAT, with the encodings of the uniquely satisfiable formulas as oracle. This form is weak: USAT as a language is coNP-hard, so even P relative to it contains NP. The Valiant–Vazirani content is the promise version NP_subset_RPWithPromiseOracle_PromiseUSAT, whose algorithm only relies on the oracle's answers on uniquely satisfiable and unsatisfiable formulas.