Appendix A Metric Spaces

Except in mathematics, the shortest distance between point A and point B is seldom a straight line. I don’t believe in mathematics.

—Albert Einstein

Let us give an introduction to metric spaces for the student that may not have seen metric spaces in full generality. This appendix is an adapted and shortened version of chapter 7 from [L1].

A.1i  \  Metric spaces

The main idea in analysis is to take limits and talk about continuity. We wish to abstract what it means to be able to take limits in various contexts. The most basic such abstraction is a metric space. While it is not sufficient to describe every type of limit we find in modern analysis, it gets us very far indeed.

Definition A.1.1.

Let X be a set, and let d:X×X→ℝ be a function such that for all x,y,z∈X,

  1. (i)

    d⁡(x,y)≥0 (nonnegativity),

  2. (ii)

    d⁡(x,y)=0 if and only if x=y (identity of indiscernibles),

  3. (iii)

    d⁡(x,y)=d⁡(y,x) (symmetry),

  4. (iv)

    d⁡(x,z)≤d⁡(x,y)+d⁡(y,z) (triangle inequality).

The pair (X,d) is called a metric space. The function d is called the metric or the distance function. If the metric is clear from context, we may write simply X instead of (X,d).

The geometric idea is that d is the distance between two points. Items (i)–(iii) have obvious geometric interpretation: Distance is always nonnegative, the only point that is distance 0 away from x is x itself, and the distance from x to y is the same as the distance from y to x. The triangle inequality (iv) has the interpretation given in Figure A.1.

 

A triangle with vertices x, y, z and sides d of x comma z, d of y comma z, d of x comma y. The direct path from x to z is labeled shorter and the path through y longer.

Figure A.1: Diagram of the triangle inequality in metric spaces.
 

For the purposes of drawing, it is convenient to draw figures and diagrams in the plane with the metric being the euclidean distance. However, that is only one particular metric space. Just because a certain fact seems to be clear from drawing a picture does not mean it is true in every metric space. You might be getting sidetracked by intuition from euclidean geometry, whereas the concept of a metric space is a lot more general.

Example A.1.2:

The set of real numbers ℝ is a metric space with the metric

d⁡(x,y)=|x−y|.

Items (i)–(iii) of the definition are easy to verify. The triangle inequality (iv) follows immediately from the standard triangle inequality for real numbers:

d⁡(x,z)=|x−z|=|x−y+y−z|≤|x−y|+|y−z|=d⁡(x,y)+d⁡(y,z).

This metric is the standard metric on ℝ. If we talk about ℝ as a metric space without mentioning a specific metric, we mean this particular metric.

The n-dimensional euclidean space ℝn=ℝ×ℝ×⋯×ℝ is also a metric space. In this book we mostly see ℝ2, but let us give the example in more generality. We use the following notation for points: x=(x1,x2,…,xn)∈ℝn. Before making ℝn a metric space, let us prove an important inequality, the so-called Cauchy–Schwarz inequality.

Lemma A.1.3 (Cauchy–Schwarz inequality11 1 Sometimes it is called the Cauchy–Bunyakovsky–Schwarz inequality. What we stated should really be called the Cauchy inequality, as Bunyakovsky and Schwarz provided proofs for infinite-dimensional versions.).

If x=(x1,x2,…,xn)∈ℝn, y=(y1,y2,…,yn)∈ℝn, then

(∑j=1nxj⁢yj)2≤(∑j=1nxj2)⁢(∑j=1nyj2).
Proof.

A square of a real number is nonnegative and so a sum of squares is nonnegative:

0⁠≤∑j=1n∑k=1n(xj⁢yk−xk⁢yj)2⁠=∑j=1n∑k=1n(xj2⁢yk2+xk2⁢yj2−2⁢xj⁢xk⁢yj⁢yk)⁠=(∑j=1nxj2)⁢(∑k=1nyk2)+(∑j=1nyj2)⁢(∑k=1nxk2)−2⁢(∑j=1nxj⁢yj)⁢(∑k=1nxk⁢yk).

We relabel and divide by 2 to obtain the needed inequality:

0≤(∑j=1nxj2)⁢(∑j=1nyj2)−(∑j=1nxj⁢yj)2.∎
Example A.1.4:

Let us construct the standard metric for ℝn. Define

d⁡(x,y)=∑j=1n(xj−yj)2.

For n=1, the real line, this metric agrees with what we did above. Again, the only tricky part of the definition to check is the triangle inequality. The trick is to work with the square of the metric and apply the Cauchy–Schwarz inequality.

(d⁡(x,z))2⁠=∑j=1n(xj−zj)2⁠=∑j=1n(xj−yj+yj−zj)2⁠=∑j=1n(xj−yj)2+∑j=1n(yj−zj)2+2⁢∑j=1n(xj−yj)⁢(yj−zj)⁠≤∑j=1n(xj−yj)2+∑j=1n(yj−zj)2+2⁢∑j=1n(xj−yj)2⁢∑j=1n(yj−zj)2⁠=(∑j=1n(xj−yj)2+∑j=1n(yj−zj)2)2=(d⁡(x,y)+d⁡(y,z))2.

Taking the square root of both sides we obtain the correct inequality.

Example A.1.5:

The set of complex numbers ℂ is a metric space using the standard euclidean metric on ℝ2 by identifying x+i⁢y∈ℂ with (x,y)∈ℝ2.

Example A.1.6:

Let C⁡([a,b],ℝ) be the set of continuous real-valued functions on the interval [a,b]. Define the metric on C⁡([a,b],ℝ) as

d⁡(f,g)=supx∈[a,b]|f⁡(x)−g⁡(x)|.

Let us check the properties. First, d⁡(f,g) is finite as |f⁡(x)−g⁡(x)| is a continuous function on a closed bounded interval [a,b], and so is bounded. Clearly d⁡(f,g)≥0. If f=g, then |f⁡(x)−g⁡(x)|=0 for all x and hence d⁡(f,g)=0. Conversely, if d⁡(f,g)=0, then for any x, we have |f⁡(x)−g⁡(x)|≤d⁡(f,g)=0, and hence f=g. That d⁡(f,g)=d⁡(g,f) is equally trivial. The triangle inequality follows from the triangle inequality on ℝ.

d⁡(f,g)⁠=supx∈[a,b]|f⁡(x)−g⁡(x)|=supx∈[a,b]|f⁡(x)−h⁡(x)+h⁡(x)−g⁡(x)|⁠≤supx∈[a,b](|f⁡(x)−h⁡(x)|+|h⁡(x)−g⁡(x)|)⁠≤supx∈[a,b]|f⁡(x)−h⁡(x)|+supx∈[a,b]|h⁡(x)−g⁡(x)|=d⁡(f,h)+d⁡(h,g).

When treating C⁡([a,b],ℝ) as a metric space without mentioning a metric, we mean this particular metric.

Example A.1.7:

The sphere with the so-called great circle distance is also a metric space. Let S2 be the unit sphere in ℝ3, that is, S2={x∈ℝ3:x12+x22+x32=1}. Take x and y in S2, draw a line through the origin and x, and another line through the origin and y, and let θ be the angle that the two lines make. Then define d⁡(x,y)=θ, see Figure A.2. The law of cosines from vector calculus says d⁡(x,y)=arccos⁡(x1⁢y1+x2⁢y2+x3⁢y3). It is relatively easy to see that this function satisfies the first three properties of a metric. The triangle inequality is harder to prove. It requires a bit more trigonometry and linear algebra than we wish to indulge in right now, so we leave it without proof.

 

A sphere with center 0 and two points x and y on it. The angle theta between the radii to x and y is marked.

Figure A.2: The great circle distance on the unit sphere.
 

Oftentimes it is useful to consider a subset of a larger metric space as a metric space itself. We obtain the following proposition, which has a trivial proof.

Proposition A.1.8.

Let (X,d) be a metric space and Y⊂X. Then the restriction d|Y×Y is a metric on Y.

Definition A.1.9.

If (X,d) is a metric space, Y⊂X, and d′=d|Y×Y, then (Y,d′) is said to be a subspace of (X,d).

It is common to simply write d for the metric on Y, as it is the restriction of the metric on X. We say d′ is the subspace metric and Y has the subspace topology.

Definition A.1.10.

Let (X,d) be a metric space. A subset S⊂X is said to be bounded if there exists a p∈X and a B∈ℝ such that

d⁡(p,x)≤Bfor all ⁢x∈S.

We say (X,d) is bounded if X itself is a bounded subset.

For instance, the set of real numbers with the standard metric is not a bounded metric space. On the other hand, the real numbers with the discrete metric, d⁡(x,y)=1 if x≠y, and d⁡(x,x)=0, is a bounded metric space. Any set with the discrete metric is bounded.

Suppose X is nonempty. Then S⊂X is bounded if and only if

  1. (i)

    For every p∈X, there exists a B>0 such that d⁡(p,x)≤B for all x∈S.

  2. (ii)

    diam⁡(S)=sup{d⁡(x,y):x,y∈S}<∞.

See the exercises. The quantity diam⁡(S) is called the diameter of a set and is usually only defined for a nonempty set.

Exercise A.1.1:

Show that for any given set X, the discrete metric (d⁡(x,y)=1 if x≠y and d⁡(x,x)=0) does give a metric space (X,d).

Exercise A.1.2:

Suppose (X,d) is a metric space and φ:[0,∞)→ℝ is an increasing function such that φ⁡(t)≥0 for all t and φ⁡(t)=0 if and only if t=0. Also suppose φ is subadditive, that is, φ⁡(s+t)≤φ⁡(s)+φ⁡(t). Show that with d′⁢(x,y)=φ⁡(d⁡(x,y)), we obtain a new metric space (X,d′).

Exercise A.1.3:

Let (X,dX) and (Y,dY) be metric spaces.

  1. a)

    Show that (X×Y,d) with d⁡((x1,y1),(x2,y2))=dX⁢(x1,x2)+dY⁢(y1,y2) is a metric space.

  2. b)

    Show that (X×Y,d) with d⁡((x1,y1),(x2,y2))=max⁡{dX⁢(x1,x2),dY⁢(y1,y2)} is a metric space.

Exercise A.1.4:

Let X be the set of continuous functions on [0,1]. Let φ:[0,1]→(0,∞) be continuous. Define

