Hunter Liu's Website

7. Continuity and Compactness

≪ 6. Homework 2, Problem 3 | Table of Contents | 8. Completeness of 2\ell^2

Today’s goal will be to refresh our memories of what continuous functions are, as well as some topological properties of metric spaces such as compactness and connectedenss. Then, we’ll look at how these topological properties interact with continuous functions.

Continuous Functions

You might remember from high school math that continuous functions are those whose graphs you can draw without lifting your pencil. This lends us some good intuition, but it’s not the most rigorous.

Definition 1.

Let (X,dX)\left( X, d_X \right) and (Y,dY)\left( Y, d_Y \right) be two metric spaces. A function f:XYf:X\to Y is continuous at a point x0Xx_0\in X if for every ϵ>0\epsilon>0, there exists a δ>0\delta>0 such that for any xXx\in X such that dX(x,x0)<δd_X\left( x, x_0 \right)<\delta, then dY(f(x),f(x0))<ϵd_Y\left( f(x), f\left( x_0 \right) \right)<\epsilon. ff is continuous if it is continuous at each x0Xx_0\in X.

Put in (very loose) words, a function is continuous if it maps nearby points to nearby points. Note that this does not say that if dY(f(x),f(x0))<ϵd_Y\left( f(x), f\left( x_0 \right) \right)< \epsilon, then dX(x,x0)<δd_X\left( x, x_0 \right)< \delta! This goes the wrong way, as it’s possible for continuous functions to take points in XX that are far apart to points in YY that are close together.

Really continuity is a statement about how ff interacts with the topologies of XX and YY! This can be formalised in the following proposition, which you should be able to prove on your own.

Proposition 2.

Let (X,dX)\left( X, d_X \right) and (Y,dY)\left( Y, d_Y \right) be two metric spaces, and let f:XYf:X\to Y a function. Show that ff is continuous if and only if for all open sets UYU\subseteq Y, f1(U)={xX:f(x)U}f ^{-1}(U) = \left\lbrace x\in X:f(x)\in U \right\rbrace is an open subset of XX.

Proof

First, suppose ff is continuous. Let UYU\subseteq Y. Let x0f1(U)x_0\in f ^{-1}(U); we wish to show that there exists some r>0r>0 such that B(x0,r)f1(U)B \left( x_0,r \right)\subseteq f ^{-1}(U).

Since UU is open and f(x0)Uf\left( x_0 \right)\in U by definition, there exists some ϵ>0\epsilon>0 such that B(f(x0),ϵ)UB \left( f\left( x_0 \right), \epsilon \right)\subseteq U. By definition of continuity, there exists some δ>0\delta>0 so that: xB(x0,δ)    dX(x,x0)<δ    dY(f(x),f(x0))<ϵ    f(x)B(f(x0),ϵ)U    xf1(U). \begin{align*} x\in B\left( x_0, \delta \right) &\implies d_X\left( x, x_0 \right)< \delta \\ &\implies d_Y\left( f(x), f\left( x_0 \right) \right) < \epsilon \\ &\implies f(x)\in B\left( f\left( x_0 \right), \epsilon \right)\subseteq U \\ &\implies x\in f ^{-1}(U). \end{align*} Thus B(x0,δ)f1(U)B \left( x_0, \delta \right)\subseteq f^{-1}(U), and f1(U)f^{-1}(U) is open.

Now suppose f1(U)f ^{-1}(U) is open for all open UYU\subseteq Y. Let x0Xx_0\in X, and let ϵ>0\epsilon>0. We wish to show that there is some δ>0\delta>0 such that dX(x,x0)<δd_X\left( x,x_0 \right)<\delta implies dY(f(x),f(x0))<ϵd_Y\left( f(x), f\left( x_0 \right) \right)<\epsilon.

Let U=B(f(x0,),ϵ)U=B\left( f\left( x_0, \right),\epsilon \right), which is an open set (open balls are open in metric spaces). By assumption, f1(U)f ^{-1}(U) is open, and clearly x0f1(U)x_0\in f ^{-1}(U). So, there exists some δ>0\delta>0 such that B(x0,δ)f1(U)B\left( x_0,\delta \right)\subseteq f ^{-1}(U). Then, we get dX(x,x0)<δ    xB(x0,δ)f1(U)    f(x)U=B(f(x0),ϵ)    dY(f(x),f(x0))<ϵ. \begin{align*} d_X\left( x, x_0 \right)< \delta &\implies x\in B\left( x_0, \delta \right)\subseteq f ^{-1}(U) \\ &\implies f(x) \in U = B \left( f\left( x_0 \right),\epsilon \right) \\ &\implies d_Y\left( f(x), f\left( x_0 \right) \right)<\epsilon. \end{align*} In particular, ff is continuous at x0x_0, and since this argument works for any x0Xx_0\in X, we conclude ff is continuous. \square

There’s not too much to say about this proof — it primarily consists of keeping track of all the right definitions.

Common Mistake 3.

This proposition says that the inverse image of open sets is open. It does not say that the image of an open set is open, i.e. if UXU\subseteq X is open, then f(U)f(U) is not necessarily open. For example, consider f:RRf:\mathbb{R}\to \mathbb{R} (under the usual metric) via f(x)=x2f(x)=x^2. Trust me when I say ff is continuous. Let U=(1,1)U=(-1, 1), which is open; is f(U)f(U) open?

