\documentclass[t]{beamer}
\mode<presentation>

\newcommand{\lecnumber}{8}

\include{cocmacros}
\newcommand{\uuline}[1]{\underline{\underline{#1}}}
\newcommand{\ures}[3]{
  \begin{array}{c@{\hspace*{2em}}c} 
    #1 & #2 \\ \hline \multicolumn{2}{c}{#3} 
  \end{array}}
\newcommand{\uex}{\underline{Example}}
\newcommand{\un}{\underline{Note}}
\newcommand{\utitle}[1]{\underline{#1}\\\smallskip}

\title{\lecnumber. Quantifier-Free Linear Arithmetic}
\date{}
\institute[Stanford University]

\begin{document}

\setbeamertemplate{footline}[text line]
{
	%\begin{large}
	\hspace*{\stretch{1}}\lecnumber - \insertframenumber \bigskip
	%\end{large}
}

\begin{frame}[c]
\Large
\textsc{The Calculus of Computation:}\\
Decision Procedures with\\
Applications to Verification

\bigskip
\bigskip
by\\
Aaron Bradley\\
Zohar Manna

\bigskip
\bigskip
Springer 2007
\end{frame}

\begin{frame}
	\titlepage
\end{frame}

\begin{frame}
\frametitle{Decision Procedures for Quantifier-free Fragments}
For theory $T$ with signature $\Sigma$ and axioms $\Sigma$-formulae of form\\
\qquad $\forall x_1,\ldots,x_n.\ F[x_1,\ldots,x_n]$
\[
\begin{array}{l}
\mbox{Decide if}\\
\qquad F[x_1,\ldots,x_n] \mbox{ or } \exists x_1,\ldots,x_n.\ F[x_1,\ldots,x_n] \mbox{ is } T\mbox{-satisfiable}
\end{array}
\]
\[
\left[ 
\begin{array}{l}
\mbox{Decide if}\\
\qquad F[x_1,\ldots,x_n] \mbox{ or } \forall x_1,\ldots,x_n.\ F[x_1,\ldots,x_n] \mbox{ is } T\mbox{-valid}
\end{array}
\right]
\]
where $F$ is quantifier-free and $\freev(F)=\set{x_1,\ldots,x_n}$

\smallskip
\un: no quantifier alternations

\bigskip
We consider only \underline{conjunctive} quantifier-free $\Sigma$-formulae, i.e.,
conjunctions of $\Sigma$-literals ($\Sigma$-atoms or negations of $\Sigma$-atoms).

For given arbitrary quantifier-free $\Sigma$-formula $F$, convert it into DNF $\Sigma$-formula\\
\qquad $F_1 \bor \ldots \bor F_k$\\
where each $F_i$ conjunctive.

$F$ is $T$-satisfiable iff at least one $F_i$ is $T$-satisfiable.
\end{frame}

\hide{  %%% HIDE
\begin{frame}
\frametitle{Preliminary Concepts}
\utitle{Vector}
\begin{tabular}{ccc}
variable $n$-vector & $n$-vector $\va \in \rationals^n$ & transpose\\
$\vx =
\begin{mymatrix}{c}
x_1 \\ \vdots \\ x_n
\end{mymatrix}$
&
$\va =
\begin{mymatrix}{c}
a_1 \\ \vdots \\ a_n
\end{mymatrix}$
&
$\tr{\va} =
\begin{mymatrix}{ccc}
a_1 & \cdots & a_n
\end{mymatrix}$
\end{tabular}

\bigskip
\utitle{Matrix}
\begin{tabular}{ccc}
$m \times n$-matrix \\
$A \in \rationals^{m \times n}$
& transpose &
\quad \rnode{c1}{column}\hspace*{\stretch{1}}\\
$A =
\begin{mymatrix}{c@{}c@{}c}
a_{11} & \cdots & a_{1n} \\
& \vdots & \\
a_{m1} & \cdots & a_{mn}
\end{mymatrix}$
&
$\tr{A} =
\begin{mymatrix}{c@{}c@{}c}
a_{11} & \cdots & a_{m1} \\
       & \vdots & \\
a_{1n} & \cdots & a_{mn}
\end{mymatrix}$
&
\raisebox{-4ex}{\rnode{r1}{row}} $\begin{mymatrix}{c@{}c@{}c@{}c@{}c}
&& \rnode{c2}{a_{1j}}\\
&& \vdots\\
\rnode{r2}{a_{i1}} & \cdots & a_{ij} & \cdots a_{in}\\
&& \vdots\\
&& a_{mj}
\end{mymatrix}$
\psset{nodesep=4pt}
\nccurve[angleA=0,angleB=90]{->}{c1}{c2}
\nccurve[angleA=90,angleB=180]{->}{r1}{r2}
\end{tabular}
\end{frame}

\begin{frame}
\utitle{Multiplication}
vector-vector\\
\qquad $
\displaystyle
\tr{\va}\vb
=
[a_1\ \cdots\ a_n]
\begin{mymatrix}{c}
b_1 \\ \vdots \\ b_n
\end{mymatrix}
=
\sum_{i=1}^n a_i b_i
$\\
matrix-vector\\
\smallskip
\qquad $
A\vx =
\begin{mymatrix}{rrr}
a_{11} & \cdots & a_{1n} \\
\multicolumn{3}{c}{\vdots} \\
a_{m1} & \cdots & a_{mn}
\end{mymatrix}
\begin{mymatrix}{r}
x_1 \\ \vdots \\ x_n
\end{mymatrix}
=
\begin{mymatrix}{c}
\sum_{i=1}^n a_{1i} x_i \\
\vdots \\
\sum_{i=1}^n a_{mi} x_i
\end{mymatrix}
$\\
\bigskip
matrix-matrix\\
\smallskip
\qquad $
\begin{array}{c@{}c@{}c@{}c}
\begin{mymatrix}{ccc}
\\ & a_{ik} & \\ \\
\end{mymatrix}
&
\begin{mymatrix}{ccc}
\\ & b_{kj} & \\ \\
\end{mymatrix}
& = &
\begin{mymatrix}{ccc}
\\ & p_{ij} & \\ \\
\end{mymatrix}
\\
A & B && P
\end{array}$\\

where $ p_{ij} = \va_i \vb_j =
\begin{mymatrix}{ccc}
a_{i1} & \cdots & a_{in}
\end{mymatrix}
\begin{mymatrix}{r}
b_{1j} \\ \vdots \\ b_{nj}
\end{mymatrix}
=
\displaystyle
\sum_{k=1}^n a_{ik}b_{kj}$
\end{frame}

\begin{frame}
\utitle{Special Vectors and Matrices}
$\vzero$ - vector (column) of $0$s\\
$\vone$ - vector of $1$s\\
\smallskip
Thus $\displaystyle \tr{\vone}\vx = \sum_{i=1}^n x_i$

\bigskip
$I = \begin{mymatrix}{ccc}
1 && 0\\
& \ddots &\\
0 && 1
\end{mymatrix}$ \underline{identity} matrix ($n \times n$)\\
\smallskip
Thus $IA = AI = A$

\bigskip
\underline{unit vector} $e_i = \begin{mymatrix}{c}
	0\\
	\vdots\\
	\rnode{i2}{1}\\
	\vdots\\
	0
\end{mymatrix} \quad \rnode{i1}{i}$
\psset{nodesep=6pt}
\ncline{->}{i1}{i2}
\end{frame}

\begin{frame}
\underline{Vector Space} - set $S$ of vectors closed under addition
and scaling of vectors. That is,\\
\qquad if $\vv_1,\ldots,\vv_k \in S$ \quad then \quad $\lambda_1 \vv_1 + \cdots + \lambda_k \vv_k \in S$\\
\qquad for $\lambda_1,\ldots,\lambda_n \in \reals$.

\bigskip
\utitle{Linear Equation}
\qquad \qquad $F\ :\ \Rnode{A}{A} \Rnode{X}{\vx} = \Rnode{B}{\vb}$\\
\smallskip
\rnode{AL}{$m\times n$-matrix} \qquad \rnode{XL}{variable $n$-vector} \qquad \rnode{BL}{$m$-vector}
\psset{nodesep=3pt}
\ncline[offset=-3pt]{->}{AL}{A}
\ncline[offset=3pt]{->}{XL}{X}
\ncline[offset=3pt]{->}{BL}{B}

represents the $\srat$-formula\\
\smallskip
\hspace*{\stretch{1}} $F:\
(a_{11}x_1 + \cdots + a_{1n}x_n = b_1)
\band \cdots \band
(a_{m1}x_1 + \cdots + a_{mn}x_n = b_m)$

\bigskip
\utitle{Gaussian Elimination}
Find $\vx$ s.t. $A\vx = \vb$ by elementary row operations
\begin{itemize}
\item Swap two rows.
\item Multiply a row by a nonzero scalar.
\item Add one row to another.
\end{itemize}
\end{frame}

\begin{frame}
\uex:\\
\smallskip
Solve
\[
\begin{mymatrix}{rrr}
3 & 1 & 2 \\
1 & 0 & 1 \\
2 & 2 & 1
\end{mymatrix}
\begin{mymatrix}{r}
x_1 \\ x_2 \\ x_3
\end{mymatrix}
=
\begin{mymatrix}{r}
6 \\ 1 \\ 2
\end{mymatrix}
\]
Construct the augmented matrix
\[
\begin{mymatrix}{rrr|r}
3 & 1 & 2 & 6 \\
1 & 0 & 1 & 1 \\
2 & 2 & 1 & 2
\end{mymatrix}
\]
Apply the row operations as follows:
\begin{enumerate}
\item Add $-2\va_1 + 4\va_2$ to $\va_3$
\[
\begin{mymatrix}{rrr|r}
3 & 1 & 2 & 6 \\
1 & 0 & 1 & 1 \\
0 & 0 & 1 & -6
\end{mymatrix}
\]
\end{enumerate}
\end{frame}

\begin{frame}
\begin{enumerate}
\setcounter{enumi}{1}
\item Add $-\va_1 + 2\va_2$ to $\va_2$
\[
\begin{mymatrix}{rrr|r}
3 & 1 & 2 & 6 \\
0 & -1 & 1 & -3 \\
0 & 0 & 1 & -6
\end{mymatrix}
\]
This augmented matrix is in \underline{triangular} form.
\end{enumerate}
Solving\\
\qquad $x_3 = -6$\\
\qquad $-x_2 - x_3 = -3 \quad \Bimplies \quad x_2 = -3$\\
\qquad $3x_1 + x_2 + 2x_3 = 6 \quad \Bimplies \quad x_1 = 7$\\
\bigskip
The solution is $\vx = \tr{[7\ -3\ -6]}$
\end{frame}

\begin{frame}
\utitle{Inverse Matrix}
$A^{-1}$ is the \underline{inverse} matrix of square matrix $A$ if
\[ AA^{-1} = A^{-1}A = I \]

Square matrix $A$ is \underline{nonsingular (invertible)} if its inverse $A^{-1}$ exists.

\bigskip
How to compute $A^{-1}$ of $A$?
\[ \Rnode{AI}{[A\ |\ I]} \qquad \qquad \qquad \Rnode{IA}{[I\ |\ A^{-1}]} \]
\psset{nodesep=4pt}
\ncline{->}{AI}{IA}
\Bput{\begin{tabular}{c}elementary\\row operations\end{tabular}}

\bigskip
How to compute $k$th column of $A^{-1}$?

Solve $A\vy = e_k$, i.e.
\[
\rnode{AK}{
\renewcommand{\arraystretch}{.5}
\begin{mymatrix}{c|c}
& 0\\
& \vdots\\
\quad A \quad & 1 \\
& \vdots\\
& 0
\end{mymatrix}
}
\qquad \qquad \qquad
\rnode{Y}{\begin{array}{c}
\vy = \ldots\\
(k\mbox{th column of }A^{-1})
\end{array}
}
\]
\psset{nodesep=4pt}
\ncline{->}{AK}{Y}
\Bput{\begin{tabular}{c}elementary\\row operations\end{tabular}}
\end{frame}

\begin{frame}
\utitle{Linear Inequality}
\smallskip
\qquad $G:\ A\vx \le b$\\
\smallskip
represents the $\srat$-formula\\
\smallskip
\hspace*{\stretch{1}} $G:\ (a_{11}x_1 + \cdots + a_{1n}x_n \le b_1) \band \cdots \band (a_{m1}x_1 + \cdots + a_{mn}x_n \le b_m)$\\
\smallskip
The inequality describes a \underline{polyhedron} in $\reals^n$.

\bigskip
For $m\times n$-matrix $A$, $m$-vector $b$, variable $n$-vector $\vx$ where $m \ge n$:

\smallskip
An $n$-vector $\vv$ is a \underline{vertex} of $A\vx \le b$ if there is nonsingular
$n \times n$-submatrix $A_0$ and corresponding $n$-subvector $b_0$ s.t.\\
\smallskip
\qquad $A_0 \vv = b_0$
\end{frame}

\begin{frame}
\utitle{Optimization Problem}
\[
\begin{optmax}{\tr{\vc}{\vx} \qquad \qquad \ \ \ldots \mbox{objective function}}
A\vx & \le & \vb \qquad \ldots \mbox{constraints}
\end{optmax}
\]
\underline{Solution}:  vertex $\vv^*$ satisfying $A\vx \le \vb$ and maximize
$\tr{\vc}\vx$.  That is,\\
\smallskip
\qquad $A\vv^* \le \vb$ and\\
\qquad $\tr{\vc}\vv^*$ is maximal: $\tr{\vc}\vv^* \ge \tr{\vc}\vu$ for all $\vu$ satisfying $A\vu \le \vb$

\medskip
\begin{itemize}
\item If $A\vx \le \vb$ is unsatisfiable \quad $\Bimplies$ \quad maximum is $-\infty$
\item It's possible that the maximum is unbounded\\ \quad $\Bimplies$ \quad maximum is $\infty$
\end{itemize}
\end{frame}

\begin{frame}
\uex: Consider optimization problem:
\[
\begin{optmax}{
\underbrace{\begin{mymatrix}{cccc} 1 & 1 & -1 & -1 \end{mymatrix}}_{\tr{\vc}}
\underbrace{\begin{mymatrix}{r} x \\ y \\ z_1 \\ z_2 \end{mymatrix}}_{\vx}
}
\underbrace{
\begin{mymatrix}{rrrr}
-1 & 0 & 0 & 0 \\
0 & -1 & 0 & 0 \\
0 & 0 & -1 & 0 \\
0 & 0 & 0 & -1 \\
1 & 1 & 0 & 0 \\
1 & 0 & -1 & 0 \\
0 & 1 & 0 & -1
\end{mymatrix}
}_{A}
\underbrace{
\begin{mymatrix}{r}
x \\ y \\ z_1 \\ z_2
\end{mymatrix}
}_{\vx}
& \le &
\underbrace{
\begin{mymatrix}{r}
0 \\ 0 \\ 0 \\ 0 \\ 3 \\ 2 \\ 2
\end{mymatrix}
}_{\vb}
\end{optmax}
\]
$A$ is a $7 \times 4$-matrix, $\vb$ is a $7$-vector, and\\
 $\vx$ is a variable $4$-vector representing the four variables
$\set{x,y,z_1,z_2}$.
\end{frame}

\begin{frame}
\underline{Example (cont):}\\
\smallskip
The objective function is
\[
(x - z_1) + (y - z_2)~.
\]
The constraints are equivalent to the $\srat$-formula
\[
\begin{array}{l}
x \ge 0 \band y \ge 0 \band z_1 \ge 0 \band z_2 \ge 0 \\
\mbox{} \band x + y \le 3 \band x - z_1 \le 2 \band y - z_2 \le 2
\end{array}
\]
$\vv = \tr{[2\ 1\ 0\ 0]}$ is a \underline{vertex} of the constraints.
For the nonsingular submatrix $A_0$ (rows 3, 4, 5, 6 of $A$), we have
\[
\underbrace{
\begin{mymatrix}{rrrr}
0 & 0 & -1 & 0 \\
0 & 0 & 0 & -1 \\
1 & 1 & 0 & 0 \\
1 & 0 & -1 & 0
\end{mymatrix}
}_{A_0}
\underbrace{
\begin{mymatrix}{r}
2 \\ 1 \\ 0 \\ 0
\end{mymatrix}
}_{\vv}
=
\underbrace{
\begin{mymatrix}{r}
0 \\ 0 \\ 3 \\ 2
\end{mymatrix}
}_{b_0}
\]
\end{frame}

\begin{frame}
\utitle{Duality Theorem}
For
$A \in \integers^{m\times n}$, $\vb \in \integers^m$, 
$\vc \in \integers^n$,
\[
\mathsf{max}\set{\tr{\vc}\vx\ |\ A\vx \le \vb}
=
\mathsf{min}\set{\tr{\vy}\vb\ |\ \vy \ge \vzero \band \tr{\vy}A = \tr{\vc}}
\]
if the constraints are satisfiable.

\bigskip
That is,\\
\smallskip
\quad maximizing the function $\tr{c}\vx$ over $A\vx \le \vb$\\
\quad (the \underline{primal} form of the optimization problem)\\
\smallskip
\quad \qquad is equivalent to\\
\smallskip
\quad minimizing the function $\tr{\vy}\vb$ over all the nonnegative $\vy$\\
\quad s.t. $\tr{\vy}A=\tr{\vc}$\\
\quad (the \underline{dual} form of the optimization problem)
\end{frame}

\begin{frame}
\utitle{Outline of Algorithm}
Given $\srat$-formula
\[
\begin{array}{r}
F:\
a_{11}x_1 + \cdots + a_{1n}x_n \le b_1
\band \cdots \band
a_{m1}x_1 + \cdots + a_{mn}x_n \le b_m\\
(7.1)
\end{array}
\]
or in matrix notation
\[
F:\ A\vx \le \vb
\]
\smallskip
\un: $\bullet$ equations
\[ a_{i1}x_1 + \ldots + a_{in}x_n=b_i \]
are allowed --- break into two inequalities
\[ a_{i1}x_1 + \ldots + a_{in}x_n \le b_i \band -a_{i1}x_1 - \ldots - a_{in}x_n \le -b_i. \]
$\bullet$ Strict inequalities
\[
a_{i1}x_1 + \cdots + a_{in}x_n < b_i~.
\]
excluded from our discussion --- but can be added.

\end{frame}

\begin{frame}
\utitle{Outline of Algorithm (cont)}
To determine the satisfiability of $F$,\\
\bigskip
\underline{Step 0}: reformulate the satisfiability of $F$ as an
optimization problem
\[
M_F:\ \mathsf{max}\set{\tr{\vc}\vx'\ |\ A'\vx' \le \vb'}
\]
s.t. $F$ is $\trat$-satisfiable iff the optimal value of $M_F$ is
a particular value $v_F$ (derived from the structure of $F$)

\bigskip
\underline{Step 1}, \underline{Step 2}, $\ldots$ (until termination) execute the \underline{simplex method}
\end{frame}

\begin{frame}
\utitle{Outline of Algorithm (cont)}
The simplex method traverses the vertices of $A'\vx' \le \vb'$ 
searching for the maximum of the objective function $\tr{\vc}\vx'$:\\
if $\vv_1,\vv_2,\ldots$ are the traversed vertices in \underline{Step 1}, \underline{Step 2}, $\ldots$, then
\[
\tr{\vc}\vv_1 < \tr{\vc}\vv_2 < \cdots~.
\]

The simplex method terminates at some vertex $\vv_{i^*}$ where
$\tr{\vc}\vv_{i^*}$ is the global optimum

\bigskip
\underline{Final step}: Compare the discovered optimal value $\tr{\vc}\vv_{i^*}$ to the
desired value $v_F$.
\begin{itemize}
\item if equal, then $F$ is $\trat$-satisfiable
\item otherwise, $F$ is $\trat$-unsatisfiable
\end{itemize}

\end{frame}

\begin{frame}
\utitle{Step 0: From Satisfiability to Optimization}

Given $\srat$-formula\\
\smallskip
\qquad $F:\ A\vx \le \vb$ \hspace{\stretch{1}} (7.1)\\
\smallskip
reformulate to new constraint system (new $A$, $\vx$, $\vb$)\\
\smallskip
\qquad $F':\ \vx \ge 0,\ A\vx \le \vb$\\
\smallskip
$F'$ is $\trat$-equisatisfiable to $F$\\
\bigskip
\underline{The trick}: replace each variable $x$ in $F$ by $x_1 - x_2$

\bigskip
Separate the new constraints $A\vx \le \vb$ into
\[
D_1\vx \le \ve_1
\quad\mbox{and}\quad
D_2\vx \ge \ve_2
\quad\mbox{for $\ve_1 \ge \vzero$, $\ve_2 > \vzero$}
\]
\end{frame}

\begin{frame}
\uex: $\srat$-formula
\[
F:\ x + y \ge 1 \band x - y \ge -1~.
\]
To convert it to the form $\vx \ge \vzero \band A\vx \le \vb$,
introduce nonnegative $x_1,x_2$ for $x$ and $y_1,y_2$ for $y$:
\[
F':\
\begin{array}{@{}l}
(x_1-x_2) + (y_1-y_2) \ge 1 \band (x_1-x_2) - (y_1-y_2) \ge -1 \\
\mbox{} \band x_1,x_2,y_1,y_2 \ge 0
\end{array}
\]
$F$ is $\trat$-equisatisfiable to $F'$.  In matrix form,
\[
F':\ \underbrace{
\begin{mymatrix}{rrrr}
-1 & 1 & -1 & 1 \\
-1 & 1 & 1 & -1
\end{mymatrix}
}_{A}
\begin{mymatrix}{r}
x_1 \\ x_2 \\ y_1 \\ y_2
\end{mymatrix}
\le
\underbrace{
\begin{mymatrix}{r}
-1 \\ 1
\end{mymatrix}
}_{\vb}
\]
Since $b_1 < 0$ and $b_2 > 0$, separating constraints yields
\[
\underbrace{\begin{mymatrix}{c@{\ \ }c@{\ \ }c@{\ }c} -1 & 1 & 1 & -1 \end{mymatrix}}_{D_1}
\begin{mymatrix}{c} x_1 \\ x_2 \\ y_1 \\ y_2 \end{mymatrix}
\le
\underbrace{[1]}_{\ve_1}
\ \mbox{and}\ 
\underbrace{\begin{mymatrix}{c@{\ }c@{\ \ }c@{\ }c} 1 & -1 & 1 & -1 \end{mymatrix}}_{D_2}
\begin{mymatrix}{c} x_1 \\ x_2 \\ y_1 \\ y_2 \end{mymatrix}
\ge
\underbrace{[1]}_{\ve_2}
\]

\end{frame}

\begin{frame}
Generate the optimization problem:\\
\smallskip
\qquad $M_F:\ \begin{optmaxn}{\tr{\vone}(D_2\vx - \vz)}
\vx,\vz      & \ge & \vzero & (1) \\
D_1\vx       & \le & \ve_1  & (2) \\
D_2\vx - \vz & \le & \ve_2  & (3)
\end{optmaxn}$
\hspace*{\stretch{1}}(7.2)\\
\smallskip
length of variable vector $\vz$ = \# of rows of $D_2$

\begin{itemize}
\item The point $\vx = \vzero$, $\vz = \vzero$ satisfies
constraints (1) -- (3). It's a vertex.
\item The optimum $v_F$ equals $\tr{\vone}\ve_2$ iff $F$ is
$\trat$-satisfiable.
\end{itemize}

\end{frame}

\begin{frame}
$M_F$ can be written in standard form as\\
\smallskip
\qquad $M_F:
\begin{optmax}{
\underbrace{
\tr{\vone}
\begin{mymatrix}{rr}
D_2 & -I
\end{mymatrix}
}_{\tr{\vc}}
\underbrace{
\begin{mymatrix}{r} \vx \\ \vz \end{mymatrix}
}_{\vy}
}
\underbrace{
\begin{mymatrix}{rr}
-I  &   \\
    & -I \\
D_1 &  \\
D_2 & -I
\end{mymatrix}
}_A
\underbrace{
\begin{mymatrix}{r}
\vx \\ \vz
\end{mymatrix}
}_{\vy}
& \le &
\underbrace{
\begin{mymatrix}{r}
\vzero \\ \vzero \\ \ve_1 \\ \ve_2
\end{mymatrix}
}_{\vb}
\end{optmax}$
\hspace*{\stretch{1}}(7.3)\\
\end{frame}

\begin{frame}
\underline{Example (cont)}:
{\small
\[
\renewcommand{\arraystretch}{0.7}
\underbrace{\begin{mymatrix}{c@{\ \ }c@{\ \ }c@{\ }c} -1 & 1 & 1 & -1 \end{mymatrix}}_{D_1}
\begin{mymatrix}{c} x_1 \\ x_2 \\ y_1 \\ y_2 \end{mymatrix}
\le
\underbrace{[1]}_{\ve_1}
\ \mbox{and}\
\underbrace{\begin{mymatrix}{c@{\ }c@{\ \ }c@{\ }c} 1 & -1 & 1 & -1 \end{mymatrix}}_{D_2}
\begin{mymatrix}{c} x_1 \\ x_2 \\ y_1 \\ y_2 \end{mymatrix}
\ge
\underbrace{[1]}_{\ve_2}
\]
}
$D_2$ has only one row, so $\vz = [z]$.  Pose the following
optimization problem:
{\small
\[
\renewcommand{\arraystretch}{0.7}
\begin{optmax}{
\begin{mymatrix}{cccc} 1 & -1 & 1 & -1 \end{mymatrix}
\begin{mymatrix}{c} x_1 \\ x_2 \\ y_1 \\ y_2 \end{mymatrix}
-
[z]
}
x_1,x_2,y_1,y_2,z \ge 0 \\
\begin{mymatrix}{cccc} -1 & 1 & 1 & -1 \end{mymatrix}
\begin{mymatrix}{c} x_1 \\ x_2 \\ y_1 \\ y_2 \end{mymatrix}
\le
[1] \\
\begin{mymatrix}{cccc} 1 & -1 & 1 & -1 \end{mymatrix}
\begin{mymatrix}{c} x_1 \\ x_2 \\ y_1 \\ y_2 \end{mymatrix}
- [z]
\le
[1]
\end{optmax}
\]
}
$F$ is $\trat$-satisfiable iff the optimum is $\tr{\vone}\ve_2 = 1$.
$[x_1\ x_2\ y_1\ y_2\ z] = [0\ 0\ 0\ 0\ 0]$ is a vertex.

\end{frame}

\begin{frame}
\underline{Example (cont)}:\\
\smallskip
Rewriting the optimization problem
\[
\begin{optmax}{
\underbrace{
\begin{mymatrix}{rrrrr} 1 & -1 & 1 & -1 & -1 \end{mymatrix}
}_{\tr{\vc}}
\begin{mymatrix}{r} x_1 \\ x_2 \\ y_1 \\ y_2 \\ z \end{mymatrix}
}
\underbrace{
\begin{mymatrix}{rrrrr}
-1 & 0 & 0 & 0 & 0 \\
0 & -1 & 0 & 0 & 0 \\
0 & 0 & -1 & 0 & 0 \\
0 & 0 & 0 & -1 & 0 \\
0 & 0 & 0 & 0 & -1 \\
-1 & 1 & 1 & -1 & 0 \\
1 & -1 & 1 & -1 & -1
\end{mymatrix}
}_A
\begin{mymatrix}{r}
x_1 \\ x_2 \\ y_1 \\ y_2 \\ z
\end{mymatrix}
&\le&
\underbrace{
\begin{mymatrix}{r}
0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 1 \\ 1
\end{mymatrix}
}_{\vb}
\end{optmax}
\]

\end{frame}

\begin{frame}
\utitle{Step $i$ ($i \ge 1$): Find a Better Vertex}

Optimization problem of form
\[
\label{eq:stepimax}
\begin{optmax}{\tr{\vc}\vx}
A\vx & \le & \vb
\end{optmax}
\]
we are given satisfying vertex $\vv_i$.
\begin{itemize}
\item  The simplex method traverses vertices of the space defined 
by $A\vx \le \vb$ to find the vertex $\vv^*$ that maximizes $\tr{\vc}\vx$.
\item One iteration seeks vertex $\vv_{i+1}$ ``adjacent'' to $\vv_i$
s.t. $\tr{\vc}\vv_{i+1} > \tr{\vc}\vv_i$.
\item For $i=1$, the initial vertex $\vv_1$ of $M_F$ is $\vx = \vzero$, $\vz = \vzero$
\end{itemize}

\bigskip
\underline{Example (cont)}:\\
\smallskip
\qquad $\vv_1 = \tr{[x_1\ x_2\ y_1\ y_2\ z]} = \tr{[0\ 0\ 0\ 0\ 0]}$ 
\end{frame}

\begin{frame}
\utitle{Find $\vu$}
Construct vector $\vu$ s.t.\\
\smallskip
\qquad $\tr{\vu}A = \tr{\vc}$ \hspace{\stretch{1}}(7.4)

\begin{itemize}
\item Given $\vv_i$
\item Construct $n \times n$ nonsingular submatrix $A_i$ with corresponding rows
$\vb_i$ s.t.
\[
A_i\vv_i = \vb_i~
\]
\item Let $R=$ rows of $A$ in $A_i$
\item Solve
\[
\tr{A_i}\vu_i = \vc
\]
\item Let $\vu$ be $\vu_i$ for indices in $R$ and\\
\qquad \qquad $0$'s for indices not in $R$.
\end{itemize}
\end{frame}

\begin{frame}
\utitle{Example (cont)}
Choose the first five rows of $A$ and $\vb$ ($R = [1;2;3;4;5]$) since
{\small
\[
\renewcommand{\arraystretch}{0.85}
\underbrace{
\begin{mymatrix}{rrrrr}
-1 & 0 & 0 & 0 & 0 \\
0 & -1 & 0 & 0 & 0 \\
0 & 0 & -1 & 0 & 0 \\
0 & 0 & 0 & -1 & 0 \\
0 & 0 & 0 & 0 & -1 \\
\end{mymatrix}
}_{A_1}
\underbrace{
\begin{mymatrix}{r}
0 \\ 0 \\ 0 \\ 0 \\ 0
\end{mymatrix}
}_{\vv_1}
=
\underbrace{
\begin{mymatrix}{r}
0 \\ 0 \\ 0 \\ 0 \\ 0
\end{mymatrix}
}_{\vb_1}
\]
}
Solving (Gaussian elimination)
{\small
\[
\renewcommand{\arraystretch}{0.85}
\underbrace{
\begin{mymatrix}{rrrrr}
-1 & 0 & 0 & 0 & 0 \\
0 & -1 & 0 & 0 & 0 \\
0 & 0 & -1 & 0 & 0 \\
0 & 0 & 0 & -1 & 0 \\
0 & 0 & 0 & 0 & -1 \\
\end{mymatrix}
}_{\tr{A_1}}
\vu_1
=
\underbrace{
\begin{mymatrix}{r} 1 \\ -1 \\ 1 \\ -1 \\ -1
\end{mymatrix}
}_{\vc}
\]
}
yields
{\small
\[
\tr{\vu_i}
=
\begin{mymatrix}{ccccc} -1 & 1 & -1 & 1 & 1 \end{mymatrix}~.
\]
}
Then
{\small
\[
\vu = \tr{\begin{mymatrix}{ccccccc}
-1 & 1 & -1 & 1 & 1 & 0 & 0
\end{mymatrix}}
\]
}
\end{frame}

\begin{frame}
\utitle{Case 1: $\vu \ge \vzero$}
\mbox{In this case, $\vv_i$ is actually the optimal point with
optimal value $\tr{\vc}\vv_i$.}

\bigskip
\underline{Case 2: $\vu \not\ge \vzero$}, i.e. there exists some $u_k < 0$\\
\smallskip
In this case, $\vv_i$ is not the optimal
point.  We need to move along an edge to an adjacent vertex to
increase the value of the objective function.
\begin{itemize}
\item Let $k$ be the lowest index of $\vu$ s.t. $u_k < 0$ (must be $k \in R$)
\item Let $k'$ be the corresponding row of $\vu_i$ and $A_i$\\
and the corresponding column of $-A_i^{-1}$
\end{itemize}

\smallskip
\utitle{Find $\vy$}
\begin{itemize}
\item Let $\vy$ be the $k'$th column of $-A_i^{-1}$.
Solve\\
\smallskip
\qquad $A_i \vy = -\uv_{k'}$\\
\smallskip
Then\\
\smallskip
\qquad $\begin{array}{@{}ll}
\va_\ell\vy = 0 &
\mbox{for every row $\va_\ell$ of $A_i$, $\ell \not = k'$}\\
\va_{k'}\vy = -1 &
\mbox{for the $k'$th row $\va_{k'}$ of $A_i$}
\end{array}$\\
\smallskip
The vector $\vy$ provides the direction along which to move to the
next vertex.
\end{itemize}
\end{frame}

\begin{frame}
\uex:\\
\smallskip
We found so far
\[
\vu_1 = \tr{\begin{mymatrix}{ccccc} -1 & 1 & -1 & 1 & 1
\end{mymatrix}} \mbox{ and } \vu = \tr{\begin{mymatrix}{ccccccc}
-1 & 1 & -1 & 1 & 1 & 0 & 0
\end{mymatrix}}
\]
$k=1$ since the first row of $\vu$ is $-1$. $k'=1$ since it is also the first row of $\vu_i$.\\
Thus, solve\[
\underbrace{
\begin{mymatrix}{rrrrr}
-1 & 0 & 0 & 0 & 0 \\
0 & -1 & 0 & 0 & 0 \\
0 & 0 & -1 & 0 & 0 \\
0 & 0 & 0 & -1 & 0 \\
0 & 0 & 0 & 0 & -1 \\
\end{mymatrix}
}_{A_1}
\vy
=
\underbrace{
\begin{mymatrix}{r}
-1 \\ 0 \\ 0 \\ 0 \\ 0
\end{mymatrix}
}_{-\uv_1}
\]
for $\vy$, yielding $\vy = \tr{\begin{mymatrix}{ccccc} 1 & 0 & 0 & 0 &
0
\end{mymatrix}}$
\end{frame}

\begin{frame}
\utitle{Find $\lambda$ and $v_{i+1}$}
We move along edge $\vy$ to better vertex $\vv_{i+1}$.
\begin{itemize}
\item Let $S = $ indices $\ell$ s.t. $\va_\ell\vy > 0$
\item Find greatest $\lambda \ge 0$ s.t.\\
\smallskip
\qquad $A(\vv_i + \lambda\vy) \le \vb$\\
\smallskip
Choose $\lambda_i$ s.t.\\
\smallskip
\qquad $\begin{array}{@{}ll}
\va_\ell(\vv_i + \lambda_i\vy) = b_\ell
& \mbox{for some }\ell \in S\\
\va_m(\vv_i + \lambda_i\vy) \le b_m
& \mbox{for other }m \ne \ell
\end{array}$\\
\item Set\\
\smallskip
\qquad \fbox{$\vv_{i+1} = \vv_i + \lambda_i\vy$} \hspace{\stretch{1}} (7.7)\\
\smallskip
Vertex $\vv_{i+1}$ is discovered by moving along ray $\vy$ as fas as possible
without violating the constraints. Moreover\\
\qquad $\tr{\vc}\vv_{i+1} > \tr{\vc}\vv_i$
\item Construct $A_{i+1}$ from $A_i$ for next iteration by substituting row
$\va_\ell$ of $A$ for row $\va_{k'}$ of $A_i$
\end{itemize}

\smallskip
Since there are only finite number of vertices to examine,
\underline{Case 1} eventually occurs.

\end{frame}

\begin{frame}
\utitle{Final Step: Satisfiability}

The $\trat$-formula $F$ (7.1) is satisfiable\\
\smallskip iff\\
\smallskip
the returned optimal value of the optimization problem $M_F$ (7.2) is $\tr{\vone}\ve_2$.

\bigskip
\underline{Example (cont)}: We found in \underline{Step 1}\\
\smallskip
\qquad $\vy = \tr{\begin{mymatrix}{ccccc} 1 & 0 & 0 & 0 & 0 \end{mymatrix}}$\\
\smallskip
where
\[
\underbrace{
\begin{mymatrix}{rrrrr}
-1 & 0 & 0 & 0 & 0 \\
0 & -1 & 0 & 0 & 0 \\
0 & 0 & -1 & 0 & 0 \\
0 & 0 & 0 & -1 & 0 \\
0 & 0 & 0 & 0 & -1 \\
\end{mymatrix}
}_{A_1}
\underbrace{
\begin{mymatrix}{c}
1 \\ 0 \\ 0 \\ 0 \\ 0
\end{mymatrix}
}_{\vy}
=
\underbrace{
\begin{mymatrix}{r}
-1 \\ 0 \\ 0 \\ 0 \\ 0
\end{mymatrix}
}_{-\uv_1}
\]
\end{frame}

\begin{frame}
\utitle{Example (cont)}
Compute $A\vy$
{\small
\renewcommand{\arraystretch}{0.85}
\[
\underbrace{
\begin{mymatrix}{rrrrr}
-1 & 0 & 0 & 0 & 0 \\ 0 & -1 & 0 & 0 & 0 \\ 0 & 0 & -1 & 0 & 0 \\ 0 &
0 & 0 & -1 & 0 \\ 0 & 0 & 0 & 0 & -1 \\ -1 & 1 & 1 & -1 & 0 \\ 1 & -1
& 1 & -1 & -1
\end{mymatrix}
}_A
\underbrace{
\begin{mymatrix}{r}
1 \\ 0 \\ 0 \\ 0 \\ 0
\end{mymatrix}
}_{\vy}
=
\begin{mymatrix}{r}
-1 \\ 0 \\ 0 \\ 0 \\ 0 \\ -1 \\ 1
\end{mymatrix}
\]
}
$S = [7]$ since $\va_7\vy = 1 > 0$.  Examining the
7th row of the constraints, choose the greatest $\lambda_1$ such
that (7.7b)
{\small
\[
\renewcommand{\arraystretch}{0.85}
\underbrace{
\begin{mymatrix}{r@{\ }r@{\ \ }r@{\ }r@{\ }r}
1 & -1 & 1 & -1 & -1
\end{mymatrix}
}_{\va_7}
(\vv_1 + \lambda_1\vy)
=
\begin{mymatrix}{r@{\ }r@{\ \ }r@{\ }r@{\ }r}
1 & -1 & 1 & -1 & -1
\end{mymatrix}
\left(
\begin{mymatrix}{r}
0 \\ 0 \\ 0 \\ 0 \\ 0
\end{mymatrix}
+
\lambda_1
\begin{mymatrix}{r}
1 \\ 0 \\ 0 \\ 0 \\ 0
\end{mymatrix}
\right)
=
1
\]
}
that is, choose $\lambda_1 = 1$.  Therefore, (7.7c)\\
\smallskip
\qquad \fbox{
$\vv_2 = \vv_1 + \lambda_1\vy = \tr{\begin{mymatrix}{rrrrr} 1 & 0 & 0 & 0 & 0 \end{mymatrix}}$
}

\end{frame}

\begin{frame}
\utitle{Example (cont):}
Form $A_2$ from $A_1$ replacing the 1st row ($k'=1$) of $A_1$ by the 7th row ($\ell=7$) of $A$.
{\small
\[
A_2 =
\begin{mymatrix}{rrrrr}
1 & -1 & 1 & -1 & -1 \\
0 & -1 & 0 & 0 & 0 \\
0 & 0 & -1 & 0 & 0 \\
0 & 0 & 0 & -1 & 0 \\
0 & 0 & 0 & 0 & -1 \\
\end{mymatrix}
\]
}
This move to vertex $\vv_2$ makes progress:
{\small
\[
\underbrace{
	\begin{mymatrix}{r@{\ }r@{\ \ }r@{\ }r@{\ }r}
	1 & -1 & 1 & -1 & -1
	\end{mymatrix}
}_{\tr{\vc}}\underbrace{
	\begin{mymatrix}{r}
	0 \\ 0 \\ 0 \\ 0 \\ 0
	\end{mymatrix}
}_{\vv_1} = 0 < \underbrace{
	\begin{mymatrix}{r@{\ }r@{\ \ }r@{\ }r@{\ }r}
	1 & -1 & 1 & -1 & -1
	\end{mymatrix}
}_{\tr{\vc}}\underbrace{
	\begin{mymatrix}{r}
	1 \\ 0 \\ 0 \\ 0 \\ 0
	\end{mymatrix}
}_{\vv_2} = 1~.
\]
}
Now $R = [7;2;3;4;5]$ (rows of $A$ in $A_2$).
\end{frame}

\begin{frame}
\utitle{Example (cont):}
Solve 
{\small
\[
\renewcommand{\arraystretch}{0.75}
\underbrace{
	\begin{mymatrix}{rrrrr}
	1 & 0 & 0 & 0 & 0 \\
	-1 & -1 & 0 & 0 & 0 \\
	1 & 0 & -1 & 0 & 0 \\
	-1 & 0 & 0 & -1 & 0 \\
	-1 & 0 & 0 & 0 & -1 \\
	\end{mymatrix}
}_{\tr{A_2}}\vu_2 = \underbrace{
	\begin{mymatrix}{r}
	1 \\ -1 \\ 1 \\ -1 \\ -1
	\end{mymatrix}
}_{\vc}
\]
}
for $\vu_2$ yielding $\vu_2 = \tr{[1\ 0\ 0\ 0\ 0]}$.  Since $\vu_2 \ge 0$, we are
in \underline{Case 1}: we have found an optimum point, $\vv_2$, with optimal
value $1$.

Since we have that $v_F = \tr{\vone}\ve_2 = 1$,
the equality of the optimial point and $v_F$ implies that\\
\smallskip
\qquad $F:\ x + y \ge 1 \band x - y \ge -1$\\
\smallskip
is $\trat$-satisfiable.  In particular, extract from
{\small
\[
\renewcommand{\arraystretch}{0.75}
\begin{mymatrix}{r}
x_1 \\ x_2 \\ y_1 \\ y_2 \\ z
\end{mymatrix}
= \vv_2 =
\begin{mymatrix}{r}
1 \\ 0 \\ 0 \\ 0 \\ 0
\end{mymatrix}
\]
}
the assignment\\
\smallskip
\qquad $ x = x_1-x_2 = 1 - 0 = 1
\quad\mbox{and}\quad
y = y_1-y_2 = 0 - 0 = 0~,$\\
\smallskip
which indeed satisfies $F$.
\end{frame}

\begin{frame}
\uex: $\srat$-formula (7.1)
\[
F:\ x \ge 0 \band y \ge 0 \band x \ge 2 \band y \ge 2 \band x + y \le 3~,
\]
or, in matrix form,
{\small
\[
\renewcommand{\arraystretch}{0.85}
F:\
\begin{mymatrix}{rr}
-1 & 0 \\
0 & -1 \\
-1 & 0 \\
0 & -1 \\
1 & 1
\end{mymatrix}
\begin{mymatrix}{r}
x \\ y
\end{mymatrix}
\le
\begin{mymatrix}{r}
0 \\ 0 \\ -2 \\ -2 \\ 3
\end{mymatrix}
\]
}
Is $F$ $\trat$-satisfiable?

\medskip
{\bf Step 0}

Because $x$ and $y$ are already constrained to be nonnegative, we do
not need to introduce new $x_1,x_2,y_1,y_2$.  Rewrite:
\[
\underbrace{[1\ 1]}_{D_1}
\begin{mymatrix}{r}
x \\ y
\end{mymatrix}
\le \underbrace{[3]}_{\ve_1}
\quad\mbox{and}\quad
\underbrace{\begin{mymatrix}{rr} 1 & 0 \\ 0 & 1 \end{mymatrix}}_{D_2}
\begin{mymatrix}{r}
x \\ y
\end{mymatrix}
\ge \underbrace{\begin{mymatrix}{r} 2 \\ 2 \end{mymatrix}}_{\ve_2}
\]
so that $\ve_1 \ge 0$ and $\ve_2 > 0$.
\end{frame}

\begin{frame}
\utitle{Example (cont)}
Then (7.2):
\[
\begin{optmax}{\tr{\vone}(D_2\vx - \vz)}
\vx,\vz      & \ge & \vzero \\
D_1\vx       & \le & \ve_1  \\
D_2\vx - \vz & \le & \ve_2  \\
\end{optmax}
\]
Expanding, we have
\begin{align*}
\tr{\vc}\vx\ &=\
\tr{\vone}
\begin{mymatrix}{rr} D_2 & -I \end{mymatrix}
\begin{mymatrix}{r} x \\ y \\ z_1 \\ z_2 \end{mymatrix}\
=\
[1\ 1]
\begin{mymatrix}{rrrr}
1 & 0 & -1 & 0 \\
0 & 1 & 0 & -1
\end{mymatrix}
\begin{mymatrix}{r} x \\ y \\ z_1 \\ z_2 \end{mymatrix} \\
&=\
\underbrace{
\begin{mymatrix}{rrrr}
1 & 1 & -1 & -1
\end{mymatrix}
}_{\tr{\vc}}
\begin{mymatrix}{r} x \\ y \\ z_1 \\ z_2 \end{mymatrix}
\end{align*}
\end{frame}

\begin{frame}
\utitle{Example (cont):}
obtaining the optimization problem (7.3)
\[
\begin{optmax}{
\underbrace{[1\ 1\ -1\ -1]}_{\tr{\vc}}\begin{mymatrix}{r} x \\ y \\ z_1 \\ z_2 \end{mymatrix}
}
\underbrace{
\begin{mymatrix}{rrrr}
-1 & 0 & 0 & 0 \\
0 & -1 & 0 & 0 \\
0 & 0 & -1 & 0 \\
0 & 0 & 0 & -1 \\
1 & 1 & 0 & 0 \\
1 & 0 & -1 & 0 \\
0 & 1 & 0 & -1
\end{mymatrix}
}_{A}
\begin{mymatrix}{r}
x \\ y \\ z_1 \\ z_2
\end{mymatrix}
& \le &
\underbrace{
\begin{mymatrix}{r}
0 \\ 0 \\ 0 \\ 0 \\ 3 \\ 2 \\ 2
\end{mymatrix}
}_{\vb}
\end{optmax}
\]

\end{frame}

\begin{frame}
\utitle{Example (cont):}
Use the initial vertex
\[
\vv_1 =
\begin{mymatrix}{r}
x \\ y \\ z_1 \\ z_2
\end{mymatrix}
=
\begin{mymatrix}{r}
0 \\ 0 \\ 0 \\ 0
\end{mymatrix}
\]
in {\bf Step 1}.

\medskip
$F$ is satisfiable iff the optimal value $v_F$ is equal to
\[
\tr{\vone}\ve_2 = [1\ 1]\begin{mymatrix}{rr} 2 \\ 2 \end{mymatrix} = 4~.
\]
We use the simplex algorithm to find the optimum.
\end{frame}

\begin{frame}
\utitle{Example (cont):}
{\bf Step 1}

\smallskip
Choose rows $R = [1;2;3;4]$ of $A$ and $\vb$, giving
\[
\underbrace{
	\begin{mymatrix}{rrrr}
	-1 & 0 & 0 & 0 \\
	0 & -1 & 0 & 0 \\
	0 & 0 & -1 & 0 \\
	0 & 0 & 0 & -1
	\end{mymatrix}
}_{A_1}
\underbrace{
	\begin{mymatrix}{r}
	0 \\ 0 \\ 0 \\ 0
	\end{mymatrix}
}_{\vv_1}
=
\underbrace{
	\begin{mymatrix}{r}
	0 \\ 0 \\ 0 \\ 0
	\end{mymatrix}
}_{\vb_1}
\]
Solving
\[
\underbrace{
	\begin{mymatrix}{rrrr}
	-1 & 0 & 0 & 0 \\
	0 & -1 & 0 & 0 \\
	0 & 0 & -1 & 0 \\
	0 & 0 & 0 & -1
	\end{mymatrix}
}_{\tr{A_1}}
\vu_1 = \underbrace{
	\begin{mymatrix}{r}
	1 \\ 1 \\ -1 \\ -1
	\end{mymatrix}
}_{\vc}
\]
yields $\vu_1 = \tr{[-1\ -1\ 1\ 1]}$.
Adding $0$s for the rows not in $R$ produces $\vu$:
\[
\vu = \tr{\begin{mymatrix}{ccccccc} -1 & -1 & 1 & 1 & 0 & 0 & 0\end{mymatrix}}~.
\]

\end{frame}

\begin{frame}
\utitle{Example (cont):}
Since $u_1,u_2 < 0$, we are in Case 2 with $k = k' = 1$.  Let
$\vy$ be the first column of $-A_1^{-1}$: solve 
{\small
\[
\renewcommand{\arraystretch}{0.85}
\underbrace{
	\begin{mymatrix}{rrrr}
	-1 & 0 & 0 & 0 \\
	0 & -1 & 0 & 0 \\
	0 & 0 & -1 & 0 \\
	0 & 0 & 0 & -1
	\end{mymatrix}
}_{A_1}\vy = \underbrace{
	\begin{mymatrix}{r}
	-1 \\ 0 \\ 0 \\ 0
	\end{mymatrix}
}_{-\ve_1}
\]
}
to yield $\vy = \tr{\begin{mymatrix}{cccc} 1 & 0 & 0 & 0
\end{mymatrix}}$.  Then $S = [5;6]$; \ie, the 5th and 6th rows
$\va$ of $A$ are such that $\va\vy > 0$.  Choose the largest
$\lambda_1$ such that\\
\smallskip
\qquad $A(\vv_1 + \lambda_1\vy) \le \vb$\\
\smallskip
\end{frame}

\begin{frame}
\utitle{Example (cont):}
Focusing on the 5th and 6th rows of $A$ (since $S'=[5;6]$), choose the largest
$\lambda_1$ such that
\[
\renewcommand{\arraystretch}{0.85}
\underbrace{
\begin{mymatrix}{rrrr}
1 & 1 & 0 & 0 \\
1 & 0 & -1 & 0
\end{mymatrix}
}_{\mbox{rows 5,6 of $A$}}
\left(
\underbrace{
\begin{mymatrix}{r}
0 \\ 0 \\ 0 \\ 0
\end{mymatrix}
}_{\vv_1}
+
\lambda_1
\underbrace{
\begin{mymatrix}{r}
1 \\ 0 \\ 0 \\ 0
\end{mymatrix}
}_{\vy}
\right)
\le
\underbrace{
\begin{mymatrix}{r}
3 \\ 2
\end{mymatrix}
}_{\mbox{rows 5,6 of $\vb$}}
\]
Namely, choose $\lambda_1 = 2$ (and $\ell = 6$).  Then
\[
\vv_2 = \vv_1 + \lambda_1\vy =
\begin{mymatrix}{r}
0 \\ 0 \\ 0 \\ 0
\end{mymatrix}
+
2
\begin{mymatrix}{r}
1 \\ 0 \\ 0 \\ 0
\end{mymatrix}
=
\begin{mymatrix}{r}
2 \\ 0 \\ 0 \\ 0
\end{mymatrix}
\]
\end{frame}

\begin{frame}
\utitle{Example (cont):}
Replace the 1st row of $A_1$ (since $k' = 1$) by the 6th row of $A$
(since $\ell = 6$) to produce
\[
A_2 =
\begin{mymatrix}{rrrr}
1 & 0 & -1 & 0 \\
0 & -1 & 0 & 0 \\
0 & 0 & -1 & 0 \\
0 & 0 & 0 & -1
\end{mymatrix}
\quad\mbox{and}\quad
\vb_2 =
\begin{mymatrix}{r}
2 \\ 0 \\ 0 \\ 0
\end{mymatrix}
\]

Have we made progress?  Yes, for
\[
\tr{\vc}\vv_1 = 0 < 2 = \tr{\vc}\vv_2~.
\]
The objective function has increased from $0$ to $2$.

\end{frame}

\begin{frame}
\utitle{Example (cont):}
{\bf Step 2}\\
\smallskip
Now $R = [6;2;3;4]$ (the indices of rows of $A$ in $A_2$).  Solve \\
\smallskip
\qquad 
$
\underbrace{
	\begin{mymatrix}{rrrr}
	1 & 0 & 0 & 0 \\
	0 & -1 & 0 & 0 \\
	-1 & 0 & -1 & 0 \\
	0 & 0 & 0 & -1
	\end{mymatrix}
}_{\tr{A_2}}\vu_2 = \underbrace{
	\begin{mymatrix}{r}
	1 \\ 1 \\ -1 \\ -1
	\end{mymatrix}
}_{\vc}
$
\\
\smallskip
to yield $
\renewcommand{\arraystretch}{0.5}
\begin{array}{cccccc}
\vu_2 = [&1& -1& 0& 1&]^\mathsf{T}\\
&6&2&3&4
\end{array}
$.  Then filling in $0$s for the other rows of $A$
produces:\\
\smallskip
\qquad $
\renewcommand{\arraystretch}{0.5}
\begin{array}{ccccccc}
\vu = [0& -1& 0& 1& 0& 1& 0]^\mathsf{T}\\
&2&3&4&&6
\end{array}
$\\
\smallskip
$u_2 < 0$, so $k = 2$, which corresponds to row $k'
= 2$ of $\vu_2$.  According to Case 2, let $\vy$ be the 2nd
column of $-A_2^{-1}$: solve $A_2\vy = -\uv_2$ to yield $\vy = \tr{[0\
1\ 0\ 0]}$.  Then the 5th and 7th rows $\va$ of $A$ are such
that $\va\vy > 0$ so that $S = [5;7]$.
\end{frame}

\begin{frame}
\utitle{Example (cont):}
Focusing on the 5th and
7th rows of $A$, choose the largest $\lambda_2$ such that\\
\smallskip
\qquad 
$
\underbrace{
\begin{mymatrix}{rrrr}
1 & 1 & 0 & 0 \\
0 & 1 & 0 & -1
\end{mymatrix}
}_{\mbox{rows 5,7 of $A$}}
\left(
\underbrace{
\begin{mymatrix}{r}
2 \\ 0 \\ 0 \\ 0
\end{mymatrix}
}_{\vv_2}
+
\lambda_2
\underbrace{
\begin{mymatrix}{r}
0 \\ 1 \\ 0 \\ 0
\end{mymatrix}
}_{\vb}
\right)
\le
\underbrace{
\begin{mymatrix}{r}
3 \\ 2
\end{mymatrix}
}_{\mbox{rows 5,7 of $\vb$}}$

\medskip
Choose $\lambda_2 = 1$ (and $\ell = 5$).  Then
\[
\vv_3 = \vv_2 + \lambda_2\vy =
\begin{mymatrix}{r}
2 \\ 0 \\ 0 \\ 0
\end{mymatrix}
+
1
\begin{mymatrix}{r}
0 \\ 1 \\ 0 \\ 0
\end{mymatrix}
=
\begin{mymatrix}{r}
2 \\ 1 \\ 0 \\ 0
\end{mymatrix}
\]
\end{frame}

\begin{frame}
\utitle{Example (cont):}
Replace the 2nd row of $A_2$ (since $k' = 2$) by the 5th row of $A$
(since $\ell = 5$) to produce
\[
A_3 =
\begin{mymatrix}{rrrr}
1 & 0 & -1 & 0 \\
1 & 1 & 0 & 0 \\
0 & 0 & -1 & 0 \\
0 & 0 & 0 & -1
\end{mymatrix}
\quad\mbox{and}\quad
\vb_3 =
\begin{mymatrix}{r}
2 \\ 3 \\ 0 \\ 0
\end{mymatrix}
\]

Have we made progress?  Yes, for
\[
\tr{\vc}\vv_1 = 0 < \tr{\vc}\vv_2 = 2 < \tr{\vc}\vv_3 = 3~.
\]
The objective function has increased from $2$ to $3$.
\end{frame}

\begin{frame}
\utitle{Example (cont):}
{\bf Step 3}\\
\smallskip
Now $R = [6;5;3;4]$.  Solve $\tr{A_3}\vu_3 = \vc$, yielding $\vu_3 =
\tr{[0\ 1\ 1\ 1]}$.  Now $\vu_3 \ge \vzero$, so we are in Case
1: $\vv_3$ is the optimum with objective value
\[
\underbrace{[1\ 1\ -1\ -1]}_{\tr{\vc}}\underbrace{\begin{mymatrix}{r} 2 \\ 1 \\ 0 \\ 0 \end{mymatrix}}_{\vv_3} = 3~.
\]
{\bf Final Step: Satisfiability}\\
\smallskip
The optimal value of the constructed optimization problem is $3$,
which is less than the required $v_F = 4$ of {\bf Step 0}.  Hence, $F$ is
$\trat$-unsatisfiable.
\end{frame}

} %%% HIDE

\end{document}
