metric spaces - search - university of maltastaff.um.edu.mt/jmus1/metrics.pdf · metric spaces are...

42
1 Distance J Muscat 1 Metric Spaces Joseph Muscat 2003 (Last revised May 2009) (A revised and expanded version of these notes are now published by Springer.) 1 Distance A metric space can be thought of as a very basic space having a geometry, with only a few axioms. Metric spaces are generalizations of the real line, in which some of the theorems that hold for R remain valid. Some of the main results in real analysis are (i) Cauchy sequences converge, (ii) for continuous functions f (lim n→∞ x n ) = lim n→∞ f (x n ), (iii) continuous real functions are bounded on intervals of type [a, b] and satisfy the intermediate value theorem, etc. At first sight, it is difficult to generalize these theorems, say to sequences and continuous functions of several variables such as f (x, y). That is the aim of this abstract course: to show how these theorems apply in a much more general setting than R. The fundamental ingredient that is needed is that of a distance or metric. This is not enough, however, to get the best results and we need to specify later that the distance be of a nice type, called a complete metric. In what follows the metric space X will denote an abstract set, not neces- sarily R or R n , although these are of the most immediate interest. When we refer to “points” we do not necessarily refer to geometrical points, although this is how most of us visualize them. They may in fact be sequences, func- tions, images, sounds, signals, etc. Definition A distance or metric on a metric space X is a function d : X 2 7R + (x, y) 7d(x, y) with the properties (i) d(x, y)=0 x = y (ii) d(y,x)= d(x, y) (iii) d(x, y) 6 d(x, z )+ d(y,z ) for all x, y, z X .

Upload: phamxuyen

Post on 10-Apr-2018

214 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Metric Spaces - Search - University of Maltastaff.um.edu.mt/jmus1/metrics.pdf · Metric spaces are generalizations of the real line, in ... Note: \An interior point of Acan be surrounded

1 Distance J Muscat 1

Metric SpacesJoseph Muscat 2003(Last revised May 2009)

(A revised and expanded version of these notes are now published bySpringer.)

1 Distance

A metric space can be thought of as a very basic space having a geometry,with only a few axioms. Metric spaces are generalizations of the real line, inwhich some of the theorems that hold for R remain valid. Some of the mainresults in real analysis are

(i) Cauchy sequences converge,(ii) for continuous functions f(limn→∞ xn) = limn→∞ f(xn),(iii) continuous real functions are bounded on intervals of type [a, b] and

satisfy the intermediate value theorem, etc.At first sight, it is difficult to generalize these theorems, say to sequences

and continuous functions of several variables such as f(x, y). That is the aimof this abstract course: to show how these theorems apply in a much moregeneral setting than R. The fundamental ingredient that is needed is that ofa distance or metric. This is not enough, however, to get the best results andwe need to specify later that the distance be of a nice type, called a completemetric.

In what follows the metric space X will denote an abstract set, not neces-sarily R or Rn, although these are of the most immediate interest. When werefer to “points” we do not necessarily refer to geometrical points, althoughthis is how most of us visualize them. They may in fact be sequences, func-tions, images, sounds, signals, etc.

Definition A distance or metric on a metric space X is a function

d : X2 7→ R+

(x, y) 7→ d(x, y)

with the properties

(i) d(x, y) = 0 ⇔ x = y(ii) d(y, x) = d(x, y)

(iii) d(x, y) 6 d(x, z) + d(y, z)

for all x, y, z ∈ X.

Page 2: Metric Spaces - Search - University of Maltastaff.um.edu.mt/jmus1/metrics.pdf · Metric spaces are generalizations of the real line, in ... Note: \An interior point of Acan be surrounded

1 Distance J Muscat 2

1.0.1 Example

On N, Q, R, C, and RN , one can take the standard Euclidean distanced(x, y) := |x − y|. Check that the three axioms for a distance are satisfied(make use of the fact that |a+b| 6 |a|+ |b|). Note that for Rn, the Euclidean

distance is d(x,y) :=√∑i=n

i=1 |xi − yi|2.One can define distances on other more general spaces, e.g. the space of

continuous functions f(x) with x ∈ [0, 1] has a distance defined by d(f, g) :=maxx∈[0,1] |f(x) − g(x)|. The space of shapes (roughly speaking, subsets ofR2 having an area) have a metric d(A,B) := area of (A ∪ BrA ∩ B). In allthese cases we get an idea of which elements are close together by looking attheir distance.

1.0.2 Exercises

1. Show that if x1, . . . , xn are n points, then

d(x1, xn) 6 d(x1, x2) + . . .+ d(xn−1, xn).

2. Verify that the metric defined on R2 does indeed satisfy the metricaxioms.

3. Show that if d is a metric, then so are the maps D1(x, y) := 2d(x, y)

and D2(x, y) := d(x,y)1+d(x,y)

, but that d(x, y)2 need not be a metric. Hencea metric space can have several metrics.

4. Show that if X, Y are metric spaces with distances dX and dY , thenX × Y is also a metric space with distance

D(

(x1y1

),

(x2y2

)) := dX(x1, x2) + dY (y1, y2).

(Note that for R2, this metric is not the Euclidean one.)

5. Show further that

D̃(

(x1y1

),

(x2y2

)) := max(dX(x1, x2), dY (y1, y2))

is also a metric for X × Y .

6. Prove that the function d(m,n) := |1/m−1/n|, on the natural numbers,is a metric.

Page 3: Metric Spaces - Search - University of Maltastaff.um.edu.mt/jmus1/metrics.pdf · Metric spaces are generalizations of the real line, in ... Note: \An interior point of Acan be surrounded

1.1 Balls J Muscat 3

7. Show that in fact the axioms (i) and (iii) imply both d(x, y) > 0 andaxiom (ii).

8. Show thatd(x, y) > |d(x, z)− d(y, z)|.

9. Consider the set X of bytes, i.e., sequences of 0s and 1s of length 8.The Hamming distance between two bytes is defined as the number ofplaces where their bits differ. Show that this is a distance on X.

1.1 Balls

Definition An (open) ball is the set

Br(a) := {x ∈ X : d(x, a) < r }

where a ∈ X is its center and r > 0 its radius.

Note: The ball is the “surroundings” of the point a. One can consider ∅and X to be balls with r = 0 and r = ∞ respectively, but this is unusual.Although we call it a ball, one must remove any preconceptions of it beinground etc.

In R, every ball Br(a) = {x ∈ R : |x− a| < r } = (a− r, a+ r) is just anopen interval. In particular, B1/2(a) = (a − 1/2, a + 1/2). Conversely, anyopen interval of the type (a, b) is a ball in R, with center (a+ b)/2 and radius(b− a)/2.

In R2, the ball Br(a) is the disk with center a and radius r without thecircular perimeter.

In N, the ball B1/2(m) = {m }, and B2(m) = {m− 1,m,m+ 1 }.

Definition A point x of a set A is called an interior point of A when

∃ε > 0 Bε(x) ⊆ A.

A point x (not in A) is an exterior point of A when

∃ε > 0 Bε(x) ⊆ XrA.

All other points of X are called boundary points. A point x of A iscalled an isolated point when there is a ball Bε(x) which contains no pointsof A other than x itself.

Page 4: Metric Spaces - Search - University of Maltastaff.um.edu.mt/jmus1/metrics.pdf · Metric spaces are generalizations of the real line, in ... Note: \An interior point of Acan be surrounded

1.1 Balls J Muscat 4

Definition A set A is open in X when all its points are interior points.

Note: “An interior point of A can be surrounded completely by a ballinside A”; “open sets do not contain their boundary”.

We also say that A is a neighborhood of a when a is an interior point ofA.

The empty set is open by default, because it does not contain any points.The whole space X is also open because any ball about any point of X is asubset of X.

1.1.1 Example

Show that (a, b) is open in R, but that [a, b] and { a } are not.

Theorem A

Balls are open sets in X.

Proof Let x ∈ Br(a) be any point in the given ball. This means thatd(x, a) < r. Let ε := r− d(x, a) which is positive. Then Bε(x) ⊆ Br(a) sincefor any y ∈ Bε(x),

d(y, a) 6 d(y, x) + d(x, a) < ε+ d(x, a) = r.

Therefore y ∈ Br(a).�

Open sets, however, need not be balls.Note that we need to specify that A is open in X. For example we have

seen that {m } is open in N (since it is a ball in N) but not open in R (seeprevious example).

Theorem B

A set is open ⇔ it is the union of balls.

