Documentation

CslibFrontier.Computability.Complexity.Classes.AverageCase.WorstCase

Worst-case consequences of easy-on-average NP #

If every distributional problem in DistNP has a polynomial-time heuristic scheme, then NE = E. This is a length-indexed form of the theorem of Ben-David, Chor, Goldreich and Luby for AvgP Ben-David, Chor, Goldreich and Luby (see Scope). The attribution is taken from Bläser and Manthey, §5. The proof is padding with a polynomial-time computable ensemble that puts mass 1/poly on every padded instance.

Heavy instances #

A heuristic scheme run with confidence parameter k errs with probability at most 1/(k+1) on each length. So it cannot err on an instance of larger probability (Cslib.Complexity.DistProblem.IsHeuristicScheme.correct_of_lt). An errorless scheme likewise answers every such instance (Cslib.Complexity.DistProblem.IsErrorlessScheme.correct_of_lt). Run with confidence q(|x|), a heuristic scheme becomes a single polynomial-time decider that is correct on every instance of probability at least 1/q(|x|) (Cslib.Complexity.exists_agree_of_mem_HeurP). When every instance in the support is that heavy, the decider is correct on the whole support (Cslib.Complexity.exists_agree_on_support_of_mem_HeurP).

Under the uniform ensemble a word x has probability 2^{-|x|}. With confidence 2^{|x|} the scheme decides L exactly, in time polynomial in 2^{|x|}. So (L, U) ∈ HeurP implies L ∈ E (Cslib.Complexity.mem_E_of_mem_HeurP_uniform).

Padded instances #

Cslib.Complexity.PaddedFrame.ensemble collapses the uniform ensemble at the prefix code of framed words (Cslib.Complexity.HeaderParser.ensemble). The padded word frame u ++ 1^m gets probability exactly 2^{-(2|u|+1)} (Cslib.Complexity.PaddedFrame.ensemble_dist_frame_append), and the ensemble is polynomial-time computable. If 2^{|u|} ≤ m and N = 2|u| + 1 + m, this probability is at least 1/(2N²). So under DistNP ⊆ HeurP, every problem in NP paired with this ensemble has a polynomial-time decider that is correct on all exponentially padded instances. That is the hypothesis Cslib.Complexity.ExpPaddedNPEasy of the padding argument (Cslib.Complexity.expPaddedNPEasy_of_DistNP_subset_HeurP), which gives NE ⊆ E and NEXP ⊆ EXP.

Scope #

Ben-David, Chor, Goldreich and Luby state the theorem for DistNP ⊆ AvgP in Levin's model, with a single distribution on all words. The statements here use the length-indexed ensembles and the scheme classes AvgP and HeurP of Bogdanov and Trevisan; no bridge between the two models is formalized. The HeurP form is stronger than the AvgP form Cslib.Complexity.NE_subset_E_of_DistNP_subset_AvgP because AvgP ⊆ HeurP (Cslib.Complexity.AvgP_subset_HeurP). The primary text has not been inspected, so its theorem number and the details of its proof are unverified. The proof here is a standard padding argument, and the HeurP strengthening is not claimed as new.

Main results #

References #

Heavy instances #

theorem Cslib.Complexity.DistProblem.IsHeuristicScheme.correct_of_lt {L : DistProblem} {A : List Bool × ℕ → Bool} (hA : L.IsHeuristicScheme A) {x : List Bool} {k : ℕ} (hx : (↑(k + 1))⁻¹ < (L.ens.dist x.length) x) :
A (x, k) = true ↔ x ∈ L.lang

A heuristic scheme is correct on heavy instances. Run with confidence parameter k, it errs with probability at most 1/(k+1) on each length. So it answers correctly on every instance of larger probability.

theorem Cslib.Complexity.DistProblem.IsErrorlessScheme.correct_of_lt {L : DistProblem} {A : List Bool × ℕ → Option Bool} (hA : L.IsErrorlessScheme A) {x : List Bool} {k : ℕ} (hx : (↑(k + 1))⁻¹ < (L.ens.dist x.length) x) :
∃ (b : Bool), A (x, k) = some b ∧ (b = true ↔ x ∈ L.lang)

An errorless scheme answers heavy instances. Run with confidence parameter k, it fails with probability at most 1/(k+1) on each length. So it answers every instance of larger probability, and correctly.

Heavy instances are decided in polynomial time. If L ∈ HeurP, then for every polynomial q a single polynomial-time decider is correct on every instance x of probability at least 1/q(|x|): run the heuristic scheme with confidence parameter q(|x|).

Exact decision on the support. If L ∈ HeurP and every instance in the support of the ensemble has probability at least 1/q(|x|), then a polynomial-time decider agrees with L on the support.

(L, U) ∈ HeurP implies L ∈ E. A word x has probability 2^{-|x|} under the uniform ensemble, so the heuristic scheme run with confidence parameter 2^{|x|} decides L exactly, in time polynomial in 2^{|x|}.

(L, U) ∈ AvgP implies L ∈ E.

The padded ensemble #

The framed word at the start of r, framed again: frame (unframe r).

A word begins with a framed word if header r is a prefix of it.

A word begins with a framed word exactly when it is frame u ++ s for some u and s.

The prefix code of framed words.

The padded ensemble: flip uniform bits until a framed word has been read, then pad it with ones.

The padded ensemble is polynomial-time computable.

A padded word frame u ++ 1^m has probability 2^{-(2|u|+1)} under the padded ensemble.

NE = E #

If DistNP ⊆ HeurP, then NP is easy on exponentially padded instances. For B ∈ NP, the distributional problem (B, PaddedFrame.ensemble) is in DistNP. A word frame u ++ 1^m of length N with 2^{|u|} ≤ m has probability 2^{-(2|u|+1)} ≥ 1/(2N²), so the heuristic scheme run with confidence 2N² decides B on it.

theorem Cslib.Complexity.NE_subset_E_of_DistNP_subset_HeurP {α : Type} {enc : α ↪ List Bool} (h : DistNP ⊆ HeurP) :
NE enc ⊆ E enc

If DistNP ⊆ HeurP, then NE ⊆ E Ben-David, Chor, Goldreich and Luby.

theorem Cslib.Complexity.E_eq_NE_of_DistNP_subset_HeurP {α : Type} {enc : α ↪ List Bool} (h : DistNP ⊆ HeurP) :
E enc = NE enc

If DistNP ⊆ HeurP, then E = NE Ben-David, Chor, Goldreich and Luby.

If DistNP ⊆ HeurP, then EXP = NEXP, by the same padding.

theorem Cslib.Complexity.NE_subset_E_of_DistNP_subset_AvgP {α : Type} {enc : α ↪ List Bool} (h : DistNP ⊆ AvgP) :
NE enc ⊆ E enc

If DistNP ⊆ AvgP, then NE ⊆ E: the AvgP form of the theorem of Ben-David, Chor, Goldreich and Luby Ben-David, Chor, Goldreich and Luby, for length-indexed ensembles rather than Levin's single distribution.

theorem Cslib.Complexity.E_eq_NE_of_DistNP_subset_AvgP {α : Type} {enc : α ↪ List Bool} (h : DistNP ⊆ AvgP) :
E enc = NE enc

If DistNP ⊆ AvgP, then E = NE Ben-David, Chor, Goldreich and Luby.

If E ≠ NE, then some distributional problem in DistNP has no polynomial-time heuristic scheme: NP is hard on average under some polynomial-time computable ensemble.