d⁡(f,g)=∫01|f⁡(x)−g⁡(x)|⁢φ⁢(x)⁢𝑑x.

Show that (X,d) is a metric space.

Exercise A.1.5:

Let (X,d) be a metric space. For nonempty bounded subsets A and B let

d⁡(x,B)=inf{d⁡(x,b):b∈B}andd⁡(A,B)=sup{d⁡(a,B):a∈A}.

Now define the Hausdorff metric as

dH⁢(A,B)=max⁡{d⁡(A,B),d⁡(B,A)}.

Note: dH can be defined for arbitrary nonempty subsets if we allow the extended reals.

  1. a)

    Let Y be the set of bounded nonempty subsets of X. Prove that (Y,dH) is a so-called pseudometric space: dH satisfies the metric properties (i), (iii), (iv), and further dH⁢(A,A)=0 for all A∈Y.

  2. b)

    Show by example that d itself is not symmetric, that is, d⁡(A,B)≠d⁡(B,A).

  3. c)

    Find a metric space X and two different nonempty bounded subsets A and B such that dH⁢(A,B)=0.

Exercise A.1.6:

Let (X,d) be a nonempty metric space and S⊂X a subset. Prove:

  1. a)

    S is bounded if and only if for every p∈X, there exists a B>0 such that d⁡(p,x)≤B for all x∈S.

  2. b)

    A nonempty S is bounded if and only if diam⁡(S)=sup{d⁡(x,y):x,y∈S}<∞.

Exercise A.1.7:
  1. a)

    Find a metric d on ℕ such that ℕ is an unbounded set in (ℕ,d).

  2. b)

    Find a metric d on ℕ such that ℕ is a bounded set in (ℕ,d).

  3. c)

    Find a metric d on ℕ such that for every n∈ℕ and every ϵ>0, there exists an m∈ℕ, m≠n, such that d⁡(n,m)<ϵ.

Exercise A.1.8:

Let C1⁢([a,b],ℝ) be the set of once continuously differentiable functions on [a,b]. Define

d⁡(f,g)=∥f−g∥[a,b]+∥f′−g′∥[a,b],

where ∥f∥X=supx∈X|f⁡(x)| is the uniform norm. Prove that d is a metric.

Exercise A.1.9:

The set of sequences {xn} of real numbers such that ∑n=1∞xn2<∞ is called ℓ2.

  1. a)

    Prove the Cauchy–Schwarz inequality for two sequences {xn} and {yn} in ℓ2: Prove that ∑n=1∞xn⁢yn converges (absolutely) and

    (∑n=1∞xn⁢yn)2≤(∑n=1∞xn2)⁢(∑n=1∞yn2).
  2. b)

    Prove that ℓ2 is a metric space with the metric d⁡(x,y)=∑n=1∞(xn−yn)2. Hint: Don’t forget to show that the series for d⁡(x,y) always converges to some finite number.

A.2i  \  Open and closed sets

A.2.1i  •  Topology

Definition A.2.1.

Let (X,d) be a metric space, x∈X, and δ>0. The open ball or simply ball of radius δ around x is

B⁡(x,δ)⁢=def⁢{y∈X:d⁡(x,y)<δ}.

The closed ball is

C⁡(x,δ)⁢=def⁢{y∈X:d⁡(x,y)≤δ}.

When dealing with different metric spaces, we may emphasize which metric space the ball is in by writing BX⁢(x,δ)=B⁡(x,δ) or CX⁢(x,δ)=C⁡(x,δ).

Example A.2.2:

Consider ℝ with the standard metric. For x∈ℝ and δ>0,

B⁡(x,δ)=(x−δ,x+δ)andC⁡(x,δ)=[x−δ,x+δ].
Example A.2.3:

Consider the metric space [0,1] as a subspace of ℝ. Then

B⁡(0,1/2)=B[0,1]⁢(0,1/2)={y∈[0,1]:|0−y|<1/2}=[0,1/2).

This is different from Bℝ⁢(0,1/2)=(−1/2,1/2). The important thing to keep in mind is which metric space we are working in.

Definition A.2.4.

Let (X,d) be a metric space. A subset V⊂X is open if for every x∈V, there exists a δ>0 such that B⁡(x,δ)⊂V. See Figure A.3. A subset E⊂X is closed if the complement Ec=X∖E is open. If the ambient space X is not clear from context, we say V is open in X and E is closed in X. The set of open sets is called the topology on X.

If x∈V and V is open, then V is an open neighborhood of x (or simply neighborhood). More generally a neighborhood of x is a set that contains an open neighborhood of x, but unless otherwise specified, we usually mean open neighborhood.

 

Shaded open set V with a point x and a small ball centered at x of radius delta inside V.

Figure A.3: Open set in a metric space. Note that δ depends on x.
 

Intuitively, a set V is open if it does not include its “boundary.” Wherever we are in V, we are allowed to “wiggle” a little bit and stay in V. Similarly, a set E is closed if everything not in E is some distance away from E. The open and closed balls are examples of open and closed sets (which must still be proved). Not every set is either open or closed, most subsets are neither.

Example A.2.5:

The set (0,∞)⊂ℝ is open: Given any x∈(0,∞), let δ=x.

The set [0,∞)⊂ℝ is closed: Given x∈(−∞,0)=[0,∞)c, let δ=−x.

The set [0,1)⊂ℝ is neither open nor closed. Every B⁡(0,δ)=(−δ,δ), contains negative numbers and hence is not contained in [0,1). So [0,1) is not open. Every B⁡(1,δ)=(1−δ,1+δ), contains numbers in [0,1). Thus [0,1)c=ℝ∖[0,1) is not open, and [0,1) is not closed.

Proposition A.2.6.

Let (X,d) be a metric space.

  1. (i)

    ∅ and X are open.

  2. (ii)

    If V1,V2,…,Vk are open subsets of X, then

    V1∩V2∩⋯∩Vk

    is also open. That is, a finite intersection of open sets is open.

  3. (iii)

    If {Vλ}λ∈I is an arbitrary collection of open subsets of X, then

    ⋃λ∈IVλ

    is also open. That is, a union of open sets is open.

Proof.

Item (i) is obvious. Let us prove (ii). If x∈⋂ℓ=1kVℓ, then x∈Vℓ for all ℓ. As Vℓ are all open, for every ℓ there exists a δℓ>0 such that B⁡(x,δℓ)⊂Vℓ. Take δ=min⁡{δ1,δ2,…,δk} and notice δ>0. Then B⁡(x,δ)⊂B⁡(x,δℓ)⊂Vℓ for every ℓ and so B⁡(x,δ)⊂⋂ℓ=1kVℓ. Let us prove (iii). If x∈⋃λ∈IVλ, then x∈Vλ for some λ∈I. As Vλ is open, B⁡(x,δ)⊂Vλ for some δ>0. But then B⁡(x,δ)⊂⋃λ∈IVλ. ∎

Item (ii) is not true for an arbitrary intersection: ⋂n∈ℕ(−1/n,1/n)={0} is not open.

Proposition A.2.7.

Let (X,d) be a metric space.

  1. (i)

    ∅ and X are closed.

  2. (ii)

    If {Eλ}λ∈I is an arbitrary collection of closed subsets of X, then

    ⋂λ∈IEλ

    is also closed. That is, an intersection of closed sets is closed.

  3. (iii)

    If E1,E2,…,Ek are closed subsets of X, then

    E1∪E2∪⋯∪Ek

    is also closed. That is, a finite union of closed sets is closed.

Exercise A.2.1:

We have not yet shown that the open ball is open and the closed ball is closed. Let us show this fact now to justify the terminology.

Proposition A.2.8.

Let (X,d) be a metric space, x∈X, and δ>0. Then B⁡(x,δ) is open and C⁡(x,δ) is closed.

Proof.

Let y∈B⁡(x,δ). Let α=δ−d⁡(x,y). As α>0, consider z∈B⁡(y,α). Then

d⁡(x,z)≤d⁡(x,y)+d⁡(y,z)<d⁡(x,y)+α=d⁡(x,y)+δ−d⁡(x,y)=δ.

Thus, z∈B⁡(x,δ) for every z∈B⁡(y,α). So B⁡(y,α)⊂B⁡(x,δ), and so B⁡(x,δ) is open.

 

Ball centered at x of radius delta containing a point y and a smaller ball centered at y of radius alpha containing a point z. There is a dashed triangle shown with vertices x, y, and z.

Figure A.4: Proof that B⁡(x,δ) is open: B⁡(y,α)⊂B⁡(x,δ) with the triangle inequality illustrated.
 

The proof that C⁡(x,δ) is closed is left as an exercise. ∎

Exercise A.2.2:

Finish the proof of Proposition A.2.8 by proving that C⁡(x,δ) is closed.

Be careful about what metric space you find yourself in. As [0,1/2) is an open ball in [0,1], the set [0,1/2) is an open set in [0,1]. On the other hand, [0,1/2) is neither open nor closed in ℝ.

Proposition A.2.9.

Let a,b be two real numbers, a<b. Then (a,b), (a,∞), and (−∞,b) are open in ℝ. Also [a,b], [a,∞), and (−∞,b] are closed in ℝ.

Exercise A.2.3:
Proposition A.2.10.

Suppose (X,d) is a metric space, and Y⊂X. Then U⊂Y is open in Y (in the subspace topology) if and only if there exists an open set V⊂X (so open in X) such that V∩Y=U.

For example, let X=ℝ, Y=[0,1], U=[0,1/2). We saw that U is an open set in Y. We may take V=(−1/2,1/2).

Proof.

Suppose V⊂X is open and V∩Y=U. Let x∈U. As V is open and x∈V, there exists a δ>0 such that BX⁢(x,δ)⊂V. Then

BY⁢(x,δ)=BX⁢(x,δ)∩Y⊂V∩Y=U.

The proof of the opposite direction, that is, that if U⊂Y is open in the subspace topology there exists a V is left as an exercise. ∎

Exercise A.2.4:

Finish the proof of Proposition A.2.10. Suppose (X,d) is a metric space and Y⊂X. Show that with the subspace metric on Y, if a set U⊂Y is open (in Y), then there exists an open set V⊂X such that U=V∩Y.