Page 5: Metric Spaces - Search - University of Maltastaff.um.edu.mt/jmus1/metrics.pdf · Metric spaces are generalizations of the real line, in ... Note: \An interior point of Acan be surrounded

1.1 Balls J Muscat 5

Proof Let A be an open set. Then

∀x ∈ A ∃ε > 0 x ∈ Bε(x) ⊆ A

which implies that

A =⋃x∈A

{x} ⊆⋃x∈A

Bε(x) ⊆ A.

Hence A =⋃x∈ABε(x), a union of balls.

Conversely, let A =⋃iBri(ai) be a union of balls, and let x be any point

in A. Then x is in at least one of these balls, say, Br(a). But balls are openand hence x ∈ Bε(x) ⊆ Br(a) ⊆ A. A is therefore open.

One can study open sets without reference to balls or metrics in thesubject of topology. The basic properties of open sets are:

Theorem C

Any union of open sets is open.Any finite intersection of open sets is open.

Proof Consider⋃iAi where Ai are all open. Given any x ∈

⋃iAi, it

must lie in at least one of these sets Ai which is open. Therefore

x ∈ Br(x) ⊆ Ai ⊆⋃i

Ai

showing that the union is open.For the second part it is enough to consider the intersection of two open

sets A∩B (the rest can be done by induction). Let x ∈ A∩B. Then x ∈ Aand x ∈ B, both sets being open. Therefore there are open balls Br1(x) ⊆ Aand Br2(x) ⊆ B. Pick the smaller of these two balls, say the one with radiusr1. Then,

x ∈ Br1(x) ⊆ Br1(x) ∩Br2(x) ⊆ A ∩B.

Page 6: Metric Spaces - Search - University of Maltastaff.um.edu.mt/jmus1/metrics.pdf · Metric spaces are generalizations of the real line, in ... Note: \An interior point of Acan be surrounded

1.1 Balls J Muscat 6

1.1.2 Example

In R the intersection of two open intervals is either empty or else anotheropen interval, both of which are open. Any collection of open intervals isopen.

Note that an infinite intersection of open sets need not be open. Forexample, in R, consider the open intervals (−1/2n, 1/2n) which are nestedone inside another. Their intersection is just the set { 0 } (prove this!) whichis not open in R.

Theorem D

Distinct points in X can be separated by disjointopen balls.

x 6= y ⇒ ∃r > 0 Br(x) ∩Br(y) = ∅

Proof If x 6= y then d(x, y) > 0. Let r := d(x, y)/2. Then Br(x) ∩Br(y) = ∅ since otherwise,

z ∈ Br(x) ∩Br(y) ⇒ d(x, z) < r and d(y, z) < r

⇒ d(x, y) 6 d(x, z) + d(y, z) < 2r = d(x, y)

which is a contradiction.�

1.1.3 Exercises

1. If r1 < r2, show that Br1(x) ⊂ Br2(x).

2. Show that in R, the sets (a,∞) and (−∞, a) are open sets.

3. Show that in R2, (i) the half-plane S = { (x, y) ∈ R2 : y > 0 } and (ii)the rectangles R = { (x, y) ∈ R2 : a < x < b, c < y < d } are open sets.

4. Show that the interval (a, b) on the x-axis, is open in R but not openin R2.

Page 7: Metric Spaces - Search - University of Maltastaff.um.edu.mt/jmus1/metrics.pdf · Metric spaces are generalizations of the real line, in ... Note: \An interior point of Acan be surrounded

1.1 Balls J Muscat 7

5. Find an example in R2 in which the infinite intersection of open sets isnot open.

6. Show that for any metric space X, the set Xr{x } is open in X.

7. Prove properly by induction, that the finite intersection of open sets isopen.

8. Show that if {x } are open sets in X for all points x ∈ X, then allsubsets of X are also open in X. In particular, all subsets of N areopen in N.

9. Given any set X, let

d(x, y) =

