\documentclass{article}
\usepackage{amsmath}
\input{preamble.tex}
\newcommand{\noi}{\noindent}
\newcommand{\bd}{\begin{diaplaymath}}
\newcommand{\ed}{\end{displaymath}}
\newcommand{\be}{\begin{eqnarray*}}
\newcommand{\ee}{\end{eqnarray*}}


\begin{document}

\lecture{7}{March 1, 2001}{Dan Spielman}{Abhinav Kumar}

\bigskip

Today we will talk about Randomized Complexity classes.

Last time we showed BPP $\subset$ P/poly. Today we will show BPP $\subset$ $\Sigma_2P \cap \Pi_2P$

\noi {\bf BPP error amplification}

\noi Error amplification means decreasing the probability of error. The key tool in this regard is the use of {\it Chernoff bounds}. 

\begin{theorem}
Let $X_1, X_2,..., X_n$ be independent, identically distributed random variables taking values in [0,1].
Let Y = $\sum\limits_{i=0}^n X_i$, $\mu $= E[Y].

Then Pr[$| Y-\mu | > \epsilon \mu$] $ < e^{-\mu \epsilon^2/3}$, for $\epsilon \in [0,1]$.
\end{theorem}

\noi {\bf Proof:}  See handout on probability.
\\

\noi {\bf Amplification Lemma:} Let L be a language such that there is a randomized polynomial-time TM M such that,
\be
x \in L \Rightarrow Pr[M(x) accepts] \geq C(|x|) \cr
x \notin L \Rightarrow Pr[M(x) accepts \leq S(|x|) \cr
\textrm{where } C(n)-S(n) \geq \frac{1}{p(n)} \textrm{ for some poly }p() 
\ee
 
\noi Then $\forall b > 0, \exists$ a random ptime TM M' such that 
\be 
x \in L \Rightarrow Pr[M'(x) accepts] \geq 1-2^{-|x|^b} \cr
x \notin L \Rightarrow Pr[M'(x) accepts \leq 2^{-|x|^b} \cr
\ee

\noi (Remark : This is reasonably tight)

\noi {\bf Proof:} M' runs M $k = 12(p(n)^3+n^b$ times, $n = |x|$. Accepts if M accepted more than $k\cdot\frac{s(n)+c(n)}{2}$ times. Applying Chernoff's bound, we get the desired behaviour of M'. 

\begin{theorem}
(Sipser) BPP $\subset \Sigma_2P$.
\end{theorem}

\noi Note: This implies co-BPP $\subset \Pi_2P$, but co-BPP = BPP since definition of BPP is symmetric.
\\

\noi {\bf Proof:} \\
 Let $L$ be a language in BPP.  We know $\exists A \in $P
and a function $f(n) = n^{O(1)}$
such that

If $w \in L$ then ${\underset{r: |r| = f(n)}{Pr}} [(r,w) \in A] > 1 - 2^{-n}$, and

if $w \notin L$ then $\underset{r: |r| = f(n)}{Pr} [(r,w) \in A] < 2^{-n}$.  

where $n = |w|$.
\smallskip

\noi{\it Def.}  Define $R_w = \{r: |r| = f(n)$ such that $(r,w) \in A\}$.
Correspondingly, 

If $w \in L$ then $|R_w| > (1-2^{-n})2^{f(n)}$ and 

if $w \notin L$ then $|R_w| < 2^{-n}2^{f(n)}$.  

\smallskip

The idea here is to take a number of translations of $R_w$, and see if
they cover the entire
space $\{0, 1\}^{f(n)}$.  Each translation of $R_w$ has the same size as
$R_w$, and if $R_w$
is most of the space (ie, $w \in L$) then this collection of translations
would be likely to
cover the space.  However, if $R_w$ is very small (ie, $w \notin L$) then
this collection 
could never cover the space.  More formally,

\noi{\it Def.} (translation)  Let $S \subset \{0, 1\}^{f(n)}$.  For $t \in
\{0, 1\}^{f(n)}$ let
the translation $S \oplus t$ be defined as

$$\{x : x \oplus t \in S\} $$

where $x \oplus t$ is defined as the XOR of the two strings (or, the
bitwise sum modulo 2).  

\smallskip

\noi{\it Claim.}  (1)  If $|S| > (1-2^{-n})2^{f(n)}$ then $\exists \tau =
\{t_1, \ldots t_{f(n)}\}$
such that 

$$  \underset{i=1}{\overset{f(n)}{\cup}}  (S \oplus t_i) = \{0, 1\}^{f(n)}  $$

(2)  If $|S| < 2^{-n}2^{f(n)}$ then $\forall \tau = \{t_1, \ldots
t_{f(n)}\}$,

$$  \underset{i=1}{\overset{f(n)}{\cup}} (S \oplus t_i) \neq \{0, 1\}^{f(n)} $$

\smallskip

First, we show that the claim proves the theorem.  If the claim is true,
we can design a $\Sigma_2P$
machine $M$ to solve $L$ as follows:  

1.  Use $\exists$ states to generate $\tau$.

2.  Use $\forall$ states to generate $r \in \{0, 1\}^{f(n)}$.  

3.  Check if $r \in \underset{i}{\cup} R_x \oplus t_i$ and accept if so, otherwise,
reject.

\smallskip

This is polynomial time, since we can check whether $r \in R_x$ in
polynomial time, and $f(n)$ is
polynomial in $n$.  By the claim, if $x \in L$ then on any correct $\tau$
we accept.  If $x \notin L$ 
we reject, since there is no such $\tau$.  Therefore, we only have to
prove the claim.

\smallskip

First, we prove part (2) of the claim.  If $|S| < 2^{-n}2^{f(n)}$ then 

$$ \left| \underset{i}{\cup} (S \oplus t_i) \right| \leq f(n)2^{-n}2^{f(n)}.$$

Since $f(n) = n^{O(1)}, f(n)2^n < 1$ for sufficiently large $n$.
Therefore, this union 
doesn't cover $\{0, 1\}^{f(n)}$.

\smallskip

Note that the "sufficiently large $n$" clause here doesn't cause a
problem.  If we take this into
account, we need only hard-code the correct answer for all words smaller
than this bound into our
$\Sigma_2P$ machine.

\smallskip

Next, we prove part (1).  Let
\be
 p &=& \underset{\tau}{Pr} [ \underset{|r| = f(n)}{\forall} r \in \underset{i=1}{\overset{f(n)}{\cup}} (t_i \oplus
S) ] \cr 
&=& 1 - \underset{\tau}{Pr} [\underset{|r| = f(n)}{\exists} r \notin \underset{i=1}{\overset{f(n)}{\cup}} (t_i
\oplus S) ] \cr
& \geq & 1 - \underset{|r| = f(n)}{\Sigma} \underset{\tau}{Pr} [ r \notin \underset{i=1}{\overset{f(n)}{\cup}} (t_i \oplus S) ].
\ee
We choose the $t_i$'s independently, so we can consider them
independently.  Therefore,

\be
p &\geq & 1 - \underset{|r| = f(n)}{\Sigma} \underset{i=1}{\overset{f(n)}{\Pi}} Pr_{t_i} [ r \notin t_i \oplus S) ] \cr
& = & 1 - \underset{|r| = f(n)}{\Sigma} \underset{i=1}{\overset{f(n)}{\Pi}} 2^{-n} 
\cr
\ee
since $r \in t_i \oplus S$ if and only if $t_i \in r \oplus S$,

$$ = 1 - 2^{f(n)}(2^{-n})^{f(n)} = 1 - 2^{-f(n)(n-1)} > 0.$$

Since this probability is nonzero, there must be at least some $\tau$ for
which the union of
the translations determined by $\tau$ covers $\{0, 1\}^{f(n)}$.  This
completes the proof. \qed \\

\noi {\bf Verifying Polynomial identities} \\

Let $p$ be a given polynomial in k variables, $q_1, ..., q_k$ given polnomials in $m$ variable. The equation 
\be
p(q_1(y_1,...,y_m),...,q_k(y_1,...,y_m)) = 0
\ee
can be difficult to check deterministically. Expanding the polynomial out would give us an exponential number of terms. However, if we use randomization there is an easy test. Choose $x_1,..., x_m$ at random and see if we get zero. If we choose $x_i's $ in a large enough range, the probability that the test is passed but $p$ is not identically zero becomes exponentially small. So we can check polynomial identities in co-RP.

\begin{lemma}[Schwartz's Lemma]\label{schwarz}
Let $P(x_1, x_2, \ldots, x_n)$ be a polynomial of degree $d$.  Then
if $P \not \equiv 0$, then
$${\rm Pr}_{x_1, x_2, \ldots x_n \in S}[P(x_1, x_2, \ldots, x_n) = 0] 
\leq \frac{dn}{|S|}.$$
\end{lemma}

\noi {\it Proof:\/}  We use induction on $n$.

\noi {\it Base case\/}  $(n=1):$  If $P \not \equiv 0$, then there are at most
$d$ zeroes in $p$.  At most $d = d \cdot 1$ of them are in $S$.

\noi {\it Inductive step:\/}  Write 
$$P(x_1, x_2, \ldots, x_n) = \sum_{i=0}^{d_1} x_1^i P_i(x_2, \ldots, x_n).$$
By hypothesis,
$${\rm Pr}_{x_2, \ldots, x_n} [P_{d_1}(x_2, \dots, x_n)=0] \leq 
\frac{(n-1)d}{|S|}.$$
If $P_{d_1}(x_2, \ldots, x_n) \neq 0$, then ${\rm Pr}_{x_1}[P(x_1, \ldots, x_n)]
\leq \frac{d_1}{|S|}$. \qed




\end{document}

