Padding argument

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. 𝖤𝖷𝖯⊆𝖭𝖤𝖷𝖯 by definition, so it suffices to show 𝖭𝖤𝖷𝖯⊆𝖤𝖷𝖯.

Let L be a language in NEXP, so there is a non-deterministic Turing machine M that verifies x∈L in nondeterministic time 2|x|c, for some constant natural number c. Now define the padded language

L′={x12|x|c∣x∈L},

where '1' is a symbol not occurring in L.

L′ is in NP: Given input x′, first verify that it has the form x′=x12|x|c and reject if it does not. If it has the correct form, verify x∈L using M, which takes non-deterministic time 2|x|c=𝗉𝗈𝗅𝗒(|x′|).

By the assumption P = NP, L′ is in P, so there is a deterministic machine DM that decides L′ in polynomial time.

We can then decide L in deterministic exponential time. Given input x, write down x′=x12|x|c, and use DM to decide if x′∈L′. This takes time 𝗉𝗈𝗅𝗒(|x|+2|x|c)=𝖤𝖷𝖯(|x|).

Ladner's theorem

Another theorem proven by the padding argument is

Ladner's theorem. If 𝖯≠𝖭𝖯 then there exists a computational problem that is NP-intermediate: in 𝖭𝖯∖𝖯 but not NP-complete.

Proof. Assume that 𝖯≠𝖭𝖯. Let SAT be the satisfiable formula language. It is NP-complete. Now, given any function H:ℕ→ℕ such that H(n) is computable in 𝗉𝗈𝗅𝗒(n) time, we can define the padded language𝖲𝖠𝖳∗:={ϕ1|ϕ|H(|ϕ|):ϕ∈𝖲𝖠𝖳}Claim 1: SAT* is NP. This is demonstrated by this algorithm

  • Given a formula ϕ, if it does not conform to the format of SAT*, return False.
  • Else, remove its padding to obtain a shorter formula ϕ′, and test whether the padding has length H(|ϕ′|). If not, return False.
  • Else, check if ϕ′∈𝖲𝖠𝖳 in nondeterministic time 𝗉𝗈𝗅𝗒(|ϕ′|)≤𝗉𝗈𝗅𝗒(|ϕ|).

Claim 2: If H is bounded, then SAT* is NP-complete. Since H is bounded, padding takes in polynomial time, reducing SAT to SAT*.

Claim 3: If H→∞, then SAT* is not NP-complete.

Assume otherwise, then there is an algorithm T, which reduces the SAT problem to SAT* in time nc. Then, we can decide SAT in polynomial time as follows:

  • Given some formula ϕ, if T(ϕ) does not conform to the format of SAT*, return False.
  • Else, by runtime upper bound, |ϕ1|H(|ϕ1|)+|ϕ1|=|ϕ11|ϕ1|H(|ϕ1|)|=|T(ϕ)|≤|ϕ|c.
  • We repeat this process, each time obtaining a shorter formula ϕ1,ϕ2,… until we either
    • hit a formula that does not conform to the format of SAT*, and we return False
    • or obtain a formula ϕk with length |ϕk|≤C for some constant C, in which case we simply brute force enumerate all O(2C) possible truth value assignments for ϕk. If ϕk is satisfiable, then return True, else return False.

Provided that C is chosen large enough so that H(m)>2c for all m>C, we can make it so that every iteration reduces the length: |ϕ1|2≤|ϕ|,|ϕ2|2≤|ϕ1|,…,|ϕk|2k≤|ϕ|Thus, this requires k=O(ln⁡ln⁡|ϕ|) iterations, and thus the whole algorithm runs in time 𝗉𝗈𝗅𝗒(|ϕ|). The idea is similar to kernelization.

Step 4: Construct an H, such that H is polytime computable, H→∞, and SAT* is not P.

Define H as follows: H(0)=0,H(1)=1, and for larger n, H(n) is the smallest positive integer i, such that

  • i≤f(n).
  • For any ϕ of length |ϕ|<g(n), the Turing machine Mi correctly decides ϕ∈𝖲𝖠𝖳∗ with runtime ≤i|ϕ|i.
  • If no such Turing machine exists, then simply set H(n)=f(n).

where f(n)=g(n)=⌈ln⁡ln⁡n⌉ are two functions designed to make H(n) computable in time 𝗉𝗈𝗅𝗒(n).

Claim: H(n) is well-defined and computable in 𝗉𝗈𝗅𝗒(n).

This is shown by induction on n. The base cases are simply memorized. For the induction step, test all f(n) Turing machines on all 2g(n) possible formulas ϕ of length |ϕ|≤g(n), for i|ϕ|i≤f(n)g(n)f(n) steps. We also need to test whether ϕ∈𝖲𝖠𝖳∗, which takes up to 2g(n) time by checking all rows of its truth table. The total time taken is bounded above by f(n)2g(n)f(n)g(n)f(n)+2g(n)2g(n)≤𝗉𝗈𝗅𝗒(n)Now, if SAT* is in P, then let Mm be a machine that decides SAT* in time CnC′. For sufficiently large n such that f(n)>max⁡(C,C′,m), the construction allows Mm to be considered in the construction of H(n). This shows that, for all large enough n, we have 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 𝖯≠𝖭𝖯.

Thus, SAT* is not in P. This implies that H(n) would be forced to grow towards infinity. By Claim 3, SAT* is not NP-complete.

See also

References