Binary witness trees, prefix sets and left sets #
A binary witness tree (Cslib.Complexity.WitnessTree) for a problem A : Set α encoded by
enc gives each instance x a polynomial-time unary witness length len x and a polynomial-time
verifier verify such that x ∈ A iff some bit string of length len x is accepted. Every NP
verifier (p, V) induces a binary witness tree (Cslib.Complexity.WitnessTree.ofIsVerifier).
The binary prefixes of length at most len x form a depth-len x search tree ordered
lexicographically (false < true). Two canonical derived sets live on α × List Bool:
prefixSet(Cslib.Complexity.WitnessTree.prefixSet): pairs(x, u)withu.length ≤ len xsuch thatuextends to a witness ofx. A problem whose prefix set reduces to a P-selective set (in particular, any prefix self-reducible P-selective set) lies inP(CslibFrontier/Computability/Complexity/Classes/Selective/Selman.lean).leftSet(Cslib.Complexity.WitnessTree.leftSet): pairs(x, w)of lengthlen xlexicographically at most some witness ofx, i.e., at most the lexicographically largest witness Arvind, Köbler and Mundhenk, Definition 2.3. At any levelk ≤ len x, padding a prefixuof lengthkwithfalsebits (pad) belongs toleftSetexactly whenuis at most the largest valid prefix of that level (Cslib.Complexity.WitnessTree.pad_mem_leftSet_iff_le).
Searching the tree level by level in decreasing lexicographic order (expand, searchWith,
acceptsWith) with a polynomial-time pruning rule that keeps the largest valid prefix of every
level and polynomially many nodes decides A in polynomial time
(Cslib.Complexity.WitnessTree.acceptsWith_iff_of_isLargest_mem_prune,
Cslib.Complexity.WitnessTree.computableInPolyTime_acceptsWith), powering
Arvind–Köbler–Mundhenk's bounded truth-table theorem
(CslibFrontier/Computability/Complexity/Classes/Sparse/BoundedTruthTable.lean).
Main definitions #
Cslib.Complexity.WitnessTree: polynomial-time fixed-length binary witness tree for a problem.Cslib.Complexity.WitnessTree.ofIsVerifier: the witness tree of anNPverifier.Cslib.Complexity.WitnessTree.prefixSet,Cslib.Complexity.WitnessTree.leftSet: prefix-extension and left sets.Cslib.Complexity.WitnessTree.pad: padding a prefix withfalseto witness length.Cslib.Complexity.WitnessTree.IsLargestPrefix: lexicographically largest valid prefix at its depth.Cslib.Complexity.WitnessTree.expand,Cslib.Complexity.WitnessTree.searchWith,Cslib.Complexity.WitnessTree.acceptsWith: level-by-level pruned binary-tree search.
Main results #
Cslib.Complexity.WitnessTree.replicate_false_le,Cslib.Complexity.WitnessTree.append_replicate_false_le_iff: lexicographic padding laws.Cslib.Complexity.WitnessTree.pad_mem_leftSet_iff_le: left-set membership on a level is an initial segment ending at the largest valid prefix.Cslib.Complexity.WitnessTree.acceptsWith_iff_of_isLargest_mem_prune: a pruning rule keeping the largest valid prefix of every level decidesA.Cslib.Complexity.WitnessTree.computableInPolyTime_acceptsWith: a pruned search with polynomial-time levels of polynomial width runs in polynomial time.
References #
A binary witness tree for a problem A : Set α encoded by enc: each instance x has
binary witnesses of polynomial-time unary length len x, checked by a polynomial-time verifier
verify.
- len : α → ℕ
The common bit length of witnesses of an instance.
The verifier checking a candidate witness of length
len x.The witness length is computable in polynomial time, in unary.
- verify_polytime : Turing.MultiTapeTM.ComputableInPolyTime self.verify (Turing.MultiTapeTM.encPair enc Turing.MultiTapeTM.encBits) Turing.MultiTapeTM.encBool
The verifier is computable in polynomial time.
Lexicographic padding #
The all-false word is lexicographically least among words of its length.
A word padded with false is lexicographically at most a word v of the same length exactly
when it is at most the prefix of v of its own length.
Construction from an NP verifier #
Every NP verifier (p, V) induces a binary witness tree with witness length
p.eval (enc x).length.
Prefix sets and left sets #
Padding a prefix to witness length is polynomial-time.
Left-set membership on a level. For a level containing the largest valid prefix c, the
padded nodes in T.leftSet are exactly those lexicographically at most c.
Level-by-level pruned binary-tree search #
Correctness of a pruned search that keeps the largest valid prefix. If prune returns a
sublist of every level and keeps the largest valid prefix of every decreasing level of depth
k ≤ T.len x, then acceptsWith T.len T.verify prune decides A.
Polynomial time #
A pruned search is polynomial-time when expanding and pruning one level is polynomial-time
uniformly in a polynomial-time parameter par x, the pruning rule keeps a subset of its input, and
each pruned level has at most width x nodes for a polynomially bounded width.