User:Markneyer

define $$d\text{-WHEN}$$, a hierarchy of increasingly difficult problems
for any integer $$d$$ (for "difficulty"), the problem $$d$$-WHEN asks:

given integers $$(t,a,c)$$, are both of the following statements true? 1) $$ a < |c|^d $$ 2) there exists some input $$s$$ such that turing machine $$t$$ performs more than $$a$$ operations to decide $$s$$.

the problem is asking whether $$t$$ performs more than $$a$$ operations when deciding any input.

the business with $$c$$ is a bookkeeping trick; the only thing it does is put a restriction on given an instance of size $$n$$, the time in question, $$a$$ is bound by $$n^d$$.

the proof demonstrates that if $$P = NP$$, the bookkeeping is unnecessary because $$d$$ does not affect the actual amount of work needed to solve the problem.

proof:

 * given instance


 * $$ i = (t,a,c)$$


 * which has size


 * $$n = |i|$$
 * $$n = |t| + |a| + |c|$$
 * $$n = \log_2 t + \log_2 a + \log_2 c$$


 * determining whether statement 1 is true, and thus $$a < |c|^d$$, can be done peforming $$O(n)$$ operations.


 * therefore, the real 'meat' of solving $$d\text{-WHEN}$$ lies in determining whether statement 2 is true, i.e. whether $$t$$ will ever need to perform more than $$a$$ operations to decide any string.


 * a nondeterministic turing machine $$\aleph$$ guesses an input $$s$$ that causes $$t$$ to perform more than $$a$$ operations, and checks to see if this guess was correct by running $$t$$ on $$s$$.


 * if $$t$$ does not halt before performing $$a$$ operations, then the guess $$s$$ was correct, and $$\aleph$$ has solved the instance.


 * if $$t$$ decides $$s$$ before performing $$a$$ operations, then $$t$$ must not have have such an input, because nondeterministic machines always guess correctly.


 * thus, a nondeterministic turing machine can decide $$d\text{-WHEN}$$ in $$a$$ steps.


 * because


 * $$ a < |c|^d $$
 * $$ a < n^d $$


 * any instance of $$d$$-WHEN of size $$n$$ can be solved by a nondeterministic turing machine in $$O(n^d)$$ time.

corollary 1.1: $$d\text{-WHEN}\in \text{NP}$$
Since $$f(n) = n^d$$ is a polynomial of degree $$d$$, $$d\text{-WHEN}\in \text{NP}$$

theorem 2: $$\text{WHEN} \notin \text{P} $$
by removing the difficulty bound, we can define the problem $$\text{WHEN}$$, which asks:

given integers $$(t,a)$$: is there some input $$s$$ such that turing machine $$t$$ performs more than $$a$$ operations to decide $$s$$?

this language is known to require exponential time to decide. i can expand a proof later if necessary.

=hold on to your butts=

in this section, we will show that

$$P = NP \rightarrow \text{WHEN} \in P$$

which theorem 2 says is not the case, and thus prove that $$P \subset NP$$.

theorem 3: $$\text{P} \subset \text{NP}$$
the proof is by contradiction.

suppose $$P = NP$$
we shall prove that $$\text{WHEN} \in \text{P}$$, which contradicts theorem 2.

lemma 3.1: for every integer d > 1, $$ d-\text{WHEN}$$ can be solved in $$O(n)$$ time
given an instance

$$\delta = (t,a,c)$$ of $$d\text{-WHEN}$$,

we can create an instance

$$\epsilon = (t,a,c') = (t,a,2^{a + 1})$$.

note that


 * $$ a < a + 1$$
 * $$ a < |c|^1 $$

the only difference between $$\delta$$ and $$\epsilon$$ is $$c'$$.

changing the value of $$c$$ will not change whether there is some string $$s$$ that will cause $$t$$ to perform $$a$$ or more operations.

because $$ a < |c'|^1 $$, we can consider $$\epsilon$$ an instance of $$1\text{-WHEN}$$:


 * $$(t,a,c') \in 1\text{-WHEN} \longleftrightarrow (t,a,c) \in d\text{-WHEN}$$.

and thus $$\epsilon$$ can be decided by $$m$$ by performing no more than $$O(|\epsilon|)$$ operations.

constructing epsilon isn't even necessary
now, of course $$|\epsilon| > |\delta|$$, but that doesn't matter.

the value of $$c$$ is irrelevant to the real difficulty of the problem; because the difficulty of solving $$d\text{-WHEN}$$ only arises from determining whether $$t$$ performs more than $$a$$ operations.

this means $$m$$ can be modified not to halt as a result of the bound on $$a$$.

thus, we have shown that it is possible to convert an instance of $$d\text{-WHEN}$$ into an instance of $$1\text{-WHEN}$$, which $$\aleph$$ can solve in $$O(n)$$ time, regardless of $$d$$.

it is known, however, that no algorithm can solve $$\text{WHEN}$$ in time boudned by any polynomial, and thus our hypothesis ($$ P = NP $$) was incorrect.

note for those who object to hand waviness
the claim that a machine can be modified is not necessary; an earlier version of this proof used induction to show that if $$d\text{-WHEN}$$ could be solved in time bounded by $$n^k$$ for some constant $$k$$, then so can $$(d + 1)\text{-WHEN}$$:

if $$(t,a,c)$$ is a valid instance of $$(d+1)\text{-WHEN}$$ but not $$d\text{-WHEN}$$, then:


 * $$|c|^d < a < |c|^{d+1}$$


 * which we can use to a find a $$c'$$ such that $$|c'|^d = |c|^{d+1}$$:


 * $$ d (\log |c'|) = (d+1) (\log |c|)$$
 * $$ \log |c'| = {(d+1) \over d } \log |c|$$
 * $$|c'| = |c|^{(d+1) \over d }$$

$$c'$$ is big enough to satisfy the bound on $$a$$. for small values of $$d$$, this means $$c'$$ is substantially larger. as $$d$$ grows, the change in size becomes minimal:

$$ \delta_2 = n^2 $$

$$ \delta_3 = n^{3/2} $$

$$ \delta_4 = n^{4/3} $$

because $$|(t,a,c')| \leq |(t,a,c)|*2$$, solving a size $$n$$ instance of $$(d+1)\text{-WHEN}$$ can be done in $$O((2n)^d)$$ which is still $$O(n^d)$$.

=ergo $$P = NP$$=