You are on page 1of 102

THE BIGGER PICTURE:

METRIC SPACES

Key idea of a ‘metric space’: a set in which we can


measure distance.

1
Metrics and Metric Spaces

Distance in R

d(x, y) = |x − y| is the distance between x, y ∈ R.


(Picture the numbers sitting on the real line.) It
obeys some simple rules:
• d(x, y) ≥ 0.
d(x, y) = 0 if and only if x=y
• d(x, y) = d(y, x).
• triangle inequality: for any x, y, z ∈ R,

d(x, y) ≤ d(x, z) + d(z, y).


Why is that?

Well, d(x, y) ≥ 0 is just the fact that |x − y| ≥ 0.

d(x, y) = 0 if and only if x = y is the fact that


|x − y| = 0 if and only if x = y.

d(x, y) = d(y, x) is the fact that |x − y| = |y − x|.

d(x, y) ≤ d(x, z) + d(z, y) is the ∆-inequality


|x − y| ≤ |x − z| + |z − y|.
Distance in R2

Our notion of distance between x = (x1, x2)T and


y = (y1, y2)T ∈ R2 is
r
d(x, y) = kx − yk = (x1 − y1)2 + (x2 − y2)2.
Again, d(x, y) ≥ 0, with equality if and only if
(x1 − y1)2 + (x2 − y2)2 = 0, that is, if and only if
x1 = y1 and x2 = y2. So there is equality if and only
if x = y.

Also, clearly d(x, y) = d(y, x), as


(x1 − y1)2 = (y1 − x1)2 and (x2 − y2)2 = (y2 − x2)2.
Finally, as discussed earlier in the course, we have
the ∆-inequality

kx − yk ≤ kx − zk + kz − yk,

and so we have the ∆-inequality

d(x, y) ≤ d(x, z) + d(z, y).


There is mathematical interest in defining distances
on abstract or unusual sets. But, also, it enables us
to discuss continuity and other concepts (e.g. open
and closed sets, compactness) in a more general
setting.
Recall: f : R → R is continuous at a if given  > 0,
there is δ > 0 such that

|x − a| < δ =⇒ |f (x) − f (a)| < .

Remember that |x − a| is the distance d(x, a)


between x and a, so this says

d(x, a) < δ =⇒ d(f (x), f (a)) < .


So: This doesn’t really use any special properties of
R, only ‘distance’ properties. It will generalise when
we have other ‘distances’: see later.
Definition of a metric space

Formal idea of distance on a set A.

Definition A metric space M = (A, d) consists of a


set A together with a function, called a metric,
d : A × A → R with the following properties.
1. d(x, y) ≥ 0 for all x, y ∈ A, and
d(x, y) = 0 ⇐⇒ x = y;

2. d(x, y) = d(y, x) for all x, y ∈ A;

3. d(x, y) ≤ d(x, z) + d(z, y) for all x, y, z.


Important examples of metric spaces

Example A = Rn and, for x, y ∈ Rn,


x1 y1
   
    v
    u n
 x   y 
 2   2 
(xi − yi)2.
u X
d(x, y) = d ,  = kx − y k = u
 ..   .. 
    t
    i=1
   
xn yn
This is the usual Euclidean metric on Rn.
This works as a metric because
v
u n
(xi − yi)2 ≥ 0.
u X
d(x, y) = kx − yk = u
t
i=1

Also, d(x, y) = kx − yk = 0 if and only if


Pn
i=1(xi − yi)2 = 0, which is if and only if xi = yi for
each i = 1, . . . , n.

Also, d(x, y) = d(y, x), since


v v
u n u n
(xi − yi)2 = (yi − xi)2.
u X u X
u u
t t
i=1 i=1
Finally, the triangle inequality

d(x, y) ≤ d(x, z) + d(z, y)

is just the triangle inequality

kx − yk ≤ kx − zk + kz − yk,

which we saw earlier in the course.


Example For any set A, we have the discrete metric
d0:

0 if x = y;
d0(x, y) = 
1 if x 6= y.

Clearly, d0(x, y) ≥ 0 for all x, y ∈ A; and d(x, y) = 0 if


and only if x = y.

Also, clearly, d(x, y) = d(y, x) for all x, y.


Also, d(x, y) ≤ 1 and 1 ≤ d(x, z) + d(z, y) if x, y, z are
not all all equal, so in this case