For an open subset of an open set or a closed subset of a closed set, matters are simpler.

Proposition A.2.11.

Suppose (X,d) is a metric space, V⊂X is open, and E⊂X is closed.

  1. (i)

    U⊂V is open in the subspace topology if and only if U is open in X.

  2. (ii)

    F⊂E is closed in the subspace topology if and only if F is closed in X.

Proof.

Let us prove (i) and leave (ii) to an exercise.

If U⊂V is open in the subspace topology, by Proposition A.2.10, there exists a set W⊂X, open in X, such that U=W∩V. Intersection of two open sets is open so U is open in X. For the other direction, suppose U is open in X. Then U=U∩V. So U is open in V again by Proposition A.2.10. ∎

Exercise A.2.5:

Finish the proof of Proposition A.2.11.

Exercise A.2.6:

Show that in any metric space, every open set can be written as a union of closed sets.

Exercise A.2.7:

Let X be a set and d, d′ be two metrics on X. Suppose there exists an α>0 and β>0 such that α⁢d⁢(x,y)≤d′⁢(x,y)≤β⁢d⁢(x,y) for all x,y∈X. Show that U⊂X is open in (X,d) if and only if U is open in (X,d′). That is, the topologies of (X,d) and (X,d′) are the same.

Exercise A.2.8:

Let (X,d) be a metric space.

  1. a)

    For every x∈X and δ>0, show B⁡(x,δ)¯⊂C⁡(x,δ).

  2. b)

    Is it always true that B⁡(x,δ)¯=C⁡(x,δ)? Prove or find a counterexample.

Exercise A.2.9:

Let (X,d) be a metric space. Show that there exists a bounded metric d′ such that (X,d′) has the same open sets, that is, the topology is the same.

Exercise A.2.10:

For every x∈ℝn and every δ>0 define the “rectangle” R⁡(x,δ)=(x1−δ,x1+δ)×(x2−δ,x2+δ)×⋯×(xn−δ,xn+δ). Show that these sets generate the same open sets as the balls in standard metric. That is, show that a set U⊂ℝn is open in the sense of the standard metric if and only if for every point x∈U, there exists a δ>0 such that R⁡(x,δ)⊂U.

A.2.2i  •  Connected sets

A set is connected if we can continuously move from one point of it to another point without jumping. For example, an interval in ℝ. We usually study functions on connected sets.

Definition A.2.12.

A nonempty22 2 Some authors do not exclude the empty set from the definition, and the empty set would then be connected. We avoid the empty set for essentially the same reason why 1 is neither a prime nor a composite number: Our connected sets have exactly two clopen subsets and disconnected sets have more than two. The empty set has exactly one. We will not dwell on this technicality. metric space (X,d) is connected if the only subsets of X that are both open and closed (so-called clopen subsets) are ∅ and X itself. If a nonempty (X,d) is not connected, we say it is disconnected.

When we apply the term connected to a nonempty subset A⊂X, we mean that A with the subspace topology is connected.

In other words, a nonempty X is connected if whenever we write X=X1∪X2 where X1∩X2=∅ and X1 and X2 are open, then either X1=∅ or X2=∅. So to show X is disconnected, we find nonempty disjoint open sets X1 and X2 whose union is X. We state this idea as a proposition for subsets.

Proposition A.2.13.

Let (X,d) be a metric space. A nonempty set S⊂X is disconnected if and only if there exist open sets U1 and U2 in X such that U1∩U2∩S=∅, U1∩S≠∅, U2∩S≠∅, and

S=(U1∩S)∪(U2∩S).

The proposition is illustrated in Figure A.5.

 

Two dark regions forming the set S, each covered by one of two dotted open sets U sub 1 and U sub 2. The open sets overlap, but not on S.

Figure A.5: Disconnected subset. Note that U1∩U2 need not be empty, but U1∩U2∩S=∅.
 
Proof.

First suppose S is disconnected, that is, there are nonempty disjoint S1 and S2 that are open in S and S=S1∪S2. Proposition A.2.10 says there exist U1 and U2 that are open in X such that U1∩S=S1 and U2∩S=S2.

For the other direction start with the U1 and U2. Then U1∩S and U2∩S are open in S by Proposition A.2.10. Via the discussion before the proposition, S is disconnected. ∎

Example A.2.14:

Let S⊂ℝ be such that x<z<y with x,y∈S and z∉S. Claim: S is disconnected. Proof:

((−∞,z)∩S)∪((z,∞)∩S)=S.
Proposition A.2.15.

A nonempty set S⊂ℝ is connected if and only if it is an interval or a single point.

Proof.

Suppose S is connected. If S is a single point, then we are done. So suppose x<y and x,y∈S. If z∈ℝ is such that x<z<y, then by the same logic as in Example A.2.14, z∈S. So S is an interval.

If S is a single point, it is connected. Therefore, suppose S is an interval. Consider open subsets U1 and U2 of ℝ such that U1∩S and U2∩S are nonempty and S=(U1∩S)∪(U2∩S). We will show that U1∩S and U2∩S contain a common point, so they are not disjoint, proving that S is connected. Suppose x∈U1∩S and y∈U2∩S. Without loss of generality, assume x<y. As S is an interval, [x,y]⊂S. Note that U2∩[x,y]≠∅, and let z=inf(U2∩[x,y]). If z=x, then z∈U1. If z>x, then for every ϵ>0 the ball B⁡(z,ϵ)=(z−ϵ,z+ϵ) contains points of [x,y] not in U2, as z is the infimum of such points. So z∉U2 as U2 is open. Therefore, z∈U1. As U1 is open, B⁡(z,δ)⊂U1 for a small enough δ>0. As z is the infimum of the nonempty set U2∩[x,y], there must exist some w∈U2∩[x,y] such that w∈[z,z+δ)⊂B⁡(z,δ)⊂U1. So U1∩S and U2∩S are not disjoint, and S is connected. ∎

 

A segment of the real line from x to y covered by two intervals U sub 1 and U sub 2 with U sub 1 coming in from the left and U sub 2 coming in from the right. The point z in the middle is the lower endpoint of U sub 2. A point w is shown to be in the intersection of U sub 1 and U sub 2 and also being inside an interval from z minus delta to z plus delta.

Figure A.6: Proof that an interval is connected.
 
Example A.2.16:

The ball B⁡(x,δ) may or may not be connected, depending on the metric space. Take the space {a,b} with the discrete metric. The ball B⁡(a,2)={a,b} is not connected as B⁡(a,1)={a} and B⁡(b,1)={b} are open and disjoint.

Exercise A.2.11:

Suppose (X,d) is a nonempty metric space with the discrete topology. Show that X is connected if and only if it contains exactly one element.

Exercise A.2.12:

Take ℚ with the standard metric, d⁡(x,y)=|x−y|, as our metric space. Prove that ℚ is totally disconnected, that is, show that for every x,y∈ℚ with x≠y, there exist two open sets U and V such that x∈U, y∈V, U∩V=∅, and U∪V=ℚ.

Exercise A.2.13:

Suppose {Sk}, k∈ℕ, is a collection of connected subsets of a metric space (X,d), and there exists an x∈X such that x∈Sk for all k∈ℕ. Show that ⋃k=1∞Sk is connected.

A.2.3i  •  Closure and boundary

Sometimes we wish to take a set and throw in everything that we can approach from within the set. This concept is called the closure. More precisely, the closure of A is the intersection of all closed sets that contain A.

Definition A.2.17.

Let (X,d) be a metric space and A⊂X. The closure of A is the set

A¯⁢=def⁢⋂{E⊂X:E⁢ is closed and ⁢A⊂E}.

We say A is dense in X if A¯=X.

Proposition A.2.18.

Let (X,d) be a metric space and A⊂X. Then, A⊂A¯ and A¯ is closed. Furthermore, if A is closed, then A¯=A.

Proof.

There is at least one closed set containing A, the set X itself, so A⊂A¯. The closure is an intersection of closed sets, so A¯ is closed. If A is closed, then A is a closed set that contains A and A¯⊂A. So A=A¯. ∎

Example A.2.19:

The closure of (0,1) in ℝ is [0,1]. Proof: If E is closed and contains (0,1), then 0,1∈E. Thus [0,1]⊂E. But [0,1] is also closed. Thus, (0,1)¯=[0,1].

Example A.2.20:

Always notice what ambient metric space you are working with. If X=(0,∞), then the closure of (0,1) in (0,∞) is (0,1]. Proof: Similarly as above, (0,1] is closed in (0,∞) (why?). Any closed set E that contains (0,1) must contain 1 (why?). Therefore, (0,1]⊂E, and hence (0,1)¯=(0,1] when working in (0,∞).

Let us justify the statement that the closure is everything that we can “approach” from the set.

Proposition A.2.21.

Let (X,d) be a metric space and A⊂X. Then x∈A¯ if and only if for every δ>0, B⁡(x,δ)∩A≠∅.

Proof.

We will prove the two contrapositives. First suppose x∉A¯. As A¯ is closed, B⁡(x,δ)⊂A¯c for some δ>0. Furthermore, A¯c⊂Ac, and hence B⁡(x,δ)∩A=∅.

On the other hand, suppose B⁡(x,δ)∩A=∅ for some δ>0. In other words, A⊂B⁢(x,δ)c. As B⁢(x,δ)c is a closed set, as x∉B⁢(x,δ)c, and as A¯ is the intersection of closed sets containing A, we have x∉A¯. ∎

We also talk about the interior of a set (points we cannot approach from the complement) and the boundary of a set (points we can approach both from the set and its complement).

Definition A.2.22.

Let (X,d) be a metric space and A⊂X. The interior of A is the set

A∘⁢=def⁢{x∈A:there exists a ⁢δ>0⁢ such that ⁢B⁢(x,δ)⊂A}.

The boundary of A is the set

∂A⁢=def⁢A¯∖A∘.
Example A.2.23:

Consider X=ℝ and A=(0,1]. Then A¯=[0,1], A∘=(0,1), and ∂A={0,1}.

Example A.2.24:

Suppose X={a,b} with the discrete metric is the metric space and A={a}. Then A¯=A∘=A and ∂A=∅.

Proposition A.2.25.

Let (X,d) be a metric space and A⊂X. Then A∘ is open and ∂A is closed.

