This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.1 Basics of Metric Spaces
1.1 Metric Spaces
1.1.1 Metric spaces: definition and examples
In Analysis and Calculus the definition of convergence was based on the notion of a distance between points, namely the standard distance between two real numbers
is given by
Similarly, the distance between
two points in the plane,
given by
d(x,y)=d((x1,x2),(y1,y2))= | √ | | .
|
A metric space formalises this notion. This will give us the flexibility to talk about distances on
function spaces, for example, or introduce other notions of distance on spaces.
Definition 1 (Metric Space)
A metric space
(
X,
d)
is a set X together with a function d:
X ×
X → ℝ
that satisfies the following properties
-
d(x,y) ≥ 0; and d(x,y)=0 ⇐⇒ x=y (positive definite);
- d(x,y)=d(y,x) (symmetric);
- d(x,z) ≤ d(x,y)+d(y,z) (triangle inequality).
The function d is called the metric
. The word distance
will be used interchangeably with the same meaning.
Example 2
-
X=ℝ. The standard metric is given by d1(x,y)=|x−y|.
There are many other metrics on ℝ, for example
d(x,y)=
| ⎧
⎨
⎩ | |x−y| | if |x−y| ≤ 1, |
1 | if |x−y| ≥ 1.
|
|
|
-
Let X be any set whatsoever, then we can define the discrete metric
-
X=ℝm. The standard metric is the Euclidean metric: if x=(x1,x2,…,xm)
and y=(y1,y2,…,ym) then
d2(x,y)= | √ | |
(x1−y1)2+(x2−y2)2+…+(xm−ym)2 |
| .
|
This is linked to the inner-product (scalar product), x ·y=x1 y1+ x2 y2+…+xm ym, since it
is just √(x−y).(x−y).
We will study inner products more carefully later, so for the moment we won’t prove the
(well-known) fact that it is indeed a metric.Other possible metrics include
d∞(x,y)=max{|x1−y1|,|x2−y2|,…,|xm−ym|}. |
Another metric on ℝm comes from the generalisation of our first example:
d1(x,y)=|x1−y1|+|x2−y2|+…+|xm−ym| .
|
These metrics d1, d2, d∞ are
all translation-invariant (i.e., d(x+z,y+z)=d(x,y)), and
positively homogeneous (i.e., d(kx,ky)=|k|d(x,y)), see Ex. 8 for further discussion.
-
Take X=C[a,b]. Here are three metrics similar to above ones:
Again, this is linked to the idea of an inner product, so we will delay proving that it is a metric.
the area between two graphs
d∞(f,g)=max{ |f(x)−g(x)|: a ≤ x ≤ b}, |
the maximum vertical separation between two graphs.
Example 3
On C[0,1]
take f(
x)=
x and g(
x)=
x2 and calculated2(f,g) | = | ⎛
⎜
⎜
⎝ | | (x−x2)2 dx | ⎞
⎟
⎟
⎠ | | = | √ | | , |
|
d1(f,g) | = | |
d∞(f,g) | = | |
|
Example 5
-
The interval [a,b] with d(x,y)=|x−y| is a subspace of ℝ.
- The unit circle {(x1,x2) ∈ ℝ2: x12+x22=1 } with
d2(x,y)=√(x1−y1)2+(x2−y2)2 is a subspace of ℝ2.
- The space of polynomials P is a metric space with any of the metrics inherited from
C[a,b] above.
Definition 6
A normed space (
V,||· ||)
is a real vector space V with a map ||·||:
V → ℝ
(called norm
) satisfying
-
||v|| ≥ 0, and (||v||=0 ⇔ v=0),
- ||λ v|| = |λ| || v|| ,
- ||v+w|| ≤ ||v||+ ||w||.
Exercise 7
Prove that V is a metric space with metric d(v,w):=||v−w||.
Exercise 8
-
Write norms ||·||1, ||·||2, ||·||∞
on ℝm which produces metrics d1, d2, d∞ from Ex. 2.3.
Hint: see (11) and (9) below.
- Show, that the following are norms on the vector space V=C[a,b]:
| || f ||1 | | | | | | | | | | |
|| f ||2 | | | | | | | | | | |
|| f ||∞ | | | | | | | | | | |
|
Furthermore, these norms generate the respective metrics d1, d2 and d∞ from Ex. 2(4) as indicated in the previous exercise.
Definition 9
An inner product space(
V,⟨·, ·⟩)
is a real vector space V with a map ⟨·, ·⟩:
V ×
V → ℝ
(called inner product
)
satisfying
-
⟨ λ v,w ⟩ = λ⟨ v,w ⟩,
- ⟨ v1 +v2 ,w ⟩ = ⟨ v1,w ⟩+⟨ v2,w ⟩,
- ⟨ v,w ⟩ = ⟨ w,v ⟩,
- ⟨ v,v ⟩ ≥ 0, and (⟨ v,v ⟩ =0 ⇔ v=0).
Exercise 10
-
Prove that the Cauchy–Schwarz inequality | ⟨ v,w ⟩ |2 ≤ ⟨ v,v ⟩ ⟨ w,w ⟩ holds.
Hint: start by considering the expression ⟨ v + λ w ,v + λ w⟩ ≥ 0 and analyse the discriminant of the quadratic expression for λ.
- Then prove that
V is a normed space with norm || v||:= ⟨ v,v ⟩1/2.
- Which of the above norms ||·||1, ||·||2, ||·||∞ from Ex. 8 can be obtained from an inner product as described in the previous item?
There is a natural name for a class of maps, which preserve metrics:
Definition 11 (Isometry)
Let (
X,
dX)
and (
Y,
dY)
be two metric spaces. A map φ:
X →
Y is an isometry
if
dY(φ(x1), φ(x2)) = dX(x1, x2) for all x1, x2 ∈ X.
|
A metric space (
X,
dX)
is isometric
to a metric space (
Y,
dY)
if there is an isometry bijection between X and Y.
1.1.2 Open and closed sets
Definition 12 (Open and closed balls)
Let (
X,
d)
be a metric space, let x ∈
X and let r>0
. The open ball
centred at x, with radius r,
is the set
Br(x)={y ∈ X: d(x,y)<r },
|
and the closed ball
is the set
Trivial but useful observations are:
- x ∈ Br(x) ⊂ Br(x) for all x∈ X and r>0, so neither ball is empty and every point is covered by all balls it centres;
- Br(x) ⊂ Br+ε (x) for all x∈ X, r>0 and whatever small ε>0.
Note, that in ℝ with the usual metric the open ball is Br(x)=(x−r,x+r), an open interval, and
the closed ball is Br(x)=[x−r,x+r], a closed interval.
For the d2 metric on ℝ2, the unit ball, B1(0), is disc centred at
the origin, excluding the boundary. You may like to think about what you get for
other metrics on ℝ2. What are balls in the discrete metric, Ex. 2.2?
Definition 13 (Open sets)
A subset U of a metric space (X,d) is said to be open, if for each point x ∈ U
there is an r>0 such that the
open ball Br(x) is contained in U (“room to swing a cat").
Clearly X itself is an open set, that is the whole metric space is open in itself. Also the empty set ∅ is also considered to be open in a trivial way.
Proposition 15
Every “open ball" Br(x) is an open set.
Proof.
For if
y ∈
Br(
x), choose δ=
r−
d(
x,
y). We claim that
Bδ(
y) ⊂
Br(
x).
If z ∈ Bδ(y), i.e., d(z,y)<δ, then by the triangle inequality
d(z,x) ≤ d(z,y)+d(y,x) < δ + d(x,y) = r.
|
So z ∈ Br(x).
□
Definition 16 (Closed set)
A subset F of (X,d) is said to be closed, if its complement X ∖ F is open.
Note that closed does not mean “not open". In a metric space the sets ∅ and X are both
open and closed. In ℝ we have:
- (a,b) is open.
- [a,b] is closed, since its complement (−∞,a) ∪ (b,∞) is open.
- [a,b) is not open, since there is no open ball B(a,r) contained in the set. Nor it is
closed, since its complement (−∞,a) ∪ [b,∞) isn’t open (no ball centred at b can be contained in
the set).
Example 18
If we take the discrete metric,
then each point {
x}=
B1/2(
x)
so is an open set. Hence every set U is open,
since for x ∈
U we have B1/2(
x) ⊆
U. Hence, by taking complements, every set is also closed.
Theorem 19
In a metric space, every one-point set {x0} is closed.
Proof.
We need to show that the set U={x ∈ X: x ≠ x0} is open, so take a point x ∈ U.
Now d(x,x0)>0, and the ball Br(x) is contained in U for every 0<r< d(x,x0).
□
Theorem 20
Let (
Uα)
α ∈ A be any collection of open subsets of a metric space (
X,
d)
(not necessarily finite!).
Then ∪
α ∈ A Uα is open.
Let U and V be open subsets of a metric space (
X,
d)
. Then U ∩
V is open. Hence (by induction)
any finite intersection of open subsets is open.
Proof.
If
x ∈ ∪
α ∈ A Uα then there is an α with
x ∈
Uα. Now
Uα is open,
so
Br(
x) ⊂
Uα for some
r>0. Then
Br(
x) ⊂ ∪
α ∈ A Uα so the
union is open.
If now U and V are open and x ∈ U ∩ V, then ∃ r>0 and s>0 such that Br(x) ⊂ U and
B(x,s) ⊂ V, since U and V are open. Then B(x,t) ⊂ U ∩ V if t ≤ min(r,s).
□
Thereafter, the collection of open sets is preserved by arbitrary unions and finite intersections.
However, an arbitrary intersection of open sets is not always open; for example (−1/n,1/n) is open for each n=1,2,3,…,
but ∩n=1∞(−1/n,1/n)= {0}, which is not an open set.
For closed sets we swap union and intersection.
Theorem 22
Let (Fα)α ∈ A be any collection of closed subsets of a metric space (X,d) (not necessarily finite!).
Then ∩α ∈ A Fα is closed.
Let F and G be closed subsets of a metric space (X,d). Then F ∪ G is closed. Hence (by induction)
any finite union of closed subsets is closed.
Proof.To prove this we recall de Morgan’s laws. We use the notation Sc for the complement X ∖ S of a set S ⊂ X.
| ⇐⇒ | x ∉Aα for all α, so (∪Aα)c = ∩Aαc.
|
| ⇐⇒ | x ∉Aα for some α, so (∩Aα)c = ∪Aαc.
|
|
Write Uα= Fαc
=X ∖ Fα which is open. So ∪α ∈ A Uα is open by Theorem
20. Now, by de Morgan’s laws, (∩α ∈ A Fα)c = ∪α ∈ A Fαc. This is just ∪α ∈ A Uα. Since the complement of ∩α ∈ A Fα is open, it is closed.
Similarly, the complement of F ∪ G is Fc ∩ Gc, which is the intersection of two open sets and hence open by
Theorem
20. Hence F ∪ G is closed.
□
Infinite unions of closed sets do not need to be closed. An example is
which is open but not closed in ℝ with standard metric.
Definition 23 (Closure of a set)
The closure of S, written S, is the
smallest closed set containing S, and is contained in all other closed sets
containing S.
The above smallest closed set containing S does exist, because we can define
| = ∩{F: F ⊃ S and F closed },
|
the intersection of all closed sets containing S. There is at least one closed set containing S, namely X itself.
Example 24
In the metric space ℝ the closure of S=[0,1) is [0,1]. This is closed, and there is nothing smaller that is closed and contains S.
Exercise 25
Give an example of an open ball Br(x) and the respective closed ball Br(x) with the same centre and radius in a metric space X, such that Br(x) is not the closure of Br(x). Note the slight discontent on our notations, which shall not mislead us in future.
Definition 26 (Dense subset)
A subset S⊂ X is dense in X if S=X.
Theorem 27
The set ℚ of rationals is dense in ℝ, with the usual metric.
Proof.
Suppose that
F is a closed subset of ℝ which contains ℚ: we claim that it
F=ℝ.
For U=ℝ ∖ F is open and contains no points of ℚ. But an open set U (unless it is empty) must contain
an interval Br(x) for some x ∈ U, and hence a rational number within it.
Our only conclusion is that U=∅ and F=ℝ, so that ℚ=ℝ.
□
Definition 28 (Neighbourhood)
We say that V is a neighbourhood (nbh) of x if there is an
open set
U such that
x ∈ U ⊆ V; this means that ∃
δ>0 s.t. Bδ(x)
⊆ V. Thus, a set is open precisely when it is a neighbourhood of each of its points.
Example 29
The half-open interval [0,1) is a neighbourhood of every point in it except for 0.
Theorem 30
For a subset S of a metric space X, we have
x∈
S iff V ∩
S ≠ ∅
for all nhds
V of
x (i.e., all neighbourhoods of x meet S).
Proof.
If there is a neighbourhood of
x that doesn’t meet
S, then there is an open subset
U with
x ∈
U and
U ∩
S=∅.
But then X ∖ U is a closed set containing S and so S ⊂ X ∖ U, and then
x ∉ S because x ∈ U.
Conversely, if every neighbourhood of x does meet S, then x ∈ S, as otherwise X ∖ S is
as open neighbourhood of x that doesn’t meet S.
□
Definition 31 (Interior)
The interior of
S, intS, is the largest open set contained in
S, and can be written as
intS = ∪{ U: U ⊂ S and U open }.
|
the union of all open sets contained in S. There is at least open set within S, namely ∅
.
We see that S is open exactly when S=intS, otherwise intS is smaller.
Example 32
-
In the metric space ℝ we have int[0,1)=(0,1); clearly this is open and there is no larger open set contained in [0,1).
- intℚ = ∅. For any non-empty open set must contain an interval Br(x) and then it contains
an irrational number, so isn’t contained in ℚ.
Proposition 33
intS=
X ∖ (
X∖ S)
.
Proof.
By De Morgan’s laws,
intS | = | ∪{ U: U ⊂ S and U open } |
| = | X ∖ ∩{Uc: U ⊂ S and U open } |
| = | X ∖ ∩{F: F ⊃ (X ∖ S) and F closed } |
| = | |
|
This is because
U ⊂
S if and only if
Uc= (
X ∖
U) ⊃ (
X ∖
S).
Also
F=
Uc is closed precisely when
U is open.
That is, there
is a correspondence between open sets contained in
S and closed sets containing its complement.
□
1.1.3 Convergence and continuity
Let (xn) be a sequence in a metric space (X,d), i.e., x1,x2,…. (Sometimes we may start counting at x0.)
Definition 34 (Convergence)
We say xn →
x (i.e., xn converges
to x) if
d(
xn,
x) → 0
as n → ∞
.In other words: xn → x if for any ε>0 there exists N∈ℕ such that for all n>N we have d(x,xn) < ε.
This is the usual notion of convergence if we think of points in ℝd with the Euclidean metric.
Theorem 35
Let (
xn)
be a sequence in a metric space (
X,
d)
. Then the following are equivalent:-
xn → x;
-
for every open U with x ∈ U, there exists an N>0 such that (n>N) xn ∈ U;
-
for every ε>0 there exists an N>0 such that (n>N) xn ∈ Bε(x).
Proof.
1 ⇒
2
If
xn →
x and
x ∈
U, then there is a ball
Bε(
x) ⊂
U, since
U is open. But
xn →
x so
d(
xn,
x) < ε for
n sufficiently large, i.e.,
xn ∈
U for
n sufficiently large.
2 ⇒ 3 is obvious.
Finally, 3 ⇒ 1. If the 3 condition works for a given ε>0 and large n the inclusion xn ∈ Bε(x) implies d(xn,x)<ε.
□
Theorem 36
Let S be a subset of the metric space X. Then x ∈
S if and only if
there is a sequence (
xn)
of points of S with xn →
x.
Proof.
If
x ∈
S, then for each
n we have
B1/n(
x) ∩
S ≠ ∅ by Theorem
30. So
choose
xn ∈
B1/n(
x) ∩
S. Clearly
d(
xn,
x) → 0, i.e.,
xn →
x.
Conversely, if x ∉S, then there is a neighbourhood U of x with U ∩ S=∅. Now
no sequence in S can get into U so it cannot converge to x.
□
This can also be phrased as follows, characterising closed set in terms of sequences.
Corollary 37 (Closedness under taking limits)
A subset Y ⊂ X of a metric space (X,d) is closed if and only if for every sequence (xn) in Y that is convergent in X
its limit is also in Y.
Hence, the closure S is obtained from S by adding all possible limit points of sequences in S.
Example 38
-
Take (ℝ2,d1), where d1(x,y)=|x1−y1|+|x2−y2|, where x=(x1,x2) and
y=(y1,y2), and consider the sequence
(1/n,2n+1/n+1). We guess its limit is (0,2).
To see if this is right, look at
d1 | ⎛
⎜
⎜
⎝ | ⎛
⎜
⎜
⎝ | | , | | ⎞
⎟
⎟
⎠ | ,(0,2) | ⎞
⎟
⎟
⎠ | =
| ⎪
⎪
⎪
⎪ | | ⎪
⎪
⎪
⎪ | + | ⎪
⎪
⎪
⎪ | | −2 | ⎪
⎪
⎪
⎪ | = | | + | |
→ 0 |
as n → ∞. So the limit is (0,2). -
In C[0,1] let fn(t)=tn and f(t)=0 for 0 ≤ t ≤ 1. Does fn → f, (a) in
d1, and (b) in d∞?
(a) as n → ∞. So fn → f in d1.
(b) d∞(fn,f)=max{tn: 0 ≤ t ≤ 1}=1 ¬→0 |
as n → ∞. So fn ¬→f in d∞.
Note: Say gn → g pointwise on [a,b]
as n → ∞ if gn(x) → g(x) for all x ∈ [a,b].
If we define g(x)=
{ 0 | for 0 ≤ x < 1, |
1 | for x=1,
|
then
fn → g pointwise on [0,1]. But g ∉C[0,1], as it is not continuous at 1. - Take the discrete metric
Then xn → x ⇐⇒ d0(xn,x) → 0. But since d0(xn,x)=0 or 1, this happens if
and only if d0(xn,x)=0 for n sufficiently large. That is, there is an n0 such that xn=x for all
n ≥ n0.
All convergent sequences in this metric are eventually constant. So, for example d0(1/n,0) ¬→0.
A result on convergence in ℝm.
Proposition 39
Take ℝ
2 with any of the metrics d1, d2 and d∞. Then a sequence
xn=(
an,
bn)
converges to x=(
a,
b)
if and only if an →
a and bn →
b.
Proof.
A useful observation is that for any
xn and
x:
d1(xn,x) ≥ d2(xn,x) ≥ d∞(xn,x).
|
If
an →
a and
bn →
b, then for any ε>0 there are
Na and
Nb such that for
N>
Na we have |
an−
a |<ε/2 and for
n>
Nb |
bn−
b |<ε/2. Thus for any
n >
N=max(
Na,
Nb):
ε > | ⎪
⎪ | an−a | ⎪
⎪ | + | ⎪
⎪ | bn−b | ⎪
⎪ | = d1(xn,x) ≥ d2(xn,x) ≥ d∞(xn,x) ,
|
which shows the convergence in all three metrics.
To show the opposite, WLOG assume towards a contradiction that an ¬→a, that is, there exits ε>0 such that for any N there exists n>N such that | an−a |>ε. Then:
| d1(xn,x) ≥
d2(xn,x) ≥ d∞(xn,x)= max{ | ⎪
⎪ | an−a | ⎪
⎪ | , | ⎪
⎪ | bn−b | ⎪
⎪ | }> | ⎪
⎪ | an−a | ⎪
⎪ | >ε
|
| | | | | | | | | | |
|
showing the divergence in all three norms.
□
A similar result holds for ℝm in general.
Now let’s look at continuous functions again.
Theorem 40
If fn →
f in (
C[
a,
b],
d∞)
, then
fn →
f in (
C[
a,
b],
d1)
.Informally speaking, d∞ convergence is stronger than d1 convergence.
Proof.
d∞(
fn,
f)=max{|
fn(
x)−
f(
x)|:
a ≤
x ≤
b} → 0 as
n → ∞, so, given
ε>0 there is an
N so that
d∞(
fn,
f)<ε for
n ≥
N. It follows that
if
n ≥
N then
d1(fn,f) = | | |fn(x)−f(x)| dx ≤ | | ε dx = ε(b−a),
|
so
d1(
fn,
f) → 0 as
n → ∞.
□
Now we look at continuous functions between general metric spaces.
Definition 42 (Continuity)
Let f: (X,dX) → (Y,dY) be a map between metric spaces. We say that f is continuous
at x ∈ X if for each ε>0 there is a δε,x>0 such that dY(f(x′),f(x)) < ε for all x′∈ X whenever
dX(x′,x) < δε,x.
Another way of saying the same is that for every ε>0 there exists a δ>0 such that
The map f is continuous, if it is continuous at all points of X.
Theorem 43 (Sequential continuity)
For f as above, f is continuous at a if and only if, whenever a sequence xn →
a, then
f(
xn) →
f(
a)
.In short, f is continuous at a if and only if f permutes with the limit:
f | ⎛
⎜
⎜
⎝ | | xn | ⎞
⎟
⎟
⎠ | = | | f | ⎛
⎝ | xn | ⎞
⎠ |
(7) |
for any sequence xn → a.
Proof.
Same proof as in real analysis, more or less. If
f is continuous at
a and
xn →
a, then
for each ε>0 we have a δ>0 such that
dY(
f(
x),
f(
a)) < ε whenever
dX(
x,
a) < δ.
Then there’s an n0 with d(xn,a)<δ for all n ≥ n0,
and so d(f(xn),f(a))<ε for all n ≥ n0. Thus f(xn) → f(x).
Conversely, if f is not continuous at a, then there is an ε for which no δ will do, so
we can find xn with d(xn,a)<1/n, but d(f(xn),f(a)) ≥ ε. Then
xn → a but f(xn) ¬→f(a).
□
But there is a nicer way to define continuity. For a mapping f: X → Y and a set U ⊂ Y, let f−1(U) be the set, called pre-image or inverse image
f−1(U)={ x ∈ X: f(x) ∈ U }.
|
This makes sense even if f−1 is not defined as a function.
Theorem 44 (Continuity and open sets)
A function f: X → Y is continuous if and only if f−1(U) is open in X for every open subset U ⊂ Y. In short: the inverse image of an open set is open.
Proof.
Suppose that
f is continuous, that
U⊂
Y is open, and that
x0 ∈
f−1(
U), so
f(
x0) ∈
U. Now
there is a ball
Bε(
f(
x0)) ⊂
U, since
U is open, and then by continuity
there is a δ>0 such that
dY(
f(
x),
f(
x0)) < ε whenever
dX(
x,
x0) < δ. This means that for
d(
x,
x0)<δ,
f(
x) ∈
U and so
x ∈
f−1(
U). That is,
f−1(
U) is open.
Conversely, if the inverse image of an open set is open, and x0 ∈ X, let ε>0 be given.
We know that Bε(f(x0)) is open, so f−1(B(f(x0),ε)) is open, and contains x0. So it
contains some Bδ(x0) with δ>0.
But now if d(x,x0)<δ, we have x ∈ Bδ(x0) ⊂ f−1(Bε(f(x0))) so f(x) ∈ Bε(f(x0))
and we have d(f(x),f(x0))<ε.
□
Example 46
Let X=ℝ
with the discrete metric, and Y any metric space. Then all functions f:
X →
Y are continuous! Indeed, in either way:
-
Because the inverse image of an open set is an open set, since all sets are open.
- Because whenever xn → x0 we have xn=x0 for n large, so obviously f(xn) → f(x0).
Exercise 47
Which functions from a metric space X to the discrete metric space are continuous?
Which function from the discrete metric space to ℝ are continuous?
Proposition 48 Let X and Y be metric spaces.
-
A function f : X → Y is continuous if and only if f−1(F) is closed whenever F is a closed
subset of Y.
- If f: X → Y and g: Y → Z are continuous, then so is the composition g ∘ f: X → Z
defined by (g ∘ f)(x) = g(f(x)).
Proof.
- We can do this by complements, as if F is closed, then U=Fc is open, and f−1(F)=f−1(U)c
(a point is mapped into F if and only if it isn’t mapped into U).
Then f−1(F) is always closed when F is closed ⇐⇒ f−1(U) is always open when U is open.
- Take U ⊂ Z open; then (g ′ f)−1(U) = f−1(g−1(U)); for these are the points which map under f into g−1(U) so that
they map under g ′ f into U.
Now g−1(U) is open in Y, as
g is continuous, and then f−1(g−1(U)) is open in X since f is continuous.
□
In many cases we may need a stronger notion.
Definition 49 (Uniform continuity)
A function f: (X,dX) → (Y, dY) is called uniformly continuous if
for each ε>0 there exists δε>0 such that whenever x,x′∈ X satisfy
dX(x,x′)≤δε, we have that dY(f(x),f(x′))≤ε.
Note, that here the same δε shall work for all x∈ X. Thus any uniformly continuous function is continuous at every point. On the other hand the function f(x)=1/x on (0,1) is continuous but not uniformly continuous.
1.2 Useful properties of metric spaces
Metric spaces may or may not have some useful properties which we are discussing in the following subsections: completeness and compactness.
1.2.1 Cauchy sequences and completeness
Recall that if (X,d) is a metric space, then a sequence (xn) of elements of X converges to x∈ X if d(xn,x) → 0, i.e., if given ε>0 there exists N such that d(xn,x)< ε whenever n ≥ N. Thus, to show that a sequence is convergent from the definition we need to present its limit x which may not belong to the sequence (xn). It would be convenient to deduce convergence of (xn) just through its own properties without a reference to extraneous x. This is possible for complete metric spaces studied in this subsection.
Often we think of convergent sequences as ones where xn and xm are close together
when n and m are large. This is almost, but not quite, the same thing in a general metric space.
Definition 50 (Cauchy Sequence)
A sequence (xn) in a metric space (X,d) is a Cauchy sequence if for any ε>0 there
is an N such that d(xn,xm)<ε for all n, m ≥ N.
Example 51
Take xn=1/n in ℝ with the usual metric. Now d(xn,xm)=|1/n−1/m|.
Suppose that n and m are both at least as big as N; then d(xn,xm) ≤ 1/N.
Hence if ε>0 and we take N>1/ε, we have d(xn,xm)≤ 1/N <ε whenever n and m are both
≥ N.
In fact all convergent sequences are Cauchy sequences, by the following result.
Theorem 52
Suppose that (
xn)
is a convergent sequence in a metric space (
X,
d)
, i.e., there
is a limit point x such that d(
xn,
x) → 0
. Then (
xn)
is a Cauchy sequence.
Proof.
Take ε>0. Then there is an
N such that
d(
xn,
x)<ε/2 whenever
n ≥
N.
Now suppose both
n≥
N and
m ≥
N. Then
d(xn,xm) ≤ d(xn,x)+d(x,xm) = d(xn,x)+d(xm,x) < ε/2+ε/2=ε,
|
and we are done.
□
Proposition 53
Every subsequence of a Cauchy sequence is a Cauchy sequence.
Proof.
If (xn) is Cauchy and (xnk) is a subsequence, then given ε>0 there
is an N such that d(xn,xm) < ε whenever n, m ≥ N. Now there is a K such that nk ≥ N
whenever k ≥ K. So d(xnk,xnl)<ε whenever k, l ≥ K.
□
Does every Cauchy sequence converge?
Example 54
-
(X,d)=ℚ, as a subspace of ℝ with the usual metric. Take x0=2 and
define xn+1=xn/2+1/xn. The sequence continues
3/2, 17/12, 577/408,… and indeed the sequence converges in ℝ as xn → x where x=x/2+1/x, i.e., x2=2.
But this isn’t in ℚ.
Thus (xn) is Cauchy in ℝ, since it converges to √2
when we think of it as a sequence in ℝ.
So it is Cauchy in ℚ, but doesn’t converge to a point of ℚ.
- Easier. Take (X,d)=(0,1). Then (1/n) is a Cauchy sequence in X (since it is Cauchy
in ℝ, as seen above), and has no limit in X.
In each case there are “points missing from X”.
Definition 55 (Completeness)
A metric space (X,d) is complete if every Cauchy sequence in X converges to a limit in X.
Theorem 56
The metric space ℝ
is complete.
This is a result from the first year. Since its proof depends on the definition of ℝ we will not demonstrate it here.
Example 58
-
Open intervals in ℝ are not complete; closed intervals are complete.
-
What about C[a,b] with d1, d2 or d∞?
Following our consideration in Ex. 38.2, define fn in C[0,2] by
fn(x)=
| ⎧
⎨
⎩ | xn | for 0 ≤ x ≤ 1, |
1 | for 1 ≤ x ≤ 2.
|
|
|
[DIAGRAM]
Then
and hence (fn) is Cauchy in (C[0,2],d1). Does the sequence converge?
If there is an f ∈ C[0,2] with fn → f as n → ∞, then
∫02 |fn(x)−f(x)| dx → 0, so
∫01 and ∫12 both tend to zero. So fn → f in (C[0,1],d1), which means
that f(x)=0 on [0,1] (from an example we did earlier). Likewise, f=1 on [1,2],
which doesn’t give a continuous limit.
- Similarly, (C[a,b],d1) is incomplete in general. Also it is incomplete in the d2 metric,
as the same example shows (a similar calculation with squares of functions). We will see later that it is complete in the d∞ metric.
If a metric space (X,d) is not complete one can always pass to its abstract completion in the following sense.
Proposition 60 (Abstract completion)
Any metric space (
X,
d)
is isometric to a dense subspace of a complete metric space, which is called its abstract completion
if (
X,
d)
.
Proof.[Sketch of proof]
We describe a metric space (
X′,
d′) in which
X is isometric to a dense subset. Consider the space
X′ of Cauchy sequences of
X.
We define an equivalence relation ∼ on
X′ by
(xn) ∼ (yn) ⇔ d(xn,yn) → 0. |
The set
X′ is defined to be the set of equivalence classes [(
xn)]. It has a well defined metric given by
d′([(xn)],[(yn)]):= | | d(xn,yn).
|
One checks easily that this is metric and is well defined (does not depend on the chosen representative
xn of [(
xn)]).
Now there is an injective map
X →
X′ defined by sending
x to the constant sequence (
x,
x,
x,…). This map is an isometry. We can therefore think of (
X,
d)
as a subset of (
X′,
d′). This subset is dense because every Cauchy sequence can be approximated by a sequence of constant sequences.
So the only difficult bit in this construction is to show that (
X′,
d′) is complete. We will sketch the construction of a limit here. It turns out that it verifies completeness on a dense set.
Lemma 61
Suppose that (X,d) is a metric space and let Y ⊂ X be a dense set with the property that every Cauchy sequence in Y has a limit in X. Then (X,d) is complete.
Proof.
Let (xn) be a Cauchy sequence in X. Now replace xn with another sequence yn in Y such that d(xn,yn)<1/n. Then, by the triangle inequality, yn
is again a Cauchy sequence and converges, by assumption, to some x ∈ X. Then also xn converges to x.
□
Let us turn to the proof of completeness of X′. Suppose that (xn) is a Cauchy sequence in X. Then, in X′ this sequence has the form
((x1,x1,…),(x2,x2,…),(x3,x3,…),…). This sequence has a limit, namely, (xn) itself.
□
Exercise 62 (Extension by continuity)
Let (
X,
d)
be a metric space and X1 be a dense subset of X. Let f:
X1 →
Y be a uniformly continuous function to a complete metric space (
Y,
d′)
.
Show that there is a unique
function f′:
X →
Y which satisfies two properties:
-
restriction of f′ to X1 coincides with f, that is f′(x)=f(x) for all x∈ X1;
- f′ is continuous on X.
Furthermore, it can be shown that f′
is uniformly continuous on X.
We will call f′
the extension of
f by continuity
and will often keep the same letter f to denote f′
.
There are many important consequences of Ex. 62, in particular the following.
Corollary 63
All abstract completions of a metric space (X,d) are isometric, in other words, the abstract completions is unique up to isometry.
1.2.2 Compactness
Accordingly to a dictionary: compact—closely and firmly united or packed together. For a metric space a meaning of “closely and firmly united” can be defined in several different forms—through open coverings or convergent subsequences—and we will see that these interpretations are equivalent.
An open cover of a metric space (X,d) is a family of open sets (Uα)α ∈ I such that
A subcover of a cover is a subset I′ ⊂ I of the index set such that
(Uα)α ∈ I′ is still a cover.
Definition 64 (Compactness)
A metric space (X,d) is called compact if every open cover has a finite subcover.
Informally: a space is compact if any infinite open covering is excessive and can be reduced just to a finite one. An example of a compact set is [0,1] and example of non-compact—all reals or the open interval (0,1). An importance of this concept is clarified by Rem. 21.
Definition 65 (Sequential Compactness)
A metric space (X,d) is called sequentially compact if every sequence (xn)n ∈ ℕ
in X has a convergent subsequence.
The limit of a convergent sequence is called the accumulation point of {xn}. It is instructive to compare the definitions of:
| x is the limit of {xn}: | ∀ ε>0 ∃ N ∀ n>N: d(x, xn) < ε; | | | | | | | | | |
x is an accumulation point of {xn}: | ∀ ε>0 ∀ N ∃ n>N: d(x, xn) < ε.
| | | | | | | | | |
|
Thereafter, x is not an accumulation point of {xn} if for some ε>0 and some N for all subsequent n>N we have d(x, xn)>ε.
Informally: a space is sequentially compact if there is no room to place infinite number of points sufficiently apart from each other to avoid their condensation to a limit. Taking the sequence xn=n shows that the set of all reals is not sequentially compact.
On the other hand, we know from previous years that bounded closed set in ℝn every sequence
has a convergent subsequence. Therefore, bounded closed sets in ℝn
are sequentially compact.
Exercise 66
What are compact sets in a discrete metric space?
What are sequentially compact sets in a discrete metric space?
Lemma 67
Let (X,d) be a sequentially compact metric space. Then for every ε >0 there
exist finitely many points x1,…,xn such that {Bε(xi)∣ i=1,…,n}
is a cover.
Proof.
Suppose this were not the case. Then there would exist an ε>0 such that
for any finite number of points
x1,…,
xn the collection of balls
Bε(
xi)
does not cover, i.e.
Starting with
n=1 and then inductively adding points that are
in the complement of ∪
i=1n Bε(
xi)
we end up with an infinite sequence of points
xi such that
d(
xi,
xk) ≥ ε.
This sequence cannot have a Cauchy subsequence (required for convergence) in contradiction with the sequential compactness of
X.
□
Theorem 68
A metric space (X,d) is compact if and only if it is sequentially compact.
Proof. We show the two directions separately.
Compactness implies sequential compactness:
Suppose that X is compact and let (xi)i ∈ ℕ be a sequence. We want to show that it has a convergent
subsequence. Suppose (xi) did not have a convergent subsequence. Then no point x is an accumulation point.
Therefore, for each x ∈ X there exists an ε(x)>0 such that only finitely many i ∈ ℕ for which xi ∈ Bε(x). Since
(Bε(x))x ∈ X is an open cover it has a finite subcover, that is a finite number of balls with a finite number of xi in each. This contradicts to the infinite number of elements in the sequence (xi).
Sequential compactness implies compactness: This implication is quite tricky. The proof is again by contradiction. Let us assume our space is sequentially compact and
there exists a cover Uα that does not have a finite subcover.
By the above lemma there are finitely many points x1,…,xN1 such that B1(xi) is a cover.
Each of the balls B1(xi) is covered by Uα as well.
Since our cover does not have a finite subcover one of the balls B1(xi) does not have a finite subcover.
Denote the relevant point xi by z1.
Again there are finitely many points x′1,…,x′N2 such that
B1/2(x′i) is a cover of X.
The collection of sets B1(z1) ∩ B1/2(x′i), with i=1,…,N2 is also a covering of B1(z1). In the same way as before
there is at least one of the x′i (which we will again call z2), such that B1(z1) ∩ B1/2(z2) can not be covered by a finite subcover of Uα.
Continuing like this we construct a sequence of points zi such that none of the sets
B1(z1) ⋂ B | | (z2) ⋂ … ⋂ B | | (zN)
|
can be covered by a finite subcover of Uα.
By assumption the sequence (zi) has a convergent subsequence.
Say z is a limit point of that subsequence. Since Uα is an open cover the point z is contained in one of
the Uα and of course that means that an open ball Bε(z) around z is contained in Uα for some ε>0.
Now we show that
there exits an N ∈ ℕ such that B1/N(zN) is a subset of Uα (this will be the desired contradiction!).
Indeed, choose N large enough so that d(zN,z) + 1/N<ε. Then x ∈ B1/N(zN) implies that
d(x,z) ≤ d(zN,z) + d(x,zN) < d(zN,z) + 1/N<ε. This means in particular that
B1(z1) ⋂ B | | (z2) ⋂ … ⋂ B | | (zN)
|
is a subset of Uα. Thus, there is a subcover of the set
B1(z1) ∩ … ∩ B1/N(zN)
consisting of one element Uα. This is a contradiction as we constructed
the sequence of balls in such a way that these sets cannot be covered by a finite number of the Uα.
□
Definition 69 (Boundedness)
A subset A ⊂ X of a metric space is called bounded if there exists x0 ∈ X and C>0 such that
for all x ∈ A we have d(x0,x) ≤ C.
Theorem 71
Suppose that A ⊂ X is a compact subset of a metric space. Then A is closed and bounded.
Proof.
First we show
A is bounded. Choose any
x0 ∈
X and note that the set
Bn(
x0) indexed by
n ∈ ℕ is an open cover of
A. Hence, there exists a finite sub-cover<
Bn1(
x0),…,
BnN(
x0). Hence,
A ⊂
BC(
x0), where
C= max{
n1,…,
cN}. Hence,
A is bounded.
Next assume that (xk) is a sequence in A that converges in X. Since A is compact there exists a subsequence that converges in A. Hence, the limit of xk must also be in A. Therefore, A is closed.
□
The converse of this statement is not correct in general. It is however famously correct in ℝm.
Theorem 72 (Heine–Borel)
A subset K ⊂ ℝm is compact if and only if it is closed and bounded.
Proof.
We just need to combine the above statements.
We have already shown that compactness implies closedness and boundedness. If K is closed and bounded we know from Analysis that it is sequentially compact. Therefore it is compact.
□
As an illustration of further nice properties of compact spaces we mention the following result:
Exercise 73
-
Any continuous function on a compact set is bounded.
- Any continuous function f: K→ X from a compact space K to a metric space X is uniformly continuous.
Last modified: November 6, 2024.