$$ \newcommand{\RR}{\mathbb{R}} \newcommand{\QQ}{\mathbb{Q}} \newcommand{\CC}{\mathbb{C}} \newcommand{\NN}{\mathbb{N}} \newcommand{\ZZ}{\mathbb{Z}} \newcommand{\FF}{\mathbb{F}} \renewcommand{\epsilon}{\varepsilon} % ALTERNATE VERSIONS % \newcommand{\uppersum}[1]{{\textstyle\sum^+_{#1}}} % \newcommand{\lowersum}[1]{{\textstyle\sum^-_{#1}}} % \newcommand{\upperint}[1]{{\textstyle\smallint^+_{#1}}} % \newcommand{\lowerint}[1]{{\textstyle\smallint^-_{#1}}} % \newcommand{\rsum}[1]{{\textstyle\sum_{#1}}} \newcommand{\uppersum}[1]{U_{#1}} \newcommand{\lowersum}[1]{L_{#1}} \newcommand{\upperint}[1]{U_{#1}} \newcommand{\lowerint}[1]{L_{#1}} \newcommand{\rsum}[1]{{\textstyle\sum_{#1}}} % extra auxiliary and additional topic/proof \newcommand{\extopic}{\bigstar} \newcommand{\auxtopic}{\blacklozenge} \newcommand{\additional}{\oplus} \newcommand{\partitions}[1]{\mathcal{P}_{#1}} \newcommand{\sampleset}[1]{\mathcal{S}_{#1}} \newcommand{\erf}{\operatorname{erf}} $$

17  Defining Continuity

Highlights of this Chapter: we formalize the concept of continuity, one of the foundational definitions in the analysis of functions. We provide an equivalent definition built out of sequences, and use it to prove ‘continuity analogs’ of the limit theorems. Finally, we prove that continuous functions are determined by their values on a dense set, an oft-useful result allowing one to reduce various arguments to considerations about rational numbers.

What does continuity mean? In pre-calculus classes, we often first hear something like “you can draw the graph without picking up your pencil”. This is a good guide to start with for a formal definition: its clearly capturing some property that is easy to check by visual inspection! But it’s not precise: terms like “you” and “pencil”, as well as modal phrases like “can draw” are nowhere to be found in the axioms of ordered fields! How can we say the same thing, using words we have access to?

17.1 Continuity

First, a function is an input-output machine, so we should rephrase things in terms of inputs and outputs. When a graph makes a jump (where you’d have to pick up your pencil), the output changes a lot even when the input barely does. Thus, not having to pick up your pencil means you change the input by a little bit, the output changes by a little bit.

This is totally something we can make precise! A good start is by giving names to things: we want to say for any change in the input smaller than some \(\delta\), we know the output cant change that much: maybe its maximum is some other small change \(\epsilon\):

Definition 17.1 (Continuity with \(\epsilon-\delta\)) A function \(f\) is continuous at a point \(a\) in its domain if for every \(\epsilon>0\) there is some threshold \(\delta\) where if \(x\) is within \(\delta\) of \(a\), then \(f(x)\) is within \(\epsilon\) of \(f(a)\). As a logic sentence: \[\forall \epsilon>0\,\exists\delta>0\, \forall x\, |x-a|<\delta\implies |f(x)-f(a)|<\epsilon\]

A function is continuous on a set \(X\subset\RR\) if it is continuous at \(a\) for each \(a\in\RR\). A function is continuous if it is continuous on its domain.

17.1.1 Using this Definition

This definition looks a lot like the sequence definition, at least in terms of the order of the quantifiers. And so we can work with it the same way: playing the “\(\epsilon\)-\(\delta\) game” instead of the \(\epsilon\)-\(N\) game.

Example 17.1 Any constant function \(f(x)=c\) is continuous at every real number \(a\).

Example 17.2 The function \(y=x\) is continuous at every real number \(a\).

This generalizes directly to functions like \(f(x)=2x+1\), where now for a fixed \(\epsilon\) we may wish to take \(\delta=\epsilon/2\) after some scratch work:

Exercise 17.1 Show that linear functions \(y=mx+b\) are continuous at every \(a\in\RR\).

Like any definition, its good after seeing a few examples to also turn and look at non-examples:

Example 17.3 The step function \[h(x)=\begin{cases} 0 & x\leq 0\\ 1 & x>0 \end{cases}\] is discontinuous at \(0\), but is continuous at all other real numbers.

Thus, a function with a jump in it is discontinuous right at the jump, as we expect. This shows its possible for a function to be discontinuous at a single point, but things can get much stranger!

Example 17.4 The characteristic function of the rational numbers is discontinuous everywhere. \[b(x)=\begin{cases} 1 & x\in\QQ\\ 0 & x\not\in\QQ \end{cases}\]

We saw above a function that is discontinuous at a single point, and then one that is discontinuous everywhere. What’s harder to imagine, is a function that is continuous at a single point. Try thinking about what this might mean!

Exercise 17.2 Show that the following function is continuous at \(0\) and discontinuous everywhere else:

\[g(x)=\begin{cases} x & x\in \QQ\\ 0 & x\not\in\QQ \end{cases}\]

While the \(\epsilon-\delta\) definition is nice in that it looks like the sequence definition, we still end up having to play the \(\epsilon\) game with every argument. Indeed, while some functions are well-suited these, for other relatively simple looking arguments, picking the right \(\delta\) actually turns out to be a bit of work!

Exercise 17.3 Prove that \(f(x)=x^2\) is a continuous function using the \(\epsilon-\delta\) definition.

To avoid having to do such hard work on a regular basis, we will seek to broaden our theoretical toolkit.

17.1.2 Using Sequences

We spent a lot of time working with sequences so far, so it would be nice if we could leverage some of that knowledge as more than just analogy. And indeed we can! In this section, we introduce an alternative definition of continuity, and prove that it is equivalent to our original.

Definition 17.2 (Continuity) Let \(f\) be a real valued function with domain \(D\subset \RR\) and \(a\in D\) a point. Then \(f\) is continuous at \(a\) if for every convergent sequence \(\{x_n\}\subset D\) with \(x_n\to a\), the limit can be taken either before or after applying \(f\): \[\lim f(x_n)=f(\lim x_n)=f(a)\] A function is continuous on a set \(S\subset D\) if it is continuous at each point of \(S\).

Thus, we can think of continuity as the condition that allows us to “pull the limit inside of \(f\)”. It is immediate from the definition that constant functions are continuous at every point of their domain, as is the function \(f(x)=x\).

Example 17.5 The function \(f(x)=x^2\) is continuous on the entire real line.

Proof. Let \(a\in\RR\) be arbitrary, and let \(x_n\) be an arbitrary sequence converging to \(a\). Then by the limit theorem for products, we see that since \(x_n\to a\), it follows that \(x_n^2\to a^2\). Thus, if \(f(x)=x^2\) we have \[\lim f(x_n) = \lim x_n^2 = a^2= f(a)=f(\lim x_n)\] So, \(f\) is continuous at \(x=a\). Since \(a\) was an arbitrary real number, \(f\) is continuous on the entire real line.

Theorem 17.1 (Equivalence of Definitions) Let \(f\) be a real function, and \(a\) a point of its domain. Then \(f\) is continuous by the sequence definition if and only if it is continuous by the \(\epsilon\)-\(\delta\) definition.

This theorem is an equivalence of definitions or an if-and-only-if result, so the proof requires two parts: first we show that continuity implies sequence continuity, and then we show the converse.

Proof (Continuity Implies Sequence Continuity). Let \(f\) be continuous at \(a\), and \(x_n\) an arbitrary sequence converging to \(a\). We wish to show the sequence \(f(x_n)\) converges to \(f(a)\). Choosing an \(\epsilon>0\), we use the assumed continuity to get a \(\delta>0\) where \(|x-a|<\delta\) implies that \(|f(x)-f(a)|<\epsilon\).

But since \(x_n\to a\), we know there must be some \(N\) such that for \(n>N\) we have \(|x_n-a|<\delta\): thus for this same \(N\) we have \(|f(x_n)-f(a)|<\epsilon\).

Putting this all together, this is just the definition of convergence for the sequence \(f(x_n)\) to \(f(a)\): starting with \(\epsilon>0\) we got an \(N\) which for \(n>N\) we can guarantee \(|f(x_n)-f(a)|<\epsilon\). So we are done.

Proof (Sequence Continuity Implies Continuity). Here we prove the contrapositive: that if \(f\) is not continuous at \(a\) then it is also not sequence continuous there.

If \(f\) is not continuous at \(a\) then there is some \(\epsilon\) where for every \(\delta>0\) we can find points within \(\delta\) of \(a\) where \(f(x)\) is more than \(\epsilon\) away from \(f(a)\). From this we need to somehow produce a sequence, so we will take a sequence of such \(\delta\)’s and for each pick some such bad point \(x\).

For example, if we let \(\delta=1/n\) then call \(x_n\) the point with \(|x_n-a|<1/n\) but \(|f(x_n)-f(a)|>\epsilon\). Doing this for all \(n\) produces a sequence where \[a-\frac{1}{n}<x_n<a+\frac{1}{n}\] And so by the squeeze theorem we see that \(x_n\) converges, and its limit is \(a\). But we also know (by our choices of \(x_n\)) that for every element of this sequence |f(x_n)-f(a)|>$, so there’s no way that \(f(x_n)\) converges to \(f(a)\).

Thus, we’ve shown by example that our function is not sequence continuous at \(a\), as required.

When working with this definition of continuity, its important to remember that we need to check \(f(\lim x)=\lim f(x_n)\) for all sequences \(x_n\to a\). If it fails for any individual sequence, that is enough to show the function is not continuous at that point. Thus when proving continuity we will always start with let \(x_n\) be an arbitrary sequence converging to \(a\), and make use of convergence theorems to help us (since we cannot know the particular sequence), whereas for proving discontinuity all we need to do is produce a specific example sequence that fails.

17.2 \(\blacklozenge\) Uniform Continuity

Give definition of uniform delta.

Definition 17.3 (Uniform Continuity: \(\epsilon-\delta\)) A function \(f\) is uniformly continuous on a domain \(D\subset\RR\) if for every \(\epsilon\) there exists a \(\delta\) such that for any \(x,y\in D\) with \(|x-y|<\delta\), it follows that \(|f(x)-f(y)|<\epsilon\).

Here’s an example showing how to use the definition, proving \(x^2\) is uniformly continuous on an interval.

Example 17.6 \(f(x)=x^2\) is uniformly continuous on the interval \([1,3]\).

Here’s some scratch work: let \(\epsilon>0\). Then at any \(a\) we see that \(|f(x)-f(a)|=|x^2-a^2|=|x+a||x-a|\). If \(|x-a|<\delta\) and we want \(|f(x)-f(a)|<\epsilon\), this tells us that we want \[|x+a|\delta<\epsilon\] We don’t know what \(x\) and \(a\) are, but we do know they are points in the interval \([1,3]\)! So, the smallest \(x+a\) could be is \(1+1=2\), and the biggest is \(3+3=6\). This means that \[|x+a|\delta \leq 6\delta\] So, if we can make \(6\delta<\epsilon\), we are good! This is totally possible: just set \(\delta=\epsilon/6\). Below is the rigorous proof.

Proof. Let \(\epsilon>0\), and set \(\delta=\epsilon/6\). Note that for any \(a\in [1,3]\) and any \(x\) within \(\delta\) of \(a\), we know \(a\leq 3\) and \(x\leq 3\) so \(x+a\leq 6\). But this implies that \[|x^2-a^2|=|x+a||x-a|\leq 6|x-a|<6\delta<6\frac{\epsilon}{6}=\epsilon\] And so \(f\) is uniformly continuous, as this single choice of \(\delta\) works for every point \(a\in [1,3]\).

There is also a sequence version of the definition:

Definition 17.4 (Uniform Continuity: Sequences) A function \(f\) is uniformly continuous if for every pair of sequences \(u_n,v_n\) in the domain with \(\lim u_n-v_n=0\), then \(\lim f(u_n)-f(v_n)=0\).

Exercise 17.4 Prove the sequence definition and the \(\epsilon-\delta\) definition of uniform continuity are equivalent.

Uniform continuity is stricter than regular continuity: there are functions which are continuous but are not uniformly continuous:

Example 17.7 The function \(f(x)=1/x\) is continuous, but not uniformly continuous on \((0,1)\). Looking at the sequence \(1/n\) we see \(f(1/n)=1/(1/n)=n\). So, consider the two sequences \(s_n=1/(n+1)\) and \(t_n=1/n\). These have \(s_n-t_n\to 0\) by the limit theorems (as each individually goes to zero) yet \(f(s_n)-f(t_n)=(n+1)-n=1\) is a constant sequence not converging to zero.

The sequence \(1/n\) used in this example provides a hint of one way to detect uniformly continuous functions: \(1/n\) is Cauchy but \(f(1/n)\) was not, and we were able to use this to show \(f\) was not uniformly continuous.

Theorem 17.2 (Uniformly Continuity Preserves Cauchy Sequences) If \(f\) is uniformly continuous and \(x_n\) is cauchy, then \(f(x_n)\) is cauchy.

Proof. Let \(x_n\) be an arbitrary Cauchy sequence in the domain of \(f\), and choose arbitrary \(\epsilon>0\). Then by uniform continuity there is a \(\delta\) such that for \(|x-y|<\delta\) we know \(|f(x)-f(y)|<\epsilon\). Since \(x_n\) is Cauchy, given this \(\delta\) we can find an \(N\) such that \(n,m>N\) implies \(|x_n-x_m|<\delta\), and hence \(|f(x_n)-f(x_m)|<\epsilon\). But this is precisely the definition of \(\{f(x_n)\}\) being a Cauchy sequence, so we are done.

Great way to check if a function is not uniformly continuous: can you find a cauchy seq taken to a non-cauchy sequence?

Example (PICTURE) functions like \(\sin(1/x)\) are also not uniformly continuous on \((0,1)\) even though it is bounded.

WARNING: does not work in reverse: the function \(x\mapsto x^2\) takes Cauchy sequences to cauchy seqs but is not uniformly continuous.

Definition 17.5 (Cauchy Continuous Functions) A real valued function \(f\) on a domain \(D\subset \RR\) is Cauchy Continuous if for every cauchy sequence \(\{d_n\}\) in \(D\), the sequence \(f(d_n)\) is also Cauchy.

17.3 Function Limits

Sometimes we need to understand the behavior of a function near a point, without actually being able to compute the function’s value at that point (perhaps, that point is outside the functions’ domain).

Definition 17.6 (Limits of Functions) Let \(f\colon D\to \RR\) and \(a\) be a limit point of \(D\). Then we write \(\lim_{x\to a}f(x)=L\) if for every \(\epsilon>0\) there is a \(\delta>0\) such that if \(x\in D\) and \(|x-a|<\delta\) then \(|f(x)-L|<\epsilon\).

One can alternatively phrase this in terms of sequences:

Exercise 17.5 Prove the following definition is equivalent to \(\lim_{x\to a}f(x)=L\): Given any sequence \(\{x_n\}\) in \(D\) with \(x_n\neq a\) for all \(n\), \(x_n\to a\) implies that \(f(x_n)\to L\).

Example 17.8 \[\lim_{x\to 2}\frac{x^2-4}{x-2}\]

Let \(x_n\) be any sequence converging to \(2\), for which \(x_n\neq 2\) for all \(n\). Then since \(x_n\neq 2\) the denominator of \((x^2-4)/(x-2)\) is never zero, and we can simplify with algebra: \[\frac{x_n^2-4}{x_n-2}=\frac{(x_n+2)(x_n-2)}{x_n-2}=x_n+2\]

Thus, for all \(n\) we have \[\lim \frac{x^2_n-4}{x_n-2}=\lim x_n+2=\lim(x_n)+2=4\]

Since \(x_n\) was arbitrary, this holds for all sequences and

\[\lim_{x\to 2}\frac{x^2-4}{x-2}=4\]

We will be most interested in taking the limit of functions in cases where things are not actually define at \(a\) like the example above: the most important example being the derivative, defined as the limit \(f^\prime(a)=\lim_{x\to a}(f(x)-f(a))/(x-a)\). However a good sanity check with a new definition is to see it performs as expected in known situations

Theorem 17.3 (Limits of Continuous Functions) If \(f\) is continuous at \(a\), then \(\lim_{x\to a}f(x)=f(a)\).

Proof. Let \(x_n\) be a sequence converging to \(a\), but not equal to \(a\) at any term. Since \(f\) is continuous at \(a\), we know the sequence \(f(x_n)\) converges to \(f(a)\). Thus by the sequence definition of function limits \(\lim_{x\to a}f(x)=f(a)\).

As an exercise, re-prove this result using the \(\epsilon-\delta\) definition. Given the similarity of the limit definition to that of continuity, its useful to rephrase continuity in terms of function limits.

Theorem 17.4 \(f\) is continuous at \(a\) if and only if \(\lim_{x\to a}f(x)=f(a)\).

Proof.

17.3.1 One-Sided Limits

The definition of function limit requires understanding all sequences limiting to \(a\) but not equal to \(a\). In applications, its often important to consider more restricted limits, looking only at what happens when we approach \(a\) from above or from below.

Definition 17.7 (Left- and Right-Sided Limits) Let \(f\) be a function

Similarly to above, these definitions have sequence counterparts (prove this, as an exercise):

Definition 17.8 Let \(f\) be a function. Then \(\lim_{x\to a^+}f(x)=L\) if for every sequence \(x_n\to a\) with \(x_n>a\) we have \(f(x_n)\to L\). Similarly \(\lim_{x\to a^-}f(x)=L\) if for every \(x_n\to a\) with \(x_n<a\) we have \(f(x_n)\to L\).

Proposition 17.1 (Limit Exists when Both Sides Agree) Let \(f\) be a function defined on an interval containing \(a\) (but perhaps not at \(a\)). Then \(\lim_{x\to a}f(x)\) exists if and only if both \(\lim_{x\to a^+}f\) and \(\lim_{x\to a^-}f\) both exist, and in this case is equal to their common value.

Proof.

Exercise 17.6 (The Pasting Lemma) Let \(f,g\) be two continuous functions and \(a\in\RR\) is a point such that \(f(a)=g(a)\). Prove that the piecewise function below is continuous at \(a\). \[h(x)=\begin{cases} f(x)& x\leq a\\ g(x) & x> a \end{cases}\]

Exercise 17.7 (One Sided Limits of Monotone Functions) Let \(f\) be a bounded monotone function on the interval \((a,b)\). Then both of the one sided limits exist \[\lim_{x\to a^+}f(x)\hspace{1cm}\lim_{x\to b^-}f(x)\] Hint: show they are the inf and sup of \(\{f(x)\mid x\in (a,b)\}\)

This proves useful in many cases where we know only that our function is monotone, but cannot compute its values. For us, the most important application is Proposition 27.1 where we show exponential functions are differentiable, when we have only assumed they are continuous.

Theorem 17.5 (Dominated Convergence for Function Limits) For each \(k\), let \(f_k(x)\) be a function of \(x\) on a domain \(D\). For a fixed \(a\in\RR\), assume there is some interval \(I\subset D\) containing \(a\) such that:

  • For each \(k\), \(\lim_{x\to a}f_k(x)\) exists.
  • \(\sum_k f_k(x)\) is convergent for each \(x\in I\).
  • There is an \(M_k\) with \(|f_k(x)|\leq M_k\) for all \(x\in I\).
  • \(\sum M_k\) is convergent.

Then, the sum \(\sum_k\lim_{x\to a}f_k(x)\) is convergent and

\[\lim_{x\to a}\sum_k f_k(x)=\sum_k\lim_{x\to a}f_k(x)\]

Proof. Let \(x_n\subset I\) be an arbitrary sequence with \(x_n\to a\) and \(x_n\neq a\). We assumed \(\lim_{x\to a} f_k(x)\) exists. As \(x_n\to a\), it follows by definition that \(\lim_n f_k(x_n)=\lim_{x\to a}f_k(x)\), so this limit also exists, and so (1) holds. Additionally for each fixed \(n\), \(\sum_k f_k(x_n)\) is convergent, as \(x_n\in I\) and we assumed convergence for each \(x\in I\).

As we assumed \(M_k\) bounds \(|f_k(x)|\) for all \(x\in I\) it also does so for all \(x_n\) in our sequence, so (3) and (4) are satisfied for the original dominated convergence, ?thm-tannerys-thm-series. Thus, we may conclude that the series \(\sum_k \lim_n f_k(x_n)\) is convergent, and that \[\lim_n\sum_k f_k(x_n)=\sum_k \lim_n f_k(x_n)=\sum_k \lim_{x\to a}f_k(x)\]

Because \(x_n\) was arbitrary, this applies for all sequences \(x_n\to a\) with \(x_n\neq a\). Thus, the overall limit \(\lim_{x\to a}\sum_k f_k(x)\) exists, and is equal to this common value

\[\lim_{x\to a}\sum_k f_k(x)=\sum_k \lim_{x\to a}f_k(x)\]

17.4 Problems

Exercise 17.8 Prove that the function \(f(x)=|x|\) is continuous at \(x=0\). Then use the fact that \(f(x)=x\) for \(x>0\) and \(f(x)=-x\) for \(x<0\) (which are linear functions) to conclude that \(|x|\) is continuous at every real number.

Exercise 17.9 Show the absolute value \(f(x)=|x|\) is a continuous function on the entire real line, using the sequence definition of continuity.

Exercise 17.10 Prove that \(f(x)=x^2\) is not uniformly continuous on the entire real line, using either the \(\epsilon-\delta\) definition or the sequence definition.

Exercise 17.11 Recall that a function \(f\) is a contraction map if there exists a \(k\in(0,1)\) with \(|f(x)-f(y)|<k|x-y|\) for all \(x,y\). Prove that contraction maps are continuous.

Exercise 17.12 The function \[\mathrm{sgn}(x)=\begin{cases} -1 & x<0\\ 0 & x=0\\ 1 &x>0 \end{cases}\] is discontinuous at \(x=0\), but continuous at every other real number.

Exercise 17.13 Show the function \[\chi_{\QQ}(x)=\begin{cases} 1 & x\in\QQ\\ 0 & x\not\in\QQ \end{cases}\] is discontinuous at every single real number.

Exercise 17.14 \[f(x)=\begin{cases} 0&x<0\\ 17 & x=0\\ x& x>0 \end{cases}\] Then \(\lim_{x\to 0}f(x)=0\)

Exercise 17.15 \[f(x)=\begin{cases} 0&x<0\\ 17 & x=0\\ x^2+1& x>0 \end{cases}\] Then \(\lim_{x\to 0}f(x)\) does not exist.