d(x, y) ≤ 1 ≤ d(x, z) + d(z, y).

If x = y = z, then both d(x, y) = 0 and


d(x, z) + d(z, y) = 0, so the triangle inequality also
holds.

So, for any A, there is always at least one metric


defined on A.
There may be different metrics on a given set.

Example On Rn, we have the discrete metric d0


and, for p ≥ 1, the metric dp:
 1/p
n
|xi − yi|p
X
dp(x, y) =  .
i=1

d2 is the usual metric.


d1(x, y) = |x1 − y1| + |x2 − y2| + . . . + |xn − yn|.

(sometimes called the taxicab metric.)

Another metric on Rn is d∞, defined by

d∞(x, y) = max |xi − yi|.


1≤i≤n
Let us verify that d1 is a metric. As usual, it is easily
seen that d1(x, y) ≥ 0 for all x, y ∈ Rn, with equality
if and only if x = y.

Also, it is easy to see that d1(x, y) = d1(y, x) for all


x, y.

It remains to verify the triangle inequality.


We need to show that, for all x, y, z ∈ Rn,
n
X n
X n
X
|xi − yi| ≤ |xi − zi| + |zi − yi|.
i=1 i=1 i=1

But the triangle inequality in R gives, for each


i = 1, . . . , n:

|xi − yi| ≤ |xi − zi| + |zi − yi|.

The result follows by adding these up over


i = 1, . . . , n.
Proving that the dp metric is a metric for p 6= 1, 2 is
harder. As usual, the tricky part is establishing the
triangle inequality: for all x, y, z,

 1/p 1/p 1/p


n

n

n
|xi − yi|p |xi − zi|p |zi − yi|p
X X X
 ≤ + .
i=1 i=1 i=1

This is a special case of what is called the Minkowski


inequality, and we are not going to prove it.
Let me mention only that the Minkowski inequality is
a consequence of Hölder’s inequality.

A special case of Hölder’s inequality in Rn is the


following: for all x, y ∈ Rn

hx, yi ≤ dp(x)dq (y),

provided 1 ≤ p, q ≤ ∞ and 1/p + 1/q = 1.

Again, proving this is outside our scope.


Let us verify that d∞ is a metric. Again, it is easily
seen that d∞(x, y) ≥ 0 for all x, y ∈ Rn, with equality
if and only if x = y.

Also, it is easy to see that d∞(x, y) = d∞(y, x) for all


x, y.

It remains to verify the triangle inequality.


We need to show that, for all x, y, z ∈ Rn,

max |xi − yi| ≤ max |xi − zi| + max |zi − yi|.


1≤i≤n 1≤i≤n 1≤i≤n

The triangle inequality in R gives, for each i:

|xi − yi| ≤ |xi − zi| + |zi − yi|.

Taking maximum of the RHS, for each i = 1, . . . , n,

|xi − yi| ≤ max |xj − zj | + max |zj − yj |.


1≤j≤n 1≤j≤n
Since, for each i = 1, . . . , n,

|xi − yi| ≤ max |xj − zj | + max |zj − yj |,


1≤j≤n 1≤j≤n

it follows that

max |xi − yi| ≤ max |xj − zj | + max |zj − yj |,


1≤i≤n 1≤j≤n 1≤j≤n

that is,

d∞(x, y) ≤ d∞(x, z) + d∞(z, y),

as required.
So far, we have defined metrics on the nice, familiar,
Euclidean spaces. But the notion of metric space
has wider applicability.
Distance between matrices

Example Let A be the set of m × n real matrices,


and define

d(X, Y ) = max |xi,j − yi,j |.


i,j

Then d is a metric on A.

Again, the only non-trivial bit is verifying the triangle


inequality.
We need, for all X, Y, Z,

max |xi,j − yi,j | ≤ max |xi,j − zi,j | + max |zi,j − yi,j |.


i,j i,j i,j

But, we have, for each i, j,

|xi,j − yi,j | ≤ |xi,j − zi,j | + |zi,j − yi,j |.

So, for each i0 = 1, . . . , m and j0 = 1, . . . , n, taking


maximum over i, j on the RHS,

|xi0,j0 − yi0,j0 | ≤ max |xi,j − zi,j | + max |zi,j − yi,j |.