Using this last proposition, you can also show if ff is continuous and CYC\subseteq Y is closed, then f1(C)f ^{-1}(C) is also closed. Recall from last week that closed sets contain all their limit points — perhaps this suggests that ff interacts with limits in some way. In fact,

Exercise 4.

Let (X,dX)\left( X, d_X \right) and (Y,dY)\left( Y, d_Y \right) be metric spaces. Show that a function ff is continuous if and only if it preserves limits — that is, if xnxx_n\to x in XX, then f(xn)f(x)f\left( x_n \right)\to f(x) in YY.

Try this exercise on your own! Like the previous proposition, it mostly amounts to pushing some definitions around.

One of the most important theorems involving continuous functions is the intermediate value theorem. Its proof involves ideas of connectedness (see one of the following sections), though it’s possible to provide more elementary proofs.

Theorem 5. Intermediate Value Theorem

Let f:[a,b]Rf:[a, b]\to \mathbb{R} be a continuous function such that f(a)<0f(a)<0 and f(b)>0f(b)>0. Then, there exists some c(a,b)c\in (a, b) such that f(c)=0f(c)=0.

One can state this theorem in greater generality, but it’s always possible to reduce to this case. Importantly, this only applies to functions whose domain contains an interval and whose codomain is R\mathbb{R}! Do not try to apply the theorem to arbitrary metric spaces.

I stole the following exercise from a past basic exam.

Exercise 6.

Suppose f:RRf:\mathbb{R}\to \mathbb{R} is a function that satisfies the “intermediate value property”: for each a<bRa< b\in \mathbb{R} and yy between f(a)f(a) and f(b)f(b), there exists some c(a,b)c\in (a, b) such that f(c)=yf(c)=y. Suppose additionally that for any xRx\in \mathbb{R} that f1(c)f ^{-1}(c) is closed. Prove that ff is continuous.

Compactness

Let’s now recall the definition of compactness:

Definition 7.

Let (X,d)(X, d) be a metric space. (X,d)(X, d) is sequentially compact if every sequence has a converging subsequence. That is, if {xn}X\left\lbrace x_n \right\rbrace\subseteq X, then there is some subsequence {xnj}\left\lbrace x _{n_j} \right\rbrace and some xXx_\infty\in X such that xnjxx _{n_j}\to x_\infty. A subset CXC\subseteq X is sequentially compact if every sequence of elements in CC has a subsequence that converges to an element of CC.

One way to think about compact sets is that they don’t have a lot of space in them. In noncompact metric spaces (such as R\mathbb R), there’s enough room for sequences to “spread out” and thus not have any convergent subsequences. In compact metric spaces, on the other hand, there’s just no space for this to happen — elements of a sequence have to eventually “clump up”.

You guys have started showing that compactness can be characterised by another definition: covering compactness.

Definition 8.

Let (X,d)\left( X,d \right) be a metric space. (X,d)\left( X,d \right) is covering compact if for every open cover X=λΛUλX=\bigcup _{\lambda\in \Lambda}U _{\lambda} (where each UλU_\lambda is open and Λ\Lambda is any indexing set) there exists some finite subcover X=Uλ1UλnX=U _{\lambda_1}\cup\cdots\cup U _{\lambda_n}.

Theorem 9.

A metric space is sequentially compact if and only if it is covering compact.

As of today, you have not finished proving this theorem, but it’s a very useful characterisation. We’ll often say “compact” without specifying sequential or covering compactness from now on, since that’s a distinction without a difference.

You should keep both sequential compactness and covering compactness in mind when you see compact sets. In many problems, only one of the two characterisations will be useful. Some problems can be solved by constructing the right sequence; others by finding a suitable open cover.

Exercise 10.

Show that the finite union of compact sets is compact.

Exercise 11.

Let XX be a compact metric space, and let f:XRf:X\to \mathbb{R} be continuous. Show that it attains its maximum value and minimum value. That is, show that there exist some m,MXm, M\in X such that f(m)f(x)f(M)f(m)\leq f(x)\leq f(M) for all xXx\in X.

Exercise 12.

Let (X,dX)\left( X, d_X \right) and (Y,dY)\left( Y, d_Y \right) be metric spaces. A function f:XYf:X\to Y is “uniformly continuous” if for every ϵ>0\epsilon>0, there exists some δ>0\delta>0 such that for all x,yXx, y\in X with dX(x,y)<δd_X\left( x, y \right)<\delta, then dY(f(x),f(y))<ϵd_Y\left( f(x),f(y) \right)<\epsilon.

Explain how this differs from the definition of continuity. Show that if f:XYf:X\to Y is continuous and XX is compact, then ff is uniformly continuous.

A great theorem about compactness is particularly useful when working in Euclidean space:

Theorem 13. Heine-Borel

A subset CRnC\subseteq \mathbb{R}^n is compact (with respect to the usual metric) if and only if it is closed and bounded.

This does not generalise to arbitrary metric spaces. Please do not try to use Heine-Borel on metric spaces in general. A good counterexample the closed unit ball in 2\ell^2 — this set is closed and bounded, yet it is not compact. Try to find a sequence with no converging subsequence youself.