May 5, 2026
Q: Are there problems, which provably require very large time /space to be solved?
Example 1 k\text{-}\mathtt{CLIQUE}: does a graph G contain a k-clique?
Complexity of a problem: actually means
complexity of the corresponding language under some natural representation of inputs as words
Definition 1 A (deterministic) Turing machine M works in time t(n) (for a function t : \mathbb N \to \mathbb N) if for every input word of n symbols, M halts after at most t(n) steps.
Definition 2 A language L\subseteq \Sigma^* is decidable in time t(n) if there exists a (multitape) Turing machine M that recognizes the language and works in time t(n).
\mathbf{DTIME}(t(n)) :=\{L\subseteq\Sigma^* \mid L \text{ is decidable in time }\mathcal O(t(n))\}
\displaystyle\mathbf{P} :=\displaystyle\bigcup_{k\in \mathbb N}\mathbf{DTIME}(n^k)
i.e. all languages decidable in time p(n) for some polynomial p
\displaystyle\mathbf{EXPTIME} :=\displaystyle\bigcup_{k\in \mathbb N}\mathbf{DTIME}(2^{n^k})
Theorem 1 If f(n)=\mathcal O(g(n)), then \mathbf{DTIME}(f(n))\subseteq \mathbf{DTIME}(g(n)).
Proof. trivial (why?)
Q: If f(n)=\mathcal o(g(n)), is \mathbf{DTIME}(f(n))\subsetneq \mathbf{DTIME}(g(n))?
In other words, given asymptotically strictly more time, can we decide strictly more languages?
In general no for arbitrary functions, but yes for time-constructible functions. (next-class)
Theorem 2 (time hierachy theorem) If f,g are time-constructible and f(n)\ln f(n) = o(g(n)), then \mathbf{DTIME}(f(n))\subsetneq \mathbf{DTIME}(g(n))\ .
Proof. maybe a proof sketch next week
Corollary 1 \mathbf{P}\subsetneq \mathbf{EXPTIME}
Definition 3 A nondeterministic Turing machine M works in time f(n) (for a function f : \mathbb N \to \mathbb N) if for every input word of n symbols, every run of M (not only the accepting ones!) halts after at most f(n) steps.
\mathbf{NTIME}(t(n)) := all languages decidable on a nondeterministic Turing machine working in time t(n)
Theorem 3 \mathbf{DTIME}(t(n))\subseteq \mathbf{NTIME}(t(n)) (why?)
\displaystyle\mathbf{NP} \displaystyle:=\bigcup_{k\in \mathbb N}\mathbf{NTIME}(n^k)
\displaystyle\mathbf{NEXPTIME} \displaystyle:=\bigcup_{k\in \mathbb N}\mathbf{NTIME}(2^{n^k})
For every class of languages \mathscr C, the class \mathbf{co}\mathscr C is \mathbf{co}\mathscr C:=\{L\mid \overline L\in \mathscr C\}
Theorem 4 deterministic classes are equal to its co-classes, e.g. \mathbf{P}=\mathbf{coP}.
(why?)
for non-deterministic classes it is not clear at all:
Definition 4 (polynomial time relation) A relation R\subseteq \Sigma^*\times \Sigma^* is defined as the language of words v\$w with v,w\in \Sigma^* and \$\notin \Sigma. A relation is polynomial-time if
Example 2 \mathtt{HAM}: the language of (codes of) graphs in which there exists a Hamiltonian cycle.
Theorem 5 L\in \mathbf{NP} \iff there exists a polynomial-time relation R s.t. L=\{v\mid \exists w, v\$w\in R\}
Proof.
(\Leftarrow) The length of witnesses is bounded by some polynomial p.
(\Rightarrow) L is recognized by a nondeterministic machine M in time p(n).
Definition 5 A language L\subseteq \Sigma_1^* is polynomial time many-one reducible (or simply polynomially) reducible to L'\subseteq \Sigma_2^* (denoted as L\leq_m^p L') if there exists a function f: \Sigma_1^*\to \Sigma_2^* computable in polynomial time s.t.
w\in L \Leftrightarrow f(w)\in L'\ .
Theorem 6
Definition 6 (completeness) Given a complexity class \mathscr C, a language L is \mathscr C-complete (w.r.t. polynomial-time reductions) if
It is surprising that complete problems exist at all!
Theorem 7 The language \mathtt{TMSAT}:=\{\langle M,1^t,w\rangle \mid M \text{ is a nondeterm. TM that accepts } w\text{ in at most } t\text{ steps}\} is \mathbf{NP}-complete.
Proof. (sketch)
\mathtt{TMSAT} is not a very useful problem.
Q: Are there natural/interesting problems that are \mathbf{NP}-complete?
\mathtt{SAT}: the language of Boolean formulas that are satisfiable, i.e. that can be set to true by some assignment of their variables.
Theorem 8 (Cook, 1971) \mathtt{SAT} is \mathbf{NP}-complete
Proof. (sketch)
\mathtt{SAT}\in \mathbf{NP}: guess the satisfying assignment \mathtt{SAT} is \mathbf{NP}-hard:
Fix a language L recognized by a nondeterministic machine M in time bounded by a polynomial p(n)
Basing on the input word w, we need to construct (in polynomial time) a formula F such that w\in L iff F is satisfiable
Idea: variables store a run of M on the word w, the formula ensures correctness of the run.
Three kinds of variables:
The formula, a conjunction of the following
There is a long list of \mathbf{NP}-complete problems which are relevant in practice. For instance:
\mathbf{NP}-hardness shown by reduction from some other \mathbf{NP}-complete problem (e.g., from \mathtt{SAT}).