\documentclass[11pt]{article}
%\usepackage{psbox}
\usepackage{amsmath,amssymb,complexity}
\usepackage{algorithm, algorithmic}
\usepackage{graphicx}


\textwidth=6in
\oddsidemargin=0.25in
\evensidemargin=0.25in
\topmargin=-0.1in
\footskip=0.8in
\parindent=0.0cm
\parskip=0.3cm
\textheight=8.00in
\setcounter{tocdepth} {3}
\setcounter{secnumdepth} {2}
\sloppy


\newtheorem{example}{Example}
\newcommand{\ntime}{\hbox{NTIME}}
\newcommand{\nspace}{\hbox{NSPACE}}
\newcommand{\conspace}{\hbox{co-NSPACE}}
\newcommand{\np}{\hbox{NP}}
\newcommand{\pspace}{\hbox{PSPACE}}
\newcommand{\lspace}{\hbox{L}}
\newcommand{\conp}{\hbox{coNP}}
\newcommand{\exptime}{\hbox{EXPTIME}}
\newcommand{\elem}{\hbox{E}}
\newcommand{\nl}{\hbox{NL}}
\newcommand{\bpp}{\hbox{BPP}}

\newcommand{\nregexp}{\hbox{NREGEXP}}

\newcommand{\tqbf}{\hbox{TQBF}}
\newcommand{\threesat}{\hbox{3SAT}}
\newcommand{\cvp}{\hbox{CVP}}
\newcommand{\stconn}{\hbox{STCONN}}
\newcommand{\ispath}{\hbox{ISPATH}}


%\newcommand{\class}{\hbox{$\mathbb{C}$}} 
%\newcommand{\class}{\hbox{$\mathbf{C}$}} 


