\documentclass[12pt]{article}
\usepackage{amsthm,amsfonts,amsmath,amscd,amssymb,latexsym,epsfig}
\usepackage[all]{xy}
\usepackage{hyperref} %http://arxiv.org/hypertex/
%\usepackage{showkeys}
%
\title{Continuity and Uniform Continuity}
\author{521}
 %
\newcommand{\N}{\mathbf{N}}   % natural numbers
\newcommand{\Z}{\mathbf{Z}}   % integer   "
\newcommand{\Q}{\mathbf{Q}}   % rational  "
\newcommand{\R}{\mathbf{R}}   % complex   "
\newcommand{\eps}{\varepsilon}
\newcommand{\ds}{\displaystyle}

 \newcommand{\jdef}[1]{{\bf #1\index{#1}}}
\newtheorem{PARA}{}%[section]
\newtheorem{theorem}[PARA]{Theorem}
\newtheorem{corollary}[PARA]{Corollary}
\newtheorem{lemma}[PARA]{Lemma}
\newtheorem{proposition}[PARA]{Proposition}
\newtheorem{definition}[PARA]{Definition}
\newtheorem{remark}[PARA]{Remark}
\newtheorem{example}[PARA]{Example}
\newtheorem{exercise}[PARA]{Exercise}
\newtheorem{problem}[PARA]{Problem}
%
\newcommand{\para}{\begin{PARA}\rm}
\newcommand{\arap}{\end{PARA}\rm}
\newcommand{\dfn}{\begin{definition}\rm}
\newcommand{\nfd}{\end{definition}\rm}
\newcommand{\rmk}{\begin{remark}\rm}
\newcommand{\kmr}{\end{remark}\rm}
\newcommand{\xmpl}{\begin{example}\rm}
\newcommand{\lpmx}{\end{example}\rm}
\newcommand{\xrcs}{\begin{exercise}\rm}
\newcommand{\scrx}{\end{exercise}\rm}
\newcommand{\prob}{\begin{problem}\rm}
\newcommand{\borp}{\end{problem}\rm}
%
\newcommand{\medskipnoindent}{\par\medskip\par\noindent}
%
\begin{document}

\maketitle


\bigskip

 

\para Throughout $S$ will denote a subset of
the real numbers $\R$ and $f:S\to\R$ will be a real valued function
defined on $S$. The set $S$ may be bounded like
$$
   S = (0,5)= \{x\in\R: 0<x<5\}
$$
or infinite like
$$
   S = (0,\infty)= \{x\in \R: 0<x\}.
$$
It may even be all of $\R$. The value
$f(x)$ of the function $f$ at the point $x\in S$
will be defined by a formula (or formulas).
\arap

\dfn
The function $f$ is said to be \jdef{continuous on $S$}
iff
$$
  \forall x_0\in S\;\forall\eps>0\;\exists\delta>0\;\forall x\in S
\biggl[ |x-x_0|<\delta\implies |f(x)-f(x_0)|<\eps\biggr].
$$
Hence $f$ is not continuous\footnote{For an example of a function which is {\em not}
continuous see Example~\ref{xmpl:not_continuous} below.} on $S$ iff
$$
  \exists x_0\in S\;\exists\eps>0\;\forall\delta>0\;\exists x\in S
\biggl[ |x-x_0|<\delta\mbox{ and } |f(x)-f(x_0)|\ge\eps\biggr].
$$
\nfd

\dfn
 The function $f$ is said to be \jdef{uniformly continuous on $S$}
iff
$$
 \forall\eps>0\;\exists\delta>0\;  \forall x_0\in S\; \forall x\in S
\biggl[ |x-x_0|<\delta\implies |f(x)-f(x_0)|<\eps\biggr].
$$
Hence $f$ is not uniformly continuous on $S$ iff
$$
  \exists\eps>0\;\forall\delta>0\; \exists x_0\in S\;\exists x\in S
\biggl[ |x-x_0|<\delta\mbox{ and } |f(x)-f(x_0)|\ge\eps\biggr].
$$
\nfd



\para The only difference between the two definitions
is the order of the quantifiers. When you prove $f$ is continuous
your proof will have the form
\begin{quote}\em
    Choose $x_0\in S$. Choose $\eps>0$. Let $\delta= \delta(x_0,\eps)$.
    Choose $x\in S$. \\ Assume $|x-x_0|<\delta$.  $\cdots$
    Therefore $|f(x)-f(x_0)|<\eps$.
\end{quote}
The expression for $\delta(x_0,\eps)$ can involve both $x_0$ and $\eps$
but must be independent of $x$. The order of the quanifiers in the definition
signals this; in the proof $x$
has not yet been chosen at the point where $\delta$ is defined so the definition
of $\delta$ must not involve $x$.
(The $\cdots$ represent the proof that $|f(x)-f(x_0)|<\eps$ follows from the
earlier steps in the proof.)
When you prove $f$ is uniformly continuous
your proof will have the form
\begin{quote}\em
     Choose $\eps>0$. Let $\delta= \delta(\eps)$. Choose $x_0\in S$.
    Choose $x\in S$. \\ Assume $|x-x_0|<\delta$.  $\cdots$
    Therefore $|f(x)-f(x_0)|<\eps$.
\end{quote}
so the expression for $\delta$ can only involve $\eps$ and must not involve
either $x$ or $x_0$.

\pagebreak[2]

   It is obvious that a uniformly continuous function 
is continuous: if we can find a $\delta$ which works
for all $x_0$, we can find one (the same one) which works for
any particular $x_0$.
 We will see below that there
are continuous functions which are not uniformly continuous.
\arap

\xmpl \label{3x+7} Let $S=\R$ and $f(x)=3x+7$.
Then  $f$ is uniformly continuous on $S$.
\lpmx


\begin{proof}
Choose $\eps>0$.
Let $\delta = \eps/3$.
Choose $x_0\in \R$.
Choose $x\in \R$.
Assume $|x-x_0|<\delta$. Then
$$
  |f(x)-f(x_0)|
=  |(3x+7)-(3x_0+7)|
=   3|x-x_0|
<3\delta=\eps.
$$ 
\end{proof}


\xmpl \label{xsqron4} Let $S=\{x\in\R:0<x<4\}$ and $f(x)=x^2$.
Then $f$ is uniformly continuous on $S$.
\lpmx

\begin{proof} Choose $\eps>0$.
Let $\delta = \eps/8$.
Choose $x_0\in S$.
Choose  $x\in S$.
Thus $0<x_0<4$ and $0<x<4$ so $0<x+x_0<8$.
Assume$|x-x_0|<\delta$. Then
$$
  |f(x)-f(x_0)|
=  |x^2-x_0^2|
=   (x+x_0)|x-x_0|
<(4+4)\delta=\eps. 
$$
\end{proof}

\para In both of the preceeding proofs
the function $f$ satisfied  an inequality of form
\begin{equation}\label{lip}
     |f(x_1)-f(x_2)|\le M|x_1-x_2| 
\end{equation}
for $x_1,x_2\in S$. In Example~\ref{3x+7} we had
$$
     |(3x_1+7)-(3x_2+7)| \le 3|x_1-x_2|
$$
and in Example~\ref{xsqron4} we had
$$
     |x_1^2-x_2^2|\le 8 |x_1-x_2|
$$
for $0< x_1,x_2<4$.    An inequality of form~$(\ref{lip})$ is called
a \jdef{Lipschitz inequality} and the constant $M$ is called the 
corresponding \jdef{Lipschitz constant}. 
\arap



\begin{theorem} \label{lipuc} \em If $f$ satisfies~$(\ref{lip})$ 
for  $x_1,x_2\in S$, then $f$  is uniformly continuous on $S$. 
\end{theorem}

\begin{proof} Choose $\eps>0$. Let $\delta=\eps/M$. Choose $x_0\in S$.
Choose $x\in S$. Assume that $|x-x_0|<\delta$. Then
$$
  |f(x)-f(x_0)|\le M|x-x_0| < M\delta = \eps.
$$
\end{proof}

\para The Lipschitz constant 
depend might depend on the interval. For example,
$$
  |x_1^2-x_2^2|= (x_1+x_2)|x_1-x_2| \le 2a |x_1-x_2|
$$
for $0< x_1,x_2<a$ but the function $f(x)=x^2$ does not satisfy a Lipschitz inequality
on the whole interval $(0,\infty)$ since
$$
  |x_1^2-x_2^2|= (x_1+x_2)|x_1-x_2| >M |x_1-x_2|
$$
if $x_1=M$ and $x_2=x_1+1$.  In fact,
\arap


\xmpl  The function $f(x)=x^2$ is continuous
but not uniformly continuous on the interval $S=(0,\infty)$.
\lpmx

\begin{proof} We show $f$ is continuous on $S$, i.e.
$$
  \forall x_0\in S\;\forall\eps>0\;\exists\delta>0\;\forall x\in S
\biggl[ |x-x_0|<\delta\implies |x^2-x_0^2|<\eps\biggr].
$$
Choose $x_0$. Let $a=x_0+1$ and $\delta=\min(1,\eps/2a)$.
(Note that $\delta$ depends on $x_0$ since $a$ does.) 
Choose $x\in S$. Assume $|x-x_0|<\delta$. Then $|x-x_0|<1$
so $x<x_0+1=a$ so $x,x_0<a$ so
$$
   |x^2-x_0^2| =(x+x_0)|x-x_0|\le 2a|x-x_0| < 2a\delta \le 2a\frac{\eps}{2a}=\eps
$$
as required.

We show that $f$ is not uniformly continuous on $S$, i.e.
$$
  \exists\eps>0\;\forall\delta>0\; \exists x_0\in S\;\exists x\in S
\biggl[ |x-x_0|<\delta\mbox{ and } |x^2-x_0^2|\ge\eps\biggr].
$$
Let $\eps=1$. Choose $\delta>0$. Let $x_0=1/\delta$ and $x=x_0+\delta/2$.
Then $|x-x_0|=\delta/2<\delta$ but
$$
   |x^2-x_0^2|= 
          \left|
          \left(\frac{1}{\delta}+\frac{\delta}{2}\right)^2-\left(\frac{1}{\delta}\right)^2
          \right| = 1+\frac{\delta^2}{4} > 1=\eps
$$
as required. (Note that $x_0$ is large when $\delta$ is small.) 
\end{proof}


\para 
According to the Mean Value Theorem from calculus
for a differentiable function $f$ we have
$$
    f(x_1)-f(x_2)  = f'(c)(x_2-x_1).
$$
for  {\em some} $c$   between $x_1$ and $x_2$. 
(The slope $(f(x_1)-f(x_2))/(x_1-x_2)$
of the secant line joining the two points 
$(x_1,f(x_1))$ and $(x_2,f(x_2))$ on the graph is
the same as the slope $f'(c)$ of the tangent point at the intermediate point
$(c,f(c))$.)
If $x_1$ and $x_2$
lie in some interval $S$ and $|f'(c)|\le M$ for {\em all} $c\in S$
we  conclude that the Lipschitz inequality $(\ref{lip})$ holds on $S$.
We don't  want to use the Mean Value Theorem without first proving it, 
but we certainly can use it to guess
an appropriate value of $M$ and then prove the inequality by other means.
 \arap

\para For example, consider the function $f(x)=x^{-1}$ defined
on the interval $S = (a,\infty)$ where $a>0$. 
For $x_1,x_2\in S$ the Mean Value Theorem says that 
$x_1^{-1}-x_2^{-1} = -c^{-2}(x_1-x_2)$ where $c$ is between $x_1$ and
$x_2$.
If $x_1,x_2\in S$ then $c\in S$ (as $c$ is between $x_1$ and $x_2$)
and hence $c>a$ so $c^{-2}< a^{-2}$. We can prove the inequality
$$
   |x_1^{-1}-x_2^{-1}| \le a^{-2}|x_2-x_2| 
$$
for $x_1,x_2\ge a$ as follows. First $a^2\le x_1x_2$ since $a\le x_1$ and $a\le x_2$.
Then
\begin{equation}\label{lip-inv}
      |x_1^{-1}-x_2^{-1}| = \frac{|x_1-x_2|}{x_1x_2} \le  \frac{|x_1-x_2|}{a^2}
\end{equation}
where we have used the fact that $\alpha^{-1}<\beta^{-1}$ if $0<\alpha<\beta$.
It follows that that the function $f(x)$ is uniformly continuous on any interval
$(a,\infty)$ where $a>0$. Notice however that the Lipschitz constant $M=a^{-2}$
depends on the interval. In fact, the function $f(x)=x^{-1}$ does {\em not} satisfy
a Lipshitz inequality on the interval $(0,\infty)$.
\arap

\para We can discover a Lipscitz inequality
for the square root function $f(x)=\sqrt{x}$ in much the same way.
Consider the function $f(x)=\sqrt{x}$ defined
on the interval $S = (a,\infty)$ where $a>0$. 
For $x_1,x_2\in S$ the Mean Value Theorem says that 
$\sqrt{x_1}-\sqrt{x_2} = (x_1-x_2)/(2\sqrt{c})$ where $c$ is between $x_1$ and $x_2$.
If $x_1,x_2\in S$ then $c\in S$ (as $c$ is between $x_1$ and $x_2$)
and hence $c>a$ so $(2\sqrt{c})^{-1}< (2\sqrt{a})^{-1}$. We can prove the inequality
\begin{equation} \label{lip-sqrt} 
   |\sqrt{x_1}-\sqrt{x_2}| \le \frac{|x_1-x_2|}{2\sqrt{a}}
\end{equation}
for $x_1,x_2\ge a$ as follows: Divide the equation
$$
   (\sqrt{x_1}-\sqrt{x_2})(\sqrt{x_1}+\sqrt{x_2})=((\sqrt{x_1})^2-(\sqrt{x_2})^2) = x_1-x_2
$$
by $(\sqrt{x_1}+\sqrt{x_2})$, take absolute values,  and use $(\sqrt{x_1}+\sqrt{x_2})\ge 2\sqrt{a}$.
Again  the Lipschitz constant $M=(2\sqrt{a})^{-1}$
depends on the interval and  the function does {\em not} satisfy
a Lipschitz inequality on the interval $(0,\infty)$.
\arap



\xmpl The function $f(x)=x^{-1}$ is continuous
but not uniformly continuous on the interval $S=(0,\infty)$.
\lpmx

\begin{proof} We show $f$ is continuous on $S$, i.e.
$$
  \forall x_0\in S\;\forall\eps>0\;\exists\delta>0\;\forall x\in S
\biggl[ |x-x_0|<\delta\implies \left|\frac{1}{x}-\frac{1}{x_0}\right|<\eps\biggr].
$$
Choose $x_0$. Let $a=x_0/2$ and $\delta=\min(x_0-a,a^2\eps)$.
Choose $x\in S$. Assume $|x-x_0|<\delta$. Then $x_0-x\le |x-x_0|<x_0-a$
so $-x<-a$ so $a<x$ so $x,x_0<a$ so by~(\ref{lip-inv})
$$
   \left|\frac{1}{x}-\frac{1}{x_0}\right|  \le  \frac{|x_1-x_2|}{a^2} < 
     \frac{\delta}{a^2} \le \frac{a^2\eps}{a^2}=\eps
$$
as required.

We show that $f$ is not uniformly continuous on $S$, i.e.
$$
  \exists\eps>0\;\forall\delta>0\; \exists x_0\in S\;\exists x\in S
\left[ |x-x_0|<\delta\mbox{ and } 
\left|\frac{1}{x}-\frac{1}{x_0}\right|\ge\eps\right].
$$
Let $\eps=1$. Choose $\delta>0$. Let $x_0=\min(\delta,1)$ and $x=x_0/2$.
Then $|x-x_0|=x_0/2\le\delta/2<\delta$ but
$$
   \left|\frac{1}{x}-\frac{1}{x_0}\right|= 
          \left|\frac{1}{x_0/2}-\frac{1}{x_0}\right| 
         = \frac{1}{x_0} \ge 1=\eps
$$
as required. 
\end{proof}

\xmpl \label{sqrt-cont} The function $f(x)=\sqrt{x}$ is uniformly continuous
on the set $S=(0,\infty)$.
\lpmx

\rmk This   example shows that a function can be uniformly continuous
on a set even though it does not satisfy a Lipschitz inequality  on that
set, i.e. the method of Theorem~\ref{lipuc} is not the only method for
proving a function uniformly continuous. The proof we give will use the following idea.
After choosing $\eps>0$ we specify two numbers $a$ and $b$ which will depend on $\eps$.
These numbers will satisfy $0<a<b$. We will choose $\delta$ so that (among other things)
$\delta<b-a$. Then after we choose $x,x_0\in S$ and assume that
$|x-x_0|<\delta$ we will be able to conclude that either both $x_0$ and $x$ are
less than $b$ or both are greater than $a$. We will choose $b$ so small that
$\sqrt{x}$ and $\sqrt{x_0}$ are within $\eps$ of zero for $x,x_0<b$. We will
use a Lipschitz inequality to handle the case where $x,x_0>a$. We give the details
of this proof after some preliminary lemmas. The only properties 
of that square root function that we will use are that $\sqrt{x}$
is defined  for $x\ge 0$ and
satisfies
$$
    \sqrt{x} \ge 0,  \qquad (\sqrt{x})^2=x,  \qquad \sqrt{x^2} = x.  
$$ 
\kmr



\begin{lemma}  \label{sqrt-increasing}
The square root function is increasing:
$$
    0\le a < b \implies\sqrt{a} < \sqrt{b}.
$$ 
\end{lemma}


\begin{proof} Assume $ 0\le a <b$. If $\sqrt{b}\le \sqrt{a}$
then $b=(\sqrt{b})^2\le (\sqrt{a})^2=a$  
contradicting $a < b$.
Hence  $\sqrt{a}<\sqrt{b}$. 
\end{proof}

\begin{lemma} $\sqrt{ab}=\sqrt{a}\sqrt{b}$ for $a,b\ge 0$.
\end{lemma}

\begin{proof}
   $(\sqrt{a}\sqrt{b})^2=(\sqrt{a})^2(\sqrt{b})^2=ab$ so  
   $\sqrt{a}\sqrt{b}=\sqrt{(\sqrt{a}\sqrt{b})^2} =\sqrt{ab}$. 
\end{proof}

\begin{lemma} \label{9alternatives}
 Assume $a<b$. Then for any two numbers $x$ and $y$ at least one of the four
alternatives
\begin{quote}
\begin{tabular}{llll}
   (i)&   $x<b \And y<b$, &
   (ii)&  $a\le x \And a\le y$, \\
   (iii)& $x< a \And b\le y$, &
   (iv)&  $y<a \And b\le x$.
\end{tabular}
\end{quote}
\end{lemma}

\begin{proof} Exactly one of the three alternatives $x<a$, $a\le x<b$, $b\le x$
holds and exactly one of the three alternatives $y<a$, $a\le y<b$, $b\le y$ holds.
There are thus nine cases which we can arrange in a table:
$$
   \begin{array}{c|ccc}
              & x<a   & a\le x<b & b\le x \\ \hline 
          y<a & (i)   & (i)      & (iv) \\
   a\le y < b & (i)   & (i),(ii)  & (ii) \\
     b\le y   & (iii) & (ii)     & (ii)
    \end{array}
$$
In each entry of the table we have indicated the alternative $(i-iv)$ which holds in the 
corresponding case. 
\end{proof}

 
\begin{proof} 
Now we prove what is claimed in Example~\ref{sqrt-cont}, viz.
that the  square root function  is uniformly continuous on the positive
real numbers, i.e.
$$
  \forall \eps>0\,\exists\delta>0\,\forall x,x_0>0
   \biggl[ |x-x_0|<\delta\implies |\sqrt{x}-\sqrt{x_0}|<\eps\biggr].
$$
Choose $\eps>0$. Let $\delta= \min(\eps^2/2, \sqrt{2}\eps^2)$.
Choose $x,x_0>0$. Assume $|x-x_0|<\delta$. Read $a=\eps^2/2$ and $b=\eps^2$
in Lemma~\ref{9alternatives}: we need consider only four cases:
\begin{quote}
\begin{tabular}{llll}
    (i)  &  $x<\eps^2 \And x_0<\eps^2$, &
    (ii) &  $\eps^2/2\le x \And \eps^2/2\le x_0$, \\
   (iii) &  $x< \eps^2/2 \And \eps^2\le x_0$, &
   (iv)   & $x_0<\eps^2/2 \And \eps^2\le x$.
\end{tabular}
\end{quote}

\noindent Cases~(iii) and~(iv) contradict the assumption that $|x-x_0|<\delta\le \eps^2/2=b-a$
so we need only consider cases~(i) and~(ii).
In case~(i) we have $\sqrt{x}<\eps$ and $\sqrt{x_0}<\eps$ by Lemma~\ref{sqrt-increasing}
so $|\sqrt{x}-\sqrt{x_0}|\le \max(\sqrt{x},\sqrt{x_0})<\eps$. In case~(ii) we use
the inequality~(\ref{lip-sqrt}) and get
$$
    |\sqrt{x}-\sqrt{x_0}| \le \frac{|x-x_0|}{2\sqrt{\eps^2/2}}
                           = \frac{|x-x_0|}{\sqrt{2}\eps}
                         < \frac{\delta}{\sqrt{2}\eps} \le \eps. 
$$
\end{proof}

\rmk Of course, $\min(\eps^2/2, \sqrt{2}\eps^2)=\eps^2/2$.
The more complicated formula is given to help the reader understand how
the proof was discovered.
\kmr

\rmk We can also prove that the square root
function is uniformly continuous by taking $\delta = \eps^2$
and using the inequality
$$
     \sqrt{a+b}\le\sqrt{a}+\sqrt{b}.
$$
(To prove the inequality square both sides.) If $|x-x_0|<\eps^2$ then
either 
$x_0\le x<x_0+\eps^2$ (which implies 
$\sqrt{x_0}\le\sqrt{x}<\sqrt{x_0}+\eps$)
or else
$x\le x_0<x+\eps^2$ (which implies 
$\sqrt{x}\le\sqrt{x_0}<\sqrt{x}+\eps$).
In either case $|\sqrt{x}-\sqrt{x_0}|<\eps$.
This proof is simpler
than the one  given but is harder to find since it uses a clever inequality
which the reader might not think of.
\kmr

\xmpl \label{xmpl:not_continuous} The function $f$ defined by
$$
   f(x) = \left\{\begin{array}{ll} 
               1 & \mbox{ if $x>0$} \\
               0 & \mbox{ if $x\le 0$}
           \end{array} \right.
$$
is not continuous.
\lpmx

\begin{proof} In other words,
$$
  \exists x_0\in \R\;\exists\eps>0\;\forall\delta>0\;\exists x\in \R
\biggl[ |x-x_0|<\delta\mbox{ and } |f(x)-f(x_0)|\ge\eps\biggr].
$$
Let $x_0=0$. (No other value of $x_0$ will work here.)
Let $\eps=1$. Choose $\delta>0$. Let $x=\delta/2$.
Then $|x-x_0|=\delta/2<\delta$ but $|f(x)-f(x_0)| = |1-0|=1\ge\eps$.
\end{proof}
\end{document}