Proof.

Given x∈A∘, there is a δ>0 such that B⁡(x,δ)⊂A. If z∈B⁡(x,δ), then as open balls are open, there is an ϵ>0 such that B⁡(z,ϵ)⊂B⁡(x,δ)⊂A. So z∈A∘. Therefore, B⁡(x,δ)⊂A∘, and A∘ is open.

As A∘ is open, ∂A=A¯∖A∘=A¯∩(A∘)c is closed. ∎

The boundary is the set of points that are close to both the set and its complement. See Figure A.7 for a diagram of the next proposition.

Proposition A.2.26.

Let (X,d) be a metric space and A⊂X. Then x∈∂A if and only if for every δ>0, B⁡(x,δ)∩A and B⁡(x,δ)∩Ac are both nonempty.

 

Shaded set A below a line marked as its boundary, its complement above it. A ball of radius delta centered at a boundary point x contains points of both A and its complement.

Figure A.7: Boundary is the set where every ball contains points in the set and also its complement.
 
Proof.

Suppose x∈∂A=A¯∖A∘ and let δ>0 be arbitrary. By Proposition A.2.21, B⁡(x,δ) contains a point of A. If B⁡(x,δ) contained no points of Ac, then x would be in A∘. Hence B⁡(x,δ) contains a point of Ac as well.

Suppose x∉∂A, so x∉A¯ or x∈A∘. If x∉A¯, then B⁡(x,δ)⊂A¯c for some δ>0 as A¯ is closed. So B⁡(x,δ)∩A is empty, because A¯c⊂Ac. If x∈A∘, then B⁡(x,δ)⊂A for some δ>0, so B⁡(x,δ)∩Ac is empty. ∎

The proposition above and Proposition A.2.21 give the following corollary.

Corollary A.2.27.

Let (X,d) be a metric space and A⊂X. Then ∂A=A¯∩Ac¯.

Exercise A.2.14:

In any metric space, prove:

  1. a)

    E is closed if and only if ∂E⊂E.

  2. b)

    U is open if and only if ∂U∩U=∅.

Exercise A.2.15:

In any metric space, prove:

  1. a)

    Show that A is open if and only if A∘=A.

  2. b)

    Suppose that U is an open set and U⊂A. Show that U⊂A∘.

Exercise A.2.16:

Let A be a connected set in a metric space.

  1. a)

    Is A¯ connected? Prove or find a counterexample.

  2. b)

    Is A∘ connected? Prove or find a counterexample.

Hint: Think of sets in ℝ2.

Exercise A.2.17:

Prove that A∘=⋃{V:V⁢ is open and ⁢V⊂A}.

A.3i  \  Sequences and convergence

A.3.1i  •  Sequences

Definition A.3.1.

A sequence in a metric space (X,d) is a function x:ℕ→X. We write xn for the nth element in the sequence and

{xn}or{xn}n=1∞

for the entire sequence.

A sequence {xn} is bounded if there exists a p∈X and B∈ℝ such that

d⁡(p,xn)≤Bfor all ⁢n∈ℕ.

That is, the sequence {xn} is bounded whenever the set {xn:n∈ℕ} is bounded.

If {nk}k=1∞ is a sequence of natural numbers such that nk+1>nk for all k, then the sequence {xnk}k=1∞ is said to be a subsequence of {xn}.

In what follows, we cheat a little and use the definite article in front of the word limit before we prove that the limit is unique.

Definition A.3.2.

A sequence {xn} in a metric space (X,d) is said to converge to a point p∈X if for every ϵ>0, there exists an M∈ℕ such that d⁡(xn,p)<ϵ for all n≥M. The point p is said to be the limit of {xn}. We write

limn→∞xn⁢=def⁢p.

A sequence that converges is convergent. Otherwise, the sequence diverges. See Figure A.8 for an idea of the definition.

 

Scattered points x sub 1 through x sub 10 and a dotted circle of radius epsilon around p. The points from x sub 7 onward lie inside the circle.

Figure A.8: Sequence converging to p. The first 10 points are shown and M=7 for this ϵ.
 
Proposition A.3.3.

A convergent sequence in a metric space has a unique limit.

Proof.

Suppose the sequence {xn} has limits x and y. Take an arbitrary ϵ>0. From the definition find an n such that d⁡(xn,x)<ϵ/2 and d⁡(xn,y)<ϵ/2. Then

d⁡(y,x)≤d⁡(y,xn)+d⁡(xn,x)<ϵ2+ϵ2=ϵ.

So x=y, and the limit (if it exists) is unique. ∎

The proofs of the following propositions are left as exercises.

Proposition A.3.4.

A convergent sequence in a metric space is bounded.

Proposition A.3.5.

A sequence {xn} in a metric space (X,d) converges to p∈X if and only if there exists a sequence {an} of real numbers such that

d⁡(xn,p)≤anfor all ⁢n∈ℕ,andlimn→∞an=0.
Proposition A.3.6.

Let {xn} be a sequence in a metric space (X,d).

  1. (i)

    If {xn} converges to p∈X, then every subsequence {xnk} converges to p.

  2. (ii)

    If for some K∈ℕ the K-tail {xn}n=K+1∞ converges to p∈X, then {xn} converges to p.

Exercise A.3.1:
Exercise A.3.2:
Exercise A.3.3:
Example A.3.7:

The set of continuous functions C⁡([a,b],ℝ), see Example A.1.6, is a metric space. Convergence of a sequence of functions in this metric space is the same as uniform convergence. See also section B.1 in the next appendix.

Exercise A.3.4:
  1. a)

    Show that d⁡(x,y)=min⁡{1,|x−y|} defines a metric on ℝ.

  2. b)

    Show that a sequence converges in (ℝ,d) if and only if it converges in the standard metric.

  3. c)

    Find a bounded sequence in (ℝ,d) that contains no convergent subsequence.

Exercise A.3.5:

Suppose {xn}n=1∞ converges to x. Suppose f:ℕ→ℕ is a one-to-one function. Show that {xf⁡(n)}n=1∞ converges to x.

Exercise A.3.6:

Let (X,d) be a metric space where d is the discrete metric. Suppose {xn} is a convergent sequence in X. Show that there exists a K∈ℕ such that for all n≥K, we have xn=xK.

Exercise A.3.7:

A set S⊂X is said to be dense in X if X⊂S¯ or, in other words, if for every x∈X, there exists a sequence {xn} in S that converges to x. Prove that ℝn contains a countable dense subset.

Exercise A.3.8:

Take ℝ∗={−∞}∪ℝ∪{∞} to be the extended reals. Define d⁡(x,y)=|x1+|x|−y1+|y|| if x,y∈ℝ, define d⁡(∞,x)=|1−x1+|x||, d⁡(−∞,x)=|1+x1+|x|| for all x∈ℝ, and let d⁡(∞,−∞)=2.

  1. a)

    Show that (ℝ∗,d) is a metric space.

  2. b)

    Suppose {xn} is a sequence of real numbers such that for every M∈ℝ, there exists an N such that xn≥M for all n≥N. Show that limxn=∞ in (ℝ∗,d).

  3. c)

    Show that a sequence of real numbers converges to a real number in (ℝ∗,d) if and only if it converges in ℝ with the standard metric.

Exercise A.3.9:

Let (X,d) be a metric space and {xn} a sequence in X. Prove that {xn} converges to p∈X if and only if every subsequence of {xn} has a subsequence that converges to p.

A.3.2i  •  Convergence in euclidean space

In ℝn, a sequence converges if and only if every component converges:

Proposition A.3.8.

Let {xj}j=1∞ be a sequence in ℝn, where xj=(xj,1,xj,2,…,xj,n)∈ℝn. Then {xj}j=1∞ converges if and only if {xj,k}j=1∞ converges for every k=1,2,…,n, in which case

limj→∞xj=(limj→∞xj,1,limj→∞xj,2,…,limj→∞xj,n).
Proof.

Suppose the sequence {xj}j=1∞ converges to y=(y1,y2,…,yn)∈ℝn. Given ϵ>0, there exists an M such that for all j≥M,

d⁡(y,xj)<ϵ.

Fix some k=1,2,…,n. For j≥M,

|yk−xj,k|=(yk−xj,k)2≤∑ℓ=1n(yℓ−xj,ℓ)2=d⁡(y,xj)<ϵ.

Hence the sequence {xj,k}j=1∞ converges to yk.

For the other direction, suppose {xj,k}j=1∞ converges to yk for every k=1,2,…,n. Given ϵ>0, pick an M such that if j≥M, then |yk−xj,k|<ϵ/n for all k=1,2,…,n. Then

d⁡(y,xj)=∑k=1n(yk−xj,k)2<∑k=1n(ϵn)2=∑k=1nϵ2n=ϵ.

That is, the sequence {xj} converges to y=(y1,y2,…,yn)∈ℝn. ∎

Example A.3.9:

For ℂ, the proposition says that {zj}j=1∞={xj+i⁢yj}j=1∞ converges to z=x+i⁢y if and only if {xj} converges to x and {yj} converges to y.

Exercise A.3.10:

Consider ℝn, and let d be the standard euclidean metric. Let d′⁢(x,y)=∑ℓ=1n|xℓ−yℓ| and d′′⁢(x,y)=max⁡{|x1−y1|,|x2−y2|,⋯,|xn−yn|}.

  1. a)

    Use Exercise A.1.3, to show that (ℝn,d′) and (ℝn,d′′) are metric spaces.

  2. b)

    Let {xj}j=1∞ be a sequence in ℝn and p∈ℝn. Prove that the following statements are equivalent:

    1. 1)

      {xj} converges to p in (ℝn,d).

    2. 2)

      {xj} converges to p in (ℝn,d′).

    3. 3)

      {xj} converges to p in (ℝn,d′′).

A.3.3i  •  Convergence and topology

The topology—the set of open sets of a space—encodes which sequences converge.

Proposition A.3.10.

Let (X,d) be a metric space and {xn} a sequence in X. Then {xn} converges to x∈X if and only if for every open neighborhood U of x, there exists an M∈ℕ such that for all n≥M, we have xn∈U.

Proof.