i,j i,j
Taking maximum over i0, j0 on LHS,

max |xi0,j0 − yi0,j0 | ≤ max |xi,j − zi,j | + max |zi,j − yi,j |,


i ,j
0 0 i,j i,j

that is,

d(X, Y ) ≤ d(X, Z) + d(Z, Y ),

as required.

Can you think of other metrics on the set of m × n


real matrices?
Distance between functions

Let A = C[0, 1] be the set of all continuous functions


f : [0, 1] → R. Recall that each such function is
bounded. Define

d∞(f, g) = sup {|f (x) − g(x)| : x ∈ [0, 1]} .

Then d∞ is a metric on A.
To prove it, clearly d∞(f, g) ≥ 0 for all
f, g : [0, 1] → R, since |f (x) − g(x)| ≥ 0 for all
x ∈ [0, 1]. Equality can happen if and only if
|f (x) − g(x)| = 0 for all x, i.e. f = g.

Also, |f (x) − g(x)| = |g(x) − f (x)| for all x, and so


d∞(f, g) = d∞(g, f ).

We must also worry about d∞(f, g) being finite. This


is no problem, since a continuous function on a
bounded interval is bounded. Hence
d∞(f, g) = sup {|f (x) − g(x)| : x ∈ [0, 1]}
≤ sup {|f (x)| + |g(x)| : x ∈ [0, 1]}
≤ sup {|f (x)| : x ∈ [0, 1]} + sup {|g(x)| : x ∈ [0, 1]}
< ∞,

since both sup {|f (x)| : x ∈ [0, 1]} and


sup {|g(x)| : x ∈ [0, 1]} are finite.
It remains to verify the triangle inequality. We have,
for f, g, h : [0, 1] → R and all x ∈ [0, 1],

|f (x) − g(x)| ≤ |f (x) − h(x)| + |h(x) − g(x)|.

Taking supremum over all x on the right hand side,


for all x ∈ [0, 1],

|f (x) − g(x)| ≤ d∞(f, h) + d∞(h, g).

Taking supremum over all x on the left hand side,

d∞(f, g) ≤ d∞(f, h) + d∞(h, g).


There are other ways of measuring distance between
functions.

Measuring distance between functions by the area


between their graphs is using the metric d1, defined
by:
Z 1
d1(f, g) = |f (x) − g(x)| dx.
0
Note:

d1(f, g) ≤ d∞(f, g),

since
Z 1 Z 1
|f (x) − g(x)|dx ≤ sup |f (x) − g(x)| dx
0 0≤x≤1 0
= sup |f (x) − g(x)|.
0≤x≤1
For p ∈ N, let
Z 1 !1/p
dp(f, g) = |f (x) − g(x)|p dx .
0

Then, each dp is a metric on A = C[0, 1].

Again, the triangle inequality is a special case of the


Minkowski inequality, and we are not going to prove
it.
Bounded subsets

Definition (A, d) a metric space and X ⊆ A. Then X


is bounded if there is K ∈ R such that for all
x, y ∈ X, d(x, y) ≤ K.

Theorem If X1, X2 are bounded subsets of a metric


space, so is X1 X2.
S
Proof. Suppose that both X1, X2 are non-empty;
otherwise, the statement is trivial. Take some
x1 ∈ X1 and x2 ∈ X2. Then 0 ≤ d(x1, x2) < ∞, since
both x1, x2 lie in the same metric space.

Suppose for all x, y ∈ X1, d(x, y) ≤ K1, and for all


x, y ∈ X2, d(x, y) ≤ K2.

Then for all x ∈ X1 and y ∈ X2,


d(x, y) ≤ d(x, x1)+d(x1, x2)+d(x2, y) ≤ K1+d(x1, x2)+K2.

This then implies that for all x, y ∈ X1 ∪ X2,

d(x, y) ≤ K1 + d(x1, x2) + K2.

Corollary If X1, X2, . . . , Xn are bounded subsets of a


Sn
metric space, then so is i=1 Xi.
Open balls

(A, d) a metric space, x ∈ A,  > 0. The open ball of


radius  around x is

B(x) = {y ∈ A : d(x, y) < } .

Sometimes, we use the notation B(x; d), to make it


clear what metric we refer to.
Example In R with the usual (Euclidean) metric,
B(x) = (x − , x + ).

