Definition. Polytime Reduction [polytime-reduction]

Definition 1. Polytime Computable [polytime-computable]

For some function f:Σ*→Σ*f:\Sigma \ast \rightarrow\Sigma \ast, it is polytime computable if there exists a Turing machine that when given xx as input terminates with f(x)f(x) on the tape and runs in time poly(|x|)\text{poly}\left( |x| \right).

Let A,B⊆Σ*A,B \subseteq \Sigma \ast (Let AA and BB be languages). ff is a polytime reduction from AA to BB if:

  • ff is a polytime computable function
  • x∈A⇒f(x)∈Bx \in A\Rightarrow f(x) \in B (f(A)⊆Bf(A) \subseteq B)
  • x∉A⇒f(x)∉Bx \notin A\Rightarrow f(x) \notin B (f(A_⊆B_f(A^{\_} \subseteq B^{\_})

We then may say A≤PBA\underset{P}{\leq}B.

…helpful image…

Example. Polytime Reduction

Suppose A={0n10n:n≥0}A = \left\{ {0^{n}10^{n}:n \geq 0} \right\}, and B={1n01n:n≥0}B = \left\{ {1^{n}01^{n}:n \geq 0} \right\}. Claim: A≤PBA\underset{P}{\leq}B

What does this mean? It means there exists some function that can take a string, map it, and manipulate it so that if x∈Ax \in A, then x∈Bx \in B, and same for converses.

Proof.

Let ff be the function that flips the bits of its input. Then, we’re done.

  • x∈A⇒f(x)∈Bx \in A\Rightarrow f(x) \in B
  • x∉A⇒f(x)∉Bx \notin A\Rightarrow f(x) \notin B
  • f(x)∈B⇒x∈Af(x) \in B\Rightarrow x \in A
  • x∈A⇔f(x)∈Bx \in A\Leftrightarrow f(x) \in B
  • Note: these do not need to be bijections!

    • A reduction that simply sends all satisfiable inputs to 0 is fine.

Facets of Reductions [cpsc/reduction-facets]

Reductions are helpful!

  • Method: find a way to map:

    • yes-instances of P1P_{1} to yes-instances of P2P_{2}
    • no-instances of P1P_{1} to no-instances of P2P_{2}
  • Notation: P1≤PP2P_{1}\underset{P}{\leq}P_{2}
  • Logic: if P2P_{2} is easy, P1P_{1} is easy
  • Contrapositive: if P1P_{1} is hard, P2P_{2} is hard
Theorem.

If A≤PBA\underset{P}{\leq}B and B∈PB \in P, then A∈PA \in P.

  • There is a polytime Turing machine N that decides BB.
  • There is a polytime reduction ff from AA to BB.
Proof.

We want a Turing machine MM that decides AA in polynomial time.

  • On input xx: compute z=f(x)z = f(x) and then simulate NN on input zz. Accept iff NN accepts.
  • If x∈A⇒f(x)∈B⇒Nacceptsx \in A\Rightarrow f(x) \in B\Rightarrow N\ \text{accepts}.
  • If x∈A_⇒f(x)∉B⇒Nrejectsx \in A^{\_}\Rightarrow f(x) \notin B\Rightarrow N\ \text{rejects}.

Question. If we know AA reduces to BB and BB is in NP\text{NP}, is AA in NP\text{NP}?

Answer. Yes, P\text{P} is a subset of NP\text{NP}. Mind the direction!

When we talked about Turing machines, we had a notion of what it meant to be hard: undecidability. But now we’re talking about NP. So which problems in NP are hard?

Maybe P=NP\text{P} = \text{NP}, and so all problems in NP are easy.