Suppose {xn} converges to x. Let U be an open neighborhood of x. There exists an ϵ>0 such that B⁡(x,ϵ)⊂U. As the sequence converges, find an M∈ℕ such that for all n≥M, we have d⁡(x,xn)<ϵ, or in other words xn∈B⁡(x,ϵ)⊂U.

Let us prove the other direction. Given ϵ>0, let U=B⁡(x,ϵ) be the neighborhood of x. Then there is an M∈ℕ such that for n≥M, we have xn∈U=B⁡(x,ϵ), or in other words, d⁡(x,xn)<ϵ. ∎

A closed set contains the limits of its convergent sequences.

Proposition A.3.11.

Let (X,d) be a metric space, E⊂X a closed set, and {xn} a sequence in E that converges to some x∈X. Then x∈E.

Proof.

Let us prove the contrapositive. Suppose {xn} is a sequence in X that converges to x∈Ec. As Ec is open, Proposition A.3.10 says that there is an M such that for all n≥M, xn∈Ec. So {xn} is not a sequence in E. ∎

To take the closure of a set A, we take A, and we throw in points that are limits of sequences in A.

Proposition A.3.12.

Let (X,d) be a metric space and A⊂X. Then x∈A¯ if and only if there exists a sequence {xn} of elements in A such that limxn=x.

Proof.

Let x∈A¯. For every n∈ℕ, by Proposition A.2.21 there exists a point xn∈B⁡(x,1/n)∩A. As d⁡(x,xn)<1/n, we have limxn=x.

For the other direction, see Exercise A.3.11. ∎

Exercise A.3.11:

Finish the proof of Proposition A.3.12: Let (X,d) be a metric space and A⊂X. Let x∈X be such that there exists a sequence {xn} in A that converges to x. Prove that x∈A¯.

Exercise A.3.12:

Suppose {Un}n=1∞ is a decreasing (Un+1⊂Un for all n) sequence of open sets in a metric space (X,d) such that ⋂n=1∞Un={p} for some p∈X. Suppose {xn} is a sequence of points in X such that xn∈Un. Does {xn} necessarily converge to p? Prove or construct a counterexample.

Exercise A.3.13:

Let E⊂X be closed and let {xn} be a sequence in X converging to p∈X. Suppose xn∈E for infinitely many n∈ℕ. Show p∈E.

Exercise A.3.14:

Suppose {Vn}n=1∞ is a sequence of open sets in (X,d) such that Vn+1⊃Vn for all n. Let {xn} be a sequence such that xn∈Vn+1∖Vn and suppose {xn} converges to p∈X. Show that p∈∂V where V=⋃n=1∞Vn.

A.4i  \  Completeness and compactness

A.4.1i  •  Cauchy sequences and completeness

Definition A.4.1.

Let (X,d) be a metric space. A sequence {xn} in X is a Cauchy sequence if for every ϵ>0, there exists an M∈ℕ such that for all n≥M and all k≥M, we have

d⁡(xn,xk)<ϵ.
Proposition A.4.2.

A convergent sequence in a metric space is Cauchy.

Proof.

Suppose {xn} converges to x. Given ϵ>0, there is an M such that d⁡(x,xn)<ϵ/2 for all n≥M. Hence, d⁡(xn,xk)≤d⁡(xn,x)+d⁡(x,xk)<ϵ/2+ϵ/2=ϵ for all n,k≥M. ∎

Definition A.4.3.

Let (X,d) be a metric space. We say X is complete or Cauchy-complete if every Cauchy sequence {xn} in X converges to an x∈X.

Proposition A.4.4.

The space ℝn with the standard metric is a complete metric space.

We assume the reader has seen the proof of completeness in ℝ=ℝ1, and we reduce the completeness in ℝn to the one-dimensional case.

Proof.

Let {xj}j=1∞ be a Cauchy sequence in ℝn, where xj=(xj,1,xj,2,…,xj,n)∈ℝn. Given ϵ>0, there exists an M such that d⁡(xi,xj)<ϵ for all i,j≥M.

Fix some k=1,2,…,n. For i,j≥M,

|xi,k−xj,k|=(xi,k−xj,k)2≤∑ℓ=1n(xi,ℓ−xj,ℓ)2=d⁡(xi,xj)<ϵ.

Hence the sequence {xj,k}j=1∞ is Cauchy. As ℝ is complete, the sequence converges; there exists a yk∈ℝ such that yk=limj→∞xj,k. Write y=(y1,y2,…,yn)∈ℝn. By Proposition A.3.8, {xj} converges to y∈ℝn, and hence ℝn is complete. ∎

A subset of ℝn with the subspace metric need not be complete. For example, (0,1] with the subspace metric is not complete as {1/n} is a Cauchy sequence in (0,1] with no limit in (0,1]. However, once we have one complete metric space, any closed subspace is also a complete metric space. After all, one way to think of a closed set is that it contains all points that can be reached from the set via a sequence. The proof is again an exercise.

Proposition A.4.5.

Suppose (X,d) is a complete metric space and E⊂X is closed. Then E is a complete metric space with the subspace topology.

Exercise A.4.1:
Example A.4.6:

Another very useful example of a complete metric space is the space of continuous functions on a closed interval with the uniform norm, C⁡([a,b],ℝ). See Corollary B.1.8 in the next appendix.

A.4.2i  •  Compactness

Definition A.4.7.

Let (X,d) be a metric space and K⊂X. The set K is said to be compact if for any collection of open sets {Uλ}λ∈I such that

K⊂⋃λ∈IUλ,

there exists a finite subset {λ1,λ2,…,λk}⊂I such that

K⊂Uλ1∪Uλ2∪⋯∪Uλk.

A collection of open sets {Uλ}λ∈I as above is said to be an open cover of K. A way to say that K is compact is to say that every open cover of K has a finite subcover.

Example A.4.8:

Let ℝ be the metric space with the standard metric.

The set ℝ is not compact. Proof: Take the sets Un=(−n,n). It is an open cover, but the union of a finite subset of these sets is just (−n,n) for some n.

The set (0,1)⊂ℝ is also not compact. Proof: Take the sets Un=(1/n,1−1/n) for n=3,4,5,…. As above (0,1)=⋃n=3∞Un, but the union of finitely many is just Un again and not all of (0,1).

The set {0}⊂ℝ is compact. Proof: Given any open cover {Uλ}λ∈I, there must exist a λ0 such that 0∈Uλ0 as it is a cover, so Uλ0 gives a finite subcover.

We will prove below that [0,1], and in fact any closed and bounded interval [a,b] is compact.

Exercise A.4.2:

Let (X,d) be a metric space and A a finite subset of X. Show that A is compact.

Exercise A.4.3:

Let A={1/n:n∈ℕ}⊂ℝ.

  1. a)

    Show that A is not compact directly using the definition.

  2. b)

    Show that A∪{0} is compact directly using the definition.

Exercise A.4.4:
  1. a)

    Show that the union of finitely many compact sets is a compact set.

  2. b)

    Find an example where the union of infinitely many compact sets is not compact.

Proposition A.4.9.

Let (X,d) be a metric space. A compact set K⊂X is closed and bounded.

Proof.

Let K be a compact set. Fix p∈X. We have the open cover

K⊂⋃n=1∞B⁡(p,n)=X.

If K is compact, then there exists some set of indices n1<n2<…<nk such that

K⊂B⁡(p,n1)∪B⁡(p,n2)∪⋯∪B⁡(p,nk)=B⁡(p,nk).

So K is bounded. See left-hand side of Figure A.9.

Next, we show that a set that is not closed is not compact. Suppose K¯≠K, that is, there is a point x∈K¯∖K. We have the open cover

K⊂⋃n=1∞C⁢(x,1/n)c.

If we take any finite collection of indices n1<n2<…<nk, then

C⁢(x,1/n1)c∪C⁢(x,1/n2)c∪⋯∪C⁢(x,1/nk)c=C⁢(x,1/nk)c

As x is in the closure of K, we have C⁡(x,1/nk)∩K≠∅. So there is no finite subcover and K is not compact. See right-hand side of Figure A.9. ∎

 

On the left: a compact set K with nested balls centered at p of radius 1, 2, and 3, the largest ball containing K. On the right: a compact set K and a point x on its boundary, with the nested complements of the closed balls centered at x of shrinking radii 1, one half, one third, one quarter shaded. None of these complements covers K.

Figure A.9: Proving compact set is bounded (left) and closed (right).
 

We prove below that in a finite-dimensional euclidean space, every closed bounded set is compact. So closed bounded sets of ℝn are examples of compact sets. It is not true that in every metric space, closed and bounded is equivalent to compact. A simple example is an incomplete metric space such as (0,1) with the subspace metric from ℝ. There are many complete and very useful metric spaces where closed and bounded is not enough to give compactness: C⁡([a,b],ℝ) is a complete metric space, but the closed unit ball C⁡(0,1) is not compact, see Exercise A.4.9. However, see also Exercise A.4.11. As this issue is such a common mistake, let me repeat it in italics: Closed and bounded is not the same as compact.

A useful property of compact sets in a metric space is that every sequence in the set has a convergent subsequence converging to a point in the set. Such sets are called sequentially compact. Let us prove that in the context of metric spaces, a set is compact if and only if it is sequentially compact. First we prove a lemma.

Lemma A.4.10 (Lebesgue covering lemma33 3 The number δ is sometimes called the Lebesgue number of the cover.).

Let (X,d) be a metric space and K⊂X. Suppose every sequence in K has a subsequence convergent in K. Given an open cover {Uλ}λ∈I of K, there exists a δ>0 such that for every x∈K, there exists a λ∈I with B⁡(x,δ)⊂Uλ.

Proof.

We prove the lemma by contrapositive. If the conclusion is not true, then there is an open cover {Uλ}λ∈I of K with the following property. For every n∈ℕ there exists an xn∈K such that B⁡(xn,1/n) is not a subset of any Uλ. Take any x∈K. There is a λ∈I such that x∈Uλ. As Uλ is open, there is an ϵ>0 such that B⁡(x,ϵ)⊂Uλ. Take M such that 1/M<ϵ/2. If y∈B⁡(x,ϵ/2) and n≥M, then

B⁡(y,1/n)⊂B⁡(y,1/M)⊂B⁡(y,ϵ/2)⊂B⁡(x,ϵ)⊂Uλ,

