\documentclass{article}
\input{preamble.tex}

\newcommand{\p}{{\rm P}}
\newcommand{\np}{{\rm NP}}
\newcommand{\atm}{{\rm ATM}}
\newcommand{\otm}{{\rm OTM}}
\newcommand{\sat}{{\rm SAT}}
\newcommand{\cval}{{\rm CVAL}}
\newcommand{\good}{{\rm GOOD}}
\newcommand{\sigp}[1]{{\rm \Sigma_{#1}^P}}
\newcommand{\pip}[1]{{\rm \Pi_{#1}^P}}
\newcommand{\eqbf}[1]{{\rm \exists QBF_{#1}}}
\newcommand{\uqbf}[1]{{\rm \forall QBF_{#1}}}
\newcommand{\ph}{{\rm PH}}
\newcommand{\ppoly}{{\rm P/poly}}
\newcommand{\func}{\leftarrow}
\newcommand{\implied}{\Leftarrow}
\newcommand{\implies}{\Rightarrow}

\begin{document}

\lecture{5}{February 18, 1999}{Daniel A. Spielman}{Prahladh Harsha}

\section{Review of previous lecture}

In the last lecture, we defined the classes $\sigp{k}$, $\pip{k}$ and
$\ph$. $\sigp{k}$ is the class of languages $L$ accepted by a
polynomial time $\atm$ that begins in an existential ($\exists$) state
and alternates between existential ($\exists$) and universal
($\forall$) states atmost $k-1$ times. $\pip{k}$ is defined similarly
except that it begins with an universal ($\forall$) state. We then
gave another characterisation of $\sigp{k}$ and $\pip{k}$ as follows:
\begin{eqnarray*}
L \in \sigp{k} \hbox{ iff } \exists A \in \pip{k-1} \hbox{ and } c > 0
\hbox{ such that } w \in L \iff \exists_{(|y| \leq |x|^c)} y \hbox{
such that } (w,y) \in A
\end{eqnarray*}
$\pip{k}$ was defined similarly, where $\sigp{0} = \pip{0} = \p$. We
also proved the equivalence of both these definitions. In this
lecture, we shall give yet another characterisation of the polynomial
hierarchy. Recall, the $\sigp{k}$-complete and $\pip{k}$-complete
languages $\eqbf{k}$ and $\uqbf{k}$ respectively, which we introduced
in the last class.
\begin{eqnarray*}
\eqbf{k} = \{ \phi : \phi = \exists \bar{x}_1 \forall \bar{x}_2 \exists
\ldots Q_k \bar{x}_k f(\bar{x}_1,\bar{x}_2,\ldots\bar{x}_k)\hbox {
where } Q_k \hbox{ is } \exists \hbox{ if $k$ is odd and } \forall\\
\hbox{ if $k$ is even; for some unquantified boolean formula } f\hbox{
and } \phi \hbox{ is true }\}\\
\uqbf{k} = \{ \phi : \phi = \forall \bar{x}_1 \exists \bar{x}_2 \forall
\ldots Q_k \bar{x}_k f(\bar{x}_1,\bar{x}_2,\ldots\bar{x}_k)\hbox {
where } Q_k \hbox{ is } \forall \hbox{ if $k$ is odd and } \exists\\
\hbox{ if $k$ is even; for some unquantified boolean formula } f\hbox{
and } \phi \hbox{ is true }\}\\
\end{eqnarray*}
Finally, we proved the first of our $\ph$ theorems that $\sigp{k} =
\pip{k} \implies \sigp{k+1} = \sigp{k}$.

\section{Polynomial Hierarchy in terms of OTMs}

In the first half of today's lecture, we shall see an alternate
characterisation of $\ph$ in terms of $\otm$s. Recall the definition
of $\otm$s and the corresponding class of languages accepted by them
from last lecture.
\begin{eqnarray*}
\np^A = \{ L : \exists \hbox{ a nondeterministic polynomial time } \otm \ M^{?}
                         \hbox{ such that } M^A \hbox{ accepts } L \}
\end{eqnarray*}

The classes $\sigp{k}$, $\pip{k}$ can be defined using $\otm$ and the
languages $\uqbf{k}$ as seen from the theorem below.

\begin{theorem}\label{otmdef}
$\np^{\uqbf{k}} = \sigp{k+1}$
\end{theorem}
\begin{proof}

\noindent (i) $\sigp{k+1} \subseteq \np^{\uqbf{k}}$: This is the easy
direction of the proof. Since $\eqbf{k+1}$ is $\sigp{k+1}$-complete,
it is sufficient if we show that $\eqbf{k+1} \in \np^{\uqbf{k}}$. The
non-deterministic $\otm$ $M^?$ that accepts $\eqbf{k+1}$ (with access
to oracle $\uqbf{k}$) works as mentioned below. Let $\phi$ be any
formula in $\eqbf{k+1}$. Let it be of the form $\phi = \exists
x_{11}x_{12}\ldots x_{1i_1}\psi = \exists \bar{x}_1 \psi$ for some
$\psi \in \uqbf{k}$\footnote{Apologies for the abuse of notation:
$\psi$ in the strict sense does not belong to $\uqbf{k}$ as it has a
few unquantified variables in it.}. $M^?$ non-deterministically
guesses the assignments, $\bar{t} = t_1t_2\ldots t_{i_1}$for the
variables $x_{11},x_{12},\ldots ,x_{1i_1}$ where $t_k \in \{ true,
false \}$ and then queries the oracle $\uqbf{k}$ with the formula
$\psi[\bar{x}_1 = \bar{t}]$ ( ie., with the guessed assignments $t_1,t_2,
\ldots ,t_{i_1}$ substituted for the occurrences of the variables
$x_{11},x_{12},\ldots ,x_{1i_1}$ in $\psi$). $M^?$ accepts $\phi$ iff
the oracle accepts $\psi[\bar{x}_1 = \bar{t}]$. Clearly,
$L(M^{\uqbf{k}}) = \sigp{k+1}$.\\

\noindent (ii) And now to the tougher direction, $\np^{\uqbf{k}}
\subseteq \sigp{k+1}$ : Consider any language $L \in
\np^{\uqbf{k}}$. Let $M^?$ be a non-deterministic $\otm$ with access
to oracle $\uqbf{k}$ that accepts $L$. To begin with, we shall assume
that $M^?$ queries the oracle atmost once in each of its computation
paths and then later deal with the general case. As $\uqbf{k} \in
\pip{k}$, there exists an $\atm$ $\bar{N}$ such that $L(\bar{N}) =
\uqbf{k}$\footnote{$L(M) = L$ for a Turing Machine $M$ if $M$ accepts
the language $L$.} and $\bar{N}$ begins in an universal ($\forall$)
state and alternates between existential ($\exists$) and universal
($\forall$) states atmost $k-1$ times. To show, $L \in \sigp{k+1}$, we
shall construct an $\atm$ $\bar{M}$ using $M^?$ and $\bar{N}$ such
that $L(\bar{M}) = L$ and $\bar{M}$ begins in an existential
($\exists$) state and alternates between existential ($\exists$) and
universal ($\forall$) states atmost $k$ times.

Construction of $\bar{M}$: On input $w$, $\bar{M}$ existentially
gueses the non-deterministic choices (say, $\bar{y}$) of $M^?$ on
input $w$. $\bar{M}$ then proceeds exactly as $M^?$ works, using
$\bar{y}$ whenever $M^?$ has to make a non-deterministic guess. When
$M^?$ has to query the oracle $\uqbf{k}$ with the formula $\phi$,
$\bar{M}$ existentially (non-deterministically) guesses an answer
(say, $a$), writes down both the formula $\phi$ and its guess ``$a$'' on
its tape and continues with the simulation of $M^?$ as if the
oracles's response to its query were ``$a$''. If $M^?$ rejects $w$,
$\bar{M}$ also rejects $w$. Otherwise if $M^?$ accepts, $\bar{M}$
before accepting has to verify that the answer it guessed was
right. Here $\bar{M}$ uses $\bar{N}$ to verify if $\phi \in
\uqbf{k}$. In case $a$ = ``yes'' (ie., it had guessed ``yes''),
$\bar{M}$ then works exactly as $\bar{N}$ would have worked on input
$\phi$. In other words, it accepts along a computation path iff
$\bar{N}$ accepts along the corresponding computation path. In case
$a$ = ``no'', $\bar{M}$ has to verify that $\phi
\notin \uqbf{k}$ or equivalently $\neg\phi \in \eqbf{k}$. Suppose
$\neg\phi = \exists \bar{x}{\tilde{\phi}}$. $\bar{M}$ existentially
(non-deteministically) guesses the assignments (say, $\bar{t}$) for
the variables corresponding to the first existential quantifier of
$\neg\phi$ (ie., the variables in $\bar{x}$). Let $\phi' =
\tilde{\phi}[\bar{x} = \bar{t}]$. $\bar{M}$ then checks that $\phi' \in
\uqbf{k-l}$ by working exactly as $\bar{N}$ would have worked on input
$\phi'$. Here, we are using the fact that $\uqbf{k-1} \subset
\uqbf{k}$. Clearly by construction of $\bar{M}$, $L = L(\bar{M})$. Also
$\bar{M}$ is an $\atm$ that begins in the existential ($\exists$) and
alternates between $\exists$ and $\forall$ states atmost once more
than $\bar{N}$ alternates. (ie., $\bar{M}$ altenates atmost $k$ times)
Hence $L \in \sigp{k+1}$.

And now to the general case. The hurdle here is that the $\otm$
$M^{\uqbf{k}}$ can query the oracle several times along each of its
computation paths. We shall get over this problem by simulating an
$\otm$ $M^?$ that can query $\uqbf{k}$ several times by another $\otm$
$N^?$ which queries the oracle atmost once along each of its
computation paths and then the earlier proof works for this $\otm$
$N^?$.

The rest of the proof will involve the construction of $N^?$ given
$M^?$. $N^?$ works exactly as $M^?$ except for querying the
oracle. Whenever $M^?$ queries the oracle $\uqbf{k}$, $N^?$ instead
guesses the answer of the oracle non-deterministically, writes down
both the formula queried and its assumed answer on the tape and
continues with the simulation of $M^?$. If $M^?$ rejects, $N^?$ too
rejects. However, if $M^?$ accepts, $N^?$ verifies its guesses by
querying the oracle in one shot and accepts only if its guesses were
right. It is to be noted that the simulation so far has been
independent of the oracle $\uqbf{k}$, whereas the verification stage
in which we have to verify all the guesses in one go is highly
dependent on the oracle $\uqbf{k}$.

Suppose $N^?$ has to verify its answers $a_1,\ldots a_n$ to the
formula queries $\phi_1,\ldots \phi_n$ respectively. (each of the
$a_i$'s is either ``yes'' or ``no''). The easy case is when all of the
$a_i$'s are ``yes''. In this case, if $N^?$ could produce a formula
$\Phi$ such that $\Phi \in \uqbf{k}$ iff $\phi_i \in \uqbf{k}$ for $i
= 1,2,\ldots n$, then $N^?$ could just query the oracle with $\Phi$
instead of querying it for each of $\phi_i$. This $\Phi$ can be
produced easily by merely pasting together all the $\phi_i$s as shown
below. (see example) $$\Phi = \bigwedge_{i=1}^{n} \phi_i$$

{\bf Example} Consider $\phi_1 = \forall x_1\exists y_1
f_1(x_1,y_1),\phi_2 = \forall x_2\exists y_2 f_2(x_2,y_2)$, (here
$\phi_1, \phi_2 \in \uqbf{2}$), then $\Phi (\in \uqbf{2})$ could be
got from pasting $\phi_1$ and $\phi_2$ together as $$ \Phi = \forall
x_1x_2\exists y_1y_2\left( f_1(x_1,y_1) \wedge f_2(x_2,y_2)\right)$$

And now to the case where some of the $a_i$s could be
``no''s. Here $N^?$ has to verify that $\phi_i \in \uqbf{k}$ if $a_i$
were ``yes'' and $\phi_i \notin \uqbf{k}$ if $a_i$ were ``no''. Consider
a formula $$\phi_i = \forall x_{11}x_{12}\ldots x_{1i_1} \exists
x_{21}\ldots x_{2i_2}\forall\ldots f_i(x_{11}x_{12}\ldots
x_{1i_1}x_{21}\ldots x_{2i_2}\ldots)$$ when $a_i$ were ``no''. In this
case $N^?$ has to check that $$\neg\phi_i = \exists x_{11}x_{12}\ldots
x_{1i_1} \forall x_{21}\ldots x_{2i_2}\exists\ldots
f_i(x_{11}x_{12}\ldots x_{1i_1}x_{21}\ldots x_{2i_2}\ldots)$$ is
true. A mere pasting argument as before wouldn't suffice as seen from
the example below.

{\bf Example} Consider $\phi_1 = \forall x_1\exists y_1
f_1(x_1,y_1),\phi_2 = \forall x_2\exists y_2 f_2(x_2,y_2)$ (here
$\phi_1, \phi_2 \in \uqbf{2}$)and $a_1$ = ``no'', $a_2$ = ``yes''. We
have $\neg\phi_1 = \exists x_1 \forall y_1 \neg f_1(x_1,y_1)$. The
$\Phi$ in this case is $$\Phi = \forall x_2 \exists x_1y_2 \forall y_1
\left(\neg f_1(x_1,y_1) \wedge f_2(x_2,y_2)\right)$$ $\Phi$ here
belongs to $\uqbf{3}$ and not $\uqbf{2}$ as earlier.

This hurdle is got over by exploiting the non-determinism of the
$\otm$ $N^?$. $N^?$ nondeterministically guesses the assignments (say
$t_1,\ldots , t_{i_1}$) of the variables (ie., $x_{11},\ldots
,x_{1i_1}$) corresponding to the first existential ($\exists$)
quantifier of $\neg\phi_i$. Suppose $\neg\phi_i = \exists
x_{11}x_{12}\ldots x_{1i_1}\tilde{\phi_i}$. Now, verifying $\neg\phi_i
\in \eqbf{k}$ is equivalent to verifying $\phi_i' =
\tilde{\phi_i}[x_{11}=t_1,\ldots ,x_{1i_1} = t_{i_1}] \in \uqbf{k-1}$ 
for some $t_1,\ldots , t_{i_1}$. The queried formula $\Phi$ is
obtained by pasting together the $\phi_i$ in the case $a_i$ = ``yes''
and $\phi_i'$ in the case $a_i$ = ``no''. Thus, $\Phi$ is given by
$$\Phi = \left(\bigwedge_{i:a_i = ``yes''}\phi_i\right) \wedge
\left(\bigwedge_{i:a_i = ``no''}{\phi_i}'\right)$$ $N^?$ then
verifies that its guesses were right, by querying the oracle with
$\Phi$. If the oracle answers ``yes'', then $N^?$ knows that its
guesses were right and accepts and rejects otherwise.
\end{proof}

\section{Non-uniform Complexity}

\subsection{Circuit Complexity}

\begin{definition} 
Given a boolean formula $f : \{0,1\}^a \func \{0,1\}^b$, the {\bf
circuit complexity} of $f$, given by $C_f$, is defined as follows:
$$C_f = \min \{ m : \exists \mbox{ a circuit with }m \mbox{ wires that
computes }f\}$$
\end{definition}

It is to be observed that a circuit, unlike a Turing Machine, can
accept\footnote{ A circuit $C$ is said to accept a string $w$ iff
$C(w) = 1$.} only strings of a fixed size. Thus, to talk of the
circuit complexity of language $L$, we have to consider a family of
circuits.

\begin{definition} 
A language $L$ is said to have {\bf polynomial circuit complexity} if
there exists a constant $k > 0$ and a sequence of circuits
$\{C_n\}_{n=1}^{\infty}$ such that $|C_n| = O(n^k)$ and $\forall w \in
\{0,1\}^*, w \in L \iff C_{|w|}(w) = 1$.
\end{definition}
Clearly, all languages in $\p$ have polynomial circuit complexity. The
immediate question that arises then is whether 3$\sat$ has polynomial
circuit complexity. It is to be noted that this is not the same as
asking whether $\p = \np$, as polynomial circuits are more powerful
than polynomial time Turing Machines. Though the answer to the above
question is not known, it is not expected to be true as if 3$\sat$ has
polynomial circuit complexity, then the polynomial hierarchy
collapses. (In fact $\sigp{2} = \pip{2}$). We shall prove this
statement later.

\subsection{P/poly}
 
\begin{definition} 
\begin{eqnarray*}
\ppoly = \{ L : \exists k > 0, A \in \p \hbox{ and a sequence of
strings } \{S_n\}_{n=1}^{\infty} \hbox{ such that } |S_n| = O(n^k)\\
\hbox{ and } \forall w, w \in L \iff (w,S_{|w|}) \in A\}
\end{eqnarray*}
\end{definition}

$\ppoly$ can be thought of as the class of languages accepted by
polynomial time Turing Machines which can use some polynomial sized
(in terms of the input length) advice, dependent only on the length of
the input. We now show that having polynomial sized advice is no
different from being accepted by a family of polynomial circuits.

\begin{theorem}
$L \in \ppoly \iff L$ has polynomial circuit complexity
\end{theorem}
\begin{proof}

\noindent (i)$\implied$: If $L$ has polynomial circuit complexity, then
there exists a family of circuits $\{C_n\}_{n=1}^{\infty}$ that accept
$L$, where each $|C_n| = O(n^k)$ for some positive constant
$k$. Consider a sequence of $\{S_n\}_{n=1}^{\infty}$, where each $S_n$
is the encoding of the circuit $C_n$. Clearly, $|S_n|$ is polynomial
in $n$. If $\cval$ is the circuit value language mentioned in lecture
1, we have $C_{|w|}(w) = 1 \iff (w,S_{|w|}) \in \cval$. Hence $L \in
\ppoly$.

\noindent (ii) $\implies$ : Assume $L \in \ppoly$. Then there exists a
sequence of strings $\{S_n\}_{n=1}^{\infty}$, where each $|S_n| =
O(n^k)$ for some positive constant $k$ and a polynomial time Turing
Machine $M$ that accepts the language $\{(w,S_{|w|}): w \in L\}$. From
the computation tableau of $M$ on input $(w,S_{|w|})$, we can
construct a circuit (as in Cook's construction) with the advice string
$S_n$ hardwired into the circuit that accepts inputs of length
$n$. This family of circuits, so constructed, is clearly polynomial in
size and accepts the language $L$. Thus $L$ has polynomial circuit
complexity.
\end{proof}
      
In the rest of the lecture, we shall begin the proof of the fact we
had mentioned earlier namely that if $\np \subseteq \ppoly$, then
$\ph$ collapses.
\begin{theorem}\label{npppoly}
$3\sat \in \ppoly \implies \sigp{2} = \pip{2}$
\end{theorem} 
{\bf Beginning of Proof} If $3\sat \in \ppoly$, then by definition
there exists a constant $k > 0$, $A \in \p$ and a sequence of strings
$\{S_n\}_{n=1}^{\infty}$ such that $\forall n, |S_n| \leq (kn)^k$ and
$\phi \in 3\sat \iff (\phi,S_{|\phi|}) \in A$.
\begin{definition} 
A finite sequence of strings $(a_1,a_2,\ldots ,a_l)$ is defined to be
{\rm good} if $\forall 1 \leq i \leq l, |a_i| \leq (ki)^k$ and $\forall
\phi$ such that $|\phi| \leq l$, we have $\phi \in 3\sat \iff (\phi,
a_{|\phi|}) \in A$. $\good$ is the language of all good sequence of
strings.
\end{definition}
The first step in proving Theorem \ref{npppoly} will involve finding
how efficiently can $\good$ be decided. It can easily be shown from
definition that $\good \in \pip{2}$. A more careful analysis will lead
to the fact that $\good \in \pip{1}$. The proof of both these
statements and the rest of the proof of Theorem \ref{npppoly} will be
done in the next lecture.
\end{document}

