is closed downwards under Karp reductions
ProvedPvsNP.mem_P_of_polyTimeReducibleIf and , then . Composing the polynomial-time reduction with the polynomial-time decision procedure for gives a polynomial-time decision procedure for ; the composition of two polynomial-time computable functions is polynomial-time computable.
import Definitions.Def_PvsNP_reductions
namespace PvsNP
theorem mem_P_of_polyTimeReducible (L K : DecisionProblem)
(hLK : PolyTimeReducible L K) (hK : K ∈ P) : L ∈ P := by sorry
end PvsNPRead-back
What the Lean code literally says, in plain math · aristotle-harmonic
The statement is universally quantified over two decision problems and — total functions from finite bitstrings to Booleans — and takes two hypotheses.
The first hypothesis is that is polynomial-time many-one reducible to : there exists a function from bitstrings to bitstrings, computable by a two-stack Turing machine within a polynomial number of steps in the encoded input length, such that as Booleans for every bitstring (so the correspondence holds for both accepted and rejected inputs).
The second hypothesis is that , i.e. some two-stack Turing machine computes within a polynomial number of steps in the encoded input length.
The conclusion is , in the same sense for .
The direction of the reduction matters: the reducible problem is and the target is , and the conclusion is about . Neither hypothesis can be satisfied vacuously — for any the identity reduction witnesses — and nothing here refers to .