**Definition** \(P=\cup_{k\geq 1}TIME(n^k)\)

**Definition** A polynomial-time TM is a TM with running time \(O(n^k)\) for some \(k\in\mathbb{N}\)

A language \(L\in P\) iff it can be decided by a single-tape polynomial-time TM.

**Theorem** \(L\in P\) iff it can be decided by a polynomial-time

- single tape TM
- multi-tape TM
- RAM algorithm.
- ...

**Proof Idea** Show that single tape TM can simulate other models with only a polynomail slowdown.

**Cobham-Edmonds Thesis** Any problem that can be solved efficiently, by some physical computer has a corresponding language that is in \(P\).

**Challenge** Quantum Computation

**Theorem** For any polynomial-time TM \(A\) and any polynomial-time subroutine TM \(B\) that calls \(A\) as a black box (and counts as \(1\) transition), there is a single-tape TM \(C\) also runs in polynomial-time and behaves exactly as \(B\).

\(TIME(n^k)\) is not closed under subroutine calls for any \(k\geq 1\).

- \(TIME(1)\) (constant time) is closed.
- \(E=\cup_{k\geq 1}TIME(k^n)=\cup_{k\geq 1}TIME(2^{kn})\) is not closed
- \(EXP=\cup_{k\geq 1}TIME(2^{n^k})\)

For many languages, there is a simple brute-force search algorithm that decides the language in exponential time.

- 2COL: \(2^n\) possible coloring to check
- 3COL: \(3^n\) possible coloring to check
- SAT: \(2^n\) assignments
- PRIMES: \(2^n\) factors to check for a # w n binary digits

For each of these language \(L\), showing that \(L\in P\) means that we can do exponentially better than brute force search.

**Definition** The running time of NTM is a function \(t:\mathbb{N}\rightarrow\mathbb{N}\) where \(t(n)\) is the maximum number of transitions followed on any valid computation path before the NTM halts and over any input of length n.

**Definition** \(NTIME(t(n))\) is the class of languages that can be decided by an NTM with running time \(O(t(n))\)

**Definition** NP=\(\cup_{k\geq 1}NTIME(n^k)\).

**Definition** The language \(L\) is efficiently verifiable, if there is a polynomail-time deterministic TM \(M\) that satisties

\(\forall x\in L\), there exist \(C=\{0,1\}^*\) of length \(|c|=poly(|x|)\) such that \(M\) accepts \(<x,c>\)

\(\forall x\not\in L\), \(\forall C=\{0,1\}^*\) of length \(|c|=poly(|x|)\), \(M\) rejects \(<x, c>\)

**Theorem** \(L\in NP\) iff \(L\) is efficiently verifiable.

**Proof** Efficient verifiable \(\Rightarrow\) \(L\in NP\).

We can build a NTM to guess the certificant and call the verifunc as a subroutine

NP \(\Rightarrow\) Efficient verifable

Use the certificate to determine which transitions to follow in a (deterministic) simulator of the NTM that decides \(L\).