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

\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{4}{January 23}{Rohit Gurjar}{Nikhila Somu}

\begin{definition}[Convex Hull]
For a set of points $S = \{P_1,P_2,...,P_k\}$, $S \subseteq \mathbb{R}^n$, Convex Hull is defined as the set of all points generated by convex combinations of these points, i.e.,

$Convex Hull\{S\} = \{\lambda_1P_1 + \lambda_2P_2 + ... + \lambda_kP_k \mid \lambda_1,\lambda_2,...,\lambda_k \geq 0 \text{ and }  \lambda_1 + \lambda_2 + ... + \lambda_k = 1 \}$.
\end{definition}

\paragraph{Example:}Convex Hull of two points consists of all the points on the line joining the two points. Similarly, convex hull of $n$ points is a polytope having all or some of those $n$ points as vertices.

\begin{claim}
\label{cla:c1}
A polytope is a Convex Hull of its (finitely many) vertices.
\end{claim}

Note: Since every vertex comes from a subset of the linear constraints $Ax \leq b$ being tight and there are only finitely many such subsets (not all give a vertex), we have finitely many vertices.

\begin{theorem}[Carth\'{e}odory Theorem]
For a polytope $P \subseteq \mathbb{R}^n$, any point $z \in P$ can be written as a convex combination of at most $n + 1$ vertices of $P$. 
\end{theorem}

\begin{proof}
Proof by induction:\\
Base case: On triangulating a polytope in $\mathbb{R}^2$, any point inside a polytope will be enclosed in a triangle formed by three of its vertices and hence can be written as their convex combination.\\
Inductive step: Let the theorem hold for $\mathbb{R}^{n-1}$. Take any arbitrary vertex $v$ of $P$. Join $v$ with $z$ by a line and extend it to the other side till it hits a face $F$. Let the point on $F$ where this line meets be $y$. $F$ is at most an $n-1$ dimensional polytope.\\
We can write, $z = \lambda v + (1 - \lambda) y$, $\lambda \geq 0$ where $y = \sum_{i=1}^n \lambda_iv_i$ such that  $ \forall i$, $\lambda_i \geq 0$, $\sum_{i=1}^n \lambda_i=1$ and $v_i$ is a vertex of $P$.\\
Since $y$ is a convex combination of at most $n$ vertices of $F$, $z$ becomes a convex combination of at most $n+1$ vertices as $\lambda+(1-\lambda)\sum_{i=1}^n \lambda_i=1$ and $\forall i$, $(1-\lambda)\lambda_i \geq 0$.
\end{proof}

\begin{claim}
If $P$ is a Convex Hull of some finitely many points, then $P$ can be described by some finitely many linear constraints.
\end{claim}

\begin{proof}
Let the given set have $k$ points  $\{(p_{i,1},p_{i,2},\dots, p_{i,n}) \mid 1\leq i \leq k\}$. Then their convex hull $P$ can be described as follows: set of all points $(x_1,x_2, \dots, x_n) \in \R^n$ such that
there exists 
\[ 0 \leq \lambda_1,\lambda_2, \dots, \lambda_k \text{ such that}\]
\[\lambda_1 + \lambda_2 + \dots + \lambda_k = 1 \text{ and}\]
\[x_j =  \lambda_1 p_{1,j} + \lambda_2 p_{2,j} + \cdots + \lambda_k p_{k,j} \text{ for each } 1\leq j \leq n.\]
This already gives us a description of $P$ with linear constraints. However, the description uses extra variables $\lambda_1, \lambda_2, \dots, \lambda_k$ besides the $x_j$ variables.
We want a description using just the $n$ variables $(x_1,x_2, \dots,x_n)$, since it is a polytope in $\R^n$. 

We can eliminate the $\lambda_i$ variables using Fourier Motzkin Elimination which aims to remove one variable at a time from a set of equations.
In general, if we have the below equations and we want to remove $\lambda$,
\begin{eqnarray*} 
\lambda \geq E1,
\lambda \geq E2,
\lambda \leq E3,
\lambda \leq E4,
\lambda = E5,
\lambda = E6
\end{eqnarray*}
We take all combinations of the RHS expressions and replace the above equations with:
\begin{eqnarray*}
E5 = E6,
E5 \geq E1,
E5 \geq E2,
E5 \leq E3,
E5 \leq E4
\end{eqnarray*}
Note: The RHS expressions should not contain $\lambda$.
Using this repeatedly for all $\lambda_i$'s will give us the desired description.
\end{proof}
\paragraph{Example:} We have two points $v_1=(2,1)$ and $v_2=(1,2)$ and we want to find the linear constraints that describe their Convex Hull $P$.
\begin{eqnarray*}
P = \{\lambda_1v_1 + \lambda_2v_2 | \lambda_1 \geq 0, \lambda_2 \geq 0 , \lambda_1 + \lambda_2 = 1 \}
\end{eqnarray*}
If $(x_1, x_2)$ represents a point in $P$, then:
\begin{eqnarray*}
x_1 = 2\lambda_1 + \lambda_2 \\
x_2 = \lambda_1 + 2\lambda_2
\end{eqnarray*}
Now to remove $\lambda_1$, we rewrite the equations as the following:
\begin{align}
\lambda_1 &= (1/2)x_1 - (1/2)\lambda_2 \label{eq:1}\\
\lambda_1 &= x_2 - 2\lambda_2 \label{eq:2}\\
\lambda_1 &\geq 0 \label{eq:3}\\
\lambda_1 &= 1 - \lambda_2 \label{eq:4}\\
\lambda_2 &\geq 0 \label{eq:5}
\end{align}
Combining RHS of \eqref{eq:4} with \eqref{eq:2}, \eqref{eq:2} with \eqref{eq:1} and \eqref{eq:3} with \eqref{eq:4}, we get rid of equations \eqref{eq:1}, \eqref{eq:2}, \eqref{eq:3}, \eqref{eq:4} to get:
\begin{align}
\lambda_2 &= x_2 - 1 \label{eq:6}\\
\lambda_2 &= (2/3)x_2 - (1/3)x_1\label{eq:7}\\
\lambda_2 &\leq 1\label{eq:8}
\end{align}
To get rid of $\lambda_2$, we combine RHS of \eqref{eq:6} with \eqref{eq:5}, \eqref{eq:6} with \eqref{eq:8} and \eqref{eq:6} with \eqref{eq:7} to get:
\begin{align}
x_1 + x_2 = 3 \label{eq:9}\\
x_2 \geq 1 \label{eq:10}\\
x_2 \leq 2 \label{eq:11}
\end{align}
Our final answer consists of \eqref{eq:9}, \eqref{eq:10} and \eqref{eq:11}.
\end{document}