Example In the metric space (R2, d2) (R2 with the


usual metric), the open ball B(x) is the region
enclosed by a circle of radius  centred at x — note
that the points on this circle do not lie in B(x).
Example With metric

d1(x, y) = |x1 − y1| + |x2 − y2|,

the open ball B(x) in R2 is a square whose sides



have length 2.
To see this, take x = 0, and note that the points
(, 0)T , (0, )T , (−, 0)T and (0, −)T mark the
corners, and the boundary of the square is formed by
line segments connecting them.
Example Let A be any set. Then open balls in the
discrete metric space M = (A, d0) are given by

 {x} if  ≤ 1;
B(x) = 
A if  > 1.

This is because y = x is the only point such that


d(x, y) < 1, while, for all y 6= x, d(x, y) = 1 < ,
whenever  > 1.
Continuity in Metric Spaces

The definition of continuity

We have seen that the definition of continuity can


be thought of in terms of distances.

With concept of distance, we should be able to


generalise continuity to functions having as domain
and codomain general metric spaces.
Definition M1 = (A1, d1), M2 = (A2, d2) two metric
spaces, f : A1 → A2, and a ∈ A1. Then f is
(d1, d2)-continuous (or just continuous) at a if given
 > 0 there exists δ > 0 such that

d1(x, a) < δ =⇒ d2 (f (x), f (a)) < .


Continuity can be phrased in terms of open balls.
(As for f : Rm → Rn.)

f : A1 → A2 is continuous at a ∈ A1 if given  > 0,


there exists δ such that

f (Bδ (a; d1)) ⊆ B (f (a); d2) .


This is equivalent to saying that, given  > 0, there
exists δ such that

Bδ (a; d1) ⊆ f −1 (B (f (a); d2)) .

If f is continuous on the whole of A1, we simply say


that f is continuous.
Example A be any set, d any metric on A, d0 the
discrete metric on A. Let f be any function from A
to A. For any a,

d0(x, a) < 1 =⇒ x = a
=⇒ f (x) = f (a)
=⇒ d(f (x), f (a)) = 0 < .

Thus (taking δ = 1 in the definition of continuity)


any f : A → A is (d0, d)-continuous.
Open Sets

Definition of open set

Similar to earlier definition in Rm:

Definition A subset U of a metric space M is open


if for any y ∈ U , there is (y) > 0 such that
B(y)(y) ⊆ U.
We saw earlier that open balls in Rm are open.
Generally, open balls in any metric space are open.

Theorem. For any x in a metric space M and r > 0,


the open ball Br (x) is an open set.
Proof. The proof is very similar to the proof in Rm.

Take y ∈ Br (x); need  > 0 such that B(y) ⊆ Br (x).

Let  = r − d(x, y) > 0. Then for each z ∈ B(y),

d(z, x) ≤ d(z, y) + d(y, x)


<  + d(x, y) = r − d(x, y) + d(x, y) = r.

So z ∈ Br (x), and so B(y) ⊆ Br (x).


Example Consider R. For any x, {x} is not open in
R with the usual metric.

But {x} is open if we use the discrete metric.


(Because {x} = B1(x; d0) is an open ball).

When not clear what metric is being used, we speak


of ‘d-open sets’.
Usually there will be no confusion
Example Not every open subset of a metric space is
an open ball. Consider R2 with the usual metric. Let

U = {(x1, x2) : a < x1 < b, c < x2 < d} ,

the interior of a rectangle. Then U is open, but not


an open ball.

(The open balls in this space are circular regions.)


Theorem (A, d) a metric space. Then

U1, . . . , Uk open =⇒ ∩ki=1Ui open;

