% -*-latex-*-
%Proof Complexity Scribe Notes template

% SEE THE "FOR THE SCRIBE SECTION BELOW"

\ifx\CompleteCourse\relax
\ClassScribeSetupA
\else
\documentclass[11pt]{article}
\usepackage{latexsym}

\newtheorem{theorem}{Theorem}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{homework}{Homework}
\newtheorem{conjecture}{Conjecture}
\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}}
\newenvironment{claim}{\begin{trivlist}\item[]{\bf Claim}\ }%
{\end{trivlist}}
\newenvironment{openprob}{\begin{trivlist}\item[]{\bf Open Problem}\ }%
{\end{trivlist}}
\newenvironment{proof-complexity}{\begin{trivlist}\item[]{\bf Proof Complexity}\ }%
{\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{Alan Nash}    % Who is the scribe?
\def\classdate{28 January 2002} % Date of the class
\def\classnumber{4}     % Is this the first, second, ...?

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

\def\classinstructor{Sam Buss}
\def\classtitle{Propositional Proof Complexity}
\def\doctitle{\textup{Math 267a - Propositional Proof Complexity}}
\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.

\def\dotequal{\dot{=}}
\def\iff{\leftrightarrow}
\def\then{\rightarrow}
\def\when{\leftarrow}
\def\reference#1{supply reference: #1}
\def\frege{\ensuremath{\mathcal{F}}}
\def\efrege{\ensuremath{e\mathcal{F}}}
\def\tab{\hbox to 10mm{}}

% 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}

\vspace*{.4in}

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

\section{The Unification Problem}

\subsection{The Problem}

Last time we looked at how to solve the system:
$x = \phi$, $\phi = \psi \then x$.
In general, given: 
\begin{itemize}
\item Variables: $x,y,z,\ldots$ 
\item Function Symbols: $f,g,h,\ldots$, each with specified arity 
(including constants as 0-ary functions) 
\item Terms: built from variables and function symbols 
\item Finite sets of equations: $s_i \dotequal t_i$ (where $s_i,t_i$ are terms) 
\end{itemize}
the \emph{unification problem} is to find a substitution $\sigma$ such that $s_i\sigma = t_i\sigma$
where equality here is equality of symbols.

\begin{example}
Take the system with a single binary function symbol $f$ and equations: 
\begin{eqnarray*}
x_1 & \dotequal & f(x_2,x_2) \\
x_2 & \dotequal & f(x_3,x_3) \\
x_3 & \dotequal & f(x_4,x_4) 
\end{eqnarray*}
a solution is given by $\sigma$ such that: 
\begin{eqnarray*}
\sigma(x_3) & = & f(x_4,x_4) \\
\sigma(x_2) & = & f(f(x_4,x_4),f(x_4,x_4)) \\
\sigma(x_1) & = & f(f(f(x_4,x_4),f(x_4,x_4)),f(f(x_4,x_4),f(x_4,x_4))) 
\end{eqnarray*}
\end{example}

As this example shows, in the worst case the solution's size is exponential in the size
of the problem (total number of symbols to represent it).

\begin{example}
The system with the single equation $f(x_1,x_2) = g(x_1,x_2)$ is unsolvable:
the function symbols clash.
\end{example}


\begin{example}
The system with equations $x \dotequal g(y)$ and $y \dotequal h(x)$ is unsolvable
(the solution must be finite): it yields the derived equation
$x \dotequal g(h(x))$ (``occurs check'').
\end{example}

We will see that these are the only two kinds of things that can go wrong.

\subsection{An Algorithm for the Unification Problem}

