Search problems: FNP, FP and TFNP #
A search problem is a relation R : α → List Bool → Prop between instances and solutions; the
task is to find, given a, some w with R a w Papadimitriou, Section 10.3,
Arora and Barak, Section 2.5. Solutions are bit strings, so the length of a
solution is the length of its description, as in Megiddo and Papadimitriou
[MP91]. Instances are encoded by enc : α ↪ List Bool, and a verifier reads
the pair encPair enc encBits (a, w) = frame (enc a) ++ w, as for Cslib.Complexity.NP.
Cslib.Complexity.FNP: relations that are polynomially balanced (every solution ofahas length at mostp (enc a).lengthfor a polynomialp) and polynomial-time decidable. These are the two conditions of Papadimitriou, Section 10.3. Balance is a property of the relation itself: unlike the certificates ofNP, solutions have no prescribed length.Cslib.Complexity.mem_FNP_iff_exists_boundedgives the equivalent form in which the length bound is part of the decided predicate.Cslib.Complexity.SolvesSearch R f: a functionf : α → Option (List Bool)solvesRiff a = some wonly for solutionswofa, andf a = noneonly whenahas no solution.Cslib.Complexity.FPSearch: the relations inFNPsolved by a polynomial-time function, with outputs encoded byencOption encBits. This is Papadimitriou's classFPof search problems Papadimitriou, Section 10.3; it is namedFPSearchto distinguish it from the class of polynomial-time computable functions.Cslib.Complexity.TFNP: the total relations inFNP, those for which every instance has a solution [MP91].
NP is the class of domains of FNP relations (Cslib.Complexity.mem_NP_iff_exists_FNP), and
the domain of a relation in FPSearch is in P (Cslib.Complexity.searchDomain_mem_P). Hence
FNP enc ⊆ FPSearch enc implies NP enc ⊆ P enc
(Cslib.Complexity.NP_subset_P_of_FNP_subset_FPSearch). The converse, and the search-to-decision
reduction for SAT, are in CslibFrontier.Computability.Complexity.Classes.TFNP.SearchToDecision.
Total problems arise from NP ∩ coNP: if A and its complement are domains of the FNP
relations R and S, then the disjoint sum Cslib.Complexity.searchSum R S, whose solutions are
true :: u for a solution u of R and false :: u for a solution u of S, is in TFNP.
Solving it in polynomial time decides A, so TFNP enc ⊆ FPSearch enc implies
NP enc ∩ coNP enc ⊆ P enc [MP91]
(Cslib.Complexity.NP_inter_coNP_subset_P_of_TFNP_subset_FPSearch). The converse is not known,
and no relation is claimed to be hard here.
Reductions #
A polynomial-time search reduction from R to S (Cslib.Complexity.SearchReducible) is a
pair of polynomial-time functions: f maps instances of R to instances of S, and g maps a
solution w of f a back to the solution g (a, w) of a. This is the reduction of Megiddo and
Papadimitriou [MP91] and of Johnson, Papadimitriou and Yannakakis
[JPY88] used for TFNP and its subclasses. For relations that need
not be total, f must in addition map instances with a solution to instances with a solution (as
in Levin reductions); otherwise a solver for S reporting that f a has no solution would say
nothing about a. For a total target, this condition holds automatically
(Cslib.Complexity.SearchReducible.of_isTotalSearch), so on TFNP the definition is exactly the
one-way condition of the literature. A search reduction is in particular a polynomial-time
many-one reduction between the domains (Cslib.Complexity.SearchReducible.polyTimeReducible).
Main definitions #
Cslib.Complexity.searchDomain,Cslib.Complexity.IsTotalSearch,Cslib.Complexity.SolvesSearch.Cslib.Complexity.FNP,Cslib.Complexity.FPSearch,Cslib.Complexity.TFNP.Cslib.Complexity.verifierSearch: the search problem of a verifier.Cslib.Complexity.searchSum: the disjoint sum of two search problems.Cslib.Complexity.SearchReducible,Cslib.Complexity.SearchHard,Cslib.Complexity.SearchComplete.
Main results #
Cslib.Complexity.FPSearch_subset_FNP,Cslib.Complexity.TFNP_subset_FNP.Cslib.Complexity.searchDomain_mem_NP,Cslib.Complexity.mem_NP_iff_exists_FNP:NPis the class of domains ofFNPrelations.Cslib.Complexity.searchDomain_mem_P,Cslib.Complexity.NP_subset_P_of_FNP_subset_FPSearch.Cslib.Complexity.searchSum_mem_TFNP,Cslib.Complexity.searchDomain_mem_P_of_searchSum_mem_FPSearch,Cslib.Complexity.NP_inter_coNP_subset_P_of_TFNP_subset_FPSearch: the bridge toNP ∩ coNP.Cslib.Complexity.SearchReducible.refl,Cslib.Complexity.SearchReducible.trans: search reducibility is a preorder.Cslib.Complexity.SearchReducible.mem_FPSearch,Cslib.Complexity.SearchReducible.isTotalSearch,Cslib.Complexity.SearchReducible.mem_TFNP: closure ofFPSearchand transfer of totality.Cslib.Complexity.SearchHard.subset_FPSearch: if a problem hard for a subclass ofFNPis inFPSearch, so is the whole subclass.
References #
Search problems and solvers #
A function that always returns a solution solves the search problem.
A solver of a total search problem never returns none.
The classes #
The search problems in FNP with respect to the encoding enc of instances: relations that
are polynomially balanced, every solution of a having length at most p (enc a).length for a
polynomial p, and decided by a polynomial-time function of the instance and the candidate
solution Papadimitriou, Section 10.3.
FNP with the length bound in the verifier. A relation is in FNP exactly when it holds
of the candidate solutions of length at most p (enc a).length accepted by a polynomial-time
verifier.
A polynomial-time solver of a total relation in FNP puts it in FPSearch.
A total relation in FPSearch has a polynomial-time function returning a solution.
Domains and NP #
The search problem of a polynomial-time verifier is in FNP.
A verifier verifies exactly the domain of its search problem.
Disjoint sums and NP ∩ coNP #
The disjoint sum of search problems whose domains cover all instances is total.
Solving a disjoint sum decides the first domain. If the domains of R and S are
disjoint and searchSum R S is in FPSearch, the domain of R is in P: an instance is in it
exactly when the solver returns a solution tagged true.
Search reductions #
A polynomial-time search reduction from R to S: a polynomial-time map f of
instances that maps instances with a solution to instances with a solution, and a
polynomial-time map g taking a solution w of f a back to a solution g (a, w) of a.
S is hard for the class 𝒞 of search problems under search reductions: every problem in
𝒞, with any encoding of its instances, reduces to S. This is HardUnder for
SearchReducible.
S is complete for the class 𝒞 of search problems: it is in 𝒞 and hard for it. This is
CompleteUnder for SearchReducible (searchComplete_iff_completeUnder), with its second conjunct
stated as SearchHard.
Search hardness is hardness under SearchReducible.
Search completeness is completeness under SearchReducible.
For a total target, the one-way condition on solutions suffices for a search reduction.
Every search problem reduces to itself.
Search reductions compose.
A search reduction to T on another instance type yields a search reduction, on the same
instance type, to the pullback fun a => T (f a) along its polynomial-time instance map f.
Classes defined by reductions to uniform families on the instance type itself use this to absorb
reductions across instance types.
FPSearch is closed under search reductions: an FNP relation that reduces to a relation
in FPSearch is in FPSearch.
Hardness transfers along search reductions.
A hard problem in FPSearch collapses the class. If every problem of 𝒞 is in FNP and
a 𝒞-hard problem is in FPSearch, then every problem of 𝒞 is in FPSearch.