[
Ui (i ∈ I) open =⇒ Ui open.
i∈I

First part does not hold for infinite intersections.


Example For n ∈ N, Un = (−1/n, 1/n) is open subset
of R with usual metric. But the intersection

\
(−1/n, 1/n) = {0}
n=1

is not open.
Let us prove the first part. This is very similar to the
corresponding proof in Rm.

Suppose U1, . . . , Uk are all open in (A, d).

Let x ∈ U = ∩ki=1Ui; then x ∈ Ui for i = 1, 2, . . . , k.

Since each of the Ui is open, for each i = 1, 2, . . . , k,


we can find i > 0 such that Bi (x) ⊆ Ui.
Let  = min{i : i = 1, 2, . . . , k} > 0.

Then B(x) ⊆ Bi (x) ⊆ Ui for each i = 1, 2, . . . , k.

So B(x) ⊆ U .
Let us prove the second part. Again, this is very
similar to the corresponding proof in Rm.

For each i ∈ I, let Ui be an open set. Let


U = ∪i∈I Ui. We want to prove that U is open.

Take x ∈ U ; there exists i0 ∈ I such that x ∈ Ui0 . As


Ui0 is open, there is  > 0 such that

B(x) ⊆ Ui0 ⊆ U.
Continuity in terms of open sets

Just as for f : Rm → Rn.

Theorem Let (A1, d1) and (A2, d2) be metric spaces.


Then f : A1 → A2 is (d1, d2)-continuous if and only if
for U ⊆ A2,

U d2−open =⇒ f −1(U ) d1−open.


Not, in general, true that if f : A1 → A2 is continuous
and if U ⊆ A1 is open, then f (U ) ⊆ A2 is open.

(Just consider f : R → R defined by f (x) = 0, for all


x. With the usual metric on R, this is continuous
but, although (0, 1) is open, f ((0, 1)) = {0} is not
open. )
The proof is like in Rm. As it is an “if and only if”
statement, there are two things to prove.

Assume first that f is continuous. This means that,


for each point a ∈ A1, f is continuous at a.

Take a d2-open set U in A2: want to show that


f −1(U ) is a d1-open set in A1. That is, for any
x ∈ f −1(U ), there exists δ > 0 such that
Bδ (x; d1) ⊆ f −1(U ).
Take x ∈ f −1(U ), so f (x) ∈ U . As U is d2-open in
A2, there is  > 0 such that B (f (x); d2) ⊆ U .

Taking this value  in the definition of continuity, we


find δ > 0 such that f (Bδ (x; d1)) ⊆ B (f (x); d2) ⊆ U .

Thus for every point y ∈ Bδ (x; d1), f (y) lies in


B (f (x); d2), and thus in U . But this means exactly
that Bδ (x; d1) ⊆ f −1(U ), so this δ does the job.
Conversely, suppose that, for all d2-open subsets U
of A2, f −1(U ) is a d1-open subset of A1.

Take any point a ∈ A1; we want to show that f is


continuous at a.

That is, want to show that, given  > 0, and so any


open ball B (f (a); d2), there is δ > 0 such that

f (Bδ (a; d1)) ⊆ B (f (a); d2) .


Take  > 0, and note that B (f (a); d2) is d2-open in
A2. Then, by assumption, inverse image
f −1(B (f (a); d2)) is a d1-open subset of A1.

Since f (a) ∈ B (f (a); d2), a ∈ f −1(B (f (a); d2)).


Since f −1(B (f (a); d2)) is open, there exists δ > 0
such that Bδ (a; d1) ⊆ f −1(B (f (a); d2)).

But this means that f (Bδ (a; d1)) ⊆ B (f (a); d2), as


required.
Some important results are remarkably easy to prove
using this characterisation of continuity.

Theorem Suppose that (A1, d1), (A2, d2) and


(A3, d3) are metric spaces and that f : A1 → A2 and
g : A2 → A3 are continuous. Then the composition
g ◦ f : A1 → A3 is continuous.
Proof. It is enough for us to prove that, for each
d3-open set U in A3, the inverse image (g ◦ f )−1(U )
is d1-open in A1.

Let U be d3-open in A3. Note that

(g ◦ f )−1(U ) = {x ∈ A1 : g(f (x)) ∈ U )}


= {x ∈ A1 : f (x) ∈ g −1(U )}
= f −1(g −1(U )).
Since U is d3-open in A3 and g is continuous, g −1(U )
is d2-open in A2.

Since g −1(U ) is d2-open in A2 and f is continuous,


f −1(g −1(U )) is d1-open in A1.

That is, (g ◦ f )−1(U ) = f −1(g −1(U )) is d1-open in


A1, as required.
Convergence in metric spaces

Definition of convergence

Recall: convergence of sequence of real numbers.

(xn) converges to x ∈ R if for all  > 0, there is


N = N () such that

n ≥ N =⇒ |xn − x| < .
We have seen how this generalises to Rm.