First, notice that terms can be represented by ordered directed acyclic diagrams (ODAGs).
By `ordered' we mean that there is a total ordering on each set of edges coming out of a vertex.
When represented as ODAGs, the solutions are always polynomial in size.

To solve an unification problem, we first define an equivalence relation $\approx$ on terms, 
as follows: 
\begin{enumerate}
\item $s \dotequal t \then s \approx t$ (equation in system) 
\item $s = t \then s \approx t$  (equal as strings) 
\item $f(s_1,s_2,\ldots,s_k) \approx f(t_1,t_2,\ldots,t_k) \then \forall i(s_i \approx t_i)$ 
\item $s \approx t \then t \approx s$ 
\item $r \approx s \approx t \then r \approx t$
\end{enumerate}

\begin{example}
Given the system $f(x,g(y)) \dotequal f(h(y),z)$ we have
$x \approx h(y)$ and $z \approx g(y)$
\end{example}

\begin{claim}
A unification problem is solvable iff 
(a) There are no $r\approx s$ so that $r$ and $s$ have different principal (outermost) function symbols and
(b) The $\approx$-equivalence classes are well-ordered (i.e. no cycles) under the extension of the
proper subterm relation to the equivalence classes (i.e., $[r]\prec[s]$ iff $r$ is a proper subterm of $s$)
%question: this last thing is not well defined.  Should we say something like:
%$A \prec B$ iff $\exists r,s([r]=A and [s]=B and r is a subterm of s)
\end{claim}

Proof: $[\Rightarrow]$ suppose that $\sigma$ is a solution.
Then it is easy to show that $r \approx s$  implies $r\sigma=s\sigma$ holds,
by induction on the cases defining $\approx$.
Similarly, the relation ``$r\sigma$ is a proper subterm of $s\sigma$'' is a well-ordering that
refines $r\prec s$.

$[\Leftarrow]$ Define $\sigma$ by induction along $\prec$ as follows.
The base elements are of the form $[x]$, containing only variables and at most a single constant $c$.
If $c\in[x]$ then define $\sigma(x)=c$.
Otherwise, define $\sigma(x)=y$ where $y$ is a new variable that depends only on $[x]$.

For the rest, i.e. $x\in[f(s_1,\ldots,s_k)]$ define 
$\sigma(x)=(f(s_1,\ldots,s_k))\sigma = f(s_1\sigma,\ldots,s_k\sigma)$.

Subclaim: $v\approx s$ implies $r\sigma = s\sigma$ (almost immediate).

Partial proof: Suppose $r=f(r_1,\ldots,r_k)$ and $s=f(s_1,\ldots,s_k)$.
Then by the induction hypothesis, we have $r_i\sigma = s_i\sigma$.

What we have just described is a polynomial time algorithm.
We can obtain the transitive closure using, for example, a breadth-first search or
some other similar means (linear in size of graph).
In fact, it is quadratic time.
Notice that we have considered so far the decision problem;
to provide an output in polynomial time we must output ODAGs.

\reference{Paterson and Wegman} provide a linear-time algorithm.

To unify a set of terms $\{r,s,t,\ldots\}$ means
to unify the set
$\{r\dotequal s, s\dotequal t, \ldots\}$.
Conversely, to unify $\{r_i\dotequal s_i:1\leq i\leq k\}$ is the same as to unify
$\{f(r_1,r_2,\ldots,r_k)=f(s_1,s_2,\ldots,s_k)\}$

\section{Extended Frege Systems (Again)}

Now we look at an alternative definition of extended Frege systems (\efrege-systems).
An \efrege-system is a Frege system (\frege-system) augmented by 
\emph{the extension rule}.  
That is, an \efrege-proof consists of formulas $\phi_1,\ldots,\phi_n$ where
each $\phi_i$ is:
\begin{itemize}
\item an axiom 
\item inferred by a rule from previous formulas 
\item is $z \iff \psi$ where 
\begin{itemize}
\item $z$ does not occur in $\psi$, 
\item $z$ does not occur in any previous line of the proof, and 
\item $z$ does not occur in $\phi_n$.
\end{itemize}
\end{itemize}


To convert an \efrege-proof into a \frege-proof, proceed as follows: 
\begin{itemize}
\item Replace $z$ by $\phi$ wherever $z$ occurs 
\item Replace $\psi \iff \psi$ with a \frege-proof of it ($O(1)$ lines).
\end{itemize}


\begin{theorem} (Statman \cite{Statman:propproofs})
An $n$-line \frege-proof of $\phi$ can be converted into an \efrege proof of $\phi$
with $O(n+|\phi|)$ lines and $O(n+|\phi|^2)$ symbols.
\end{theorem}

\begin{theorem}
Any two \efrege-systems $p$-simulate each other
\end{theorem}

\begin{conjecture}
\frege-systems do not simulate \efrege-systems
\end{conjecture}

% I lost it after about this point.  
% I don't know how to title the table below, or how to supply the references for it.
% Also, the text just below this point is slightly incomplete, 
% but I don't know how to complete it

Notice that in polynomial-size \frege-proofs, each line is a poly\-nomial-size formula,
while in polynomial-size \efrege-proofs, each line is equivalent to a polynomial-size circuit.
This converts to circuits; every use of resolution defines a circuit that is then used
as input to subsequent circuits:
$\psi(x_1,\ldots,x_k,z_1,\ldots,z_\ell)$ where $z_i \iff \chi_i(x_1,\ldots,x_k,z_i,\ldots,z_{i-1})$.

\begin{openprob}
Polynomial size formulas have the same expressive power as polynomial circuits
\end{openprob}

Not only we do not know whether $\frege$ systems simulate $\efrege$ systems
and whether $p$-size formulas simulate $p$-size circuits, 
we also do not know how to prove either one of this implications if the other one holds.


\vskip 2ex
\noindent
\begin{tabular}{|l|l|l|l|}
\hline
Proof     & Nonuniform         & Uniform     & Bounded     \cr
System    & Complexity         & Complexity  & Arithmetic   \cr    
\hline
\frege    & $p$-size formulas  & ALOGTIME    &  $TNC_1$     \cr
\efrege   & $p$-size circuits  & P           &  $PV/S^1_2$  \cr
\hline
\end{tabular}

\vskip 2ex
\noindent For references on this table, see Steve Cook's slides
from the Edinburgh Complexity Workshop, October 2001,
available at
\begin{center}
\tt
http://www.cs.toronto.edu/~sacook/edinburgh.ps
\end{center}

\bibliography{cstheory,logic}

\end{document}