{0 x = y

1 x 6= y.

Show that d is a metric (it is called the discrete metric), for which theopen balls are just the sets {x } and X. Deduce that all the subsets ofX with this metric are open in X.

10. * Show that the set of interior points of A is the largest open set insideA, i.e., if A◦ denotes the set of interior points of A, and V ⊆ A is anopen set, then V ⊆ U◦.

Page 8: Metric Spaces - Search - University of Maltastaff.um.edu.mt/jmus1/metrics.pdf · Metric spaces are generalizations of the real line, in ... Note: \An interior point of Acan be surrounded

2 Closed Sets and Convergence J Muscat 8

2 Closed Sets and Convergence

2.1 Closed Sets

Definition A set F is closed in a space X when XrF is open in X.

2.1.1 Example

On R the set [a, b] is closed, since Rr[a, b] = (−∞, a) ∪ (b,∞) is the unionof two open sets, hence itself open. Similarly [a,∞) and (−∞, a] are closedin R.

N is closed in R, but Q is not.On any metric space X, the sets X and ∅ are closed since Xr∅ = X

and XrX = ∅ are open in X.

Proposition 2.1

The sets {x } are closed in X.

Proof. Exercise.

Theorem A

The finite union of closed sets is closed.Any intersection of closed sets is closed.

ProofXr(F ∪G) = (XrF ) ∩ (XrG)

which is the intersection of two open sets, hence open.

Xr⋂i

Fi =⋃i

(XrFi)

which is the union of open sets, hence open.�

Page 9: Metric Spaces - Search - University of Maltastaff.um.edu.mt/jmus1/metrics.pdf · Metric spaces are generalizations of the real line, in ... Note: \An interior point of Acan be surrounded

2.1 Closed Sets J Muscat 9

2.1.2 Exercises

1. Let U be an open set. Show that XrU is closed in X.

2. Show that the ‘closed ball’ {x ∈ X : d(x, a) 6 r } is closed.

3. Let U be an open set and F a closed set in X. Show that UrF is openand FrU is closed.

4. Show that a finite collection of points { a1, . . . , aN } form a closed set.

5. Find a set in R which is (i) neither open nor closed; (ii) both open andclosed.

6. Find an example in which the infinite union of closed sets (i) is notclosed; (ii) is closed.

7. Determine which of the following sets in R are closed, open, neither orboth: (i) (0,∞); (ii) Z; (iii)

⋃n[0, 2−1/n); (iv) R; (v) [0, 1]r

⋃∞n=2{ 1/n };

(vi) [0, 1] ∪ { 5 }.

8. * Let the Cantor set be defined as follows. Start with the closed interval[0, 1]; remove the middle interval (1/3, 2/3) to end up with two closedintervals [0, 1/3]∪[2/3, 1]. For each of these intervals remove the middleinterval of each to end up with four closed intervals [0, 1/9]∪[2/9, 1/3]∪[2/3, 7/9] ∪ [8/9, 1]. Show that if we continue this process indefinitelywe end up with a closed set.

Definition A limit point of a set A is a point b (not necessarily inA) such that

∀ε > 0 ∃a 6= b a ∈ A ∩Bε(b)

In other words, a limit point is one that cannot be ‘separated’ from itsset — it can be an interior point or part of the boundary. Every point of Ais either a limit point or an isolated point.

Theorem B

A set is closed ⇔ it contains all its limit points.

Page 10: Metric Spaces - Search - University of Maltastaff.um.edu.mt/jmus1/metrics.pdf · Metric spaces are generalizations of the real line, in ... Note: \An interior point of Acan be surrounded

2.1 Closed Sets J Muscat 10

Proof Let F be a closed set, and let x be a limit point of it.

x /∈ F ⇒ x ∈ XrF ⇒ x ∈ Bε(x) ⊆ XrF

which shows that Bε(x) ∩ F = ∅, a contradiction since x is a limit point ofF .

Conversely, suppose F contains all its limit points, and let x /∈ F . Thenx is not a limit point of F . Therefore,

∃ε > 0 ∀y 6= x y /∈ F ∩Bε(x)

i.e., F ∩Bε(x) ⊆ {x } ⊆ XrF

∴ x ∈ Bε(x) ⊆ XrF

which means that x can be surrounded by a ball inside XrF . ThereforeXrF is open, which by definition means that F is closed.

Definition Any set A can be closed by adding its limit points to formthe closure of A

A = A ∪ {limit points of A}

Note: the set of limit points of a set is sometimes called its derived set.

2.1.3 Exercises

1. Find the limit points and closure of Z and Q in R.

2. Show that (a, b) = [a, b]; { 1/n } = { 1/n } ∪ {0}.

3. Can a set not have limit points? Can an infinite set not have limitpoints?

4. A set A is said to be dense in X when A = X. Show that any ε-ballof X must contain elements of A. Prove that Q is dense in R.

5. Let A be a bounded non-empty set in R. Show that supA is a limitpoint of both A and RrA.

6. Show that x ∈ A ⇔ infa∈A d(x, a) = 0.

Page 11: Metric Spaces - Search - University of Maltastaff.um.edu.mt/jmus1/metrics.pdf · Metric spaces are generalizations of the real line, in ... Note: \An interior point of Acan be surrounded

2.2 Convergence J Muscat 11

7. Show that any point of A must be either a limit point of A or an isolatedpoint of A.

8. * Show that A ∪B = A∪B; A ⊆ B ⇒ A ⊆ B; A is closed ⇔ A = A.

9. * Show that A is the smallest closed set containing A i.e., if F ⊇ A isa closed set, then A ⊆ F .

10. ** Show that the limit points of A belong to A so that A = A.

11. ** Let the decimal expansion of x be 0.n1n2n3 . . .. Show that

{x :n1 + . . .+ nk

k6 5 ∀k }

is closed in R.

2.2 Convergence

Definition A sequence (xn) in the metric space X converges to x, written

xn → x as n→∞, or limn→∞

xn = x,

when∀ε > 0 ∃N n > N ⇒ xn ∈ Bε(x).

In other words, “any neighborhood of x contains all the sequence fromN onwards.” This definition generalizes the definition of convergence for realsequences — the expression |xn − x| < ε generalizes to d(xn, x) < ε which isthe same as xn ∈ Bε(x).

Proposition 2.2

A sequence can only converge to one point.

Proof Suppose xn → x and xn → y as n → ∞. Suppose that x 6= ythen they can be separated by two disjoint balls Br(x) and Br(y). But

∃N1 n > N1 ⇒ xn ∈ Br(x)

Page 12: Metric Spaces - Search - University of Maltastaff.um.edu.mt/jmus1/metrics.pdf · Metric spaces are generalizations of the real line, in ... Note: \An interior point of Acan be surrounded

2.2 Convergence J Muscat 12

and∃N2 n > N2 ⇒ xn ∈ Br(y).

Therefore for n > N1, N2 we have that xn ∈ Br(x) ∩ Br(y) = ∅ which is acontradiction.

Theorem C

If xn ∈ F converges to x, then x ∈ F̄ .

If (xn) is a convergent sequence in a closed set F ,then lim

n→∞xn ∈ F .

Proof If x is in F then we’re done. So suppose that the limit x 6∈ F .Take any ball Bε(x) about x. Since xn converges to x, we can find an integerN such that n > N ⇒ xn ∈ Bε(x). Hence x is a limit point of F and so isin F̄ .

The corollary follows immediately from the theorem.�

2.2.1 Exercises

1. Show that if x is a limit point of the set A then there is a sequence(an) in A which converges to x. (Hint: take balls around x, with radiidecreasing to 0)

2. Show that if xn → x then d(xn, xm)→ 0 as n,m→∞.

3. Show that a sequence

(xnyn

)in X × Y converges to

(xy

)if, and only

if, xn → x and yn → y. (Recall the distance defined on X × Y .)

4. Show that if d1(x, y) 6 λd2(x, y) (λ > 0) and the sequence (xn) con-verges with respect to d2, then it converges with respect to d1.

5. Try to generalize the definition of limx→x0 f(x) from the case of realfunctions to the case of functions f : X → Y on metric spaces.

Page 13: Metric Spaces - Search - University of Maltastaff.um.edu.mt/jmus1/metrics.pdf · Metric spaces are generalizations of the real line, in ... Note: \An interior point of Acan be surrounded

2.3 Completeness J Muscat 13

2.3 Completeness

When does a sequence converge/diverge? Let us take some examples ofdivergent sequences:

(n) diverges in R because the set {n } seems to be too large;(1/n) diverges in the set (0, 1) because the point it’s trying to converge

to, 0, is not in the set;((−1)n) diverges because it keeps alternating between two points;(xn) where xn+1 = xn

2+ 1

xnin Q diverges because were it to converge then

the limit would satisfy x = x/2 + 1/x which implies that x2 = 2 which weknow cannot be satisfied by any rational number.

We seem to be able to make an intuitive distinction between sequencesthat do not converge at all (truly divergent), and those that seem to converge‘outside’ the set — if we restrict ourselves to X however, it fails to convergebecause the metric space does not contain the ‘limit’.

The same phenomenon can occur for other more general spaces e.g. asequence of continuous functions can ‘converge’ to a discontinuous function.

It is possible to distinguish between the two ideas rigorously as follows:

Definition A Cauchy sequence is one such that

∀ε > 0 ∃N n,m > N ⇒ d(xn, xm) < ε.

In other words, limn,m→∞ d(xn, xm) = 0. Intuitively speaking, a Cauchysequence is one which is “trying” to converge. Convergent sequences arealways Cauchy (see exercises above) but there are examples of Cauchy se-quences which do not converge (e.g. the case of the rational sequence above,which tries to converge to

√2).

Definition A metric space is complete when every Cauchy sequenceconverges.

It follows that the set of rational numbers Q is not complete; but it willbe shown that the set of real numbers R is complete. This is the main reasonwhy we use the real numbers rather than the rationals in most applicationsof calculus.

Note that every metric space X can be completed i.e., there is a complete

metric space X̃ which contains X; for example Q̃ = R and (̃0, 1) = [0, 1].

Proposition 2.3

Page 14: Metric Spaces - Search - University of Maltastaff.um.edu.mt/jmus1/metrics.pdf · Metric spaces are generalizations of the real line, in ... Note: \An interior point of Acan be surrounded

2.3 Completeness J Muscat 14

For a complete metric space X, any subset F iscomplete ⇔ F is closed in X.

Proof Let F ⊆ X be complete i.e., any Cauchy sequence in F con-verges to a limit in F . Let x be a limit point of F . Then as shown inan exercise above, we can find a sequence (xn) in F which converges to x,xn → x. But convergent sequences are Cauchy and F is complete. Hence(xn) converges to a point in F i.e., x ∈ F . Thus F contains all its limitpoints and is therefore closed.

Conversely, let F be a closed set in X and let (xn) be a Cauchy sequencein F . Then (xn) is a Cauchy sequence in X, which is complete. Thereforexn → x for some x ∈ X. But x must be a limit point of F and so x ∈ F .Thus any Cauchy sequence of F converges in F .

Corollary

If X is a complete metric space, then a Cauchysequence xn ∈ F converges to a limit in F̄ .

Theorem D

The set of real numbers R is complete.

Proof (From Real Analysis course) Let (xn) be a Cauchy sequence,that is |xn − xm| → 0 as n,m → ∞. Set ε = 1, then there must be an N0

beyond which |xn − xm| < 1; let y0 := xN0 . Now set ε = 1/2, then theremust be an N1, with N1 > N0, beyond which |xn − xm| < 1/2; let y1 := xN1 .Continuing this way we get a sequence yk for which |yk+1 − yk| < 1/2k.

Now consider the sum y0 − yK = y0 − y1 + y1 − y2 + . . .− yK :

|K∑k=0

(yk − yk+1)| 6K∑k=0

|yk − yk+1| 6K∑k=0

2−k < 2.

Page 15: Metric Spaces - Search - University of Maltastaff.um.edu.mt/jmus1/metrics.pdf · Metric spaces are generalizations of the real line, in ... Note: \An interior point of Acan be surrounded

2.3 Completeness J Muscat 15

The middle sum is increasing but bounded above, and so must converge. Bycomparison, the first sum must converge to, say, y; set x := y0 − y. ThenyK → y0 − y = x as K →∞. That is, we have shown that the subsequenceyK converges to x; it is left as an exercise to show that the full sequence xnconverges to x.

It follows that any closed subset of R is complete. For example, anyCauchy sequence in [0, 1] must converge to a limit in [0, 1]; and any Cauchysequence in the Cantor set must converge there as well. However a Cauchysequence of rational numbers need not converge to a rational number becauseQ is not closed in R.

Theorem E

If X, Y are complete metric spacesthen so is X × Y .

Proof Let

(xnyn

)be a Cauchy sequence in X × Y . This means that

d(

(xnyn

),

(xmym

)) = dX(xn, xm) +dY (yn, ym)→ 0 as n,m→∞. In particular

d(xn, xm) → 0, so that the sequence (xn) is a Cauchy sequence in X, whichis complete. We therefore get xn → x ∈ X, and similarly, yn → y ∈ Y . Now

d(

(xnyn

),

(xy

)) = dX(xn, x) + dY (yn, y) → 0 as n → ∞, so that the Cauchy

sequence

(xnyn

)converges in X × Y .

Corollary

Hence Rn = R× . . .× R and C are complete.

Page 16: Metric Spaces - Search - University of Maltastaff.um.edu.mt/jmus1/metrics.pdf · Metric spaces are generalizations of the real line, in ... Note: \An interior point of Acan be surrounded

2.3 Completeness J Muscat 16

2.3.1 Exercises

1. Show that the interval (a, b] is incomplete, but [a, b] is complete.

2. Show that if a Cauchy sequence (xn) has a convergent subsequencexni→ x as i→∞, then (xn) must converge to x.

3. A set A is called bounded when all the distances between points in A arebounded i.e., d(x, y) 6 R for x, y ∈ A. Show that Cauchy sequences arebounded. Hence we get the following set inclusions: {set of convergentsequences}⊆{set of Cauchy sequences}⊆{set of bounded sequences}.

4. In the proof of the completeness of X × Y we used one particulardistance dX + dY . Show that the other distance max(dX , dY ) is alsocomplete (if dX and dY are complete).

Page 17: Metric Spaces - Search - University of Maltastaff.um.edu.mt/jmus1/metrics.pdf · Metric spaces are generalizations of the real line, in ... Note: \An interior point of Acan be surrounded

3 Continuity J Muscat 17

3 Continuity

Definition A function f : X → Y is continuous when

∀x ∈ X ∀ε > 0 ∃δ > 0 dX(x, y) < δ ⇒ dY (f(x), f(y)) < ε

Since d(a, b) < r ⇔ b ∈ Br(a), this can be rewritten as

∀x ∈ X ∀ε > 0 ∃δ > 0 y ∈ Bδ(x) ⇒ f(y) ∈ Bε(f(x))

or even as

∀x ∈ X ∀ε > 0 ∃δ > 0 fBδ(x) ⊆ Bε(f(x)).

Note also that a function is “discontinuous” at x if the opposite holds i.e.,

∃ε > 0 ∀δ > 0 ∃y ∈ Bδ(x) f(y) /∈ Bε(f(x)).

Proposition 3.1

A function f : X → Y is continuous ⇔

for every open set V in Y, f−1V is open in X.

Proof Let f be a continuous function and let V be an open set in Y .We want to show that U := f−1V is open in X. Let x be any point of U .Then f(x) ∈ V , which is open. Hence

f(x) ∈ Bε(f(x)) ⊆ V,

and so∃δ > 0 fBδ(x) ⊆ Bε(f(x)) ⊆ V.

In other words,∃δ > 0 Bδ(x) ⊆ f−1V = U.

Conversely, assume the second statement holds for all open sets V . Inparticular apply it to the open set Bε(f(x)). Then f−1Bε(f(x)) is open inX, that is,

∃δ > 0 x ∈ Bδ(x) ⊆ f−1Bε(f(x))

Page 18: Metric Spaces - Search - University of Maltastaff.um.edu.mt/jmus1/metrics.pdf · Metric spaces are generalizations of the real line, in ... Note: \An interior point of Acan be surrounded

3 Continuity J Muscat 18

which implies∃δ > 0 fBδ(x) ⊆ Bε(f(x)),

as required.�

Note that if U is open in X, then fU need not be open in Y .

Proposition 3.2

If f : X → Y and g : Y → Z are continuous, thenso is g ◦ f : X → Z.

Proof Let W be any open set in Z. Then g−1W is an open set in Y ,and so f−1g−1W is an open set in X. But this set is precisely (g ◦ f)−1W .

Note that f continuous need not imply that f−1 is continuous.

Theorem A

f is continuous ⇔

f( limn→∞

xn) = limn→∞

f(xn).

Proof Let f be a continuous function and let (xn) be a sequenceconverging to x in the domain. We want to show that f(xn) → f(x) in thecodomain as n → ∞. Consider the neighborhood Bε(f(x)) of f(x). Then,since f is continuous,

∃δ > 0 fBδ(x) ⊆ Bε(f(x)).

But xn → x means

∃N > 0 n > N ⇒ xn ∈ Bδ(x)

Page 19: Metric Spaces - Search - University of Maltastaff.um.edu.mt/jmus1/metrics.pdf · Metric spaces are generalizations of the real line, in ... Note: \An interior point of Acan be surrounded

3 Continuity J Muscat 19

which implies thatf(xn) ∈ fBδ(x) ⊆ Bε(f(x)).

Conversely, suppose f is not continuous. Then there is a point x suchthat

∃ε > 0 ∀δ > 0 fBδ(x) 6⊆ Bε(f(x)).

In particular∃ε > 0 ∀n fB1/n(x) 6⊆ Bε(f(x)).

Therefore we can find points xn ∈ B1/n(x) for which f(xn) /∈ Bε(f(x)) i.e.,f(xn) 6→ f(x) while xn → x.

We thus see that continuous functions preserve convergence, a centralconcept in metric spaces; that is, if a sequence converges in X, and it ismapped continuously to Y , then it still converges. In a sense, they corre-spond to homomorphisms of groups and rings, which preserve the group andring operations. The following concept is then analogous to an isomorphismbetween metric spaces.

Definition A homeomorphism between two metric spaces X and Yis a map φ : X → Y such that

φ is bijective (1-1 and onto)φ is continuousφ−1 is continuous

In other words, two spaces are homeomorphic when one can be obtainedcontinuously and continuously invertibly from the other; in effect when con-vergence in one space is equivalent to convergence in the other. The mostvivid example is of one space being continuously deformed into another home-omorphic to it; the classic ‘tongue-in-cheek’ example is that a ‘teacup’ ishomeomorphic to a ‘doughnut’ !

3.0.2 Exercises

1. Show that the constant functions f(x) := y0 ∈ Y are continuous.

2. Find a continuous function f : R → R and an open set U ⊆ R suchthat fU is not open.

Page 20: Metric Spaces - Search - University of Maltastaff.um.edu.mt/jmus1/metrics.pdf · Metric spaces are generalizations of the real line, in ... Note: \An interior point of Acan be surrounded

3 Continuity J Muscat 20

3. Let

χA(x) =

{1 x ∈ A0 x /∈ A

When is χA continuous?

4. Show that if F is a closed set in Y and f : X → Y is a continuousfunction, then f−1F is closed in X.

5. Show that if f, g : X → R are continuous functions, then so are thefunctions f + g and λf .

6. Show that {x ∈ X : f(x) > 0 } is open in X when f : X → R is acontinuous function.

7. Reprove the proposition that g ◦ f is continuous using distances ratherthan open sets.

8. Show that if xn → x and yn → y then d(xn, y)→ d(x, y) and d(xn, yn)→d(x, y).

9. Show that continuous functions need not map Cauchy sequences toCauchy sequences.

10. Find an example where f is continuous and bijective but f−1 is not.

11. Show that “X is homeomorphic to Y ” is an equivalence relation onmetric spaces, so that we can partition metric spaces into equivalenceclasses.

12. Show that (0, 1) is homeomorphic to (a, b).

13. Let f : Q → Q be a continuous function. Show that there is only oneway of extending it to the reals as a continuous function f̃ : R → R.Show further that the only function f : Q → Q satisfying f(x + y) =f(x) + f(y) is f(x) = λx. Deduce that there is only one continuousfunction f̃ : R→ R with this property.

14. * Let f : A→ Y and g : B → Y be continuous functions with A,B ⊆X. Suppose that the two functions agree on A∩B, i.e., x ∈ A∩B ⇒f(x) = g(x). Show that the function

h(x) =

{f(x) x ∈ Ag(x) x ∈ B

is well-defined and continuous on A ∪B.

Page 21: Metric Spaces - Search - University of Maltastaff.um.edu.mt/jmus1/metrics.pdf · Metric spaces are generalizations of the real line, in ... Note: \An interior point of Acan be surrounded

3.1 Applications J Muscat 21

15. * A function f : X → Y is called isometric when f preserves distancesi.e.,

dY (f(x), f(y)) = dX(x, y) ∀x, y ∈ X.

Show that onto isometric maps are continuous, invertible and have acontinuous inverse (i.e., they are homeomorphisms).

3.1 Applications

Definition A function is called a contraction when there is a constant0 6 k < 1 such that

∀x, y ∈ X, d(f(x), f(y)) 6 k d(x, y).

If follows that f is continuous, because

d(x, y) < δ := ε/k ⇒ d(f(x), f(y)) < ε.

Theorem B

The Banach contraction mapping theorem

Let X be a complete metric space, and supposethat f : X → X is a contraction map. Then f hasa unique fixed point x = f(x).

Proof Consider the iteration xn+1 = f(xn) with x0 = a any pointin X. Note that d(xn+1, xn) = d(f(xn), f(xn−1)) 6 kd(xn, xn−1); hence, byinduction, d(xn+1, xn) 6 knd(x1, x0).

(xn) is a Cauchy sequence since

d(xn, xm) 6 d(xn, xn−1) + . . .+ d(xm+1, xm)

6 (kn−1 + . . .+ km)d(x1, x0) 6km

1− kd(x1, x0)

which converges to 0 as m,n→∞. Hence xn → x, and by continuity of f ,

x = limn→∞

xn+1 = limn→∞

f(xn) = f( limn→∞

xn) = f(x).

Page 22: Metric Spaces - Search - University of Maltastaff.um.edu.mt/jmus1/metrics.pdf · Metric spaces are generalizations of the real line, in ... Note: \An interior point of Acan be surrounded

3.1 Applications J Muscat 22

Moreover, the rate of convergence is given by d(xn, x) 6 kn

1−kd(x, x0).Suppose there are two fixed points x = f(x) and y = f(y); then

d(x, y) = d(f(x), f(y)) 6 kd(x, y)

so that d(x, y) = 0 since k < 1.�

Page 23: Metric Spaces - Search - University of Maltastaff.um.edu.mt/jmus1/metrics.pdf · Metric spaces are generalizations of the real line, in ... Note: \An interior point of Acan be surrounded

4 Connectedness J Muscat 23

4 Connectedness

Definition A set A is disconnected when it can be divided into (at least)two disjoint non-empty subsets A = B ∪ C and each subset can be coveredexclusively by an open set (U , V respectively) i.e.,

B ⊆ U, C ∩ U = ∅,

C ⊆ V, B ∩ V = ∅.

A set is called connected otherwise.

4.0.1 Example

Two distinct points are disconnected by Theorem 1D.Single points are always connected because they cannot be separated into

two non-empty sets. Similarly the empty set is connected.Any subset of the natural numbers is disconnected except the single points

{n} and the empty set.The set of rational numbers Q is disconnected e.g. Q ⊆ (−∞,

√2) ∪

(√

2,∞).

Theorem A

The connected subsets of R are precisely its intervals.

Proof Let A be a connected subset of R. Let a, b ∈ A and let a <x < b. Then if x /∈ A, it follows that (−∞, x) ∪ (x,∞) is a non-trivial openpartition of A, which is a contradiction for a connected set. Hence x ∈ A,which means that A is an interval.

For the converse, first consider an interval [a, b]. Suppose it to be discon-nected. Then it can be split up into disjoint subsets B and C, each coveredexclusively by U and V respectively. Suppose b belongs to B ⊆ U say. Con-sider the open set V ∩ [a, b] (open in [a, b]). Then this set is bounded aboveby b and is non-empty (because it contains the non-empty set C). Henceby the least upperbound property of the real numbers, V ∩ [a, b] has a leastupperbound α 6 b. Now α ought to belong to either U or V . If it belongsto U then we should find an ε-ball around it contained completely in U ; butthis would make α− ε a smaller upperbound. If instead it belongs to V , then

Page 24: Metric Spaces - Search - University of Maltastaff.um.edu.mt/jmus1/metrics.pdf · Metric spaces are generalizations of the real line, in ... Note: \An interior point of Acan be surrounded

4 Connectedness J Muscat 24

we can find an ε-ball around it contained completely in V ; but then therewould be points of V larger than α. As both of these are contradictory, weconclude that the set [a, b] is connected.

Now consider any other interval. The intervals ∅ = (a, a) and { a } =[a, a] are always connected. So suppose the interval contains at least twopoints and is disconnected. Then we can find two points contained in sep-arating open sets, a ∈ U and b ∈ V . But this means that the set [a, b] isdisconnected using the same open sets U and V , which is false. Hence everyinterval is connected.

Theorem B

If f : X → Y is continuous and A ⊆ X is a con-nected set, then fA is a connected subset of Y .

Proof Suppose fA is disconnected into the non-empty disjoint setsB and C covered exclusively by the open sets U and V . That is,

fA = B ∪ C ⊆ U ∪ V ; U ∩ C = V ∩B = ∅.

Then,

A = f−1B ∪ f−1C ⊆ f−1U ∪ f−1V ; f−1U ∩ f−1C = f−1V ∩ f−1B = ∅.

Moreover f−1B and f−1C are disjoint and f−1U and f−1V are open sets.Hence fA disconnected ⇒ A disconnected.

This means that the property of connectedness is preserved by continuousmaps. In particular a path which is a continuous function γ : [0, 1]→ X hasa connected image. For example, straight line segments, circles and parabolasin R2 are connected.

Corollary

The Intermediate Value Theorem.

If f : [a, b] → R is continuous and f(a) < c < f(b)then there exists an x such that a 6 x 6 b andf(x) = c.

Page 25: Metric Spaces - Search - University of Maltastaff.um.edu.mt/jmus1/metrics.pdf · Metric spaces are generalizations of the real line, in ... Note: \An interior point of Acan be surrounded

4 Connectedness J Muscat 25

Proof We have proved that [a, b] is a connected set and hence f [a, b]is also connected in R. But connected subsets of R are just the intervals.Now f(a), f(b) ∈ f [a, b] and so c ∈ f [a, b] i.e., c = f(x) for some x ∈ [a, b].

Similarly a continuous function f : [0, 1]2 → R has the same property: iff(a) < c < f(b) then there is an x ∈ [0, 1]2 such that c = f(x). By theabove theorem, this remains true if we substitute [0, 1]2 by any connectedsubset of R2.

Proposition 4.1

If A and B are connected sets and A∩B 6= ∅ thenA ∪B is connected.

Proof Suppose A ∪B splits up into two parts covered exclusively byopen sets U and V . Then A itself would split up into the two parts A ∩ Uand A ∩ V were these non-empty. But A is known to be connected henceone of these must be empty, say A∩U = ∅. Similarly for B, B ∩ V = ∅. Inother words, A ⊆ V and B ⊆ U . Hence A ∩B ⊆ A ∩ U = ∅.

4.0.2 Exercises

1. Show that the only connected subsets of Q are the single points or theempty set.

2. Let y be a positive real number. Use the intermediate value theoremto show that n

√y exists.

3. Generalize the last proposition to the case when there are an infinitenumber of connected sets Ai with

⋂iAi 6= ∅.

4. Show that R2 is connected by considering the radial lines and applyingthe previous exercise. More generally show that any vector space overthe real numbers is connected.

5. Similarly show that (a,∞)×R is connected. Show further that R2r{x }is connected but that Rr{x } is not. Deduce that R and R2 are nothomeomorphic.

6. Use the same idea to show that [a, b] is not homeomorphic to [a, b).

Page 26: Metric Spaces - Search - University of Maltastaff.um.edu.mt/jmus1/metrics.pdf · Metric spaces are generalizations of the real line, in ... Note: \An interior point of Acan be surrounded

4 Connectedness J Muscat 26

7. Show that if a set contains a non-trivial proper subset which is bothopen and closed then it is disconnected. Equivalently, a connected setcannot contain a non-trivial open and closed proper subset.

8. Do balls have to be connected? Consider the space X = (−∞,−1) ∪(1,∞). Find a ball in this space which is not connected.

9. Let A be a connected metric space and let f : A→ N be a continuousfunction. Show that f must be a constant function.

10. Suppose that there is an x0 ∈ X and an r > 0 such that d(x0, y) 6= r ∀y.Moreover there is another point x1 such that d(x0, x1) > r. Show thatX must be disconnected.

11. * Show that A is connected if A is.

Page 27: Metric Spaces - Search - University of Maltastaff.um.edu.mt/jmus1/metrics.pdf · Metric spaces are generalizations of the real line, in ... Note: \An interior point of Acan be surrounded

5 Compactness J Muscat 27

5 Compactness

Definition A set B is bounded when

∃R > 0 ∀x, y ∈ B d(x, y) < R.

That is, a set is bounded when the distances between any two pointsin the set have an upperbound. The least such upperbound is called thediameter of the set:

diamB = sup{d(x, y) : x, y ∈ B}.

5.0.3 Example.

The set [a, b) is bounded in R because d(x, y) 6 b − a for any two elementsx, y ∈ [a, b); in fact diam[a, b) = b − a. The set R is unbounded becaused(0, x) = |x| can be made as large as needed.

Note: Boundedness is a property of how large a set is. However it is nota good “metric” property: if B is bounded and f is a continuous function,then fB need not be bounded (see Ex. 4). Thus a set may be bounded inone metric space X, but not remain so when X is deformed continuously toanother.

Proposition 5.1

A set B is bounded when it can be covered by a ball,

∃R > 0, a ∈ X, B ⊆ BR(a).

Proof. (Left as an exercise)

Hence, the set [0, 1) ∪ (2, 3) is bounded because it can be covered by theball B4(0).

Definition A set B is totally bounded when

∀ε > 0 ∃a1 . . . aN B ⊆N⋃i=1

Bε(ai).

That is, a set is totally bounded when it can be covered by a finite numberof ε-balls, however small their radii ε.

Page 28: Metric Spaces - Search - University of Maltastaff.um.edu.mt/jmus1/metrics.pdf · Metric spaces are generalizations of the real line, in ... Note: \An interior point of Acan be surrounded

5 Compactness J Muscat 28

5.0.4 Example.

The set [0, 1] is totally bounded because it can be covered by the balls Bε(nε)for n = 0, . . . , N where N > 1/ε.

Proposition 5.2

A totally bounded set is bounded.

Proof Let B be a totally bounded set. We can therefore cover B witha finite number of ε-balls, in particular with 1-balls.

B ⊆N⋃i=1

B1(ai).

Since there are only a finite number of these balls, we can find the maximumdistance between their centers.

D := max{d(ai, aj)}.

Now, given any two points x, y ∈ B, they must be covered by two of theseballs B1(aI) and B1(aJ), say. Therefore, using the triangle inequality twice,

d(x, y) 6 d(x, aI) + d(aI , aJ) + d(aJ , y) 6 1 +D + 1.

That is, D + 2 is an upperbound for the distances between points in B.�

In one of the exercises, you are asked to show that, in R, bounded setsare totally bounded (i.e., boundedness and totally boundedness coincide forthe real line). So a totally bounded set also need not be preserved by acontinuous function.

Definition A set K is said to be compactif

K ⊆⋃i

Bεi(ai) ⇒ ∃i = i1, . . . , iN : K ⊆N⋃k=1

Bεik(aik).

In plain English, a set is compact when given any cover of balls of varyingsizes, we can find a finite subcollection of them that still cover the set. Thisis a stronger property than totally-boundedness.

Page 29: Metric Spaces - Search - University of Maltastaff.um.edu.mt/jmus1/metrics.pdf · Metric spaces are generalizations of the real line, in ... Note: \An interior point of Acan be surrounded

5 Compactness J Muscat 29

5.0.5 Example.

The set [0, 1) is not compact. For example, the cover of balls B1−1/n(0) forn = 2, . . . has no finite subcover. Similarly the sets R and N are not compact.On the other hand we will soon see that the sets [a, b] are compact in R.

By an open cover we mean a cover of open sets, and a subcover is asubcollection of a cover.

Theorem A

A set is compact ⇔ any open cover of it has afinite subcover.

Proof Let K be the compact set and let the open sets Ai cover it i.e.,K ⊆

⋃iAi. Now, by theorem 1B, the open sets Ai are composed of balls.

Therefore it follows that K is inside a union of (a large number of) balls, i.e.,it is covered by these balls. Therefore there is a finite number of these ballsBε1(a1), . . . , BεN (aN) which still cover the set K. Each of these balls is insideone of the open sets Ai. Therefore there is a finite number of these open sets(those which contain these balls) that still cover the compact set K.

Conversely, suppose K is such that any open cover of it has a finitesubcover. In particular if we can cover it with (open) balls, then we can finda finite subcollection of them which still cover K.

We show next that “compactness” is a metric property: it is preservedby continuous functions.

Theorem B

If K is compact and f is a continuous function,then fK is compact.

Proof Let Ai be an open cover for fK. We would like to show thata finite subcollection of them still covers fK.

Page 30: Metric Spaces - Search - University of Maltastaff.um.edu.mt/jmus1/metrics.pdf · Metric spaces are generalizations of the real line, in ... Note: \An interior point of Acan be surrounded

5 Compactness J Muscat 30

FromfK ⊆

⋃i

Ai

we can deduceK ⊆ f−1

⋃i

Ai =⋃i

f−1Ai.

But f−1Ai are open sets since f is continuous (Prop. 3.0.1). Therefore theright-hand side is an open cover of K, which is compact. Therefore, byTheorem 5A, a finite number of these open sets will do to cover K.

K ⊆N⋃i=1

f−1Ai.

It follows that

fK ⊆N⋃i=1

Ai.

That is, a finite number of the original open sets Ai will cover the set fK,which is therefore compact.

Theorem C

Compact sets are closed and bounded.

Proof Compact sets are bounded. Let K be a compact set. For anyfixed point a ∈ X, consider the balls Bn(a) for n = 1, 2, . . .. These balls coverthe set K (in fact they cover the whole space X). Therefore a finite numberof these balls will cover K. But these balls are nested in each other, so thatit follows that the largest of these finite number of balls, say BN(a), containsall the others. Hence BN(a) contains K, which is therefore bounded.

Compact sets are closed in X. Let x ∈ XrK. We would like to surroundit by a ball outside K. From Theorem 1D, x can be separated from y ∈ Kby open balls Bry(x) and Bry(y). Since y ∈ Bry(y), these latter balls coverK. But K is compact, so that a finite subcollection of these balls still coverK,

K ⊆ Br1(y1) ∪ . . . ∪BrN (yN).

Page 31: Metric Spaces - Search - University of Maltastaff.um.edu.mt/jmus1/metrics.pdf · Metric spaces are generalizations of the real line, in ... Note: \An interior point of Acan be surrounded

5 Compactness J Muscat 31

Now let U := Br1(x) ∩ . . . ∩ BrN (x). Since this involves a finite intersectionof open sets, then U is also an open set. Moreover U ∩K = ∅ since

z ∈ U ⇒ z ∈ Bri(x) for i = 1, . . . , N

⇒ z /∈ Br1(y1) ∪ . . . ∪BrN (yN) ⊇ K.

Therefore,x ∈ U ⊆ XrK.

Theorem D

A closed subset of a compact set is itself compact.

Proof Let F be a closed subset of a compact set K. Let the opensets Ai cover F . Then

K ⊆ F ∪ (XrF ) ⊆⋃i

Ai ∪ (XrF ).

The right-hand side is the union of open sets since XrF is open when F isclosed. But K is compact and therefore a finite number of these open setswill do to cover it i.e.,

K ⊆N⋃i=1

Ai ∪ (XrF ).

Hence

F ⊆N⋃i=1

Ai,

since XrF is outside F and doesn’t cover it.�

5.0.6 Exercises

1. Show that B is bounded if and only if ∃R > 0, a ∈ X, B ⊆ BR(a).

2. Show that any subset of a bounded set is bounded; the union of two(or finite number of) bounded sets is bounded; repeat the exercise withtotally bounded sets.

Page 32: Metric Spaces - Search - University of Maltastaff.um.edu.mt/jmus1/metrics.pdf · Metric spaces are generalizations of the real line, in ... Note: \An interior point of Acan be surrounded

5 Compactness J Muscat 32

3. Show that a Cauchy sequence is bounded. Deduce that an unboundedsequence cannot converge.

4. Find an example of a bounded set B ⊆ R and a continuous functionf : B → R such that fB is not bounded.

5. Show that if diamA 6 R and A ∩BR(a) 6= ∅ then A ⊆ B2R(a).

6. Show that, in R, a bounded set is totally bounded. (Hint: first showthat a ball is totally bounded).

7. Theorem 5C shows that a compact set is bounded. Show further thata compact set is totally bounded. (Hint: consider ε-balls centred aboutall the points of the compact set).

8. Show that R is not compact by finding an open cover that does nothave a finite subcover.

9. Show that [0, 1] is not compact in Q by finding an infinite open coverthat does not have a finite subcover. (Hint: you need to consider anirrational number in between 0 and 1).

10. Let X be a space with the discrete metric of Ex. 1.1.3.9. Show that asubset K is compact ⇔ K consists of a finite number of points.

11. Show that compact sets behave like closed sets i.e., any intersectionand any finite union of compact sets are compact. (Hint: use theorem1D)

12. (Cantor) Let Kn be a decreasing sequence of nonempty compact sets.Show that if

⋂nKn = ∅ then XrKn form an open cover of K1. De-

duce that⋂nKn is compact and nonempty. Show moreover that if

diamKn → 0 then⋂nKn consists of a single point.

13. * Show that for a metric space with the distance functionD2 of Ex.1.0.2.3,any set is bounded. Show that not all sets are totally bounded and de-duce that a bounded set need not be totally bounded.

14. * Let K precompact mean that K is compact. Show that any sub-set of a precompact set is precompact, and that continuous images ofprecompact sets are precompact.

Page 33: Metric Spaces - Search - University of Maltastaff.um.edu.mt/jmus1/metrics.pdf · Metric spaces are generalizations of the real line, in ... Note: \An interior point of Acan be surrounded

5.1 Compactness in R J Muscat 33

5.1 Compactness in R

Theorem E

(Heine-Borel)

The closed interval [a, b] is compact in R.

Proof Let [a, b] ⊆⋃iAi be an open cover of the set. Suppose there

is no finite subcover, and we seek to obtain a contradiction. Divide the set[a, b] in two [a, (a + b)/2] and [(a + b)/2, b]. One of the two (and possiblyboth) does not admit a finite subcover: call it [a1, b1]. Repeat this processof dividing to get nested intervals [an, bn] of length (b − a)/2n which do notadmit finite subcovers.

Now (an) is an increasing real sequence bounded above by b, while (bn) isdecreasing bounded below by a. They therefore both converge, say, an → xand bn → y with x 6 y since an 6 bn. In fact x = y since

an 6 x 6 y 6 bn and bn − an → 0.

This limit x is in the set [a, b] and is therefore covered by some open setAi0 . This implies that we can surround x with an ε-ball

x ∈ Bε(x) ⊆ Ai0 .

But an → x implies that there is an N such that aN ∈ Bε(x); similarly forbn, so that [aN , bN ] ⊆ Bε(x) ⊆ Ai0 . But [aN , bN ] was not supposed to becovered by a finite number of Ai’s. This implies that there must be a finitesubcover to start with.

Exercise: Generalize this to closed rectangles [a, b]×[c, d] in R2, by repeat-edly dividing it into four sub-rectangles and adapting the same argument.Can you extend this further to closed cuboids in R3?

Corollary

In R, a set is compact ⇔ it is closed and bounded.

Page 34: Metric Spaces - Search - University of Maltastaff.um.edu.mt/jmus1/metrics.pdf · Metric spaces are generalizations of the real line, in ... Note: \An interior point of Acan be surrounded

5.2 Compactness in a general Metric Space J Muscat 34

Proof That a compact set is closed and bounded is shown in Theorem5C. Conversely, let F ⊆ R be a closed and bounded set. By its boundednessF ⊆ BR(a) ⊆ [a, b]. Hence F is a closed subset of a compact set and by 5Cthis implies that it is itself compact.

Exercise: Generalize this to show that any closed and bounded subset ofR2, R3 etc. is compact.

Corollary

Let f : [a, b] → R be a continuous function. Thenits image f [a, b] := {f(x) : a 6 x 6 b} is bounded,and the function attains its bounds, i.e.,

∃c ∈ [a, b] ∀x ∈ [a, b] f(x) 6 f(c).

Proof [a, b] is a compact set. Its continuous image f [a, b] is thereforealso compact, and by 5C is bounded i.e., f [a, b] ⊆ BR(0) i.e., |f(x)| 6 R.Moreover compact sets are closed and so contain their limit points. In par-ticular it contains sup f [a, b] i.e., sup f [a, b] = f(c) for some c ∈ [a, b].

More generally, a continuous function f : K → R on a compact set willbe bounded and attain its bounds.

5.2 Compactness in a general Metric Space

We have seen that in the space of real numbers, a subset is compact if andonly if it is closed and bounded. But this is not true for every metric space.Instead, we can prove the following:

Theorem F

A set is compact ⇔ it is complete and totallybounded.

Page 35: Metric Spaces - Search - University of Maltastaff.um.edu.mt/jmus1/metrics.pdf · Metric spaces are generalizations of the real line, in ... Note: \An interior point of Acan be surrounded

5.2 Compactness in a general Metric Space J Muscat 35

Proof The proof will be divided into several parts:

Every infinite subset of a compact set K has a limit point in K:Let A be a subset of a compact set K, and suppose it has no limit points

in K. This means that any x ∈ K is not a limit point, and so we can findballs Bε(x) which do not contain elements of A unless they are at the center.In particular, this is an open cover of K.

But K is compact and so must have a finite subcover of these,

K ⊆ Bε1(x1) ∪ . . . ∪BεN (xN).

∴ A ∩K ⊆ A ∩N⋃i=1

Bεi(xi) =N⋃i=1

A ∩Bεi(xi) ⊆ {x1, . . . , xN}.

So A is a finite set. Equivalently, infinite subsets of K must have at leastone limit point in K.

The property that every infinite subset of a set has a limit point is termedthe Bolzano-Weierstraß property (BW-compact for short). So we have shownhere that compact sets are BW-compact.

K BW-compact ⇒ K complete:Let (an) be a Cauchy sequence in a given BW-compact set K. If the set

{ an } is infinite, then it has a limit point x in K. Now, from exercises 2.2.1.1and 2.3.1.2, we can deduce that there is a subsequence of (an) which convergesto x, and, since (an) is Cauchy, that the whole sequence (an) converges to x.

Otherwise, the set { an } is finite, and the sequence (an) must repeatitself. The fact that the sequence is Cauchy implies that the sequence musteventually be constant an = aN for n > N , so that it converges to aN in K.

K compact ⇒ K totally bounded :This is trivially true, since for any ε > 0, each x ∈ K belongs to Bε(x).

Hence, K ⊆⋃x∈K Bε(x), which reduces to a finite subcover since K is com-

pact i.e., K ⊆⋃Ni=1Bε(xi), making K totally bounded.

K complete and totally bounded ⇒ K compact :This part of the proof is really a generalization of the Heine-Borel theo-

rem.Let K be a complete and totally bounded set. Suppose K is covered by

open sets Vi, and that no finite number of these open sets is enough to coverK. Since K is totally bounded, we can find a finite number of balls of radius1 which cover K,

K ⊆N⋃i=1

B1(yi).

Page 36: Metric Spaces - Search - University of Maltastaff.um.edu.mt/jmus1/metrics.pdf · Metric spaces are generalizations of the real line, in ... Note: \An interior point of Acan be surrounded

5.2 Compactness in a general Metric Space J Muscat 36

If each of these balls had a finite subcover from the open cover {Vi }, then sowould K. So at least one of these balls cannot be covered by a finite numberof Vi’s; let us call this ball B1(x1).

Now consider B1(x1) ∩ K, also totally bounded. We can again cover itwith a finite number of balls of radius 1/2, one of which does not have afinite subcover, say B1/2(x2). Repeat this process to get a nested sequenceof balls B1/2n(xn), none of which have a finite subcover. The sequence (xn)is Cauchy since d(xn, xm) < 1/2n (for m > n), and K is complete, hencexn → x in K.

But x is covered by some open set Vi. Hence

x ∈ Bε(x) ⊆ Vi.

Moreover since 1/2n → 0 and xn → x, we can find an N such that 1/2N < ε/2and d(xN , x) < ε/2, so that

B1/2N (xN) ⊆ Bε(x) ⊆ Vi,

which contradicts the way that the balls B1/2n(xn) were chosen.�

Note that complete subsets are always closed, and totally bounded setsare always bounded. Hence the statement K compact ⇒ K closed andbounded is really just a special case of this theorem. In general, however,closed and bounded sets are not complete and totally bounded, although wehave seen that this is true in RN .

Theorem G

K is compact ⇔ every infinite subset of K has alimit point in K.

Proof One implication has already been proved. Moreover, we havealso shown that BW-compactness implies completeness, so we only need toprove that BW-compact sets are totally bounded to show the converse.

Let K be a (non-empty) BW-compact set. Let ε > 0 and let a1 be anypoint in K.

Either Bε(a1) covers K (and we’re done i.e., K would be bounded) orif not, there is some point a2 with d(a2, a1) > ε. Repeating the argument

Page 37: Metric Spaces - Search - University of Maltastaff.um.edu.mt/jmus1/metrics.pdf · Metric spaces are generalizations of the real line, in ... Note: \An interior point of Acan be surrounded

5.2 Compactness in a general Metric Space J Muscat 37

for a2, either Bε(a1) ∪ Bε(a2) cover K or else they omit some point, say a3.Continuing like this we get a sequence of points an each covered by Bε(an)satisfying d(an, am) > ε.

Suppose this process does not stop and we end up with an infinite set{ an }. This has a limit point x since K is BW-compact, which implies thatsome of these an are close to x within ε/2. But by the choice of the an,d(an, am) > ε. This leads to a contradiction unless the process actually stopsin a finite number of steps and the Bε(an) cover the whole of K.

5.2.1 Exercises

1. Show that a finite set of points is BW-compact.

2. Show directly that a BW-compact set is closed.

3. Show that [a, b] is not compact in Q by finding an infinite set of rationalnumbers in [a, b] that do not have a limit point.

4. Let γ : [0, 1] → R2 be a continuous curve. Show that there is a max-imum and a minimum distance of points on the curve to the origin.Give an example to show that this is false if [0, 1] is replaced by (0, 1).

5. Show that the Bolzano-Weierstraß property is equivalent to the prop-erty that every sequence has a convergent subsequence.

6. Show directly that a continuous function maps a BW-compact set to aBW-compact set.

7. Show that if X, Y are compact metric spaces then so is X × Y . (Hint:show that X × Y is BW-compact.)

8. Let X be a complete metric space. Show that a subset K is compact⇔ it is closed and totally bounded. Deduce that for a complete metricspace, a set is precompact (defined in 5.13.14) if and only if it is totallybounded.

9. * Let X be a totally bounded space. Consider finite covers of 1n-balls

and let A be the set of all the centers of all these balls. Show that A iscountable and A = X.

Page 38: Metric Spaces - Search - University of Maltastaff.um.edu.mt/jmus1/metrics.pdf · Metric spaces are generalizations of the real line, in ... Note: \An interior point of Acan be surrounded

A Answers J Muscat 38

A Answers

Ex. 1.0.1(7)

0 = d(x, x) 6 d(x, z) + d(x, z) = 2d(x, z)

d(x, y) 6 d(x, x) + d(y, x) = d(y, x) 6 d(x, y)

Ex. 1.1.3(4) There are points in R2, such as (x, ε) (a < x < b), which are arbitrarily

close to points in the interval (x, 0).(5) For example,

⋂n(−1/n, 1/n) = { 0 }.

Ex. 2.1.2(5) For example, (i) [0, 1[ and (ii) R.(6) For example, (i)

⋃∞n=1[0, 1− 1/n] = [0, 1), (ii)

⋃∞n=0{n } = N.

(7) (i) open, (ii) closed, (iii) neither, (iv) both, (v) neither, (vi) closed.Ex. 2.1.3(1) Z = Z, Q = R.(3) Yes to both, e.g. N in R.Ex. 3.0.2(2) For example, f(x) := x2 with U = (−1, 1), then fU = [0, 1).(3) For R (or RN), never. But on “disconnected” spaces, such as Z, χA

may be continuous (e.g. A = {n }).

(10) For example, take X := Rr(0, 1] and f(x) :=

{x x 6 0

x− 1 x > 1; then

f : X → R is bijective and continuous but f−1 is discontinuous at 0.Ex. 4.0.2(8) For example, B4(2).Ex. 5.0.6(4) For example, f(x) := 1/x maps (0, 1)→ (1,∞).Ex. 5.2.1(4) For example, any spiral curve, such as γ(x) := e−1/x(cos(1/x), sin(1/x)),

approaches but never reaches the origin, so has no minimum distance.

Page 39: Metric Spaces - Search - University of Maltastaff.um.edu.mt/jmus1/metrics.pdf · Metric spaces are generalizations of the real line, in ... Note: \An interior point of Acan be surrounded

B Summary J Muscat 39

B Summary

B.1 Definitions

1. A distance (or metric) on a metric space X is a function

d : X2 7→ R+

(x, y) 7→ d(x, y)

with the properties

i d(x, y) = 0 ⇔ x = yii d(y, x) = d(x, y)iii d(x, y) 6 d(x, z) + d(y, z)

2. A ball is a set Br(a) = {x ∈ X : d(x, a) < r}.

3. An open set, A, in X is a set such that

∀x ∈ A ∃ε > 0 Bε(x) ⊆ A.

Every point of A can be surrounded by a ball inside A.

4. A closed set, F , in X is a set such that X − F is open in X.

Every point not in F can be surrounded by a ball outside F .

5. A limit point of a set A is a point b such that

∀ε > 0 ∃a 6= b a ∈ A ∩Bε(b)

Every ball around b contains points of A apart from b.

6. The closure of a set A is the set A = A ∪ {limit points of A}.

7. A sequence (xn) converges to x, xn → x means

∀ε > 0 ∃N n > N ⇒ xn ∈ Bε(x).

The sequence of points eventually comes arbitrarily close to the limit.

8. A Cauchy sequence is one such that

∀ε > 0 ∃N n,m > N ⇒ d(xn, xm) < ε.

Eventually the points get arbitrarily close to each other.

Page 40: Metric Spaces - Search - University of Maltastaff.um.edu.mt/jmus1/metrics.pdf · Metric spaces are generalizations of the real line, in ... Note: \An interior point of Acan be surrounded

B.1 Definitions J Muscat 40

9. A complete metric space is one in which every Cauchy sequence con-verges.

10. A continuous function f : X → Y is one for which

∀x ∈ X ∀ε > 0 ∃δ > 0 y ∈ Bδ(x) ⇒ f(y) ∈ Bε(f(x))

Points sufficiently close to x are mapped to points arbitrarily close tof(x).

11. Two metric spaces X and Y are homeomorphic when there is a mapφ : X → Y which is bijective (1-1 and onto), continuous, and its inverseis continuous.

12. A connected set is one such that

A ⊆ U∪V with U , V open sets ⇒ A∩U∩V 6= ∅ or A∩U = ∅ or A∩V = ∅.

It cannot be separated by two non-trivial open sets.

13. A bounded set B is one for which ∃R > 0 ∀x, y ∈ B d(x, y) < R.

It can be covered by a single ball.

14. A totally bounded set B is one for which

∀ε > 0 ∃a1 . . . aN B ⊆N⋃i=1

Bε(ai).

It can be covered by a finite number of ε-balls.

15. A compact set K is one for which

K ⊆⋃i

Ai ⇒ ∃i = i1, . . . , iN : K ⊆N⋃k=1

Aik .

Any cover of open sets (balls) has a finite subcover.

16. A BW-compact set K is one for which every infinite subset of K hasa limit point in K.

Page 41: Metric Spaces - Search - University of Maltastaff.um.edu.mt/jmus1/metrics.pdf · Metric spaces are generalizations of the real line, in ... Note: \An interior point of Acan be surrounded

B.2 Main Theorems J Muscat 41

B.2 Main Theorems

1. Balls are open sets.

2. Any union and any finite intersection of open sets is open.

3. A set is closed when it contains its limit points.

4. A Cauchy sequence in a set A converges to a limit in A, for a completemetric space; closed sets of complete spaces are complete.

5. f : X → Y continuous and V open in Y ⇒ f−1V open in X.

6. A function f is continuous ⇔ f(limn→∞ xn) = limn→∞ f(xn).

7. The connected sets of R are the intervals.

8. A continuous function maps a connected set to a connected set.

9. The union of non-disjoint connected sets is connected.

10. Compact sets are closed and bounded.

11. A continuous function maps a compact set to a compact set.

12. (Heine-Borel theorem) The compact sets of Rn are the closed andbounded sets. (In particular [a, b] is compact.)

13. A set is compact ⇔ it is BW-compact ⇔ it is complete and totallybounded.

Page 42: Metric Spaces - Search - University of Maltastaff.um.edu.mt/jmus1/metrics.pdf · Metric spaces are generalizations of the real line, in ... Note: \An interior point of Acan be surrounded

C Miscellaneous Exercises J Muscat 42

C Miscellaneous Exercises

Each question should take less than 3/4 hours to answer.

1. (a) Show that a continuous function maps a compact set to a compactset.

(b) Prove that the set [0, 1]2 is compact.

(c) Deduce that if f : [0, 1]2 → R is continuous then there is a maxi-mum point x:

∃x ∈ [0, 1]2, ∀y ∈ [0, 1]2 f(y) 6 f(x).

2. (a) Define a connected set.

(b) Show that the circle S (subset of R2) is connected, but that itscomplement S ′ is not.

(c) Show that the only connected sets in N are the single points {n }.(d) Deduce that if f : S → N is a continuous function then it must

be constant.

3. (a) Let Kn := [an, bn] be closed and bounded intervals in R satisfyingKn+1 ⊆ Kn and bn − an → 0. Show that⋂

n

Kn = {x}

and that x is a limit point of {an}, unless the sequence (an) iseventually constant.

(b) Give an example to show that this intersection can be empty inQ.