To generalise to a metric space (A, d) we use the


following definition.

Definition (A, d) a metric space and (xn) a sequence


in A. Then (xn) converges to x ∈ A if for any  > 0
there is N = N () such that

n ≥ N =⇒ d(xn, x) < .
Closed sets in metric spaces

Definition Suppose (X, d) is a metric space. A


subset C of X is closed if, whenever (xn) is a
sequence of elements of C converging to a limit x,
the limit x is also in C.
Example If d0 is the discrete metric on any set X,
then a sequence (xn) converges to x if and only if
there is an N such that n ≥ N =⇒ xn = x. (I.e., a
sequence is convergent if and only if it is eventually
constant.)
To see this, suppose otherwise, i.e. there is no N
such that for all n ≥ N , xn = x.

Take any value 0 <  ≤ 1. Then for each N , there


will be some n ≥ N such that d(xn, x) = 1 ≥ , so xn
cannot converge to x.
Since, every convergent sequence is eventually
constant, it follows that, if C ⊆ X, xn ∈ C for each n
and xn → x, then x ∈ C also.

Thus all subsets of X are closed in the discrete


metric.
Theorem Suppose (X, d) is a metric space. A set
C ⊆ X is closed if and only if its complement
U = X \ C is open.
Proof. The proof is much like in Rm. Because this is
an ‘if and only if’ result, there are two things to
prove here: first, that if C is closed then U = X \ C
is open; secondly, that if U = X \ C is open then C is
closed.
Suppose, first, that C is closed and consider its
complement U = X \ C. We want to show U is open.
Suppose it isn’t. Then there is some y ∈ U such that
for no  > 0 do we have B(y) ⊆ U . In other words,
for all  > 0, the ball B(y) does not lie entirely within
U = X \ C and hence must contain points of C.
For any positive integer n, let us take  = 1/n. Then
there is some xn ∈ B1/n(y) such that xn ∈ C.
Because d(xn, y) < 1/n, we have that xn → y as
n → ∞.

So here we have a sequence (xn) in C such that


lim xn = y 6∈ C. But this cannot happen since C is
closed. So what’s gone wrong? Well, we supposed
that X \ C was not open, and this supposition must
therefore be wrong. So X \ C is open.
Next, suppose that U = X \ C is open. To prove that
C is closed, we need to show that the limit of any
convergent sequence of points of C is in C. So
suppose (xn) is a convergent sequence, with xn ∈ C,
and L = lim xn. We need to show L ∈ C.
Suppose this isn’t so. Then L is in the open set
U = X \ C, so there is some  > 0 such that
B(L) ⊆ U . Now, because xn → L, there is some N
such that for n > N , d(xn, L) < , that is xn ∈ B(L).
But then for n > N , xn ∈ U . This is a contradiction
to the fact that xn ∈ C. So we have gone wrong in
assuming that L is not in C. Therefore it is in C,
and C is closed.
Compactness in metric spaces

Definition of compactness

Just as for Rn, we define (‘sequential’) compactness


in a metric space:

Definition (A, d) a metric space. A subset C of A is


compact if any sequence (xn), where xn ∈ C for all n,
has a subsequence converging to a point of C.
Properties of compact sets

Closed-ness and boundedness

Theorem Any compact subset C of a metric space


(A, d) is closed and bounded.
Proof.

We want to prove that, if C is compact in (A, d),


then it must be closed and bounded.

Suppose that C is compact. Let us show it is closed.


That is, we need to prove that, for every sequence
xn of elements of C such that xn is convergent, the
limit x = limn→∞ xn lies in C.
By compactness, such a sequence xn has a
subsequence xnk such that x0 = limk→∞ xnk is
contained in C.

However, xn converges to x, and thus so also do all


its subsequences. Thus x0 = x lies in C. So C is
closed.

Let us now show that C is bounded. Suppose for a


contradiction it is not bounded.
Then there is a point x0, and, for each n ∈ N, there
is some xn ∈ C with d(xn, x0) > n.

We show that the sequence xn has no convergent


subsequence, contradicting the compactness of C.

Suppose that xnk is a subsequence and that xnk → x


as k → ∞. Then there is some N such that for all
k ≥ N , d(xnk , x) ≤ 1. Hence, for all k ≥ N ,

