\documentclass{article}
\usepackage[margin=1in]{geometry}
\usepackage{amsmath,amsthm,amssymb}
\usepackage{relsize}
\newcounter{lecnum}
\usepackage{graphicx}
\usepackage{xspace}
\graphicspath{./}
\usepackage{caption}
\usepackage{subcaption}
\newcommand{\abs}[1]{\lvert #1 \rvert}
\newcommand{\lecture}[4]{
   \newpage
   \setcounter{lecnum}{#1}
   \noindent

   \begin{center}
   \framebox{
      \vbox{\vspace{2mm}
    \hbox to 16cm { {\bf CS760 Topics in Computational Complexity
                        \hfill 2024-25 Sem I} }
       \vspace{4mm}
       \hbox to 16cm { {\Large \hfill Lecture #1: #2  \hfill} }
       \vspace{2mm}
       \hbox to 16cm { {\it Scribe: #4  \hfill  Lecturer: #3} }
      \vspace{2mm}}
   }
   \end{center}
   \vspace*{4mm}
}

\newtheorem{theorem}{Theorem}[lecnum]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{claim}[theorem]{Claim}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{definition}[theorem]{Definition}

% custom
\usepackage{enumitem}
\usepackage{hyperref}
\usepackage{cleveref}
\usepackage{commath}
\newcommand{\N}{\mathbb{N}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\F}{\mathbb{F}}
\newcommand{\E}{\mathbb{E}}
\newcommand{\restr}[2]{\ensuremath{\left.#1\right|_{#2}}}
\newcommand{\aw}{\operatorname{aw}}

\renewcommand{\L}{\text{L}\xspace}
\newcommand{\NL}{\text{NL}\xspace}
\renewcommand{\P}{\text{P}\xspace}
\newcommand{\NP}{\text{NP}\xspace}
\newcommand{\NPSPACE}{\text{NPSPACE}\xspace}
\newcommand{\PSPACE}{\text{PSPACE}\xspace}
\newcommand{\NEXP}{\text{NEXP}\xspace}
\newcommand{\EXP}{\text{EXP}\xspace}
\newcommand{\NSPACE}{\text{NSPACE}\xspace}
\newcommand{\SPACE}{\text{SPACE}\xspace}
\newcommand{\PPoly}{\text{P/Poly}\xspace}
\newcommand{\PH}{\text{PH}\xspace}
\newcommand{\sigp}{\text{$\Sigma_{2}^{p}$}\xspace}
\newcommand{\DTIME}{\text{DTIME}\xspace}



\begin{document}

\lecture{13}{13-09-2024}{Rohit Gurjar}{Ananth Krishna Kidambi, Soham Joshi}

\section{Circuit lower bounds}

From the previous lectures, we know that, 
\begin{align*}
    \P \subseteq \PPoly
\end{align*}
We also recall the Karp-Lipton theorem, 
\begin{theorem}{(Karp-Lipton)}
  $  \NP \subseteq \PPoly \implies \PH = \sigp$
\end{theorem}
It is not believed that the polynomial hierarchy collapses to \sigp. Since $\P \subseteq \PPoly$, showing $\NP \not\subseteq \PPoly$ implies $\P \neq \NP$. So, one can try to show $\NP \not \subseteq \PPoly$ by obtaining a language in $\NP$ which does not have a polynomial sized boolean circuit, i.e. we try to show a lower bound on the circuit size. However, the best known lower bound for an \NP language is around $5n$.
\section{Turing Machines with Advice}

\begin{definition}
A language $L$ is in \DTIME$(T(n)/a(n))$ if there exists a Turing machine $M$ running in time $T(n)$ and a sequence of strings $(A_n)$, $|A_n| = O(a(n))$ such that: % not clear if turing machine runs in T(|x|) or T(|x| + a(|X|) 
\begin{align*}
    x \in L \iff M(x, A_{|x|}) = 1
\end{align*}
\end{definition}

\noindent In the above definition, $A_{|x|}$ is the advice given to the turing machine for input $x$.

We can define $\PPoly$ as a special case of TMs with advice, where the Turing machine runs in poly-time and the advice also has polynomial length ($T(n) = a(n) = \text{poly}(n)$). Note that this definition is equivalent to the previous definition of $\PPoly$ (defined using boolean circuits). The backward direction is true since we can provide an encoding of the boolean circuit as advice to a TM which evaluates it in time polynomial in the size of the circuit, which in turn is polynomial in the size of the input. For the forward direction, we can directly encode the TM and the advice into a boolean circuit, which has a polynomial-size increase.  

\section{Uniform Circuits}

\begin{definition}
    A family of circuits is called logspace-uniform if, given $1^n$, we can compute $C_n$ in log-space.
\end{definition}

\begin{theorem} \label{theorem:P-iff-logspace-uniform}
    $L \in P$ iff there is a logspace-uniform family of circuits accepting $L$. 
\end{theorem}

The only if direction is easy to show - construct a Turing machine that can construct the Boolean circuit $C_n$. Since this can be done in log-space, and $L \subseteq P$, this runs in polynomial time. Also, this circuit can be evaluated in polynomial time, and hence, the TM runs in poly-time. 

The proof of the other direction is more involved. You need to argue the computation of a polytime Turing machine
can be represented by a circuit computable in logspace. Refer to \cite{Arora_Barak_2009} for the proof sketch.

\section{Bounded depth circuits}

Why should we believe that it is possible to show exponential  circuit size lower bounds? 
The following is an existential argument, that shows almost all Boolean functions require exponential size circuits. 
The challenge is to show an explicit function that requires large size circuits.

\begin{lemma} \label{lem:ckt-size-lower}
    There is a Boolean function $f : \{0, 1\}^n \to \{0, 1\}$ which requires $\Omega(\frac{2^n}{n})$ sized circuits.
\end{lemma}
\begin{proof}
    We will proceed via a counting argument. The number of Boolean functions is $2^{2^n}$. The number of circuits with size $s$ can be bounded  by number of DAGs with $s$ nodes (and hence $O(s)$ edges). If we represent the circuit by adjacency list, number of edges is $O(s)$ and vertex needs $\log s$ bits for representation. Hence, number of circuits of size $s$ is given by $2^{O(s\log s)}$. Now, let $s = c \cdot \frac{2^n}{n}$, then number of circuits is bounded above by $2^{2^n}$.
\end{proof}

Given a Boolean function, we can encode it trivially using a DNF. We can take the disjunction of all the configurations of $(x_1, \cdots, x_n)$ which output $1$. For example $(x_1 \wedge x_2 \wedge \neg x_3) \vee (x_1 \wedge \neg x_2 \wedge x_3)$. The number of possible inputs is $2^n$, and number of gates per clause of DNF is $n$. Hence, total size of the circuit is $O(n\cdot 2^n)$.

Remarkably, there is better upper bound, showing that above lower bound for representing Boolean functions given in lemma \ref{lem:ckt-size-lower} is actually tight. 

\begin{lemma}
    For every Boolean function there is a circuit of size $O(\frac{2^n}{n})$.
\end{lemma}
The proof for this lemma was given by Lupanov in 1958. A proof can be found in \cite{ckt-upper-bound}.

This raises further questions such as which Boolean functions require large circuits. Namely do there exist languages in \NP or \EXP which require exponential sized circuits? 

\begin{theorem}{(Karp-Lipton)}
    \NP $\subseteq$ \PPoly $\implies$ \PH $=$ \sigp
\end{theorem}

\begin{theorem}{(Meyer)}
    \EXP $\subseteq$ \PPoly $\implies$ \EXP $=$ \sigp
\end{theorem}

The above theorems show that if all languages in \NP or \EXP require only polynomially sized circuits then \PH, \EXP classes collapse to \sigp which is not believed to be true.

Since there is not much progress in showing lower bounds for general circuits, we can analyze circuits with limitation in compute power. Namely, we will analyze circuits with bounded depth.

\subsection{AC, NC classes}

The analysis of circuits was a field on interest in 80s because it was a model of parallel computation, with the depth of the circuit a measure of running time of the parallel computer in some sense. We define bounded depth classes of Boolean circuits as follows, 
\begin{itemize}
    \item $\text{NC}^i$ : Class of problems which have Boolean circuits of polynomial size and $O(\log^i n)$ depth with a fan-in of atmost 2 for all gates.
    \item $\text{AC}^i$ : Class of problems which have Boolean circuits of polynomial size and $O(\log^i n)$ depth and arbitrary fan-in
\end{itemize}
From the above definitions, it is clear that $\text{AC}^i$ is at least as expressive as class  $\text{NC}^i$. 
Moreover, any gate with fan-in of atmost $m$ can be converted into a circuit with a fan-in of $2$ and depth $\log m$ using a binary tree-like construction of gates. Hence, we get that
\begin{align*}
    \text{NC}^0 \subseteq \text{AC}^0 \subseteq \text{NC}^1 \subseteq \text{AC}^1 \subseteq \cdots
\end{align*}
Further, we can define complexity classes, 
\begin{align*}
    \text{NC} := \bigcup_i \text{NC}^i \\ 
    \text{AC} := \bigcup_i \text{AC}^i
\end{align*}

We know that parity is not in $\text{AC}^0$ (discussion ahead), however if given the power of xor gates, parity  will 
have depth 1 circuit. This motivates us to define the class
\begin{itemize}
    \item $\text{AC}^i[k]$ : Class of problems which have Boolean circuits with additional mod $k$ gate of polynomial size and $O(\log^i n)$ depth, arbitrary fan-in.
\end{itemize}
So, parity is in $\text{AC}^0[2]$. These classes can be further combined to get a class with any mod gate given by,  
\begin{align*}
    \text{ACC}^i := \bigcup_j \text{AC}^i[j]
\end{align*}
With respect to the expressive power of these classes, Ryan Williams gave an important result, 
\begin{theorem}{(\cite{nexp-acc0})}
    \NEXP $\not \subseteq$ $\text{ACC}^0$.
\end{theorem}


\subsection{Problems in AC, NC classes}
\begin{itemize}
    \item \emph{Addition $\in \text{AC}^0$}: This can be shown by directly constructing a circuit of constant depth for adding 2 numbers. Note that to find the $i$th bit of the sum, we only need the $i$th bits of the two input numbers and the carry bit of the sum of the last $i-1$ bits of those numbers. So if we can find the carry in constant depth, we are done. 

    Let the two numbers be $x = x_nx_{n-1}\dots x_1$ and $y = y_ny_{n-1}\dots y_1$, where $x_i, y_i$ are the bits of $x, y$. Note that the carry bit at the $i$th position is $1$ iff  
\begin{align*}
    \exists_{i > j \ge 0}: \big(\forall_{i > k > j} x_k \lor y_k\big) \land x_j \land y_j 
\end{align*}
Since this formula can be expressed using a Boolean circuit of depth 4, we can find the carry bit in constant depth, and hence add with a Boolean circuit of constant depth. 

    \item \emph{Parity $\notin \text{AC}^0$} :  Refer to \cite{parity-not-in-ac0}  for the proof. Will prove in later lectures.
    \item \emph{Parity} $\in \text{NC}^1$: Since parity is simply the \textit{xor} of all bits, we can compute it in a binary tree fashion of depth $\log n$. 
    \item \emph{Multiplication $\in \text{AC}^1$}: This can be done by multiplying each bit of the second number with the first number and adding them in a binary tree fashion (having $\log n$ depth). Since addition is in $\text{AC}^0$, this circuit has depth $O(\log n)$. 

We can rule out an $\text{AC}^0$ circuit for multiplication as follows. 

    \item \emph{Multiplication $\in \text{AC}^0 \implies $ Parity $\in \text{AC}^0$} : Let there be a constant depth circuit for multiplication of two numbers. Then given bits $x_1, x_2, \cdots, x_n$, consider the product of $x_10^{\log n}x_2\cdots 0^{\log n}x_n$ and $10^{\log n}1\cdots 0^{\log n}1$. Using the high-school multiplication method, this will give us the addition of $x_1, x_2, \cdots, x_n$ in the column corresponding to $x_1$ in the input. Moreover, addition of $n$ bits in a column needs a carry over in atmost $\log n$ columns, hence the column corresponding to $x_1$ does not get a carry bit from any other column. Hence the output bit corresponding to the column of $x_1$ will give the parity of $x_1, x_2, \cdots, x_n$.

\end{itemize}
We will state some more results without proof. 

\begin{itemize}
    \item Multiplication $\in \text{NC}^1$
    \item Matrix Multiplication $\in \text{NC}^1$
    \item System of Linear Equations $\in \text{NC}^2$
    \item Determinant, Rank $\in \text{NC}^2$
    \item $\text{NC}^1 \subseteq L \subseteq NL \subseteq AC^1 \subseteq NC^2$ : The proof for NL $\subseteq \text{AC}^1$ is given in \cite{clote-kranakis}.
\end{itemize}

An important open question is whether bipartite matching is in NC. This is one of most important problems in context of the question whether $\text{NC} = \P$. If true, it will mean that any problem with efficient algorithm can be parallelized with a significant speed-up.
\section{$P$-complete}

\begin{definition}
A problem $Q$ is $P$-complete if $Q$ is in $P$ and every problem in $P$ logspace-reduces to $Q$.
\end{definition}

\subsection{Examples of $P$ complete problems}
\begin{enumerate}
    \item  \emph{Circuit evaluation}: Given a circuit $C$ (in a graph form) and an input $x$ for it, the problem asks for finding $C(x)$. 
    $P$-completeness directly follows from \ref{theorem:P-iff-logspace-uniform}. This is because the theorem says that
for any polynomial time TM and a given input length, we can compute a circuit for it in logspace.  Note that even though the size of the circuit may not be logarithmic in the input size, we can compute the $i$th bit of the circuit in logspace  (and we can compute the size of the circuit in logspace).

    \item \emph{Min cost flow}
    \item \emph{Linear programming}
\end{enumerate}


\bibliographystyle{alpha}
\bibliography{refs}

\end{document}