\documentclass{article}
\usepackage[margin=1in]{geometry}
\usepackage{subfig}
\usepackage{amssymb}
\usepackage{amsmath,amsthm}
\usepackage{graphicx}
\newcounter{lecnum}

\newcommand{\lecture}[4]{
   \newpage
   \setcounter{lecnum}{#1}
   \noindent

   \begin{center}
   \framebox{
      \vbox{\vspace{2mm}
    \hbox to 16cm { {\bf CS602 Applied Algorithms
                        \hfill 2019-20 Sem II} }
       \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}
}

\newcommand{\R}{\mathbb{R}}
\newcommand{\transpose}{\mathtt{T}}

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




\begin{document}

%\lecture{**LECTURE-NUMBER**}{**DATE**}{**LECTURER**}{**SCRIBE**}
\lecture{6}{January 28}{Rohit Gurjar}{Rajat Majoka}
\paragraph{Binary Search Puzzle:} You need to find an unknown rational number p/q (assume $p,q \in Z$ , $p,q \le M$). You are allowed queries like `is $\alpha \ge p/q $'?
\section*{Feasibility in coNP}
\paragraph{Example: }Consider the following linear program. Let P be a polyhedron given by the following set of linear constraints 
\begin{eqnarray} 
x_1 & \ge & 0 \label{eq:x31} \\
x_2 & \ge & 0  \label{eq:x32}\\
x_1 + x_2 & \le & 1 \label{eq:x33} \\
x_2 - 2x_1 & \ge & 2\label{eq:x34} 
\end{eqnarray}
As from the below figure we can state that there is no feasible solution for this LP.
\begin{figure}[!hbt]
    \centering
    \includegraphics[width=50mm,scale=0.8]{graph.png}
    \label{fig:graph}
\end{figure}

We can also prove this Algebraically, (\ref{eq:x31}) * 3 + (\ref{eq:x34}) will give $x_1+x_2 \ge 2$.
\begin{eqnarray} 
x_1 + x_2 & \ge & 2  \label{eq:x35}\\
-x_1 - x_2 & \ge & -1  \label{eq:x36} 
\end{eqnarray}
Now adding both (\ref{eq:x35}) and (\ref{eq:x36}) will give $0 \ge 1$ which is incorrect. Therefore the given LP is not feasible. We will now prove this for any linear program.
\begin{definition}[Cone]
$C \in \mathbb{R}^n$ is a cone if for every $z \in C$ , $\alpha z \in C$, $\forall \alpha \ge 0$ 
\end{definition}
\begin{definition}[Convex cone]
A cone $C \in \mathbb{R}^n$ is a convex cone if $\alpha x + \beta y$ belongs to C, for any positive scalars $\alpha, \beta$, and any x, y in C.
\end{definition}
\begin{definition}[Polyhedral Cone]
A cone C is called Polyhedral Cone if it can be represented by a finite set of vectors $v_1,v_2 \cdots v_k $ such that C is the conical combination of $\{v_1,v_2 \cdots v_k\}$, i.e., $ C=\{a_1v_1+\cdots +a_kv_k \mid a_i\ge 0,v_i\in \mathbb {R}^{n}\}$
\end{definition}
\begin{lemma}
A Polyhedral Cone can be described by $Ax \le \textbf{0}$ \{$A \in \mathbb{R}^{m\times n}, x \in \mathbb{R}^n$\}.
\end{lemma}
A proof of this lemma can be obtained by Fourier-Motzkin elimination, just like we did in case of a convex hull of points (Lecture 4).
\begin{corollary}
For a polyhedral cone $C = \alpha_1v_1+\alpha_2v_2+\cdots+\alpha_kv_k $ where $v_i \in \mathbb{R}^n, \alpha_i \ge 0$ , If $u \not\in C$ for some $u \in \mathbb{R}^n$ then $\exists a \in \mathbb{R}^n $ such that $a^\transpose u > 0$ but $a^\transpose z \le 0 ,\forall z \in C$.
\label{co:th}
\end{corollary}
\begin{lemma}[Farkas' Lemma]
Let $A \in \mathbb{R}^{m\times n}$ and $b \in \mathbb{R}^m$. If $Ax \le b$ is not feasible then $\exists  y \in \mathbb{R}^{m}$ , $y=(y_1,\cdots,y_m) \ge 0 $ such that $y^\transpose A = \textbf{O}$ and $y^\transpose b =- 1$.
\label{cla:farkas}
\end{lemma}
\subsection*{Farkas' Lemma from Corollary}Let $A \in \mathbb{R}^{m\times n}$, $b \in \mathbb{R}^m$. As $Ax \leq b$ is composed of $m$ constraints, it can be written individually as
\begin{eqnarray} 
a_1^\transpose x -b_1& \le & 0 \nonumber \\
a_2^\transpose x -b_2& \le & 0 \nonumber\\
&\vdots \nonumber\\
a_m^\transpose x -b_m& \le & 0 \nonumber
\end{eqnarray}
where $a_i \in \mathbb{R}^{ n}$. Now define a vector $v_i=$($a_i , b_i$) i.e., $\{a_{i1},a_{i2},\cdots,a_{in},b_i\}$.\\
Defining C as conical combination of vectors $v_i$, i.e., $C=cone(v_1,v_2,\cdots,v_m)$.
If $Ax \leq b$ is not feasible then we need to  to show that the vector $\{0,0\cdots,0,-1\}$ belongs to the set C. We will use   Corollary \ref{co:th} for this.

Suppose $u= \{0,0\cdots,0,-1\}$, for contradiction suppose $u \not\in C$ then by corollary \ref{co:th} $\exists \beta \in \mathbb{R}^{n+1}$ such that:
\begin{eqnarray} 
\beta^\transpose u & > & 0 \label{eq:x37} \\
\beta^\transpose v_i & \le & 0 \text{ for each } 1\leq i \leq m. \label{eq:x38}
\end{eqnarray}
Write $\beta=\{\lambda,\beta_{n+1}\}$. By (\ref{eq:x37}) and (\ref{eq:x38}) we get:
\begin{eqnarray} 
\beta_{n+1}  & < & 0  \label{eq:x39}\\
\lambda^\transpose a_i + \beta_{n+1}b_i & \le & 0 \label{eq:x310} 
\end{eqnarray}
Divide equation (\ref{eq:x310}) by $-\beta_{n+1}$ and let $\gamma = -\lambda/\beta_{n+1}$. Now,
\begin{eqnarray} 
\gamma^\transpose a_i -b_i & \le & 0 \label{eq:x311}\\
\gamma^\transpose a_i  & \le & b_i \label{eq:x312}
\end{eqnarray}
Equation (\ref{eq:x312}) can be written as
\begin{eqnarray} 
a_i^\transpose\gamma  & \le & b_i \label{eq:x313}
\end{eqnarray}
which shows that $\gamma$ is a feasible solution which is a contradiction to the assumption in the Lemma \ref{cla:farkas}. Therefore $u \in C$ which proves the Farkas' lemma.
\subsection*{Farkas' Lemma Another Form}Let $A \in \mathbb{R}^{m\times n}$, $b \in \mathbb{R}^m$. If the system  $x \in \mathbb{R}^n$, $Ax = b , x \ge 0$  is not feasible then $\exists y = \{y_1,y_2,\cdots,y_m\}$ where $y_i \in \mathbb{R}$ such that 
\begin{eqnarray} 
y^\transpose A & \ge & 0 \label{eq:x314}\\
y^\transpose b  & < & 0 \label{eq:x315}
\end{eqnarray}
\section*{Separating hyperplane}
\begin{definition}[Separating Hyperplane]
Let  $C \in \mathbb{R}^n$ be a closed convex set and $x \in \mathbb{R}^n$ not in C. Then x and C can be strictly separated by a separating hyperplane.
\end{definition}
% \begin{figure}[!hbt]
%     \centering
%     \includegraphics[width=50mm,scale=0.8]{seph.png}
%     \label{fig:seph}
% \end{figure}
\subsection*{Proof of Separating Hyperplane}
Let  $C \in \mathbb{R}^n$ be a closed convex set and $p \in \mathbb{R}^n$ not in $C$.
Let $z\in C$ be the closest point in $C$ from $p$. The equation of the line joining the points $p$ and $z$ is parallel to $z-p$. Now,the hyperplane perpendicular to the line joining $p$ and $z$ and passing through $z$ has the equation :
\begin{eqnarray} 
(z-p)^\transpose x & = & (z-p)^\transpose z \label{eq:x316}
\end{eqnarray}
Here x is any point on that hyperplane with equation (\ref{eq:x316}).
\paragraph{To prove: }For any point $x\in C$,  $(z-p)^\transpose x \ge (z-p)^\transpose z$.\\
For contradiction suppose not, then $\exists x$ such that
\begin{eqnarray} 
(z-p)^\transpose x & < & (z-p)^\transpose z \label{eq:x317}
\end{eqnarray}
As C is convex, now for every $\lambda \in [0,1]$, point $\lambda x + (1-\lambda)z$ lies in $C$. Now the distance between this point and p will be:
\begin{eqnarray} 
=||p-(\lambda x +(1-\lambda)z)||^2\\
=||p-z||^2 + \lambda^2 ||x-z||^2-2\lambda (z-p)^\transpose (z-x) 
\end{eqnarray}
Note that the term $2\lambda (z-p)^\transpose (z-x)$ is positive. We can choose our $\lambda$ to be small enough so that the term with $\lambda^2$ will be negligible and thus, the distance between $\lambda x + (1-\lambda)z$ and $p$ will be less than $z$ and $p$ i.e., $||p-z||^2$. This is a contradiction as $z$ has the smallest distance in $C$ from $p$.
Therefore, $\forall x \in C$
\begin{eqnarray} 
(z-p)^\transpose x & \ge & (z-p)^\transpose z \label{eq:x318}
\end{eqnarray}
Assuming $z-p =a$ and $(z-p)^\transpose z =b$,we have equation
\begin{eqnarray} 
a^\transpose x & - & b \label{eq:x319}
\end{eqnarray}
So, $\forall x \in C ,a^\transpose x  -  b \ge 0 $ from equation \ref{eq:x318}.\\
For $x=p$ , $a^\transpose x  -  b < 0$ as $-(z-p)^\transpose (z-p) < 0$ .Therefore $a^\transpose x  -  b$ will act as a hyperplane separating point $p$ from all points $x \in C$.


\end{document}