Unbounded-error probabilistic time (PP)
DefinitionThe MAJSAT language#✓fully proved
MAJSAT is the decision problem that accepts a bitstring \(x\) exactly when \(x\) decodes, under the canonical bitstring encoding of pairs, to a pair \((u, \varphi)\) of a bitstring \(u\) and a CNF formula \(\varphi\) such that, with \(n = |u|\), every literal of \(\varphi\) has variable index less than \(n\), and more than half of the \(2^n\) assignments \(a : \{0, \dots, n-1\} \to \{\mathrm{true}, \mathrm{false}\}\) satisfy \(\varphi\), that is, twice their number exceeds \(2^n\). Only the length of \(u\) matters, and a bitstring that does not decode is rejected.
noncomputable def majSatDec :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode
(α := List Bool × Cslib.Logic.PL.CNF) x with
| some i => decide (
(∀ clause ∈ i.2, ∀ l ∈ clause, l.1 < i.1.length) ∧
2 * Set.ncard {a : Fin i.1.length → Bool |
Cslib.Logic.PL.CNF.Satisfies
(fun v => if h : v < i.1.length then a ⟨v, h⟩ else false) i.2} > 2 ^ i.1.length)
| none => false
abbrev DecisionProblem := List Bool → Bool
MathlibExt/Computability/Complexity.lean:170
def bitDecode [BitstringEncoding α] (l : List Bool) : Option α := toEncoding.decode l
MathlibExt/Computability/Complexity.lean:58
abbrev CNF := List CNFClause
CSLibExt/Logics/Propositional/CNF/Basic.lean:33
def Satisfies (assignment : Nat → Bool) (formula : CNF) : Prop :=
∀ clause ∈ formula, CNFClause.Satisfies assignment clause
CSLibExt/Logics/Propositional/CNF/Semantics.lean:71
Uses 12 · Used by 1
TheoremMAJSAT is PP-complete#●ready to prove
The MAJSAT language is in PP, and every decision problem in PP has a polynomial-time many-one reduction to MAJSAT.
public theorem_wanted majsat_pp_complete :
majSatDec ∈ PP ∧ ∀ L : MetaMathlibExt.ComplexityTheory.DecisionProblem,
L ∈ PP → Cslib.CookLevin.PolyManyOneRed L majSatDec
noncomputable def majSatDec :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode
(α := List Bool × Cslib.Logic.PL.CNF) x with
| some i => decide (
(∀ clause ∈ i.2, ∀ l ∈ clause, l.1 < i.1.length) ∧
2 * Set.ncard {a : Fin i.1.length → Bool |
Cslib.Logic.PL.CNF.Satisfies
(fun v => if h : v < i.1.length then a ⟨v, h⟩ else false) i.2} > 2 ^ i.1.length)
| none => false
WantedExt/Complexity/KeyTheorems/MAJSATPPCompleteWanted.lean:43
def PP : DecisionComplexityClass :=
{L | ∃ p : Polynomial ℕ, ∃ R : List Bool × List Bool → Bool, IsPolyTime R ∧
∀ x,
(L x = true →
2 * Set.ncard {r : Fin (p.eval x.length) → Bool | R (x, List.ofFn r) = true} >
2 ^ (p.eval x.length)) ∧
(L x = false →
2 * Set.ncard {r : Fin (p.eval x.length) → Bool | R (x, List.ofFn r) = true} ≤
2 ^ (p.eval x.length))}
CSLibExt/Computability/Complexity/Classes.lean:211
abbrev DecisionProblem := List Bool → Bool
MathlibExt/Computability/Complexity.lean:170
def PolyManyOneRed (L₁ L₂ : MetaMathlibExt.ComplexityTheory.DecisionProblem) : Prop :=
∃ reduce : List Bool → List Bool,
MetaMathlibExt.ComplexityTheory.IsPolyTime reduce ∧ ∀ x, L₁ x = L₂ (reduce x)
CSLibExt/Computability/CookLevin.lean:396
Sources
- J. Gill, "Computational complexity of probabilistic Turing machines", SIAM Journal on Computing 6 (1977), 675-695.
TheoremNP is contained in PP#●ready to prove
Every decision problem in NP also belongs to PP, the class of decision problems decided in probabilistic polynomial time with unbounded error.
public theorem_wanted np_subset_pp :
MetaMathlibExt.ComplexityTheory.NP ⊆ PP
def NP : DecisionComplexityClass :=
{ L | ∃ (p : Polynomial ℕ), ∃ R : (List Bool × List Bool) → Bool,
IsPolyTime R ∧
∀ x, L x ↔ ∃ w : List Bool, w.length ≤ p.eval x.length ∧ R (x, w) }
MathlibExt/Computability/Complexity.lean:200
def PP : DecisionComplexityClass :=
{L | ∃ p : Polynomial ℕ, ∃ R : List Bool × List Bool → Bool, IsPolyTime R ∧
∀ x,
(L x = true →
2 * Set.ncard {r : Fin (p.eval x.length) → Bool | R (x, List.ofFn r) = true} >
2 ^ (p.eval x.length)) ∧
(L x = false →
2 * Set.ncard {r : Fin (p.eval x.length) → Bool | R (x, List.ofFn r) = true} ≤
2 ^ (p.eval x.length))}
CSLibExt/Computability/Complexity/Classes.lean:211
Sources
- J. Gill, "Computational complexity of probabilistic Turing machines" (1977).
Uses 4
TheoremPP is contained in PSPACE#●ready to prove
Every decision problem in PP, the class of decision problems decided with unbounded error in probabilistic polynomial time, belongs to PSPACE.
public theorem_wanted pp_subset_pspace :
PP ⊆ PSPACE
def PP : DecisionComplexityClass :=
{L | ∃ p : Polynomial ℕ, ∃ R : List Bool × List Bool → Bool, IsPolyTime R ∧
∀ x,
(L x = true →
2 * Set.ncard {r : Fin (p.eval x.length) → Bool | R (x, List.ofFn r) = true} >
2 ^ (p.eval x.length)) ∧
(L x = false →
2 * Set.ncard {r : Fin (p.eval x.length) → Bool | R (x, List.ofFn r) = true} ≤
2 ^ (p.eval x.length))}
CSLibExt/Computability/Complexity/Classes.lean:211
def PSPACE : DecisionComplexityClass :=
{L | langOf L ∈ Cslib.Turing.MultiTapeTM.Classes.PSPACE}
CSLibExt/Computability/Complexity/Classes.lean:117
Sources
- J. Gill, "Computational complexity of probabilistic Turing machines" (1977); S. Arora and B. Barak, Computational Complexity: A Modern Approach, 2009 (PP ⊆ PSPACE).
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.