\documentclass{article}
\usepackage[margin=1in]{geometry}
\usepackage{amsmath,amsthm,amssymb}
\usepackage{relsize}
\newcounter{lecnum}
\usepackage{graphicx}
\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}}
\newcommand{\NL}{\text{NL}}
\renewcommand{\P}{\text{P}}
\newcommand{\NP}{\text{NP}}
\newcommand{\NPSPACE}{\text{NPSPACE}}
\newcommand{\PSPACE}{\text{PSPACE}}
\newcommand{\EXP}{\text{EXP}}
\newcommand{\NSPACE}{\text{NSPACE}}
\newcommand{\SPACE}{\text{SPACE}}



\begin{document}

\lecture{9}{30-08-2024}{Rohit Gurjar}{ Priyanshu Singh, Ravi B Prakash}

\section{From the previous lectures, we know that}

We know the following relationships between complexity classes:

\[
\L \subseteq \\NL \subseteq \P \subseteq \NP \subseteq \PSPACE \subseteq \NPSPACE \subseteq \EXP
\]

By the Space Hierarchy Theorem, we also know that:

\[
\L \subsetneq \PSPACE \quad \text{and} \quad \P \subsetneq \EXP
\]

\section{Savitch's Theorem}

Savitch's Theorem states that if we have a non-deterministic Turing machine (NTM) working in space $S(n)$, then:

\[
\NSPACE(S(n)) \subseteq \SPACE(S(n)^2)
\]

This implies:

\[
\NL \subseteq \L^2
\]

\textit{(Note: In the $\NSPACE(S(n))$ part, a standard depth-first search (DFS) does not help because we end up with an exponential number of vertices in the configuration graph.)}

\textit{(For $SPACE(S(n)^2)$, we have a deterministic Turing machine (TM) with space bound by $S(n)^2$.)}

\subsection{Proof of Savitch's Theorem}

Given an input $x$ and a Turing Machine (TM) that is space-bound by $O(S(n))$, the TM has a configuration graph with $2^{O(S(n))}$ nodes. A configuration consists of:
\begin{itemize}
    \item Head position
    \item State of the TM
    \item Work tape contents
\end{itemize}

We assume  $S(n) \geq \log n$. Each edge in the configuration graph represents a transition between configurations based on the input. The main question is: {\bf Is there a path from the starting configuration $C_{\text{start}}$ to an accepting configuration $C_{\text{accept}}$?} This is known as the reachability problem.

We can solve this using the following observation:

- Given two configurations $C$ and $C'$, it is easy to check if there is an edge from $C$ to $C'$ in $O(S(n))$ space.
- Using this, we solve the reachability problem by bounding the path length by $2^{O(S(n))}$.

We define the function \texttt{IsPath}$(C, C', i)$: whether there is a path from $C$ to $C'$ of length at most $2^i$.
Our final answer will be \texttt{IsPath}$(C_{\text{start}}, C_{\text{accept}}, S(n))$.
 This can be computed recursively as follows:
\[
\texttt{IsPath}(C, C', i) \text{ is true if and only if there exists a configuration } C'' \text{ such that:}
\]
\[
\texttt{IsPath}(C, C'', i-1) \text{ and } \texttt{IsPath}(C'', C', i-1)
\]
We check this for all possible configurations $C''$. The number of configurations is $2^{O(S(n))}$, so this step has exponential time complexity. 
%And the overall time complexity can be bounded by $2^{O(S(n)^2)}$.
 


\subsection{Space Complexity}
The space complexity can be computed using the recurrence relation:
\[
T(i) = T(i-1) + O(S( n))
\]
$T(i)$ represents the space needed at recursion depth $i$, and $i$ goes up to $S( n)$.
Since the depth of recursion is bounded by $S(n)$, the overall space complexity comes out to be:
\[
O(S(n)^2)
\]
This proves Savitch's Theorem.
\subsection{Time Complexity}
The time complexity is $2^{O(S(n)^2)}$ because the branching factor is $2^{O(S(n))}$ and the maximum depth of the recursion tree is $S(n)$. 
%For our case, since the depth is $S(n)$, this yields the overall space bound of $O(S(n)^2)$, as stated in Savitch's Theorem.

For the reachability problem on an $n$-node graph, the algorithm has:
\begin{itemize}
    \item Space complexity: $O((\log n)^2)$
    \item Time complexity: $O(n^{\log n})$
\end{itemize}
In contrast a polynomial time algorithm like DFS uses $O(n)$ space. Here, we have a big improvement
in space complexity, but then we have to pay the cost in time complexity.

\section{PSPACE Completeness}

A problem $Q$ is \textbf{PSPACE-Complete} if the following conditions hold:
\begin{enumerate}
    \item Every problem in PSPACE can be reduced to $Q$ in polynomial time (poly-time reduction).
    \item $Q$ belongs to PSPACE.
\end{enumerate}

\textit{Note:} The power of reduction must be strictly less than the complexity class for which we are defining completeness. Otherwise, we would end up with a trivial case.

\section{Theorem - QBF Problem is PSPACE-Complete}

The Quantified Boolean Formula (QBF) problem is PSPACE-Complete. To prove this, we first note that:

- The SAT problem reduces to QBF, which makes QBF NP-hard.
  
Before diving into the proof, here are a few interesting examples of PSPACE-Complete problems:
\begin{itemize}
    \item \textbf{Chess}: The game of Chess is PSPACE-Complete (for some generalized forms of the game).
    \item \textbf{POSET Game}: The Partially Ordered Set (POSET) game is PSPACE-Complete.
    \item \textbf{Robotics Problems}: Some problems in robotics also turn out to be PSPACE-Complete. For instance, in certain robotics scenarios, after making every move, the environment (or nature) changes. The objective is to make the right moves in order to ``win".
    \item \textbf{Games Against Nature}: Papadimitirou showed that certain games against nature are also PSPACE-Complete. These can be viewed as instances of QBF, where Player 1 is the non-random player, and ``nature" acts as a random player.
\end{itemize}

\subsection{Proof of PSPACE-Completeness of QBF}

Let us now prove that QBF is PSPACE-Complete.

Consider a language $L$ and say it is accepted by a Turing machine $M$ working in space $S(n)$. Given an input $x$, we need a polynomial-time reduction to a QBF instance $\Psi_{M,x}$ such that $M$ accepts $x$ if and only if $\Psi_{M,x}$ is true.

We can convert the question ``Is there an edge from $C$ to $C'$?" into a polynomial-size Boolean formula. Let:
\[
C \text{ be represented by } (x_1, x_2, \dots, x_s)
\]
\[
C' \text{ be represented by } (x'_1, x'_2, \dots, x'_s)
\]
We can write a Boolean formula in variables $x_1, \dots, x_s, x'_1, \dots, x'_s$
which expresses
whether it is possible to transition from configuration $C$ to $C'$. 
This can be built using the transition function of the Turing machine and the input tape.

\subsection{Approach 1}
Define a QBF $\Psi_i(C, C')$ for $0 \leq i \leq s$, where $\Psi_i(C, C')$ is true if and only if there is a path of length at most $2^i$ from $C$ to $C'$. We now define the recursive relation:
\[
\Psi_{i+1}(C, C') = \exists C'' [\Psi_i(C, C'') \land \Psi_i(C'', C')]
\]
However, proceeding this way results in formula size growing  exponentially with $i$.

\subsection{Improved Approach}
Instead, define $\Psi_{i+1}(C, C')$ as:
\[
\Psi_{i+1}(C, C') = \exists C'' \forall D_1 \forall D_2 \left[ (D_1 = C \land D_2 = C'') \lor (D_1 = C'' \land D_2 = C') \right] \implies \Psi_i(D_1, D_2)
\]
The part of the formula inside the square brackets has size $O(s)$, and we avoid the exponential blow-up.

Thus, the size of $\Psi_{M,x}$ is $O(s(n)^2)$, which implies that QBF is PSPACE-hard.

\textit{Note:} The same QBF formula works for a non-deterministic Turing machine (NTM) $M$, implying that QBF is also \NPSPACE-hard. Since we know from the previous lecture that QBF belongs to PSPACE and \NPSPACE, it follows that:
\[
\PSPACE = \NPSPACE
\]
This conclusion is supported by Savitch's Theorem.

\end{document}