\newcommand{\lep}{\leq _{\hbox{P}}}
\newcommand{\lel}{\leq _{\hbox{L}}}
\newcommand{\aspace}[1]{{\rm ASPACE}(#1)}
\newcommand{\atime}[1]{{\rm ATIME}(#1)}
\newcommand{\spa}[1]{{\rm SPACE}(#1)}
\newcommand{\ti}[1]{{\rm TIME}(#1)}
\newcommand{\ap}{{\rm AP}}
\newcommand{\al}{{\rm AL}}

\begin{document}
\input{preamble.tex}
\lecture{3}{Mar 9, 2009}{Jayalal Sarma M.N.}{Xiaohui Bei}

Last time we introduced the Hierarchy Theorem which discuss the
relationship among deterministic complexity classes, in both time and
space aspects. We also introduced nondeterminism, and proved Savitch's
Theorem which relates space-bounded nondeterminism to space-bound
determinism.

In today's lecture, first we continue our discussion about the
space-bounded nondeterminism. We show that most of such classes are
closed under complements. Then we give a short description of oracle
turing machines and notion of relativisation, and talk about the
limitation of such property, which gives us a sense that why the \P vs
\NP question is so hard to settle.

\section{Space-bounded Nondeterminism}

For any complexity class $C$, we let $coC$ be the class of complements
of sets in $C$, i.e. $coC = \{L | \overline{L} \in C\}$. Deterministic
complexity classes are closed under complementation, while this is not
always true for undeterministic cases. For example, the relation
between \NP and \hbox{coNP} is still a open question left to us.
However, if we consider the nondeterministic space-bounded classes $C$,
the following theorem shows that $C$ and $coC$ are actually same.

\begin{theorem}[Immerman-Szlepcsenyi theorem]

  $\nspace(s(n)) = \conspace(s(n))$ for all $s(n) \geq \log{n}$.

\end{theorem}

\begin{proof}
We need to show that for any $L \in \nspace(s(n))$, there exist
a NTM that computes $\overline{L}$. Recall that to compute
$\overline{L}$ is to check if all computation paths start from
$\alpha_0$ (the initial configuration) lead to rejection.

We define a predicate $reach(\alpha, \beta, k)$, here $\alpha$ and
$\beta$ are both configurations and $k$ is an integer. $reach(\alpha,
\beta, k)$ means that $\beta$ is reachable from $\alpha$ in at most
$k$ steps, that is, that there exist a sequence $\alpha = \alpha_0,
\alpha_1, \ldots, \alpha_{k-1}, \alpha_k = \beta$, where $\alpha_{i-1}
\rightarrow \alpha_i$ or $\alpha_{i-1} = \alpha_i$ for each $i = 1, 2,
\ldots, k$. First we show that there exist a NTM which can computes
$reach(\alpha, \beta, k)$ in space $O(s(n) + \log{k})$.

\begin{claim}
  $reach(\alpha, \beta, k)$ can be tested in $\nspace(s(n) + \log{k})$.
\end{claim}

\begin{proof}
  The NTM $M$ does the following: Let $\gamma_0 = \alpha$. For each $i
  = 1, 2, \ldots, k-1$. $M$ guesses a configuration $\gamma_i$ and
  verifies that $\gamma_{i-1} \rightarrow \gamma_i$ or $\gamma_{i-1} =
  \gamma_i$. If the test fails at some step, $M$ refect. Finally $M$
  verifies that $\gamma_{k-1} = \beta$ and accepts if it holds.
 
  It's easy to see that $M$ accepts $(\alpha, \beta, k)$ if and only
  if $reach(\alpha, \beta, k)$. Storing the current configuration
  $\gamma_i$ costs $O(s(n))$ space, and the counter of $i$ costs
  $O(\log{k})$ space.  So $M$ uses space $O(s(n) + \log{k})$.
\end{proof}

Having this problem solved, we can now use it as a subroutine to solve
other problems. The next task would be constructing another NTM $M_1$
which computes $N_k$, the number of configurations reachable from a
given configuration $\alpha$ in no more than $k$ steps, using space
$O(s(n) + \log{k})$.

We let $M_1$ computes $N_1, N_2, \ldots, N_k$ one by one. First we
know $N_0 = 1$ ($\alpha$ is the only reachable configuration). Now
assume we have $N_{k-1}$ (induction) and want to compute $N_k$. In
order to do this, let $M_1$ runs the following procedure:

\begin{algorithmic}

  \STATE $N_k \leftarrow 0$
  \FORALL{configuration $\beta$}
    \STATE $\tau_{\beta} \leftarrow \FALSE$
    \FOR{$i = 1$ to $N_{k-1}$}
      \STATE Guess a configuration $\delta_i$.
      \STATE Verify $reach(\alpha, \delta_i, k-1)$.
      \STATE Verify $\delta_i \rightarrow \beta$ or $\delta_i = \beta$.
      \STATE If both of these conditions hold, set $\tau_{\beta}$ to \TRUE.
    \ENDFOR
    \IF{$\tau_{\beta} = \TRUE$}
      \STATE $N_k \leftarrow N_k + 1$
    \ENDIF
  \ENDFOR
  
\end{algorithmic}

It's easy to see that $M_1$ uses space $O(s(n) + \log{k})$ and it
indeed computes the number of reachable configurations from a given
configuration in no more than $k$ steps. And using this as a
subroutine, we can actually compute the number $N$ of all reachable
configurations from a given configuration. The idea is simple, just
find the smallest $k$ such that $N_k = N_{k+1}$, which means no
new configurations can be reached after $k$ steps. And $N = N_k$
is just the answer we wanted. Let $m$ be the maximum length of an accepting
path on some input $x$. Then, $m = 2^{O(s(n))}$. So we know $k \leq
2^{O(s(n))}$. Which means this NTM uses space $O(s(n) + \log{k}) =
O(s(n))$.

Finally, we will use $M$ and $M_1$ to construct our final NTM $M_2$
for $\overline{L}$ as follows:

First $M_2$ calls $M_1$ to compute the number $N$ of all reachable
configurations from the initial configuration $\alpha_0$. Then we
guess $N$ configurations $\gamma_1, \gamma_2, \ldots, \gamma_N$ one by
one, checks that each of them is reachable from $\alpha_0$ (using NTM
$M$) and none of them is an accepting path. If all of the above
conditions are checked, $M_2$ accepts, otherwise $M_2$ rejects the
computation path.
  
Following is the pseudocode of NTM $M_2$:

\begin{algorithmic}
  \STATE $N \leftarrow$ number of reachable configurations from the
  initial configuration.

  \STATE $k \leftarrow$ maximum length of an accepting path.

  \STATE \COMMENT{The above two values can be computed by simulating
    $M_1$}

  \STATE $flag \leftarrow \FALSE$

  \FOR{$i=1$ to $N$}
    \STATE Guess $\delta_i$.

    \STATE Check $reach(\alpha_0, \gamma_i, k)$ (by NTM $M$). If it's
    not true, $M_2$ rejects.

    \IF{$\gamma_i$ is an accepting configuration}
      \STATE $flag \leftarrow \TRUE$
    \ENDIF
  \ENDFOR
  \IF{$flag = \FALSE$} 
  \STATE $M_2$ accepts
  \ELSE
  \STATE $M_2$ rejects.
  \ENDIF
\end{algorithmic}

We claim that $M_2$ computes $\overline{L}$. First it's easy to see
that if $x \notin L$, which means all reachable configurations from
$\alpha_0$ are rejecting. So $M_2$ will guess all the reachable
configurations $\gamma_i$ and at least accept $x$. If $x \in L$, then
there exist one reachable configuration which is accepted. So either
$M_2$ will guess all the reachable configurations which contain this
one, or it will guess at least one nonreachable configuration. In
either cases the computation will lead to rejection.

Finally, it's not hard to show that $M_2$ also uses $O(s(n))$ spaces,
and by the tape compression theorem, we know the theorem holds.
\end{proof}

This result together with the ones proved in the last two lectures,
give us a relationship picture about time/space-bouneded complexity
classes, which is the best we know so far.

\begin{figure}[htbp]
\centering
\includegraphics[width=0.65\textwidth]{relation.png}
\caption{Relation among the complexity classes}
\end{figure}

\section{Relativization}

Roughly speaking, relativization of a statement with respect to (a
language) $A$ means giving each machine involved in that statement the
ability to access an $A$-oracle. If the statement still holds, we say
that it holds relative to A. And we say that a statement relativizes
if it holds relative to any language.

A very revealing fact is that many results we have in complexity
relativize. The reason behind this is that most of the techniques we
used so far all relativize, such as diagonalization, etc.

However, the relativization property also gives limitation to these
techniques on proving some results. Let's take the most famous \P vs
\NP problem as an example. One can prove the following result:

\begin{theorem}
  There exist oracles $A$ and $B$, such that $\P^A = \NP^A$ and $\P^B
  \neq \NP^B$.
\end{theorem}

In other words, neither of the statements $\P = \NP$ and $\P \neq \NP$
relativize. Which means that none of the techniques that relativize
have enough power to solve the \P vs \NP question. In order to settle
this ultimate problem, we need new ideas.
\end{document}
