Padding argument
In-game article clicks load inline without leaving the challenge.
In computational complexity theory, the padding argument is a tool to conditionally prove that if some complexity classes are equal, then some other bigger classes are also equal. This type of argument is also sometimes used for space complexity classes, alternating classes, and bounded alternating classes.
Example
EXP=NEXP
Theorem. If P=NP then EXP=NEXP.
Proof. E X P ⊆ N E X P {\displaystyle {\mathsf {EXP}}\subseteq {\mathsf {NEXP}}} by definition, so it suffices to show N E X P ⊆ E X P {\displaystyle {\mathsf {NEXP}}\subseteq {\mathsf {EXP}}}.
Let L be a language in NEXP, so there is a non-deterministic Turing machine M that verifies x ∈ L {\displaystyle x\in L} in nondeterministic time 2 | x | c {\displaystyle 2^{|x|^{c}}}, for some constant natural number c. Now define the padded language
L ′ = { x 1 2 | x | c ∣ x ∈ L } , {\displaystyle L'=\{x1^{2^{|x|^{c}}}\mid x\in L\},}
where '1' is a symbol not occurring in L.
L ′ {\displaystyle L'} is in NP: Given input x ′ {\displaystyle x'}, first verify that it has the form x ′ = x 1 2 | x | c {\displaystyle x'=x1^{2^{|x|^{c}}}} and reject if it does not. If it has the correct form, verify x ∈ L {\displaystyle x\in L} using M, which takes non-deterministic time 2 | x | c = p o l y ( | x ′ | ) {\displaystyle 2^{|x|^{c}}={\mathsf {poly}}(|x'|)}.
By the assumption P=NP, L ′ {\displaystyle L'} is in P, so there is a deterministic machine DM that decides L ′ {\displaystyle L'} in polynomial time.
We can then decide L in deterministic exponential time. Given input x {\displaystyle x}, write down x ′ = x 1 2 | x | c {\displaystyle x'=x1^{2^{|x|^{c}}}}, and use DM to decide if x ′ ∈ L ′ {\displaystyle x'\in L'}. This takes time p o l y ( | x | + 2 | x | c ) = E X P ( | x | ) {\displaystyle {\mathsf {poly}}(|x|+2^{|x|^{c}})={\mathsf {EXP}}(|x|)}.
Ladner's theorem
Another theorem proven by the padding argument is
Ladner's theorem. If P ≠ N P {\displaystyle {\mathsf {P}}\neq {\mathsf {NP}}} then there exists a computational problem that is NP-intermediate: in N P ∖ P {\displaystyle {\mathsf {NP}}\setminus {\mathsf {P}}} but not NP-complete.
Proof. Assume that P ≠ N P {\displaystyle {\mathsf {P}}\neq {\mathsf {NP}}}. Let SAT be the satisfiable formula language. It is NP-complete. Now, given any function H : N → N {\displaystyle H:\mathbb {N} \to \mathbb {N} } such that H ( n ) {\displaystyle H(n)} is computable in p o l y ( n ) {\displaystyle {\mathsf {poly}}(n)} time, we can define the padded languageS A T ∗ := { ϕ 1 | ϕ | H ( | ϕ | ) : ϕ ∈ S A T } {\displaystyle {\mathsf {SAT}}^{*}:=\{\phi 1^{|\phi |^{H(|\phi |)}}:\phi \in {\mathsf {SAT}}\}}Claim 1: SAT* is NP. This is demonstrated by this algorithm
- Given a formula ϕ {\displaystyle \phi }, if it does not conform to the format of SAT*, return False.
- Else, remove its padding to obtain a shorter formula ϕ ′ {\displaystyle \phi '}, and test whether the padding has length H ( | ϕ ′ | ) {\displaystyle H(|\phi '|)}. If not, return False.
- Else, check if ϕ ′ ∈ S A T {\displaystyle \phi '\in {\mathsf {SAT}}} in nondeterministic time p o l y ( | ϕ ′ | ) ≤ p o l y ( | ϕ | ) {\displaystyle {\mathsf {poly}}(|\phi '|)\leq {\mathsf {poly}}(|\phi |)}.
Claim 2: If H {\displaystyle H} is bounded, then SAT* is NP-complete. Since H {\displaystyle H} is bounded, padding takes in polynomial time, reducing SAT to SAT*.
Claim 3: If H → ∞ {\displaystyle H\to \infty }, then SAT* is not NP-complete.
Assume otherwise, then there is an algorithm T {\displaystyle T}, which reduces the SAT problem to SAT* in time n c {\displaystyle n^{c}}. Then, we can decide SAT in polynomial time as follows:
- Given some formula ϕ {\displaystyle \phi }, if T ( ϕ ) {\displaystyle T(\phi )} does not conform to the format of SAT*, return False.
- Else, by runtime upper bound, | ϕ 1 | H ( | ϕ 1 | ) + | ϕ 1 | = | ϕ 1 1 | ϕ 1 | H ( | ϕ 1 | ) | = | T ( ϕ ) | ≤ | ϕ | c {\displaystyle |\phi _{1}|^{H(|\phi _{1}|)}+|\phi _{1}|=|\phi _{1}1^{|\phi _{1}|^{H(|\phi _{1}|)}}|=|T(\phi )|\leq |\phi |^{c}}.
- We repeat this process, each time obtaining a shorter formula ϕ 1 , ϕ 2 , … {\displaystyle \phi _{1},\phi _{2},\dots } until we either hit a formula that does not conform to the format of SAT*, and we return False or obtain a formula ϕ k {\displaystyle \phi _{k}} with length | ϕ k | ≤ C {\displaystyle |\phi _{k}|\leq C} for some constant C {\displaystyle C}, in which case we simply brute force enumerate all O ( 2 C ) {\displaystyle O(2^{C})} possible truth value assignments for ϕ k {\displaystyle \phi _{k}}. If ϕ k {\displaystyle \phi _{k}} is satisfiable, then return True, else return False.
Provided that C {\displaystyle C} is chosen large enough so that H ( m ) > 2 c {\displaystyle H(m)>2c} for all m > C {\displaystyle m>C}, we can make it so that every iteration reduces the length: | ϕ 1 | 2 ≤ | ϕ | , | ϕ 2 | 2 ≤ | ϕ 1 | , … , | ϕ k | 2 k ≤ | ϕ | {\displaystyle |\phi _{1}|^{2}\leq |\phi |,|\phi _{2}|^{2}\leq |\phi _{1}|,\dots ,|\phi _{k}|^{2^{k}}\leq |\phi |}Thus, this requires k = O ( ln ln | ϕ | ) {\displaystyle k=O(\ln \ln |\phi |)} iterations, and thus the whole algorithm runs in time p o l y ( | ϕ | ) {\displaystyle {\mathsf {poly}}(|\phi |)}. The idea is similar to kernelization.
Step 4: Construct an H {\displaystyle H}, such that H {\displaystyle H} is polytime computable, H → ∞ {\displaystyle H\to \infty }, and SAT* is not P.
Define H {\displaystyle H} as follows: H ( 0 ) = 0 , H ( 1 ) = 1 {\displaystyle H(0)=0,H(1)=1}, and for larger n {\displaystyle n}, H ( n ) {\displaystyle H(n)} is the smallest positive integer i {\displaystyle i}, such that
- i ≤ f ( n ) {\displaystyle i\leq f(n)}.
- For any ϕ {\displaystyle \phi } of length | ϕ | < g ( n ) {\displaystyle |\phi |<g(n)}, the Turing machine M i {\displaystyle M_{i}} correctly decides ϕ ∈ S A T ∗ {\displaystyle \phi \in {\mathsf {SAT}}^{*}} with runtime ≤ i | ϕ | i {\displaystyle \leq i|\phi |^{i}}.
- If no such Turing machine exists, then simply set H ( n ) = f ( n ) {\displaystyle H(n)=f(n)}.
where f ( n ) = g ( n ) = ⌈ ln ln n ⌉ {\displaystyle f(n)=g(n)=\lceil \ln \ln n\rceil } are two functions designed to make H ( n ) {\displaystyle H(n)} computable in time p o l y ( n ) {\displaystyle {\mathsf {poly}}(n)}.
Claim: H ( n ) {\displaystyle H(n)} is well-defined and computable in p o l y ( n ) {\displaystyle {\mathsf {poly}}(n)}.
This is shown by induction on n {\displaystyle n}. The base cases are simply memorized. For the induction step, test all f ( n ) {\displaystyle f(n)} Turing machines on all 2 g ( n ) {\displaystyle 2^{g(n)}} possible formulas ϕ {\displaystyle \phi } of length | ϕ | ≤ g ( n ) {\displaystyle |\phi |\leq g(n)}, for i | ϕ | i ≤ f ( n ) g ( n ) f ( n ) {\displaystyle i|\phi |^{i}\leq f(n)g(n)^{f(n)}} steps. We also need to test whether ϕ ∈ S A T ∗ {\displaystyle \phi \in {\mathsf {SAT}}^{*}}, which takes up to 2 g ( n ) {\displaystyle 2^{g(n)}} time by checking all rows of its truth table. The total time taken is bounded above by f ( n ) 2 g ( n ) f ( n ) g ( n ) f ( n ) + 2 g ( n ) 2 g ( n ) ≤ p o l y ( n ) {\displaystyle f(n)2^{g(n)}f(n)g(n)^{f(n)}+2^{g(n)}2^{g(n)}\leq {\mathsf {poly}}(n)}Now, if SAT* is in P, then let M m {\displaystyle M_{m}} be a machine that decides SAT* in time C n C ′ {\displaystyle Cn^{C'}}. For sufficiently large n {\displaystyle n} such that f ( n ) > max ( C , C ′ , m ) {\displaystyle f(n)>\max(C,C',m)}, the construction allows M m {\displaystyle M_{m}} to be considered in the construction of H ( n ) {\displaystyle H(n)}. This shows that, for all large enough n {\displaystyle n}, we have H ( n ) = m {\displaystyle H(n)=m}, and so by claim 2, SAT* is NP-complete, but then we have an NP-complete problem that is in P, contradicting the assumption that P ≠ N P {\displaystyle {\mathsf {P}}\neq {\mathsf {NP}}}.
Thus, SAT* is not in P. This implies that H ( n ) {\displaystyle H(n)} would be forced to grow towards infinity. By Claim 3, SAT* is not NP-complete.
See also
- Arora, Sanjeev; Barak, Boaz (2009), , Cambridge, p.57, ISBN978-0-521-42426-4