where B⁡(y,ϵ/2)⊂B⁡(x,ϵ) follows by triangle inequality. See Figure A.10. Thus y≠xn. In other words, for all n≥M, xn∉B⁡(x,ϵ/2). The sequence cannot have a subsequence converging to x. As x∈K was arbitrary we are done. ∎

 

Open set U sub lambda containing a ball centered at x of radius epsilon, with two smaller balls of radius epsilon over 2 centered at x and y both within the larger ball and y being within epsilon over 2 of x, and also a ball of radius 1 over n centered at y.

Figure A.10: Proof of Lebesgue covering lemma. Note that B⁡(y,ϵ/2)⊂B⁡(x,ϵ) by triangle inequality.
 

It is important to recognize what the lemma says. It says that if K is sequentially compact, then for any given cover, there is a single δ>0. The δ depends on the cover, but, of course, it does not depend on x.

For example, let K=[−10,10] and for n∈ℤ let Un=(n,n+2) define an open cover. Take x∈K. There is an n∈ℤ, such that n≤x<n+1. If n≤x<n+1/2, then B⁡(x,1/2)⊂Un−1. If n+1/2≤x<n+1, then B⁡(x,1/2)⊂Un. So δ=1/2. If instead we take the open cover by Un′=(n2,n+22), the best δ is 1/4.

Theorem A.4.11.

Let (X,d) be a metric space. Then K⊂X is compact if and only if every sequence in K has a subsequence converging to a point in K.

Proof.

Claim: Let K⊂X be a subset of X and {xn} a sequence in K. Suppose that for each x∈K, there is a ball B⁡(x,αx) for some αx>0 such that xn∈B⁡(x,αx) for only finitely many n∈ℕ. Then K is not compact.

Proof of the claim: Notice

K⊂⋃x∈KB⁡(x,αx).

Any finite collection of these balls contains at most finitely many elements of {xn}, and so there must be an xn∈K not in their union. Therefore, K is not compact and the claim is proved.

Suppose K is compact and {xn} is a sequence in K. Then there exists an x∈K such that for any δ>0, B⁡(x,δ) contains xk for infinitely many k∈ℕ. The ball B⁡(x,1) contains some xk, so let n1=k. Suppose nj−1 is defined. There must exist an ℓ>nj−1 such that xℓ∈B⁡(x,1/j). Define nj=ℓ. We now possess a subsequence {xnj}j=1∞. Since d⁡(x,xnj)<1/j, Proposition A.3.5 says limxnj=x.

For the other direction, suppose every sequence in K has a subsequence converging in K. Take an open cover {Uλ}λ∈I of K. Using the Lebesgue covering lemma above, find a δ>0 such that for every x∈K, there is a λ∈I with B⁡(x,δ)⊂Uλ.

Pick x1∈K and find λ1∈I such that B⁡(x1,δ)⊂Uλ1. If K⊂Uλ1, we stop as we have found a finite subcover. Otherwise, there must be a point x2∈K∖Uλ1. Note that d⁡(x2,x1)≥δ. There must exist some λ2∈I such that B⁡(x2,δ)⊂Uλ2. We work inductively. Suppose λn−1 is defined. Either Uλ1∪Uλ2∪⋯∪Uλn−1 is a finite cover of K, in which case we stop, or there must be a point xn∈K∖(Uλ1∪Uλ2∪⋯∪Uλn−1). Note that d⁡(xn,xj)≥δ for all j=1,2,…,n−1. Next, there must be some λn∈I such that B⁡(xn,δ)⊂Uλn. See Figure A.11.

 

A shaded compact set K with points x sub 1 to x sub 4, balls of radius delta around them, and dotted open sets U sub lambda sub 1, U sub lambda sub 2, U sub lambda sub 3 covering the balls. the point x sub 4 is outside of the three open sets.

Figure A.11: Covering K by Uλ. The points x1,x2,x3,x4, the three sets Uλ1, Uλ2, Uλ3, and the first three balls of radius δ are drawn.
 

Either at some point we obtain a finite subcover of K, or we obtain an infinite sequence {xn} as above. For contradiction, suppose that there is no finite subcover and we have the sequence {xn}. For all n and k, n≠k, we have d⁡(xn,xk)≥δ, so no subsequence of {xn} can be Cauchy. Hence, no subsequence of {xn} can be convergent, which is a contradiction. ∎

Example A.4.12:

The Bolzano–Weierstrass theorem for sequences of real numbers says that a bounded sequence in ℝ has a convergent subsequence. Therefore, any sequence in a closed interval [a,b]⊂ℝ has a convergent subsequence. The limit must also be in [a,b] as limits preserve non-strict inequalities. Hence a closed bounded interval [a,b]⊂ℝ is compact.

Proposition A.4.13.

Let (X,d) be a metric space and let K⊂X be compact. If E⊂K is a closed set, then E is compact.

Proof.

Because K is closed, E is closed in K if and only if it is closed in X. See Proposition A.2.11. Let {xn} be a sequence in E. It is also a sequence in K. Therefore, it has a convergent subsequence {xnj} that converges to some x∈K. As E is closed, the limit of a sequence in E is also in E and so x∈E. Thus E must be compact. ∎

Theorem A.4.14 (Heine–Borel).

A closed bounded subset K⊂ℝn is compact.

So subsets of ℝn are compact if and only if they are closed and bounded, a condition that is much easier to check. Let us reiterate that the Heine–Borel theorem only holds for ℝn and not for metric spaces in general. In general, compact implies closed and bounded, but not vice versa.

Proof.

For ℝ=ℝ1 if K⊂ℝ is closed and bounded, then any sequence {xk} in K is bounded, so it has a convergent subsequence by the Bolzano–Weierstrass theorem. As K is closed, the limit of the subsequence must be an element of K. So K is compact.

Let us carry out the proof for n=2 and leave arbitrary n as an exercise. As K⊂ℝ2 is bounded, there exists a set B=[a,b]×[c,d]⊂ℝ2 such that K⊂B. We will show that B is compact. Then K, being a closed subset of a compact B, is also compact.

Let {(xk,yk)}k=1∞ be a sequence in B. That is, a≤xk≤b and c≤yk≤d for all k. A bounded sequence of real numbers has a convergent subsequence, so there is a subsequence {xkj}j=1∞ that is convergent. The subsequence {ykj}j=1∞ is also a bounded sequence so there exists a subsequence {ykjℓ}ℓ=1∞ that is convergent. A subsequence of a convergent sequence is still convergent, so {xkjℓ}ℓ=1∞ is convergent. Let

x=limℓ→∞xkjℓandy=limℓ→∞ykjℓ.

By Proposition A.3.8, {(xkjℓ,ykjℓ)}ℓ=1∞ converges to (x,y). As a≤xk≤b and c≤yk≤d for all k, we know that (x,y)∈B. ∎

Exercise A.4.5:

Prove Theorem A.4.14 for arbitrary dimension. Hint: The trick is to use the correct notation.

Proposition A.4.15.

Suppose (X,d) is a metric space and E1, E2, …, are nonempty compact subsets of X such that E1⊃E2⊃E3⊃⋯. Then

⋂k=1∞Ek≠∅.
Proof.

Suppose E1,E2,… are as in the statement except we do not assume they are nonempty. Compact sets are closed, so their complement is open. Consider Uk=X∖Ek. Suppose that the intersection is empty. Then {Uk} is an open cover of E1, which is compact, and hence there is a finite subcover. As the sets are nested, Uℓ⊂Uℓ+1 for all ℓ, we have E1⊂Uk for some k. Thus Ek is empty. ∎

Example A.4.16:

Let (X,d) be a metric space with the discrete metric, that is, d⁡(x,y)=1 if x≠y. Suppose X is an infinite set. Then:

  1. (i)

    (X,d) is a complete metric space.

  2. (ii)

    Any subset K⊂X is closed and bounded.

  3. (iii)

    A subset K⊂X is compact if and only if it is a finite set.

  4. (iv)

    The conclusion of the Lebesgue covering lemma is always satisfied with any δ∈(0,1), even for noncompact K⊂X.

The proofs of the statements are either trivial or are relegated to the exercises below.

Remark A.4.17.

A subtle point about Cauchy sequences, completeness, compactness, and convergence is that compactness and convergence only depend on the topology, that is, on which sets are the open sets. On the other hand, Cauchy sequences and completeness depend on the actual metric.

Exercise A.4.6:

Let (X,d) be a metric space with the discrete metric.

  1. a)

    Prove that X is complete.

  2. b)

    Prove that X is compact if and only if X is a finite set.

Exercise A.4.7:

Show that a compact set K (in any metric space) is itself a complete metric space (using the subspace metric).

Exercise A.4.8:

Show that there exists a metric on ℝ that makes ℝ into a compact set.

Exercise A.4.9:

Let C⁡([0,1],ℝ) be the metric space of Example A.1.6. Let 0 denote the zero function. Show that the closed ball C⁡(0,1) is not compact (even though it is closed and bounded). Hint: Construct continuous functions fn:[0,1]→ℝ such that d⁡(fn,0)=1 and d⁡(fn,fk)=1 for all n≠k.

Exercise A.4.10:

Let C⁡([0,1],ℝ) be the metric space of Example A.1.6. Let K be the set of f∈C⁡([0,1],ℝ) such that f is equal to a quadratic polynomial, i.e., f⁡(x)=a+b⁢x+c⁢x2, and such that |f⁡(x)|≤1 for all x∈[0,1], that is f∈C⁡(0,1). Show that K is compact.

Exercise A.4.11:

Let (X,d) be a complete metric space. Show that K⊂X is compact if and only if K is closed and such that for every ϵ>0 there exists a finite set of points x1,x2,…,xn with K⊂⋃j=1nB⁡(xj,ϵ). Note: Such a set K is said to be totally bounded, so in a complete metric space a set is compact if and only if it is closed and totally bounded.

Exercise A.4.12:

Take ℕ⊂ℝ using the standard metric. Find an open cover of ℕ such that the conclusion of the Lebesgue covering lemma does not hold.

Exercise A.4.13:

Prove the general Bolzano–Weierstrass theorem: Any bounded sequence {xk} in ℝn has a convergent subsequence.

Exercise A.4.14:

