\documentclass[11pt]{article}
%\usepackage{synttree}
%\usepackage{amssymb}
\newtheorem{theorem}{Theorem}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{homework}{Homework}
\newenvironment{definition}{\begin{trivlist}\item[]{\bf Definition}\ }%
{\end{trivlist}}
\newenvironment{fact}{\begin{trivlist}\item[]{\bf Fact}\ }%
{\end{trivlist}}
\newenvironment{example}{\begin{trivlist}\item[]{\bf Example}\ }%
{\end{trivlist}}
\newenvironment{proof}{\begin{trivlist}\item[]{\bf Proof}\ }%
{\end{trivlist}}
% Make the page large
\addtolength{\textwidth}{1.50in}
\addtolength{\textheight}{1.00in}
\addtolength{\evensidemargin}{-0.75in}
\addtolength{\oddsidemargin}{-0.75in}
\addtolength{\topmargin}{-.50in}

% \vdashsub{X}  makes a turnstyle with subscript "X"
% \vdashsup{X}  makes a turnstyle with superscript "X"

\newdimen\srbdimenA
\newcommand{\vdashsupsub}[2]{ \mathop{
  \setbox251 = \hbox{$\scriptstyle #1$}
  \setbox252 = \hbox{$\scriptstyle #2$}
  \ifdim \wd251<\wd252 \srbdimenA = \wd252 \else \srbdimenA = \wd251 \fi
  \setbox255 = \hbox {${\srbAvdash \vphantom( \kern -\srbdimenA \kern +.05em}
                  ^{\hbox to\srbdimenA{\hfill \box251\hfill}}
                  _{\hbox to\srbdimenA{\hfill \box252\hfill}}$}
  \box255 \kern .05em}}
\newcommand{\srbAvdash}{\hbox{ \vrule height1.4ex width0.02em
                                \dimen255 = \srbdimenA
                                \advance\dimen255 by 0.1em
                              \vbox{\hrule width\srbdimenA height0.02em
                                    \kern .65ex  }}}
\newcommand{\vdashsup}[1]{\vdashsupsub{{#1}}{\mbox{~}}}
\newcommand{\vdashsub}[1]{\vdashsupsub{\mbox{~}}{#1}}
%\fi

%   FOR THE SCRIBE: CUSTOMIZE THE ENTRIES BELOW:
%   Fill in the following information particular to these scribe notes:

\def\scribeone{Alex Edmonds}    % Who is the scribe?
\def\classdate{Fall, 2015} % Date of the class
\def\classnumber{1}     % Is this the first, second, ...?

% Here are some commands that stay the same for the whole class.

\def\classinstructor{Toniann Pitassi}
\def\classtitle{Complexity Theory}
\def\doctitle{\textup{CS 2401 - Introduction to Complexity Theory}}
\def\classid{\textup{Lecture \#\classnumber: \classdate}}

%   Put your macros for these scribe notes HERE
%  It is best to use as few as possible.
%  environments for "theorem", "corollary", "lemma", "fact" "definition"
%   "homework", "proof", "example", "proposition"
%   are already defined above.

\usepackage[makeroom]{cancel}
\usepackage{amsmath}


% Start the document

%\ifx\CompleteCourse\relax
%\ClassScribeSetupB
%\else
\def\makeatletter{\catcode`\@=11\relax}
\def\makeatother{\catcode`\@=12\relax}
\makeatletter
\def\ps@scribeheadings{\let\@mkboth\@gobbletwo
\def\@oddhead{\sl\doctitle \hfill \classid
}\def\@oddfoot{\hfil \rm \thepage \hfil}\def\@evenhead{\@oddhead}%
\def\@evenfoot{\@oddfoot}\def\sectionmark##1{}\def\subsectionmark##1{}}
\makeatother
\pagestyle{scribeheadings}

\begin{document}
\bibliographystyle{siam}
%\fi

\begin{center}
\Large\bf\doctitle\\[1em]
\Large\bf\classid\\[1em]
{\large\bf Lecturer: \classinstructor}\\[.5em]
{\large\bf Scribe Notes by: \scribeone}
\end{center}

% HERE IS WHERE YOUR SCRIBE NOTES SHOULD START
%  DELETE ALL OF ROB'S TEXT AND ENTER YOUR OWN.

\section{Course Topics}

\begin{itemize}
	\item Turing machines
	\item Main complexity classes:
	\begin{itemize}
		\item Time: P, NP, EXP, E, PH, NP-complete
		\item Space: L, NL, PSPACE
		\item Randomized complexity classes: RP, BPP
	\end{itemize}
	\item Concrete computational models and lower bounds
\end{itemize}

\section{Turing Machines}

\begin{definition}
A Turing machine $M$ is described by a tuple $(\Gamma,Q,\delta)$ consisting of:
\begin{itemize}
\item $\Gamma$, called the \textit{alphabet} of $M$, is a set of symbols which includes 0, 1, $\bcancel{b}$, $\triangleright$ where $\bcancel{b}$ and $\triangleright$ stand for ``blank'' and ``start'' resp.
\item $Q$, a set containing the possible states of $M$, which includes $q_{\text{start}}$ and $q_{\text{halt}}$
\item $\delta: Q \times \Gamma^k \rightarrow Q \times \Gamma^{k-1} \times \{L,R,S\}^k$ called the \textit{transition function}, where $L$, $R$ and $S$ stand for ``left'', ``right'' and ``stay'' resp.
\end{itemize}
The Turing machine (TM) is represented by $k$ tapes. Each \textit{tape} is a sequence of cells, infinite in one direction, where each cell contains a symbol from $\Gamma$. The first tape is designated the \textit{input tape}. Initially, all tapes contain $\triangleright$ in the first cell and all tapes except the input tape contain $\bcancel{b}$ everywhere else. The input tape begins with a finite sequence of non-blank symbols followed by $\bcancel{b}$ everywhere else. Each tape always has one of its cells marked by a \textit{head}. Initially, these heads mark the first cells of each tape.

On each step, the machine is in some state $q\in Q$ and the machine reads each cell marked by a head to obtain $(\sigma_1,\sigma_2,\dots\sigma_k)$. Let
\begin{equation}
(q',(\sigma_2',\dots,\sigma_k'),(z_1,\dots,z_k))=\delta(q,(\sigma_1,\dots,\sigma_k))
\end{equation}
Then, the following occurs:

\begin{enumerate}
\item On the $i^{\text{th}}$ tape, in the cell marked by the head, $\sigma_i$ is replaced with $\sigma_i'$.
\item On the $i^{\text{th}}$ tape, the head moves to the left, right or stays in place according to $z_i\in \{L,R,S\}$.
\item The state of the machine is updated to $q'$. If $q'=q_{\text{halt}}$, the machine stops and ceases to update the tapes.
\end{enumerate}

\begin{definition}
Let $f:\{0,1\}^*\rightarrow\{0,1\}^*$. We say that the TM $M$ \textit{computes} $f$ if, for $x \in \{0,1\}^*$, when $M$ is run on $x$, it halts with $f(x)$ on its output tape (tape $k$). We say $M$ computes $f$ in time $T(n)$ if, for all $n$, for all $x$ where $|x|=n$, the number of steps $M$ takes on input $x$ is at most $T(n)$.
\end{definition}

\end{definition}

\section{Church-Turing Thesis}

The Church-Turing thesis claims that $f:\{0,1\}^*\rightarrow\{0,1\}^*$ can be realized in some computational model or device iff $f$ can be computed by some TM. It is noted that it is impossible to discuss the formal validity of such a statement since there does not exist a general characterization of computational models.

\section{On Restrictions of Turing Machines}

\subsection{Restriction of alphabet $\Gamma$}

\begin{fact}
(Claim 1.5) If $f:\{0,1\}^*\rightarrow\{0,1\}^*$ is computed by $M=(Q,\Gamma,\delta)$ then $f$ can also be computed by $M'=(Q',\Gamma',\delta')$ where $\Gamma'=\{\triangleright,0,1,\bcancel{b}\}$. If $M$ runs in time $T(n)$, then $M'$ runs in time $T'(n)=4 T(n)\log |\Gamma |$.
\end{fact}
\begin{proof}
\textit{(sketch)} \ Every tape of $M$ is encoded by a tape of $M'$. Because any member of $\Gamma$ may be encoded in $\log |\Gamma|$ bits, every cell in a tape of $M$ may be represented by $\log |\Gamma|$ cells in the tape of $M'$. To simulate a step of $M$, $M'$ does the follwing for each tape in parallel:
\begin{enumerate}
\item reads the $\log |\Gamma|$ sequence of cells corresponding to the one read by $M$;
\item uses its state register to store the symbol read;
\item uses the transition function of $M$ to compute the symbols $M$ writes, etc.;
\item stores this information in its state register;
\item uses $\log |\Gamma|$ steps to write the encodings of these symbols on its tapes.
\end{enumerate}
To allow for such a procedure, the state register $Q'$ of $M'$ is extended so that it may represent $k$ symbols in $\Gamma$ and a counter from $1$ to $\log |\Gamma|$. Hence, $|Q'|\le O(|Q||\Gamma |^{k+1})$. Corresponding to a single step in $M$, $4\log |\Gamma|$ steps may be required in $M'$, whereby we obtain $T'(n)=4 T(n)\log |\Gamma |$.
\end{proof}

\subsection{Restriction to single tape}

\begin{fact}
(Claim 1.6) If $f$ is computable by a $k$-tape TM $M=(Q,\Gamma,\delta)$ in time $T(n)$, then $f$ is computable by a 2-tape (or 1-tape read/write) TM $M'=(Q',\Gamma',\delta')$ in time $T'(n)=5T(n)^2$.
\end{fact}
\begin{proof}
\textit{(sketch)} \ Extend $\Gamma=\{z_1,z_2,\dots,z_n\}$ to $\Gamma'=\{z_1,z_2,\dots,z_n,\hat{z}_1,\hat{z}_2,\dots,\hat{z}_n\}$. The $i^\text{th}$ tape of $M$ is inscribed in the cells $i,i+k,i+2k,\dots$ of $M'$. Where a cell in a tape of $M$ is marked by a head and contains $z_j$, the corresponding cell in $M'$ is inscribed with $\hat{z}_j$ instead. Corresponding to a single step in $M$, $M'$ sweeps its entire tape to register those symbols marked by ``$\hat{\ \ }$'' and, after registering the results of $M$'s transition function, sweeps the entire tape once again to update the encoding accordingly. Since $M$ never reaches further than location $T(n)$ on its tapes, $M'$ never reaches further than $2n+kT(n)\le (k+2)T(n)$. Thus, for a single step of $M$, the corresponding sequence of steps in $M'$, described above, may be as long as $5kT(n)$, which accounts for some extra steps needed for updating head movement and book keeping. This gives $T'(n)=5kT(n)^2$.
\end{proof}

\section{Universal Turing Machines}

\begin{fact}
Every TM may be represented by binary strings such that each string $\alpha\in\{0,1\}^*$ represents a TM denoted $M_{\alpha}$ (if some string is not a legal representation, map it to a trivial TM) and every TM is represented by infinitely many strings.
\end{fact}

\begin{theorem}
There is a TM $\mathcal{U}$ such that, for $x, \alpha \in \{0,1\}^*, \ \mathcal{U}(x,\alpha)=M_{\alpha}(x)$. Moreover, if the running time of $M_\alpha$ is $T(n)$, then, for $|x|\le n$, $\mathcal{U}(x,\alpha)$ takes at most $C\cdot T(n) \log T(n)$ steps where $C$ depends only on the alphabet size and number of tapes of $M_\alpha$
\end{theorem}

\begin{proof}
\textit{(sketch)} \ $\mathcal{U}$ consists of an input tape and three work tapes. The first work tape is a simulation of the work tape of $M_\alpha$. Here, we invoke Claim 1.5 and Claim 1.6 so that we may assume $M_\alpha$ consists of single work tape and uses the same alphabet as $\mathcal{U}$, although these transformations introduce quadratic slowdown so that $M_\alpha$ runs in time $C\cdot T(n)^2$. Another work tapes of $\mathcal{U}$ is used to store the values of the transition function of $M_\alpha$. The last work tape is used to keep record of the current state of $M_\alpha$. Other techniques are required to obtain the tighter bounds of the theorem as stated above (see section 1.7 of Arora \& Borak).
\end{proof}

\section{Undecidable Functions}

Some functions, indeed most, are not computable. For instance,
\[
 UC(\alpha) =
  \begin{cases} 
      \hfill 0    \hfill & \text{if $M_\alpha(\alpha)$ outputs 1} \\
      \hfill 1 \hfill & \text{otherwise} \\
  \end{cases}
\]
is not computable. To see this, take any TM $M$ and its encoding $\alpha$ so that $M=M_\alpha$. By definition, $M_\alpha(\alpha)$ and $UC(\alpha)$ do not agree.

The most famous undecidable function is the halting function:
\[
 HALT(x,\alpha) =
  \begin{cases} 
      \hfill 1    \hfill & \text{if $M_\alpha$ halts on input $x$} \\
      \hfill 0 \hfill & \text{otherwise} \\
  \end{cases}
\]
We prove that it is undecidable by showing that its computability would imply the computability of $UC$, thereby deriving a contradiction. Indeed, suppose there exists TM $M_{HALT}$ which computes $HALT$. Then we can compute $UC$ with $M_{UC}$ defined as follows: first run $M_{HALT}(\alpha,\alpha)$; if the result is 0, meaning $M_\alpha(\alpha)$ does not halt, return 1; otherwise, run $\mathcal{U}(\alpha,\alpha)$ and return its negation.

\section{Time Complexity Classes}

\begin{definition}
A \textit{language} $L$ is a subset of $\{0,1\}^*$. This may be equivalently represented by a boolean function $f:\{0,1\}^*\rightarrow\{0,1\}$.
\end{definition}

\begin{definition}
A language $L$ is in $DTIME(T(n))$ iff $\exists$ TM $M$, $\exists c>0$ so that $M$ runs in time $c\dot T(n)$ and decides $L$, i.e. [$x\in L\Rightarrow M(x)$ outputs 1] and [$x\notin L\Rightarrow M(x)$ outputs 0].
\end{definition}

\begin{definition}
$P$, which stands for \textit{polynomial time}, is defined by $P=\bigcup_{k=1}^{\infty}DTIME(n^k)$.
\end{definition}

\noindent Some important languages in $P$ include:
\begin{itemize}
\item graph connectivity
\item linear programming
\item primality testing
\item greatest common denominator
\item circuit evaluation
\end{itemize}

\begin{definition}
$L\in NP$ if there exists a polynomial $p(n)=n^c$ and a polytime TM $M$ such that, for all $x$,
\begin{equation}
x\in L \Leftrightarrow \exists u \ \{|u|\le|x|^c \ \& \  M(x,u)=1\}
\end{equation}
Here, $u$ is referred to as the \textit{witness}.
\end{definition}

Important languages in $NP$ include:
\begin{itemize}
\item $P\subseteq NP$
\item independent set problem (IS)
\item integer linear programming
\item SAT, circuit-SAT, 3SAT
\end{itemize}

\end{document}
