Reduction & Diagonal Method - 0x03

之前[计算理论]({{< relref "post/2025-01-14-computation-theory.md" >}})的坑还没填完.. 但是后面很多内容都在这本复杂性里面,于是先看这个了

Hierarchy, Diagonalization (and its limitations), Circuit Complexity forms the Chapter 9 INTRACTABILITY in Sipser's book🤣

先挂一张 reduction graph

首先将判定问题扩展到搜索问题.

回顾我们是怎么证 SATSATNP\mathbf{NP}-hard 的, 是假设给到了任意一个 NP\mathbf{NP} 语言, 根据这个语言造一个逻辑表达式. 由于 LLNP\mathbf{NP} 的,一定存在确定性图灵机 MM,使得 xL    u{0,1}poly(x),  M(x,u)=1x\in L\iff\exists u\in\{0,1\}^{\text{poly}(x)},\;M(x,u)=1. 我们构造一个逻辑表达式,它描述了图灵机 MM 每一步的状态直到接受,所需满足的条件. (有一个细节,我们需要根据原来的图灵机构造一个 22 纸带图灵机,有一条是只读带,而且图灵机的指针移动和输入内容无关,只和输入长度有关,这样的图灵机称为 Oblivious TM). 这样一来,逻辑表达式只需要描述 44 个条件:

这样的一个归约函数 ff 不仅满足 xL    f(x)=1x\in L\iff f(x)=1, 而且将 xx 的一个 witness 转换成了逻辑表达式的一个赋值. 同时,由于这个逻辑公式完全符合图灵机的运行情况,一个使表达式为真的赋值也对应了一个 witness. 这样的归约称为 Levin reduction, 可被用于搜索问题上(搜索问题就是找到一个 witness).

Thm 1. 如果 P=NP\mathbf{P}=\mathbf{NP},那么对任意 LNPL\in\mathbf{NP}, verifier MM, 存在多项式时间的确定性图灵机 BB, 对于任意输入 xLx\in L, M(x,B(x))=1M(x,B(x))=1.

Pf. 首先, 如果我们对 L=SATL=SAT 证明了这个结论并得到 BSATB_{SAT},那么任何 LNPL\in\mathbf{NP}, 对于一个 Levin 归约 ff,将 f(x)f(x) 作为输入给到 BSATB_{SAT} 得到一个赋值后,将赋值转化成一个 witness 即可. 下面证明对于 SATSAT 上面的论断成立.

BB 如何构造?首先由于 P=NP\mathbf{P}=\mathbf{NP}, 存在多项式算法 AA 确定 SATSAT 问题. 对于一个逻辑表达式 ϕ\phiBB 先用 AA 确定 ϕ\phi 是否可满足;然后假设第一个变量 x1=1x_1=1,得到 ϕ1\phi_1. 我们知道如果 ϕ\phi 可满足, 那么 ϕ[x1=1]\phi[x_1=1]ϕ[x1=0]\phi[x_1=0] 必有一个可满足,因此跑一次 AA 就够了. 这样一来,运行时间为 ntime(A)n\text{time}(A), 多项式;同时记录下每个赋值,就是计算出了一个 witness. \blacksquare

coNP\mathbf{coNP}

Def. coNP={L:LNP}\mathbf{coNP}=\{L:\overline{L}\in\mathbf{NP}\}

即,存在一个确定性图灵机 MM 和多项式 pp, 对任意 xx,

xL    u{0,1}p(x),  M(x,u)=0.x\in L\iff\forall u\in\{0,1\}^{p(x)},\;M(x,u)=0.

注意核心的区别不在于输出 00 还是 11, 在于中间的量词是存在还是任意.

定义 TAUTO={ϕ:  ϕ}TAUTO=\{\phi:\;\vdash\phi\}, 有

Thm 2. TAUTOTAUTOcoNP\mathbf{coNP}-complete 语言.

Pf. 首先对于 ϕ∉TAUTO\phi\not\in TAUTO 存在一个 witness 让 ϕ\phi 的值为 false, 因此属于 coNP\mathbf{coNP}.

下证所有 LcoNPL\in\mathbf{coNP}TAUTOTAUTO 容易. 可以知道 LNP\overline{L}\in\mathbf{NP}, 因此根据 Cook-Levin 定理的证明,存在多项式可计算的归约函数,xLf(x)x\in\overline{L}\to f(x) 可满足,xLf(x)x\in L\to f(x) 不可满足. 直接取 ¬f(x)\neg f(x) 就是 tautology.

Diagonal Method

回顾一道妙题:

Ex. Prove that TOT={x:x=M,M halts on every input}TOT=\{x:x=\langle M\rangle,M\text{ halts on every input}\} is undecidable.

Pf. Soppose there exists a decider TM RR. Construct a TM TT that operates on input xx: run RR on input xx, if RR rejects, halt; if RR accepts, simulate MM on input xx where x=Mx=\langle M\rangle.

For all possible input xx, if x=MTOTx=\langle M\rangle\in TOT, then MM halts and TT halts; if not, RR rejects and TT also halts. Thus TTOT\langle T\rangle\in TOT.

However, consider T(T)T(\langle T\rangle). Since TTOT\langle T\rangle\in TOT, TT will simulate TT on input T\langle T\rangle recursively and without terminating, a contradiction.

Thm 3. (Deterministic time hierarchy thm) If f,gf,g are time-constructible functions that f(n)logf(n)=o(g(n))f(n)\log{f(n)}=o(g(n)), then DTIME(f(n))DTIME(g(n))\mathbf{DTIME}(f(n))\subsetneq\mathbf{DTIME}(g(n)).

Pf. For simplicity we relax the condition to f(n)=n,g(n)=n1+ϵf(n)=n,g(n)=n^{1+\epsilon} for all ϵ\epsilon.

Goal: find a language that can be decided in O(g(n))O(g(n)) time but never in O(f(n))O(f(n)) time.

A Turing Machine DD operates like this: on input xx, run the universal TM U\mathcal{U} for x1+ϵ|x|^{1+\epsilon} steps, simulating the TM MxM_x on input xx. If the step is used up, reject. Otherwise output the opposite of the answer of the simulation.

The language LL that is decided by TM DD is a member of class DTIME(n1+ϵ)\mathbf{DTIME}(n^{1+\epsilon}). For contradiction, assume LDTIME(n)L\in\mathbf{DTIME}(n), then there exists a TM MM, on input xx, outputs D(x)D(x) in O(x)O(|x|) steps Thus the universal TM U\mathcal{U} that simulates MM on input M\langle M\rangle operates in at most O(MlogM)O(|\langle M\rangle|\log{|\langle M\rangle|}) steps. For enough large n=Mn=|\langle M\rangle|, cnlogn<n1+ϵcn\log{n}\lt n^{1+\epsilon}, so the simulation halts in advance. By definition the output of DD on input M\langle M\rangle is the opposite of D(M)D(\langle M\rangle), which is a contradiction. \blacksquare

Thm 4. (Ladner) If PNP\mathbf{P}\not=\mathbf{NP}, then there is a language LNPPL\in\mathbf{NP}\setminus\mathbf{P} that is not NP\mathbf{NP}-complete.

Pf. The key is the language SATH={ϕ01nH(n):ϕSAT,n=ϕ}SAT_H=\{\phi01^{n^{H(n)}}:\phi\in SAT,n=|\phi|\} with H:NNH:\mathbb{N}\mapsto\mathbb{N}.

(to be completed)


参考资料