Let X be a metric space and C the set of nonempty compact subsets of X. Using the Hausdorff metric from Exercise A.1.5, show that (C,dH) is a metric space. That is, show that if L and K are nonempty compact subsets, then dH⁢(L,K)=0 if and only if L=K.

Exercise A.4.15:

Let (X,d) be an incomplete metric space. Show that there exists a closed and bounded set E⊂X that is not compact.

Exercise A.4.16:

Let (X,d) be a metric space and K⊂X. Prove that K is compact as a subset of (X,d) if and only if K is compact as a subset of itself with the subspace metric.

Exercise A.4.17:

Let (X,d) be a complete metric space. We say a set S⊂X is relatively compact if the closure S¯ is compact. Prove that S⊂X is relatively compact if and only if given any sequence {xn} in S, there exists a subsequence {xnk} that converges (in X).

A.5i  \  Continuous functions

A.5.1i  •  Continuity

Definition A.5.1.

Let (X,dX) and (Y,dY) be metric spaces and c∈X. Then f:X→Y is continuous at c if for every ϵ>0 there is a δ>0 such that whenever x∈X and dX⁢(x,c)<δ, then dY⁢(f⁡(x),f⁡(c))<ϵ.

If f:X→Y is continuous at all c∈X, then we say that f is a continuous function.

Proposition A.5.2.

Let (X,dX) and (Y,dY) be metric spaces. Then f:X→Y is continuous at c∈X if and only if for every sequence {xn} in X converging to c, the sequence {f⁡(xn)} converges to f⁡(c).

Proof.

Suppose f is continuous at c. Let {xn} be a sequence in X converging to c. Given ϵ>0, there is a δ>0 such that dX⁢(x,c)<δ implies dY⁢(f⁡(x),f⁡(c))<ϵ. So take M such that for all n≥M, we have dX⁢(xn,c)<δ, and then dY⁢(f⁡(xn),f⁡(c))<ϵ. Hence {f⁡(xn)} converges to f⁡(c).

Now suppose f is not continuous at c. Then there exists an ϵ>0, such that for every n∈ℕ there is an xn∈X, with dX⁢(xn,c)<1/n such that dY⁢(f⁡(xn),f⁡(c))≥ϵ. So {xn} converges to c, but {f⁡(xn)} does not converge to f⁡(c). ∎

Example A.5.3:

Suppose f:ℝ2→ℝ is a polynomial. That is,

f⁡(x,y)⁠=∑k=0d∑ℓ=0d−kak⁢ℓ⁢xk⁢yℓ⁠=a0 0+a1 0⁢x+a0 1⁢y+a2 0⁢x2+a1 1⁢x⁢y+a0 2⁢y2+⋯+a0⁢d⁢yd,

for some d∈ℕ (the degree) and ak⁢ℓ∈ℝ. Then we claim f is continuous. Let {(xn,yn)}n=1∞ be a sequence in ℝ2 that converges to (x,y)∈ℝ2. Therefore, limxn=x and limyn=y. Then

limn→∞f⁡(xn,yn)=limn→∞∑k=0d∑ℓ=0d−kak⁢ℓ⁢xnk⁢ynℓ=∑k=0d∑ℓ=0d−kak⁢ℓ⁢xk⁢yℓ=f⁡(x,y).

So f is continuous at (x,y), and as (x,y) was arbitrary, f is continuous everywhere. Similarly, a polynomial in n variables is continuous.

Be careful about taking limits separately. It is not enough that for every y, the function g⁡(x)=f⁡(x,y) is continuous, and for every x, the function h⁡(y)=f⁡(x,y) is continuous. The function f⁡(x,y) could still be discontinuous.

Exercise A.5.1:

Let f:ℝ2→ℝ be defined by f⁡(0,0)=0, and f⁡(x,y)=x⁢yx2+y2 if (x,y)≠(0,0). See Figure A.12.

  1. a)

    Show that for each fixed x, the function that takes y to f⁡(x,y) is continuous. Similarly for each fixed y, the function that takes x to f⁡(x,y) is continuous.

  2. b)

    Show that f is not continuous.

 

3D surface plot of x y over x squared plus y squared: a saddle-like surface with a twisting discontinuity at the origin.

Figure A.12: Graph of x⁢yx2+y2.
 
Example A.5.4:

Consider f:X→ℂ on a metric space X. Write f⁡(p)=u⁡(p)+i⁢v⁢(p), where u:X→ℝ and v:X→ℝ are the real and imaginary parts. Then f is continuous at c∈X if and only if its real and imaginary parts are continuous at c. This fact follows because {f⁡(pn)=u⁡(pn)+i⁢v⁢(pn)}n=1∞ converges to f⁡(p)=u⁡(p)+i⁢v⁢(p) if and only if {u⁡(pn)} converges to u⁡(p) and {v⁡(pn)} converges to v⁡(p).

Proposition A.5.5.

Let (X,d) be a metric space.

  1. (i)

    If p∈X, then f:X→ℝ defined by f⁡(x)=d⁡(x,p) is continuous.

  2. (ii)

    Given a nonempty set S⊂X, the function

    f⁡(x)=infp∈Sd⁡(x,p)

    is continuous.

Proof.

The reverse triangle inequality |f⁡(x)−f⁡(y)|=|d⁡(x,p)−d⁡(y,p)|≤d⁡(x,y) gives part (i).

For (ii), S being nonempty implies that f is real-valued. Take x,y∈X and assume without loss of generality that f⁡(x)>f⁡(y). For any ϵ>0, there exists a q such that infp∈Sd⁡(y,p)≥d⁡(y,q)−ϵ. Using this inequality together with infp∈Sd⁡(x,p)≤d⁡(x,q) and the reverse triangle inequality gives

f⁡(x)−f⁡(y)=infp∈Sd⁡(x,p)−infp∈Sd⁡(y,p)≤d⁡(x,q)−d⁡(y,q)+ϵ≤d⁡(x,y)+ϵ.

Since the inequality holds for every ϵ, f is continuous. ∎

Exercise A.5.2:

Take the metric space of continuous functions C⁡([0,1],ℝ). Let k:[0,1]×[0,1]→ℝ be a continuous function. Given f∈C⁡([0,1],ℝ) define

φf⁢(x)=∫01k⁡(x,y)⁢f⁡(y)⁢𝑑y.
  1. a)

    Show that T⁡(f)=φf defines a function T:C⁡([0,1],ℝ)→C⁡([0,1],ℝ).

  2. b)

    Show that T is continuous.

Exercise A.5.3:

Let (X,d) be a metric space. Define a metric on X×X as in Exercise A.1.3 part b, and show that g:X×X→ℝ defined by g⁡(x,y)=d⁡(x,y) is continuous.

Exercise A.5.4:

Let C⁡([a,b],ℝ) be the set of continuous functions and C1⁢([a,b],ℝ) the set of once continuously differentiable functions on [a,b]. Define

dC⁢(f,g)=∥f−g∥SanddC1⁢(f,g)=∥f−g∥S+∥f′−g′∥S,

where ∥⋅∥S is the uniform norm. By Example A.1.6 and Exercise A.1.8, C⁡([a,b],ℝ) with dC is a metric space and so is C1⁢([a,b],ℝ) with dC1.

  1. a)

    Prove that the derivative operator D:C1⁢([a,b],ℝ)→C⁡([a,b],ℝ) defined by D⁡(f)=f′ is continuous.

  2. b)

    On the other hand, if we consider the metric dC on C1⁢([a,b],ℝ), then prove the derivative operator is no longer continuous. Hint: Consider sin⁡(n⁢x).

Exercise A.5.5:

Define

f⁡(x,y)={2⁢x⁢yx4+y2if ⁢(x,y)≠(0,0),0if ⁢(x,y)=(0,0).
  1. a)

    Show that for every fixed y the function that takes x to f⁡(x,y) is continuous and hence Riemann integrable.

  2. b)

    For every fixed x, the function that takes y to f⁡(x,y) is continuous.

  3. c)

    Show that f is not continuous at (0,0).

  4. d)

    Now show that g⁡(y)=∫01f⁡(x,y)⁢𝑑x is not continuous at y=0.

Note: Feel free to use what you know about arctan from calculus, in particular that d𝑑s⁢[arctan⁡(s)]=11+s2.

A.5.2i  •  Compactness and continuity

Continuous maps do not map closed sets to closed sets. For example, f:(0,1)→ℝ defined by f⁡(x)=x takes the set (0,1), which is closed in (0,1), to the set (0,1), which is not closed in ℝ. On the other hand, continuous maps do preserve compact sets.

Lemma A.5.6.

Let (X,dX) and (Y,dY) be metric spaces and f:X→Y a continuous function. If K⊂X is a compact set, then f⁡(K) is a compact set.

Proof.

Write a sequence in f⁡(K) as {f⁡(xn)}n=1∞, where {xn}n=1∞ is a sequence in K. The set K is compact, so there is a subsequence {xnℓ}ℓ=1∞ that converges to some x∈K. By continuity,

limℓ→∞f⁡(xnℓ)=f⁡(x)∈f⁡(K).

So every sequence in f⁡(K) has a subsequence convergent to a point in f⁡(K), and f⁡(K) is compact by Theorem A.4.11. ∎

As before, f:X→ℝ achieves an absolute minimum at c∈X if

f⁡(x)≥f⁡(c)for all ⁢x∈X.

On the other hand, f achieves an absolute maximum at c∈X if

f⁡(x)≤f⁡(c)for all ⁢x∈X.
Theorem A.5.7.

Let (X,d) be a nonempty compact metric space and f:X→ℝ continuous. Then f achieves an absolute minimum and maximum on X. In particular, f is bounded.

Proof.

As X is compact and f is continuous, f⁡(X)⊂ℝ is compact. Hence f⁡(X) is closed and bounded. In particular, supf⁡(X)∈f⁡(X) and inff⁡(X)∈f⁡(X), because both the sup and the inf can be achieved by sequences in f⁡(X) and f⁡(X) is closed. Therefore, there is some x∈X such that f⁡(x)=supf⁡(X) and some y∈X such that f⁡(y)=inff⁡(X). ∎

Exercise A.5.6:

