\chapter{Math Preliminaries}

\section{Non-Negativity Theorems} \label{s-pos:s-im}

The following theorem gives simple conditions that a differentiable
function must satisfy in order to be positive everywhere on a given interval.

\begin{theorem} \label{s-pos:sim-theo}
 Given a continuous function $f$ on an interval $[a,b]$, if
\begin{enumerate}
\item $f(a) \geq c,$ and
\item for all $x \in [a,b)$, if $f(x) \leq c$ then $f'(x)$ exists and $f'(x) \geq 0$,
\end{enumerate}
then for all $x \in [a,b]$, $f(x) \geq c$.
\end{theorem}

\begin{proof}
We prove this by contradiction. Suppose there exists $b' \in [a,b]$ such that $f(b') < c$. Since $f(a) \geq c$ and $f$ is continuous, there exists $a' \in [a,b')$ such that $f(a') = c$ and for all $ x \in (a',b']$, $f(x) < c$ by the Intermediate Value Theorem. 

By the Mean Value Theorem, there exists $x \in (a',b')$ such that
$f'(x)=\frac{f(b')-f(a')}{b'-a'}$. Since $f(x) < c$, it follows by
assumption 2 that $f'(x) \geq 0$. Thus, since $b' > a'$, it follows
that $f(b') \geq f(a')$. But since $f(a') =  c$, it follows that $f(b') \geq c$, which is a contradiction.

\end{proof}

We now prove a similar theorem for functions that have right and left
derivatives that are not necessarily equal to each other. The right
and left derivatives of a continuous function $f$ are defined as follows:

$$f'(x^+) = \lim_{t \rightarrow x^+} \frac {f(t) - f(x)} {t - x}
\text{  (right derivative)} \text{, and}$$
$$f'(x^-) = \lim_{t \rightarrow x^-} \frac {f(t) - f(x)} {t - x} \text{  (left derivative)}.$$

First, we prove a helpful lemma about right and left derivatives of a
continuous function at its local maxima and minima.

\begin{lemma} \label{s-pos:minimax}
Let $f$ be a continuous function defined on $[a,b]$, whose both right
and left derivatives are defined on $(a,b)$. Then, 
\begin{enumerate}
\item
if $x \in (a,b)$ is a local maximum, then $f'(x^+) \leq 0$ and $f'(x^-) \geq 0$;
\item
if $x \in (a,b)$ is a local minimum, then $f(x^+) \geq 0$, and $f(x^-) \leq 0$.
\end{enumerate}
\end{lemma}

\begin{proof}
Let $x$ be a local maximum. Then there exists $\delta > 0$ such that $f(q) \leq f(x)$ for all $ q$ such that $|x - q| < \delta$. Choose such $\delta$ so that
$$a < x - \delta < x < x + \delta < b.$$
Choose $t$ such that $x - \delta < t < x$. Then
$$\frac{f(t) - f(x)}{t - x} \geq 0.$$
Letting $t \rightarrow x^-$, we see that $f'(x^-) \geq 0$.

Now choose $t$ such that $x < t < x + \delta$. Then
$$\frac{f(t) - f(x)}{t - x} \leq 0,$$
which shows that $f'(x^+) \leq 0$.

The statement about local minima can be proven analogously.

\end{proof}

Using Lemma \ref{s-pos:minimax} we prove an analog of the Mean Value Theorem for functions whose right and left derivatives are not necessarily equal.

\begin{lemma} \label{s-pos:mean}
Let $f$ be a continuous function defined on $[a,b]$ whose right and
left derivatives are defined on $(a,b)$. Then there exists $x \in (a,b)$ such that either
$$\frac{f(b)-f(a)}{b-a} \geq f'(x^+) \text{,  or  }$$
$$\frac{f(b)-f(a)}{b-a} \geq f'(x^-).$$
Also, there exists $x \in (a,b)$ such that either
$$\frac{f(b)-f(a)}{b-a} \leq f'(x^+) \text{,  or  }$$
$$\frac{f(b)-f(a)}{b-a} \leq f'(x^-).$$
\end{lemma}

\begin{proof}
Put $h(t) = (f(b) - f(a))t - (b-a)f(t)$. Then $h$ is continuous on $[a,b]$, has right and left derivatives on $(a,b)$, and
$$h(a) = af(b) - bf(a) = h(b).$$
To prove the first half of the lemma it suffices to show that either $h'(x^+) \geq 0$ or $h'(x^-) \geq 0$ for some $x \in (a,b)$, since 
$$h'(x^+)=f(b)-f(a) - (b-a)f'(x^+) \text{  and  } h'(x^+)=f(b)-f(a) - (b-a)f'(x^+).$$

Case 1: $h$ is constant. Then, $h'(x^+) = h'(x^-) = h'(x) = 0$, so the condition holds for all $x$.

Case 2: $h(t) > h(a)$ for some $t \in (a,b)$. By continuity of $h$,
there exists $x \in (a,b)$ which is a local maximum in $(a,
b)$. Lemma \ref{s-pos:minimax} shows that $h'(x^-) \geq 0$.

Case 3: $h(t) < h(a)$ for some $t \in (a,b)$. By continuity of $h$,
there exists $x \in (a,b)$ which is a local minimum in $(a,
b)$. Lemma \ref{s-pos:minimax}  shows that $h'(x^+) \geq 0$.

The second part of the lemma is proved analogously.

\end{proof}

Finally, we are able to prove a theorem similar to our first non-negativity theorem (Theorem \ref{s-pos:sim-theo}), but for functions with unequal right and left derivatives.

\begin{theorem} \label{s-pos:im-theo}
Let $f$ be a continuous function defined on $[a,b]$. If
\begin{enumerate}
\item $f(a) \geq c$;
\item for all $x \in [a,b)$ and $f(x) \leq c$, $f'(x^+)$ and $f'(x^-)$
exist, with $f'(x^+) \geq 0$ and $f'(x^-) \geq 0$,
\end{enumerate}
then for all $ x \in [a,b]$, $f(x) \geq c$.
\end{theorem}

\begin{proof}
Again, we use proof by contradiction. Suppose there exists $b' \in
[a,b]$ such that $f(b') < c$. Since $f(a) \geq c$ and $f$ is
continuous on $[a,b]$, there exists $a' \in [a,b')$ such that $f(a') =
c$ and for all $x \in (a',b']$, $f(x) < c$, by the Intermediate Value Theorem.

By Lemma \ref{s-pos:mean} we have that either 
$$\frac{f(b')-f(a')}{b'-a'} \geq f'({x'}^+) \text{ or } \frac{f(b')-f(a')}{b'-a'} \geq f'({x'}^-)$$
for some $x' \in (a',b')$. Since $f(x) < c$ for all $x \in (a',b']$, both derivatives have to
be  non-negative by property 2, so in either case we have
$\frac{f(b')-f(a')}{b'-a'} \geq 0$. Also, $b'>a'$, so we get $f(b')
\geq f(a')$. But $f(a') = c$, so $f(b') \geq c$, which contradicts our
assumption.
\end{proof}

\section{Non-Increasing Functions}

The following lemma gives simple conditions for a function with unequal right and left derivatives to be non-increasing.

\begin{lemma} \label{lsr:dec}
Let $f$ be a continuous function defined on $[a,b]$ whose right and
left derivatives are defined on (a,b). Then if for
all $x \in (a,b)$, $f'(x^+) \leq 0$ and $f'(x^-) \leq 0$, then $f$ is a non-increasing function.
\end{lemma}

\begin{proof}
This follows directly from Lemma \ref{s-pos:mean}. We have that for
any $a' < b'$ in $[a,b]$, there exists $x \in [a',b']$ such that either
$$\frac{f(b')-f(a')}{b'-a'} \leq f'(x^+) \text{  or  } \frac{f(b')-f(a')}{b'-a'} \leq f'(x^-).$$
But since $b' > a'$ and also $f'(x^+) \leq 0$ and $f'(x^-) \leq 0$, we
get $f(b') \leq f(a')$. Since $a', b'$ were chosen arbitrarily, it
follows that $f$ is non-increasing.

\end{proof}

\section{Derivatives of The $\mathit{max}$ Function}

We prove a useful theorem about the right
and left derivatives of the $\mathit{max}$ function. 

\begin{theorem} \label{th:max}
Let $f$ and $g$ be differentiable functions, and $m(x) =
max(f(x),g(x))$. Then,
\begin{enumerate}
\item the right derivative of $m(x)$ exists and equals the
right derivative of either $f$ or $g$;
\item the left derivative of $m(x)$ exists and equals the left
  derivative of either $f$ or $g$.
\end{enumerate}
\end{theorem}

\begin{proof}
We start with the right derivative. First suppose that there exists
$\delta > 0$, such that for all $t \in [x, x + \delta)$, $m(t)=f(t)$. Then,

$$m'(x^+) = \lim_{t \rightarrow x^+} \frac {m(t) - m(x)} {t - x} =  \lim_{t \rightarrow x^+} \frac {f(t) - f(x)} {t - x} = f'(x^+),$$ 
as needed. Analogously for $m(t) = g(t)$.

Alternatively, suppose that no such $\delta$ exists. This means
that 
for all $\delta > 0$, there
exists a point $t_1 \in [x, x + \delta)$, such that $m(t_1) = f(t_1) > g(t_1)$, and there
also exists a point $t_2 \in [x, x + \delta)$, such that $m(t_2) =
g(t_2) > f(t_2)$. 

Then the following two statements must be true:
\begin{enumerate}
\item
$f(x) = g(x) = p = m(x)$, where $p$ is some real number. 
\begin{proof}
Suppose this is not so. Let $f(x) > g(x)$, without loss of generality.
Then, by continuity of $f$ and $g$, there exists a neighborhood of $x$ in
which for all $ t$, $f(t) > g(t)$. But this contradicts our original
assumption that there does not exist a $\delta$-neighborhood of $x$ in
which $f(t) > g(t)$ for all $t \in [x, x + \delta)$.
\end{proof}

\item
$f'(x^+) = g'(x^+) = q$, where $q$ is some real number. 

\begin{proof}
Suppose this is not so. Then $f'(x^+) = q_1$ and $g'(x^+) = q_2$,
where $q_1 \not= q_2$. Without loss of generality, let's assume that
$q_1 > q_2$. From the definition of the derivative, we know that for
all $\epsilon > 0$, there exist $\delta_1, \delta_2 > 0$, such that
$\forall t' \in (x, x+\delta_1)$ and $\forall t'' \in (x, x+\delta_2)$,  

$$\left| \frac{f(t') - f(x)}{t' - x} - q_1 \right| < \epsilon \text{ and }
\left| \frac{g(t'') - g(x)}{t'' - x} - q_2 \right|< \epsilon.$$

Let's pick $\epsilon < \frac{1}{2} (q_1 - q_2)$, and let $\delta = min(\delta_1,
\delta_2)$. Then, using the result from statement 1, $\forall t \in
(x, x + \delta)$,

$$\left| \frac{f(t) - p}{t - x} - q_1 \right| < \epsilon \text{ and }
\left| \frac{g(t) - p}{t - x} - q_2 \right| < \epsilon.$$

From these inequalities, by choice of $\epsilon$, and using the fact
that $t > x$, it follows that
\begin{align*}
\frac{f(t) - p}{t-x} & > \frac{g(t) - p}{t-x} \\
f(t) - p & > g(t) - p \\
f(t) & > g(t)
\end{align*}

This means that there exists a $\delta$-neighborhood of $x$ in
which $f(t) > g(t)$, which contradicts our original assumption.

\end{proof}
\end{enumerate}

From statement 2 we have that for all $ \epsilon > 0$, there
exists $\delta > 0$ such that $\forall t \in (x,
x+\delta_1)$ the following hold:
$$\left| \frac{f(t) - f(x)}{t - x} - q \right| < \epsilon \text{ and }
\left| \frac{g(t) - g(x)}{t - x} - q \right|< \epsilon.$$
Then $\forall t \in (x, x + \delta)$,
$$\frac{m(t) - m(x)}{t - x} - q = 
        \begin{cases}
        \left| \frac{f(t) - p}{t - x} - q \right| < \epsilon & \text{ if }f(t) \geq g(t) \\
        \left| \frac{g(t) - p}{t - x} - q \right| < \epsilon & \text{ if }f(t) < g(t).
        \end{cases}$$
Thus, in both cases, $\left| \frac{m(t) - m(x)}{t - x} - q \right|
< \epsilon$. This means that 
$$m'(x^+) = \lim_{t \rightarrow x}\frac{m(t) - m(x)}{t - x} = q,$$
which is the same as the right derivative of both $f$ and $g$ at $x$.

The left derivative part is proven analogously.
\end{proof}



%%% Local Variables: 
%%% mode: latex
%%% TeX-master: t
%%% End: 
