\documentclass{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{epsfig}

\setlength{\oddsidemargin}{.25in}
\setlength{\evensidemargin}{.25in}
\setlength{\textwidth}{6in}
\setlength{\topmargin}{-0.4in}
\setlength{\textheight}{8.5in}
\newcommand{\handout}[5]{
   \renewcommand{\thepage}{#1-\arabic{page}}
   \noindent
   \begin{center}
   \framebox{
      \vbox{
    \hbox to 5.78in { {\bf 18.405J/6.841J Advanced
  Complexity Theory} \hfill #2 }
       \vspace{4mm}
       \hbox to 5.78in { {\Large \hfill #5  \hfill} }
       \vspace{2mm}
       \hbox to 5.78in { {\it #3 \hfill #4} }
      }
   }
   \end{center}
   \vspace*{4mm}
}

\newcommand{\lecture}[4]{\handout{#1}{#2}{Lecturer:
#3}{Scribe: #4}{Lecture #1}}

\makeatletter
\def\fnum@figure{{\bf Figure \thefigure}}
\def\fnum@table{{\bf Table \thetable}}
\long\def\@mycaption#1[#2]#3{\addcontentsline{\csname
  ext@#1\endcsname}{#1}{\protect\numberline{\csname 
  the#1\endcsname}{\ignorespaces #2}}\par
  \begingroup
    \@parboxrestore
    \small
    \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
  \endgroup}
\def\mycaption{\refstepcounter\@captype \@dblarg{\@mycaption\@captype}}
\makeatother

\newcommand{\bigO}{\text{O}}
\newcommand{\hp}{\text{\#}P}
\newcommand{\op}{{\oplus}P}
\newtheorem{theorem}{Theorem}

\begin{document}
\lecture{12}{March 19, 1998}{Daniel A. Spielman}{Yoav Yerushalmi}

\section{Toda's Theorem}
In the previous class, we proved the following theorem:
\begin{theorem}
For any depth $d$ $AC_0$ predicate $\mathfrak{A}$, there exists a family
of polynomials $P(x,r)$ such that:
\[ \forall{x}, \Pr_r[{P(\overline{x}, \overline{r}) = \mathfrak{A}(x)}] \geq
\frac{3}{4} \]
$x$ is a normal input, and $r$ is a random input. The degree of $P$ is
$(\log n)^{\bigO(d)}$, where $\overline{x} = x_1, x_2, \hdots, x_n$
and $|r| = (\log n)^{\bigO(1)}$
\end{theorem}

We will use that theorem to prove {\bf Toda's Theorem}, but first we
need to introduce a new class and explain some symbols.  

Our new class (introduced by Valiant) is $\hp$.  This
class is used to count the number of accepting paths in the computation
tree of $P$, and is useful for solving some problems:
\[ f(x) \leftarrow \hp \quad \text{iff} \quad
\exists L \in P \quad \text{such that} \quad
f(\overline{x}) = \left| \{ y | (x,y) \in L\} \right|
\]

This class can be used to solve some problems that are seemingly
harder than NP. One such example is the {\it permanent} of a matrix,
which is similar to the determinant, with the minor difference that
all of its nonzero coefficients are $+1$. The permanent is defined thus:
\[ Perm(M) = \sum_{\pi \in permutation(1, \hdots,
n) \quad }{\prod_{i=1}^{n}{M_{i,\pi(i)}}} \]

Unlike the determinant, no efficient algorithm for computing the
permanent is known. Valiant has proved that $Perm(M) \subseteq \hp$

\bigskip

Next we show that for all instantiations of problems in NP, we can
solve them by reduction to $Perm$. This is simple, since we know that
given any nondeterministic polynomial time turing machine $M$, there
exist polynomial-time computable functions $f,g$, such that the number
of accepting paths of $M$ on $w=g(Perm(f(w)))$. Since we can count the
number of accepting paths, we can easily decide if there will be a
path which accepts. Therefore:
\[ NP \subseteq P^{\hp} \]

We now have what is required to define {\bf Toda's Theorem}

\begin{theorem}[Toda's Theorem] Toda's Theorem puts a class in between
the polynomial hierarchy and PSPACE:

\[ PH \subset P^{\hp} \subset PSPACE \]
\end{theorem}

However, we can't prove the theorem just yet.

We define another new class $\op$ which we shall call parity-P:
\[ \op = \{ f | \exists g \in \hp \quad \text{such that} \quad f = g
\bmod 2 \} \]

That is, $\op$ tells us whether the number of accepting branches in a
computation tree is even or odd. We will use parity-P and the theorem
from the previous class to show that for any language $L$ in the
polynomial hierarchy, there exists a randomized bounded-error
reduction from $L$ to a language in $P^{\hp}$, which will enable us to
prove half of Toda's Theorem.

\bigskip

It is implied that $P \subset \op$, since all languages in P are
solved by turing machines that have only one accepting path, which is
therefore an odd number of paths.

Also, if $L_1, L_2 \in \op$ where $M_1 \in \op$ accepts $L_1$ and $M_2
\in \op$ accepts $L_2$, then:

\medskip
$(L_1 \oplus L_2) \in \op$ :

\begin{center}
\epsfig{file=fig12-1.eps}
\end{center}
The above tree shows how we demonstrate this fact. If both
branches accept, then we have an even number of accepting branches, so
we do not include it. If neither do, then still even (or zero). Only
if only one side accepts does it remain within the tree (and therefore
it is a unique element to one of the two languages).

\medskip
$(L_1 \cdot L_2) \in \op$ :

\begin{center}
\epsfig{file=fig12-2.eps}
\end{center}
The above tree shows how we demonstrate this fact. For each accepting
branch in $M_1$ we run the rest through $M_2$, if this yields a net
sum of even branches that accept, we will not end up accepting, and
vice-versa.

\bigskip

Now, let 
\[L \in P , \text{ define }  f(w) = \sum_{k=1}^{2^{poly(|w|)}}{\text{number of }y}
\text{ such that } (w,y,k) \in L \]
\[ \text{ then } f \in \hp \text{, or when taken} \bmod 2, f \in \op \]
The machine in question existentially guesses the appropriate
$k$, and then existentially guesses $y$. Similarly, we can argue for
the same fact with $\sum$ replaced with $\prod$.

\medskip

Now, we take a language $L \in \sum_k{P}$, and examine its computation
tree. This forms an $AC_0$ circuit with $N$ gates where $N =
2^{poly(n)}$:

\begin{center}
\epsfig{file=fig12-3.eps}
\end{center}

The theorem proved in the previous class yields us a probabilistic
polynomial $P(\overline{x}, \overline{r})$ where $deg(P) = (log
N)^{\bigO(k)} = poly(n)$ and $|r| = (log N)^{\bigO(1)} =
poly(n)$. That is, $\exists$ a function $f$ on two inputs $w,
\overline{r}$, such that $f(w,\overline{r}) \in \op$:
\[ w \in L \Longrightarrow \Pr_{\overline{r}} \left[ f(w,\overline{r})
= 1 \right]  \geq \frac{3}{4} \]
\[ w \not \in L \Longrightarrow \Pr_{\overline{r}} \left[ f(w,\overline{r})
= 0 \right]  \geq \frac{3}{4} \]
This is equivalent to thinking of the following: for $L$, $exists A
\not \in P$ such that $w \in L$ iff $\exists y_1, \forall y_2, \exists
y_3, \forall y_4, \hdots , \exists y_k$:
\[ (w, y_1, y_2, y_3, y_4, \hdots, y_k) \leftarrow A \]
the above is contained in $\op$.

\bigskip

Now, given a function that outputs bits, we want to determing if
mostly their parity is $0$ or $1$. Let $M$ be the nondeterministic
polynomial-time machine corresponding to our function $f()$. That is,
if $w \in L$, then for $3/4$ of the settings of $\overline{r}$, $M(w,
\overline{r})$ has an odd number of accepting paths.

Now, let $x_r$ be the number of accepting paths of
$M(w,\overline{r})$. Consider:
\[ h(z) = 3z^2 - 2z^3 \equiv 
\left\{\begin{array}{lr}
0 \pmod{2^{2^k}} & \text{ if } z \equiv 0 \pmod {2^k} \\
1 \pmod{2^{2^k}} & \text{ if } z \equiv 1 \pmod {2^k} \\
\end{array} \right. \]

Define $h^c(z) = h(h^{c-1}(z)), h^1(z) = h(z)$. This is a simple
recursive definition.  We know that
\[ h^c(z) \equiv 
\left\{\begin{array}{lr}
0 \pmod{2^{2^c}} & \text{ if } z \equiv 0 \pmod {2} \\
1 \pmod{2^{2^c}} & \text{ if } z \equiv 1 \pmod {2} \\
\end{array} \right. \]
$deg(h^c) = \bigO(2^c); \quad \text{ Choose } c = \lceil \log |r| \rceil + 1
\rightarrow 2^{2^c} > 2^{|r|}$.  We can now claim that
\[ \sum_r{h^{(c)}(X_r)} \bmod 2^{2^c} \geq 3/4 \cdot 2^{|r|} \text
{ iff } w \in L \]
or alternatively stated, most of the $X_r$'s were odd. $X_r$ is
basically the number of accepting paths of $M(w,\overline{r})$. We now
resolve the above equation:
\[ \sum_r{h^{(c)}(X_r)} \in \hp \quad \equiv \quad
\sum_r{h^{(c)}(\text{\#}M(w,\overline{r}))} \in \hp \]

The above equation means that 
\[ PH \subset P^{\hp} \]

The latter part of the theorem is presumably proved in the next lecture.


\end{document}