Let (X,d) be a metric space. Use Exercise A.5.3 to prove that if K1 and K2 are compact subsets of X, then there exists a p∈K1 and q∈K2 such that d⁡(p,q) is minimal, that is, d⁡(p,q)=inf{d⁡(x,y):x∈K1,y∈K2}.

Exercise A.5.7:

Let (X,d) be a compact metric space, let C⁡(X,ℝ) be the set of real-valued continuous functions. Define

d⁡(f,g)=∥f−g∥S=supx∈X|f⁡(x)−g⁡(x)|.
  1. a)

    Show that d makes C⁡(X,ℝ) into a metric space.

  2. b)

    Show that for each x∈X, the evaluation function Ex:C⁡(X,ℝ)→ℝ defined by Ex⁢(f)=f⁡(x) is a continuous function.

A.5.3i  •  Continuity and topology

Let us see how to define continuity in terms of the topology, that is, the open sets. We have already seen that topology determines which sequences converge, and so it is no wonder that the topology also determines continuity of functions.

Lemma A.5.8.

Let (X,dX) and (Y,dY) be metric spaces. A function f:X→Y is continuous at c∈X if and only if for every open neighborhood U of f⁡(c) in Y, the set f−1⁢(U) contains an open neighborhood of c in X. See Figure A.13.

In other words, f−1⁢(U) is a not-necessarily-open neighborhood of c.

 

On the left, the set f inverse of U containing a smaller neighborhood W of c. On the right, an open set U around f of c. An arrow f maps c to f of c.

Figure A.13: For every neighborhood U of f⁡(c), the set f−1⁢(U) contains an open neighborhood W of c.
 
Proof.

First suppose that f is continuous at c. Let U be an open neighborhood of f⁡(c) in Y, then BY⁢(f⁡(c),ϵ)⊂U for some ϵ>0. By continuity of f, there exists a δ>0 such that whenever x is such that dX⁢(x,c)<δ, then dY⁢(f⁡(x),f⁡(c))<ϵ. In other words,

BX⁢(c,δ)⊂f−1⁢(BY⁢(f⁡(c),ϵ))⊂f−1⁢(U),

and BX⁢(c,δ) is an open neighborhood of c.

For the other direction, let ϵ>0 be given. If f−1⁢(BY⁢(f⁡(c),ϵ)) contains an open neighborhood W of c, it contains a ball. That is, there is some δ>0 such that

BX⁢(c,δ)⊂W⊂f−1⁢(BY⁢(f⁡(c),ϵ)).

That means precisely that if dX⁢(x,c)<δ then dY⁢(f⁡(x),f⁡(c))<ϵ, and so f is continuous at c. ∎

Theorem A.5.9.

Let (X,dX) and (Y,dY) be metric spaces. A function f:X→Y is continuous if and only if for every open U⊂Y, f−1⁢(U) is open in X.

The proof follows from Lemma A.5.8 and is left as an exercise.

Exercise A.5.8:

Prove Theorem A.5.9. Hint: Use Lemma A.5.8.

Example A.5.10:

Let f:X→Y be a continuous function. Theorem A.5.9 tells us that if E⊂Y is closed, then f−1⁢(E)=X∖f−1⁢(Ec) is also closed. Therefore, given a continuous f:X→ℝ, the zero set of f, that is, f−1⁢(0)={x∈X:f⁡(x)=0}, is closed.

The set where f is nonnegative, that is, f−1⁢([0,∞))={x∈X:f⁡(x)≥0}, is closed. On the other hand, the set where f is positive, f−1⁢((0,∞))={x∈X:f⁡(x)>0}, is open.

Exercise A.5.9:

Consider ℕ⊂ℝ with the standard metric. Let (X,d) be a metric space and f:X→ℕ a continuous function.

  1. a)

    Prove that if X is connected, then f is constant (the range of f is a single value).

  2. b)

    Find an example where X is disconnected and f is not constant.

Exercise A.5.10:

Suppose (X,dX), (Y,dY) are metric spaces and f:X→Y is continuous. Let A⊂X.

  1. a)

    Show that f⁡(A¯)⊂f⁡(A)¯.

  2. b)

    Show that the subset can be proper.

Exercise A.5.11:

Suppose f:X→Y is continuous for metric spaces (X,dX) and (Y,dY). Show that if X is connected, then f⁡(X) is connected.

Exercise A.5.12:

Prove the following version of the intermediate value theorem. Let (X,d) be a connected metric space and f:X→ℝ a continuous function. Suppose that there exist x0,x1∈X and y∈ℝ such that f⁡(x0)<y<f⁡(x1). Then prove that there exists a z∈X such that f⁡(z)=y. Hint: See Exercise A.5.11.

Exercise A.5.13:

Let (X,dX) and (Y,dY) be metric spaces and f:X→Y be a one-to-one and onto continuous function. Suppose X is compact. Prove that the inverse f−1:Y→X is continuous.

A.5.4i  •  Uniform continuity

As for continuous functions on the real line, in the definition of continuity it is sometimes convenient to be able to pick one δ for all points.

Definition A.5.11.

Let (X,dX) and (Y,dY) be metric spaces. Then f:X→Y is uniformly continuous if for every ϵ>0 there is a δ>0 such that whenever p,q∈X and dX⁢(p,q)<δ, then dY⁢(f⁡(p),f⁡(q))<ϵ.

A uniformly continuous function is continuous, but not necessarily vice versa. It is “vice versa” if X is compact.

Theorem A.5.12.

Let (X,dX) and (Y,dY) be metric spaces. Suppose f:X→Y is continuous and X is compact. Then f is uniformly continuous.

Proof.

Let ϵ>0 be given. For each c∈X, pick δc>0 such that dY⁢(f⁡(x),f⁡(c))<ϵ/2 whenever x∈B⁡(c,δc). The balls B⁡(c,δc) cover X, and the space X is compact. Apply the Lebesgue covering lemma to obtain a δ>0 such that for every x∈X, there is a c∈X for which B⁡(x,δ)⊂B⁡(c,δc).

If p,q∈X where dX⁢(p,q)<δ, find a c∈X such that B⁡(p,δ)⊂B⁡(c,δc). Then q∈B⁡(c,δc). By the triangle inequality and the definition of δc,

dY⁢(f⁡(p),f⁡(q))≤dY⁢(f⁡(p),f⁡(c))+dY⁢(f⁡(c),f⁡(q))<ϵ/2+ϵ/2=ϵ.∎
Example A.5.13:

Useful examples of uniformly continuous functions are the so-called Lipschitz continuous functions. That is, if (X,dX) and (Y,dY) are metric spaces, then f:X→Y is called Lipschitz or K-Lipschitz if there exists a K∈ℝ such that

dY⁢(f⁡(p),f⁡(q))≤K⁢dX⁢(p,q)for all ⁢p,q∈X.

A Lipschitz function is uniformly continuous: Take δ=ϵ/K. A function can be uniformly continuous but not Lipschitz: x on [0,1] is uniformly continuous but not Lipschitz (exercise).

It is worth mentioning that, if a function is Lipschitz, it tends to be easiest to simply show it is Lipschitz even if we are only interested in knowing continuity (or uniform continuity).

Exercise A.5.14:

Show that x is uniformly continuous on [0,1] but not Lipschitz.

Exercise A.5.15:
  1. a)

    Show that f:(c,∞)→ℝ for some c>0 defined by f⁡(x)=1/x is Lipschitz continuous.

  2. b)

    Show that f:(0,∞)→ℝ defined by f⁡(x)=1/x is not Lipschitz continuous nor uniformly continuous.

Exercise A.5.16:

Suppose f:ℝ→ℝ is a differentiable function such that f′ is a bounded function. Prove f is a Lipschitz continuous function.

Exercise A.5.17:

Prove that the map T defined in Exercise A.5.2 is Lipschitz continuous.

Exercise A.5.18:

Let f:ℝ→ℝ be a polynomial of degree d≥2. Show that f is not Lipschitz continuous.

A.5.5i  •  Cluster points and continuous limits

Definition A.5.14.

Let (X,d) be a metric space and S⊂X. A point p∈X is called a cluster point of S if for every ϵ>0, the set B⁡(p,ϵ)∩S∖{p} is not empty.

Definition A.5.15.

Let (X,dX), (Y,dY) be metric spaces, S⊂X, p∈X a cluster point of S, and f:S→Y a function. Suppose there exists an L∈Y and for every ϵ>0, there exists a δ>0 such that whenever x∈S∖{p} and dX⁢(x,p)<δ, then

dY⁢(f⁡(x),L)<ϵ.

Then f⁡(x) converges to L as x goes to p, and L is the limit of f⁡(x) as x goes to p. We write

limx→pf⁡(x)⁢=def⁢L.

If f⁡(x) does not converge as x goes to p, we say f diverges at p.

We again used the definite article without showing that the limit is unique. We leave the proof of uniqueness as an exercise.

Proposition A.5.16.

Let (X,dX) and (Y,dY) be metric spaces, S⊂X, p∈X a cluster point of S, and let f:S→Y be a function such that f⁡(x) converges as x goes to p. Then the limit of f⁡(x) as x goes to p is unique.

Exercise A.5.19:

In a metric space, continuous limits may be replaced by sequential limits. We leave the proof as an exercise. The upshot is that we really only need to prove things for sequential limits.

Lemma A.5.17.

Let (X,dX) and (Y,dY) be metric spaces, S⊂X, p∈X a cluster point of S, and let f:S→Y be a function.

Then f⁡(x) converges to L∈Y as x goes to p if and only if for every sequence {xn} in S∖{p} such that limxn=p, the sequence {f⁡(xn)} converges to L.

Exercise A.5.20:

Prove Lemma A.5.17.

By applying Proposition A.5.2 or the definition directly we find (exercise) that for cluster points p of S⊂X, the function f:S→Y is continuous at p if and only if

limx→pf⁡(x)=f⁡(p).
Exercise A.5.21:

Let (X,d) be a metric space, S⊂X, and p∈X. Prove that p is a cluster point of S if and only if p∈S∖{p}¯.

Exercise A.5.22:

Let (X,dX) and (Y,dY) be metric spaces, S⊂X, p∈X a cluster point of S, and let f:S→Y be a function. Prove that f:S→Y is continuous at p if and only if limx→pf⁡(x)=f⁡(p).