d(xnk , x0) ≤ d(xnk , x) + d(x, x0) < 1 + d(x, x0).


But also

d(xnk , x0) > nk ≥ k → ∞, as k → ∞.

This is a contradiction, and so we conclude that C is


indeed bounded.
We know that for Rm with the usual metric, the
converse is true. Not so for a general metric space.
Some contain closed and bounded, but
non-compact, subsets.
For a ‘silly’ example, consider A = (0, 1) as a
subspace of itself. It is then closed. To see this,
note that, if we take a sequence xn ∈ (0, 1), it will be
considered convergent only if xn → x for some x ∈ A.

Thus for instance, xn = 1/n, which would be


considered convergent if we viewed xn as elements of
R or even of [0, 1], is not convergent in this world, as
0 is not a point in the underlying set A.
Also, take d(x, y) = |x − y| for x, y ∈ A. Then
d(x, y) ≤ 1 for all x, y ∈ A, so A is bounded.

However, A not compact. As an example, consider


once again the sequence (xn) given by xn = 1/n.

This converges to 0, which is not in (0, 1). Then


every subsequence of xn also converges to 0, and so
xn has no subsequence convergent to an element of
(0, 1).
In this argument, we have used the following general
fact.

For any metric space (A, d), the set A is both open
and closed.

To see this, if x ∈ A, then, clearly, for any  > 0,


B(x) = {y ∈ A : d(x, y) < } ⊆ A. Thus A is open.
Also, the complement of A in A is the empty set,
which is trivally open. Hence A must be closed, as a
complement of an open set.
See also Sutherland, Chapter 10, for some examples
of closed and bounded sets that are not compact in
metric spaces of functions.
Continuous functions on compact sets

Theorem Suppose that (A1, d1) and (A2, d2) are


metric spaces, and that C ⊆ A1 is a compact subset
of A1. If f : A1 → A2 is (d1, d2)-continuous, then
f (C) is a compact subset of A2.
Proof.

Let C be a compact subset of A1.

We want to show that f (C) = {f (x) : x ∈ C} is


compact in A2.

In other words, we need to show that, for any


sequence (yn) in f (C), (yn) has a subsequence
converging to some element of f (C).
For each n, since yn ∈ f (C), there exists xn ∈ C such
that yn = f (xn).

Consider the sequence (xn) in C. Since C is


compact, there is a subsequence (xnk ) of (xn)
converging to a limit x ∈ C.

We show that ynk = f (xnk ) → f (x) as k → ∞.


Let  > 0. By continuity of f , there exists δ > 0 such
that d2(f (x), f (y)) <  provided d1(x, y) < δ.

Since xnk converges to x there exists an N such that


whenever nk ≥ k > N , d1(xnk , x) < δ.

Then, as long as nk ≥ k > N , d2(f (xnk ), f (x)) < .


Since  > 0 was arbitrary, f (xnk ) → f (x) as k → ∞.
So we have the following important result, which
generalises earlier results on the maximisation and
minimisation of continuous functions.

Theorem Suppose that C is a compact subset of a


metric space (A, d) and that f : A → R is continuous
(with respect to d and the usual metric on R). Then
f attains its bounds on C. That is, there are c, d ∈ A
such that

f (c) = sup f (x), f (d) = inf f (x).


x∈C x∈C
Proof. The previous theorem implies that

f (C) = {f (x) : x ∈ C}

is compact.

Hence, by an earlier result, it must be bounded and


closed.

We now use the fact that f (C) is bounded and


closed to prove that it achieves its maximum and
minimum.
Let

M = sup f (C) = sup{f (x) : x ∈ C},

and let

m = inf f (C) = inf{f (x) : x ∈ C}.

Since f (C) is bounded, these are finite real numbers.


By definition of sup and inf, for each n ∈ N, there
0 ∈ f (C) such that
exist yn ∈ f (C) and yn

M − 1/n < yn ≤ M

and
0 ≥ m.
m + 1/n > yn

0 → m as n → ∞. Since f (C) is
Then yn → M and yn
closed, M ∈ f (C) and m ∈ f (C).
But if M ∈ f (C) = {f (x) : x ∈ C}, there must be
x1 ∈ C such that M = f (x1).

Similarly, there exists x2 ∈ C such that f (x2) = m.

You might also like