Metric Spaces: 1.1 Definition and Examples
Metric Spaces: 1.1 Definition and Examples
Metric Spaces
lim f (x) = y0
x→x0
if
∀" > 0 ∃ > 0 such that ∀x ∶ 0 < �x − x0 � < � f (x) − y0 � < ".
Let’s examine what is needed for this definition to make sense and how much we
can generalize it. The domain and the range are both R. Can we replace them
by other sets? Clearly, we could take them to be “nice enough” subsets of R. In
addition, it is assumed that we can subtract elements in the domain (x − x0 ) and
elements in the range ( f (x) − y0 ). Vectors, for example, can be subtracted. Can
we replace the domain and the range by any vector space? The answer is positive,
but we need something to replace the absolute value. In vector spaces, the role of
the absolute value (the distance from zero) is played by a norm.
Thus, we have the following generalization:
2 Chapter 1
lim f (x) = y0
x→x0
if
∀" > 0 ∃ > 0 such that ∀x ∶ 0 < �x−x0 �V < � f (x)−y0 �W < ".
lim f (x) = y0
x→x0
if ∀" > 0 there exists a > 0, such that the distance between f (x) and
y0 is less than " whenever the distance between x and x0 is greater
than zero and less than .
In this reformulation, we observe that we don’t really need the domain and the
range of f to be vector spaces. All we need is a notion of distance. Sets endowed
with a distance are called metric spaces, and they are the subject of this chapter.
y
x
z
It follows, by induction, from the triangle inequality that for every finite set of
points (xi )ni=1 in a metric space,
n−1
d(x1 , xn ) ≤ � d(x j , x j+1 ).
j=1
x2 xn−1
x3 xn−2
x1
xn
Comment: Metric spaces were first introduced by Maurice Frechet in 1906, uni-
fying work on function spaces by Cantor, Volterra, Arzelà, Hadamard, Ascoli,
and others. Topological spaces (.**#&-&5&) .*"(9/), of which metric spaces are a
special instance, were first introduced by Felix Haussdorf in 1914; their current
formulation is a slight generalization from 1922 by Kazimierz Kuratowski.
4 Chapter 1
Examples:
(a) Both R and C are metric spaces when endowed with the distance function
d(x, y) = �x−y�. We will often refer to “the metric space R”, without explicit
mention of the metric.
(b) Let F ∶ R → R be any strictly monotonic function (say increasing). Then, R
endowed with the distance function
Note that the strict monotonicity of F is only needed to ensure the positivity
of d.
(c) Rn endowed with the Euclidean distance,
n 1�2
d(x, y) = ��(xi − yi ) � 2
i=1
= (x0 , x1 , x2 , . . . , xn1 , xn )
It remains to show that d satisfies the triangle inequality. If 1 and 2 are two
paths, such that 1 ends at the point where 2 starts, then we can concatenate
(9:9:-) them; denote the compound path by 2 ∗ 1 . Then,
`( 2 ∗ 1) = `( 1 ) + `( 2 ).
(f) Any non-empty set X can be endowed with the discrete metric (%8*9)/%
%$*$"%),
�
�
�0 x = y
d(x, y) = �
�1 x ≠ y.
�
�
This is a particularly boring metric, since it provides no information about
the structure of the space. We will often use it, however, as a clarifying
example (or as a counter-example). Note that the discrete metric coincide
with the graph metric, if we endow X with the structure of a complete graph
(every two points are connected by an edge).
x∼y ⇐⇒ d(x, y) = 0.
6 Chapter 1
. Exercise 1.1 The goal of the following exercise is to rehearse elementary set-
theoretic relations. Let X be a set and let A, B, C ⊂ X. Let f ∶ X → Y and let
E, F ⊂ Y. Prove the following:
(a) (A ∪ B) ∩ C = (A ∪ C) ∪ (B ∪ C).
(b) (A ∩ B)c = Ac ∪ Bc .
(c) (A ∪ B)c = Ac ∩ Bc .
(d) f −1 (E ∩ F) = f −1 (E) ∩ f −1 (F).
(e) f −1 (E ∪ F) = f −1 (E) ∪ f −1 (F).
(f) f −1 (E c ) = ( f −1 (E))c .
(g) f (A ∪ B) = f (A) ∪ f (B).
(h) f (A ∩ B) ⊂ f (A) ∩ f (B) (note that this is not an equality).
(i) A ⊂ f −1 ( f (A)).
(j) E ⊃ f ( f −1 (E)).
(k) Is there any relation between f (A) and f (Ac )?
. Exercise 1.2 Prove that the set of infinite sequences of real numbers, endowed
with the function
1 �xn − yn �
∞
d((xn ), (yn )) = �
n=1 2 1 + �xn − yn �
n
is a metric space.
. Exercise 1.3 For each of the following pairs (X.d), determine whether it is a
metric space:
d( f, g) = �
1
� f (x) − g(x)� dx.
0
Metric Spaces 7
d( f, g) = �
1
� f (x) − g(x)� dx.
0
Proposition 1.2 Let (X, d) be an arbitrary metric space, and let Y ⊂ X. Then the
set Y with the function d restricted to Y × Y is a metric space.
We will call d�Y×Y the metric on Y induced by the metric on X (;*9:&/ %8*9)/).
A subspace of a metric space always refers to a subset endowed with the induced
metric.
Example: Let X = R2 endowed with the Euclidean metric, and let Y = S 1 be the
unit circle. Then, the induced metric on Y is depicted below:
8 Chapter 1
Note that this metric is di↵erent from the “natural” metric on S 1 which determined
by the shortest distance along the arc. ▲▲▲
Definition 1.3 Let (X, d) be a matric space. A sphere (%9*52) of radius r > 0
centered at a ∈ X is the set of points,
Sr (a) = {x ∈ X ∶ d(x, a) = r} .
(Note that this set may be empty.) An open ball ((&;5 9&$,) (or for short, a ball)
of radius r centered at a is the set
x y
Metric Spaces 9
Lemma 1.5 Let x ∈ X and suppose that y ∈ Br (x) for every r > 0. Then, y = x.
Lemma 1.6 Let x ∈ X and r > 0. Let y ∈ Br (x) and let s > 0 satisfiy
d(x, y) + s < r.
Then,
B s (y) ⊂ Br (x).
r
s
y x
r
Y
y
Proof : We need to show that two sets are equal. Just follows the definitions,
n
Recall the definition of a bounded set in R from your first calculus course. We
have the following generalization for metric spaces:
(Note that a does not need to be an element of A; in particular, the empty set is
always bounded.)
Metric Spaces 11
The following lemma shows that the center of the bounding ball is immaterial to
the definition of boundedness:
A ⊂ Br (a)
A ⊂ B⇢ (b)
Lemma 1.10 Every open ball Br (a) contains a closed ball centered at a.
Proof : By definition,
B̂r�2 (a) ⊂ Br (a).
n
Definition 1.11 Let X be a vector space over R (we might consider vector spaces
over C as well). A norm (%/9&1) on X is a function � ⋅ � ∶ X → R satisfying
�x + y� ≤ �x� + �y�.
A vector space X endowed with a norm is called a normed space (*/9&1 "(9/).
Normed space are an important instance of metric spaces, as the following propo-
sition asserts:
defines a metric on X. That is, every normed space is automatically a metric space
with a canonical metric.
Proof : Immediate. n
Note, however, that normed spaces carry properties that are not pertinent to all
metric spaces. Metric spaces need not be vector spaces. In addition, normed
spaces, as metric spaces, are translational invariant,
and homogeneous,
d( x, y) = � � d(x, y),
where is a scalar.
. Exercise 1.4 Let (X, d) be a metric space. Suppose that X is also a vector
space over R and that
Show that there exists a norm on X such that d is the corresponding metric.
Examples:
Metric Spaces 13
(a) Both R and C are normed space, with �x� = �x�, and the resulting metric is
the same as the one above.
(b) For X = Rn and 1 ≤ p < ∞, the function � ⋅ � p ∶ X → R defined by
n 1�p
�x� p = �� �xi � p �
i=1
(e) Consider C([a, b]), the set of continuous real-valued functions on [a, b]. It
is a vector space over R, where addition and multiplication by a scalar are
defined pointwise, namely, for f, g ∈ C([a, b]) and ↵, ∈ R,
� f �∞ = max � f (x)�
a≤x≤b
is a norm, therefore C([a, b]) is a metric space if endowed with the distance
function
d( f, g) = max � f (x) − g(x)�.
a≤x≤b
. Exercise 1.5 Draw the unit balls B1 (0) in R2 for the metrics induced by the
1-, 2-, and ∞-norms.
satisfy the definition of a norm. (Hint: the triangle inequality is proved through
Young’s inequality, followed by Hölder’s inequality, followed by Minkowski’s
inequality. Prove all three inequalities.)
defined for 1 < p < ∞ is monotonically decreasing, and that '(p) → �x�∞ as
p → ∞.
—2h(2019)—
lim d(xn , x) = 0.
n→∞
That is,
∀" > 0 ∃N ∈ N such that ∀n > N d(xn , x) < ".
The point x is called a limit (-&"#) of the sequence xn , and we write
lim xn = x or xn → x.
n→∞
We must first make sure that in a convergent sequence, the notion of the limit is
well-defined:
Proof : Suppose that a sequence xn converges to x and to y. Then, for every " > 0
there exists a (sufficiently large) n such that
xn ∈ Br (x).
16 Chapter 1
Br (x)
Examples:
(c) In particular, let X = C([a, b]) endowed with the maximum norm. Let
fn , f ∈ C([a, b]). Then,
xn y
x
yn
Letting n → ∞ and using the definition of the limit, both left- and right-hand sides
tend to d(x, y). n
lim d(xn , x) = 0,
n→∞
lim d(xnk , x) = 0.
k→∞
Proposition 1.19 Let xn be a sequence in a metric space X and suppose that there
exists an " > 0 such that
which is a contradiction. n
k 1�2
�xnj −x �≤
j
�� �xnj − x j� �
2
,
i=1
k 1�2
lim �� �xnj −x � �
j2
=0
n→∞
i=1
by limit arithmetics. n
Metric Spaces 19
. Exercise 1.8 Let (X, ⇢) be a metric space and define for every x, y ∈ X,
⇢(x, y)
d(x, y) =
1 + ⇢(x, y)
.
. Exercise 1.9 Let X = {0, 1}N (the space of infinite binary sequences), and
define for every two sequences xn , yn ∈ X,
∞
d1 ((xn ), (yn )) = � 2−n �xn − yn �
�
n=1
�
�2− min(i�xi ≠yi ) (xn ) ≠ (yn )
d2 ((xn ), (yn )) = �
�
.
�
�0 otherwise
Definition 1.21 In a metric space (X, d), a set A ⊂ X is called open ((&;5) if
every point a ∈ A is the center of an open ball contained in A. That is,
a
A
Comments:
(a) We can replace “open ball” by “closed ball”, since Br (a) ⊂ A implies
B̂r�2 (a) ⊂ A.
(b) By definition, X itself is always an open set.
(c) By convention, the empty set � is considered to be open as well (it satisfies
the conditions in a null sense).
Proof :
1. It suffices to show that the intersection of two open sets is open, since the
extension to finitely-many will follow by induction (but note that induction
does not hold for infinitely-many sets, even if there are countably-many).
Let A, B ⊂ X be open sets of X and set C = A ∩ B. If C = � then we are done,
for the empty set is open. Otherwise, let c ∈ C. Since c ∈ A and A is open,
there exist an r1 > 0, such that
Br1 (c) ⊂ A.
Likewise, since c ∈ B and B is open, there exist an r2 > 0, such that
Br2 (c) ⊂ B.
Set r = min(r1 , r2 ). Then,
Br (c) ⊂ A and Br (c) ⊂ B hence Br (c) ⊂ C,
proving that C is open.
c
A B
Every point a ∈ A belongs to at least one open set A , therefore there exists
an r > 0 such that Br (a) ⊂ A ⊂ A.
22 Chapter 1
a x
4. We have already seen that every open ball is open and that any union of open
sets is open. Thus, every union of open balls in open. It remains to show that
every open set can be represented as a union of open balls. By definition, to
every point x in a open set A corresponds an open ball Br(x) (x) ⊂ A. Then,
A = � {x} ⊂ � Br(x) (x) ⊂ A,
x∈A x∈A
n
An infinite intersection of open sets is not necessarily open. Take for example
X = R with the standard metric. For every integer n, the open ball B1�n (0) =
(−1�n, 1�n) is open, however
∞ 1 1
� �− , � = {0}
n=1 n n
is not open. There is no r > 0 for which Br (0) ⊂ {0}.
Proof : Let A be a non-empty set in a discrete metric space (X, d). Then,
A = � B1�2 (a).
a∈A
. Exercise 1.11 Show, by example, that it is not generally true that an infinite
union of closed sets is closed.
Comments:
(a) Being closed does not mean not being open. The set [0, 1) in R is neither
open nor closed.
(b) By duality, a set is open if and only if its complement is closed.
(c) In every metric space (X, d), the sets X and � are both open and closed
(one sometimes uses the term clopen to designate the property of being
both open and closed).
(d) A metric space is called connected (9*:8) if X and � are the only sets
that are both open and closed. The reason for this terminology is the fol-
lowing: suppose that a non-trivial set A is both open and closed, then X is
the disjoint union of two open sets, A and Ac , i.e., you can disconnect it
into two separated open sets. Discrete spaces are the extreme example of a
non-connected set.
(e) For every x ∈ X the singleton (0&$*(*) {x} is a closed set, since for every
y ∈ {x}c ,
Bd(x,y) (y) ⊂ {x}c .
(f) By Proposition 1.26, the union of every finite collection of points is closed
as well; it is not generally true, however, that a countable union of points is
closed.
24 Chapter 1
(g) Every closed ball B̂r (a) is closed. Indeed, if x ∈ (B̂r (a))c then Bd(x,a)−r (x) ⊂
(B̂r (a))c .
r
a x
(h) In a set endowed with the discrete metric, every subset is both open and
closed. This follows from the fact that every set is open.
Examples:
(a) Consider X = R2 with the Euclidean metric and let A = S 1 , the unit circle.
Then, A is closed because every point not in S 1 is the center of a ball not in
S 1.
(b) Let X = C([a, b]), let h1 , h2 ∈ X with h1 < h2 and let
B" ( f ) = {g ∈ C([a, b]) ∶ ∀x ∈ [a, b] f (x) − " < g(x) < f (x) + "}
That is, a closed set is a set that contains all its limit points.
xn ∈ C and lim xn = x.
n→∞
and equivalently,
In particular,
Examples:
(a) Consider X = C([a, b]) endowed with the max-norm and let
As explained above, sets in metric spaces are not necessarily either open or closed.
Every set, however, has a largest open set contained in it, and a smallest closed set
containing it.
(it is the largest open subset of A). Its closure (9), A, is the intersection of all
the closed sets that include A,
Proposition 1.29 The interior of a set is open and the closure of a set is closed.
Proof : Any union of open sets is open and any intersection of closed sets is closed.
n
Also,
Proof : Immediate from the definitions of U ○ being the maximal open set con-
tained in U and C being the minimal closed set containing C. n
The following are immediate consequences of the definitions of the interior and
the closure:
Corollary 1.33 For every set A, the open sets contained in A coincide with the
open sets contained in A○ and the closed sets containing A coincide with the closed
sets containing A. As a result, the operations of interior and closure are idempo-
tent. For every set A,
(A○ )○ = A○ and A = A.
Proof : The first part is an immediate corollary of the lemma. For the second part,
A○ = �{U is open ∶ U ⊂ A}
= �{U is open ∶ U ⊂ A○ }
= (A○ )○ ,
Metric Spaces 29
and
A = �{C is closed ∶ A ⊂ C}
= �{C is closed ∶ A ⊂ C}
= A.
n
We have seen that the property of being closed is related to limits being in that set.
The following proposition relates the closure of a set to limits:
Proposition 1.34 The closure of a set A is the set of points that are limits of
sequences in A,
A = {x ∈ X ∶ ∃xn ∈ A such that xn → x} .
Proof : Define
B = {x ∈ X ∶ ∃xn ∈ A such that xn → x} .
We need to show that A = B, i.e., that A ⊂ B and B ⊂ A.
Let x ∈ B. By definition, there exists a sequence xn ∈ A converging to x. Since
A ⊂ A, xn is a sequence in A. Since A is closed, x ∈ A, implying that B ⊂ A.
In the other direction, we first assert that B is closed. Let (bn ) be a sequence in B
converging to x ∈ X. By the definition of B, there exists for every n ∈ N a sequence
in A converging to bn , and in particular, an an ∈ A, such that
1
d(bn , an ) < .
n
It follows that
d(x, an ) ≤ d(x, bn ) + d(bn , an ) → 0.
By definition, x ∈ B, and by Proposition 1.27, B is closed.
Clearly, every point in A belongs to B (take the trivial sequence). Thus, B is a
closed set containing A, and by Lemma 1.32, A ⊂ B. n
Proof : The boundary is the intersection of two closed sets, A, and (A○ )c , hence it
is closed. n
This is not true in a general metric space. For example, in the case of a discrete
space,
@B1 (x) = B1 (x) � B1 (x) = � ≠ S1 (x),
where we used the fact that every set is both open and closed. ▲▲▲
Example: Consider the space X = C([0, 1]) endowed with the maximum norm,
and consider the set
A = B.
Let now f ∈ A and let r > 0. Since f is continuous, there exists a pair of points
x < y, such that f (y) > f (x) − r�2. Let g ∈ C([0, 1]) be any function satisfying
Then,
f + g ∈ Br ( f ),
however
( f + g)(x) < f (y) + r�2 + g(y) − r�2 = ( f + g)(y),
i.e., f + g ∈� A. Thus, for every f ∈ A and every r > 0, the open ball Br (x)
contains elements not in A, namely, A does not have any non-empty open subset.
We conclude that
A○ = �.
Finally,
@A = A � A○ = B.
▲▲▲
32 Chapter 1
. Exercise 1.15 Let A, B be subsets of a metric space (X, d). Prove that
1. A ∪ B = A ∪ B.
2. A ∩ B ⊂ A ∩ B.
3. If A is open then (@A)○ = �.
4. A is closed if and only if @A ⊂ A.
5. A is open if and only if @A ∩ A = �.
. Exercise 1.16 Let A be a set in a metric space (X, d). Show that its boundary
@A coincides with the set of points x, such that every open ball with center at x
intersects both A and Ac .
Consider now a metric space (X, d). Any Y ⊂ X is a metric space with the induced
metric. Note, however, that a set A ⊂ Y can be open in the metric space (Y, d), but
closed in the metric space (X, d) (e.g., the set Y itself is always open in (Y, d), but
could be closed in (X, d)).
Proposition 1.37 Let (X, dX ) be a metric space and let Y ⊂ X; we denote the
induced metric on Y by dY . A set A ⊂ Y is open in (Y, dY ) if and only if it is the
intersection of Y and a set that is open in (X, dX ). The same applies if we replace
“open” by “closed”.
A = � Br(a)
Y
(a) = � (Y ∩ Br(a)
X
(a)) = Y ∩ � � Br(a)
X
(a)� ,
a∈A a∈A a∈A
Definition 1.38 Let (X, d) be a metric space. A set A ⊂ X is called dense (4&57)
if
A = X.
That is, f is continuous at a if for every open ball B" ( f (a)) ⊂ Y there exists an
open ball B (a) ⊂ X whose image under f is contained in B" ( f (a)). A function
is called continuous if it is continuous at all points.
f
f (a) f (B (a))
a
Examples:
(a) Every constant function is continuous.
(b) Let (X, d) be an arbitrary metric space and let a ∈ X be an arbitrary point.
The function f ∶ x � d(x, a) is a continuous mapping f ∶ (X, d) → (R, � ⋅ �)
because for every " > 0 take = ". Then d(x, z) < implies that
(c) Every function defined on a discrete space and whose range is any metric
space is continuous. Indeed, for every " > 0 take = 1�2. Then,
(This notion of continuity is attributed to Heine, unlike the "- notion, which is
attributed to Cauchy.)
Proof :
∀" > 0 ∃ > 0 such that x ∈ B (a) implies f (x) ∈ B" ( f (a)).
Since xn → a,
2. Suppose that xn → a implies f (xn ) → f (a). Suppose that f were not con-
tinuous at a: then
1
∃" > 0 such that ∀n ∈ N ∃xn ∶ d(xn , a) < and ⇢( f (xn ), f (a)) ≥ ".
n
The sequence xn converges to a, however the sequence f (xn ) does not con-
verge to f (a), contradicting the assumption.
36 Chapter 1
Examples:
(a) Let (X, � ⋅ �) be a normed space and let B = B1 (0) be the unit ball centered
at the origin. The indicator function (;1**7/% %*781&5%)
�
�
�1 x∈B
B (x) = �
�
� x ∈� B
�0
is not continuous. We will show it by constructing a converging sequence
xn → x for which f (xn ) →
� f (x).
Let x be a unit vector; by definition it is not in B, i.e., f (x) = 0. Take the
sequence
1
xn = �1 − � x ∈ B.
n
Then,
lim xn = x however lim f (xn ) = 1 ≠ f (x).
n→∞ n→∞
E( f ) = f (x0 )
In particular,
(c) Let X = C([−1, 1]) and let A ⊂ X be the subset of functions that are di↵er-
entiable on [−1, 1]. Consider the function D ∶ A → R defined by
D( f ) = f ′ (0).
Metric Spaces 37
1
fn (x) = sin nx.
n
and set f = 0. Then
whereas
�D( fn ) − D( f )� = 1 →
� 0.
Theorem 1.42 Let f ∶ (X, d) → (Y, ⇢) be a function between two metric spaces.
Then the following three statements are equivalent:
1. f is continuous.
2. The pre-image of every set open in Y is a set open in X ( f pulls back (+:&/
9&(!-) open sets into open sets).
3. The pre-image of every set closed in Y is a set closed in X ( f pulls back
closed sets into closed sets).
Proof :
1. The equivalence between Property 2 and Property 3 follows from the com-
mutativity between the pre-images and set-theoretic operations. Thus, if the
38 Chapter 1
f −1 (A)
A
f
x
f (x)
Comment: Continuous function not necessarily map open sets into open sets. For
example the function f ∶ R → R defined by f ∶ x � 0 maps the open set (0, 1) into
the closed set {0}. Functions that map open sets into open sets are called open
maps (;&(&;5 ;&8;3%) (and likewise, functions that map closed sets into closed
sets are called closed maps (;&9 ;&8;3%)). Open maps, on the other hand are
not necessarily continuous.
(g ○ f )−1 = f −1 ○ g−1 .
Then, for every open A ⊂ X3 , g−1 (A) is open in X2 and f −1 (g−1 (A)) is open in X1 ,
proving that g ○ f is continuous.
Alternative proof using Heine’s characterization: Let xn → a in X1 . Then, f (xn ) →
f (a) in X2 and g( f (xn )) → g( f (a)) in X3 . n
is continuous.
Proposition 1.47 Let (X, d) and (Y, ⇢) be metric spaces and let f ∶ X → Y be
continuous. Let X′ ⊂ X be non-empty. Then,
f �X′ ∶ X′ → Y
Proposition 1.48 Let (X, d) and (Y, ⇢) be metric spaces and let fn ∶ X → Y be a
sequence of continuous functions satisfying
Since this holds for every n, and since the right-hand side tends to zero as n → ∞
we obtain the desired result. n
. Exercise 1.24 Let A ⊂ X. The indicator function (;1**7/ %*781&5) of the the
�
set A is defined as
�
�1 x ∈ A
A (x) = �
�
�0 x ∈� A.
�
Show that the points of discontinuity of A coincide with @A.
. Exercise 1.26 Let F, G be sets in a metric space X and let Y be a metric space.
Given two functions f ∶ F → Y and g ∶ G → Y such that f = g on F ∩ G, we define
�
the function
�
� f (x) x ∈ F
( f ∧ g)(x) = �
�
�g(x) x ∈ G.
�
1. Prove that if F, G are closed in X and f, g are continuous, then f ∧ g is
continuous.
2. Prove that this is also correct if F, G are open in X.
3. Show that this is not necessarily the case if F is open and G is closed.
42 Chapter 1
Comments:
(a) A function f ∶ Rk → Rm gets for input a k-tuple of real numbers and returns
an m-tuple of real numbers. We can represent it as
(c) When m = 1, the function is called a scalar function (;*9-82 %*781&5). Its
graph is a surface in Rm+1 .
(d) When k = 1, the function
Its image is the unit circle. Note that if the domain is [0, 4⇡] or the whole of R,
the image is still the unit circle. What about its graph? It is the set
j (A) = R × ⋅ ⋅ ⋅ × R ×A × R × . . . R
⇡−1
��� � � � � � � � � �� � � � � � � � � � � ��� � � � � � ��� � � � � � �
j − 1 times m − j times
is open in Rm .
Now suppose that f ∶ Rk → Rm is continuous; then f j = ⇡ j ○ f is continuous as
a composition of continuous functions. Conversely, suppose that all the f j are
continuous, and let xn = (x1n , . . . , xkn ) ∈ Rk converge to x ∈ Rk . Then
lim f j (xn ) = f j (x) for all j = 1, . . . , m,
n→∞
hence
lim ( f1 (xn ), . . . , fm (xn )) = ( f1 (x), . . . , fm (x)).
n→∞
n
1.4 Compactness
1.4.1 Definition and basic properties
In this section, we study an important property that certain metric spaces (or sub-
sets of) possess: compactness. As we will see, compactness, is a certain measure
of “smallness”.
44 Chapter 1
Comment: The compactness of a set requires two conditions: (i) that every se-
quence has a converging subsequence, and (ii) that the limit belongs to that set.
The second conditions is superfluous when the set is the entire space.
Comment: Note that the compactness of a set is a property pertinent only to the
set, whereas openness/closedness is property of a set in relation with the entire
space.
. Exercise 1.27 Let (X, d) be a metric space and let Y ⊂ X with the subspace
metric dY . Prove that a set A ⊂ Y is compact as a subset of Y if and only if it is
compact as a subset of X.
. Exercise 1.28 Let (X, d) be a metric space and xn a sequence that converges
to a limit x. Prove that the set {x} ∪ {xn ∶ n ∈ N} is compact.
. Exercise 1.29 Consider the space {0, 1}N (infinite binary sequences) with the
metric
d(x, y) = 2min{i ∶ xi ≠yi } .
(First prove that it is indeed a metric.) Prove that this space is compact. Hint:
show first that convergence in this space amounts to component-by-component
convergence.
Examples:
(a) Every singleton in a metric space is compact.
Metric Spaces 45
Lemma 1.53 In a metric space (X, d), a set containing an infinite ↵-discrete set
for some ↵ > 0 is not compact.
∀m ≠ n d(xm , xn ) ≥ ↵.
If xn has a subsequence xnk converging to a limit x, then there exist k ≠ ` such that
Comment: The other direction is not true: a set may fail to contain an ↵-discrete
set for every ↵ > 0 and yet not be compact. The segment (0, 1) ⊂ R is an example.
Proposition 1.54 A compact set in a metric space is both bounded and closed.
46 Chapter 1
Proof : Closedness: Let K be a compact set in a metric space (X, d). By defini-
tion, every sequence xn ∈ K has a subsequence that converges to a point in K. In
particular, if xn is a sequence converging to a point x ∈ X, then by the uniqueness
of the limit, x ∈ K. It follows from Proposition 1.27 that K is closed.
Boundedness: Suppose, by contradiction, that K was not bounded. We will show
that it contains a 1-discrete sequence, hence it is not compact. Take an arbitrary
point x1 . Since K is not bounded, there exists a point x2 ∈ K � B1 (x1 ). Inductively,
there exists for every n a point
n−1
xn ∈ K � � B1 (x j ),
j=1
Comment: One often confuses between “compact” and “bounded and closed”. In
general, the implication is only uni-directional, although we will soon see situa-
tions in which there is indeed a correspondence between the two. An elementary
counter-example is the segment (0, 1), which is closed (as a space) and bounded,
but not compact.
Proposition 1.55 If (X, d) is a compact metric space, then every closed subset of
X is compact.
Corollary 1.56 In a compact metric space closedness and compactness are the
same.
. Exercise 1.31 Prove that in a metric space in which all the closed balls are
compact, the compact sets coincide with the sets that are closed and bounded.
Metric Spaces 47
(Note that we write inf because we can’t guarantee the existence of a minimum.)
Since A is compact, the sequence xn has a subsequence xnk with limit x ∈ A, Then,
d(x, ynk ) ≤ d(x, xnk ) + d(xnk , ynk ) → 0,
from which follows that ynk → x. Since B is closed, x ∈ B, contradicting the
disjointness of A and B. n
Uc
U
48 Chapter 1
. Exercise 1.32 For a countable sequence metric spaces (Xn , dn ) define the prod-
uct space
∞
X = � Xn = {(x1 , x2 , . . . , ) ∶ x1 ∈ X1 , x2 ∈ X2 , . . . }
n=1
with the metric ∞
dn (xn , yn )
d(x, y) = � 2−n
1 + dn (xn , yn )
.
n=1
Prove that if each Xn is a compact space, then the product space X is compact.
Hint: think of Cantor’s diagonalization.
Let {A↵ } be a covering of X. One may ask whether we could still cover X with
a smaller collection of subsets. Consider for example the case where X = R; the
countable collection of subsets
{(n − 1, n + 1) ∶ n ∈ Z}
is an open covering of R. The omission of any of those (n − 1, n + 1) would
fail to cover the point x = n; that is, this open covering does not have a strict sub-
covering, not to speak of a finite sub-covering. As the main theorem below shows,
compactness can be defined alternatively as “every open covering can be reduced
to a finite sub-covering”.
Lemma 1.61 Let (X, d) be a compact metric space, and let F an open covering
of X (F is a collection of open subsets of X). Then, there exists an " > 0 such that
every open ball of radius " is contained in one of the sets in F . That is,
Comment: Given an open covering, the supremum over all such " is called the
Lebesgue number (#⌥"- 952/) of the covering.
Suppose that the desired property does not hold. That is,
1 1 1
d(y, x) ≤ d(y, xn ) + d(xn , x) < + < ,
n 2m m
i.e., y ∈ B1�m (x), which implies that
Proof : Suppose that the space was not totally bounded. Then, there exists an
" > 0 such that no finite collection of balls of radius " covers X. As a result, we
can construct inductively an "-discrete sequence, proving that X is not compact.
n
Lemma 1.64 Let xn be a sequence in a metric space (X, d). If xn doesn’t have a
converging subsequence, then the set
{xn ∶ n ∈ N}
is closed.
Proof : Denote A = {xn ∶ n ∈ N}. Let x ∈� A. Since x is not a partial limit of the
sequence xn , it is not true that
∀" > 0 ∀n0 ∈ N ∃k > n0 such that d(xk , x) < ".
That is,
∃" > 0 ∃n0 ∈ N such that ∀k > n0 d(xk , x) ≥ ".
Since x ∈� A, there exists an
r = min{d(xn , x) ∶ n ≤ n0 } > 0.
Then,
∀n ≤ n0 d(xn , x) > r and ∀n > n0 d(xn , x) > ",
i.e., Bmin(r,") (x) ⊂ Ac , proving that Ac is open, i.e., that A is closed. n
1. X is compact.
2. Every open covering of X has a finite sub-covering.
3. Every collection of closed sets {F↵ }↵∈I has the property that if the intersec-
tion of every finite sub-collection is not empty, then the intersection of the
entire collection is not empty.
Metric Spaces 51
By duality.
c c
�� F ↵ �
c
=� �⇒ ∃ finite J ⊂ I such that � � F↵ �
c
= �.
↵∈I ↵∈J
We next show that Property 3 implies Property 1. Suppose that Property 3 holds,
and let xn be a sequence. We need to show that it has a converging subsequence.
Suppose, by contradiction, that it doesn’t, and consider the sets
An = {xk ∶ k ≥ n}.
By Lemma 1.64, the sets An are closed; they are also decreasing, and have have
the property that every finite sub-collection has a non-empty intersection, as for
every finite set J ⊂ N,
� An = Amax(J) .
n∈J
By Property 3, there exists an
∞
x ∈ � An .
n=1
This means that x repeats infinitely many times in the sequence xk , hence x is a
partial limit, contradicting the assumption. —12h(2019)—
It remains to show that Property 1 implies Property 2. Let X be compact and let
U be an open covering. By Lemma 1.61 there exists an " > 0 such that every
open ball of radius " is contained in an element of U , namely,
∀x ∈ X ∃V x ∈ U ∶ B" (x) ⊂ V x .
52 Chapter 1
Then,
n
� V xi = X,
i=1
Example: A non-example: the space X = (0, 1) is not compact, yet for every
" > 0 we can cover (0, 1) with a finite number of segments of size " (this space is
totally-bounded). However, the open covering of (0, 1),
Likewise, every k ∈ N,
nk
∃x1k , . . . , xnk k such that X = � B1�k (xik ).
i=1
The set A is dense in X, because for every x ∈ X and every " > 0, take k > 1�".
Since
nk
X = � B1�k (xik ),
i=1
there exists an xik such that d(xik , x) < 1�k < ". n
. Exercise 1.35 Show that the finite product space of compact spaces is com-
pact: Let (X1 , d1 ), . . . , (Xn , dn ) be metric spaces and consider the product space
n
X = � {(x1 , . . . , xn ) ∶ x j ∈ X j ∀ j} ,
i=1
with
d(x, y) = max di (xi , yi ).
j=1,...,n
(1) Prove that (X, d) is a metric space. (2) Prove that if the (Xi , di ) are compact
then (X, d) is compact.
lim xnk = x ∈ K.
k→∞
Since f is continuous,
. Exercise 1.37 Let F ⊂ X be a subset in a metric space. Prove that the function
X → R defined by x � d(x, F) is Lipschitz continuous.
∃" > 0 ∶ ∀ > 0 ∃x, y ∶ d(x, y) < and ⇢( f (x), f (y)) ≥ ".
In particular,
∃" > 0 ∶ ∀n ∈ N ∃xn , yn ∶ d(xn , yn ) < 1�n and ⇢( f (xn ), f (yn )) ≥ ".
Since X is compact, there exists a subsequence xnk , ynk such that xnk → x and
ynk → y. For every n,
hence,
d(x, y) ≤ lim inf (d(x, xnk ) + d(xnk , ynk ) + d(ynk , y)) = 0,
k→∞
which is a contradiction. n
Examples:
(a) The identity map from (Rn , �⋅� p ) to (Rn , �⋅�q ) is a homeomorphism, because
open balls with respect to the � ⋅ � p metric are open sets (although not balls)
with respect to the � ⋅ �q metric, and vice versa.
(b) Every two open segments (a, b) and (c, d) on the line are homeomorphic,
because the linear mapping x → c + (d − c)(x − a)�(b − a) is a homeomor-
phism.
(c) Every open segment (a, b) is homeomorphic to the entire real line because
it is homeomorphic to the open segment (−⇡�2, ⇡�2) and the latter is home-
omorphic to the real line though the homeomorphism x � tan x.
Proof : This is an immediate corollary on the fact that the pre-image of an open set
under f or f −1 is open and the image of a compact set under f or f −1 is compact.
n
58 Chapter 1
Examples:
Definition 1.77 Two metric spaces (X, d) and (Y, ⇢) are called isometric (.**9)/&'*!)
if they are homeomorphic, and there exists a homeomorphism f ∶ X → Y which is
distance-preserving: for all x, y ∈ X,
. Exercise 1.38
. Exercise 1.41 Prove that the following spaces are homeomorphic (using the
natural metrics):
1. R2 .
2. The unit disc: D2 = {(x, y) ∶ x2 + y2 < 1}.
3. The unit square: Sq2 = {(x, y) ∶ max(�x�, �y�) < 1}.
4. The unit sphere in R3 less one point, e.g.
S 2 � � = {(x, y, z) ∶ x2 + y2 + z2 = 1} � {(0, 0, 1)}.
m 1�2
d(x, 0) = �� �x � � i2
< M.
i=1
In particular,
�xi � < M ∀i = 1, . . . , m.
Corollary 1.79 The closed unit ball B̂1 (0) in Rm is compact, and so is the unit
sphere S1 (0).
Definition 1.80 Let V be a vector space and let � ⋅ � and � ⋅ �′ be norms on V. The
norms are called equivalent (;&-&8:) if there exist constants c1 , c2 > 0, such that
for all v ∈ V,
c1 �v� ≤ �v�′ ≤ c2 �v�.
Another way to state it is that the mapping Id ∶ (V, � ⋅ �) → (V, � ⋅ �′ ) is Lipschitz
and so is its inverse (it is bi-Lipschitz).
where ei is the i-th unit vector. Using the triangle inequality and the Cauchy-
Schwarz inequality,
m m 1�2 m 1�2 m 1�2
�x� ≤ � �xi ��ei � ≤ �� xi � �� �ei � �
2 2
≤ �� �ei � �
2
�x�2 .
i=1 i=1 i=1 i=1
Corollary 1.83 Let � ⋅ � be a norm on Rm . Then, all the closed and bounded sets
are compact.
Proof : Let A ⊂ Rm be closed and bounded. Since the identity map is a homeo-
morphism from (Rm , � ⋅ �) to (Rm , � ⋅ �2 ) mapping bounded sets to bounded sets, it
follows that Id(A) = A is closed and bounded in (Rm , � ⋅ �2 ), hence compact. Fi-
nally, using again the fact that the identity map is a homeomorphism, A is compact
in (Rm , � ⋅ �). n
Proof : Let ai be a basis for V and consider the linear map T ∶ V → Rm , given by
m
T �� xi ai � = (x1 , . . . , xm ).
i=1
�x�m = �T −1 (x)�.
Finally, for x, y ∈ Rm ,
n
Metric Spaces 63
Proof : It follows from the fact that (V, � ⋅ �) are (V, � ⋅ �′ ) are isometric to Rm
endowed with two norms and that every two norms on Rm are equivalent. n
Corollary 1.86 Let (V, � ⋅ �) be a finite-dimensional normed space. Then, all the
closed and bounded sets are compact.
Proof : It follows from the fact that (V, � ⋅ �) is isometric to a normed space in
which this property holds. n
n→∞ n→∞ 0
however
lim � fn − 0�∞ = lim sup �xn − 0� = 1,
n→∞ n→∞ 0≤x≤1
so the sequence converges to zero in one norm and not in the other, implying that
the norms are not equivalent. ▲▲▲
i.e.,
∀x ∈ X ∀" > 0 ∃N ∈ N ∶ ∀n > N ⇢( fn (x), f (x)) < ".
It is said to converge uniformly (%&&: %$*/" ;&21,;/) if N can be chosen inde-
pendently of x; that is,
∀" > 0 ∃N ∈ N such that ∀m, n > N sup � fn (x) − fm (x)� < ".
x∈X
∀" > 0 ∃N ∈ N such that ∀m, n > N � fn (x) − fm (x)� < ".
It follows from Cauchy’s criterion for sequences in R that the sequence fn (x) has
a limit, which we denote by f (x).
It remains to prove that the convergence is uniform. Given " > 0, there exists an
N ∈ N such that for every m, n > N and for every x ∈ X,
Examples:
(a) The functions between the discrete spaces N and {0, 1} defined by fn ( j) =
j,n converge to the constant function f ∶ j � 0 pointwise but not uniformly.
In fact, one can show that a sequence of functions fn into a discrete space
converges uniformly to f if and only if fn coincides with f eventually.
(b) The sequence of functions fn ∶ [0, 1) → [0, 1) (with the standard metric)
defined by fn (x) = xn converges to f (x) = 0, pointwise, but not uniformly,
because for every n,
. Exercise 1.42 Let (X, d) be a metric space and let Y be an non-empty set
endowed with the discrete metric. Suppose that a sequence of functions fn ∶ X → Y
converges to a function f ∶ X → Y uniformly. Show that there exists an N ∈ N
such that for all n > N, fn ≡ f .
Consider the sequence of functions fn (x) = xn on the closed interval [0, 1]. Al-
though each of the fn is continuous, this sequence converges pointwise to the
�
discontinuous function
�
�0 0 ≤ x < 1
f (x) = �
�
�1 x = 1.
�
The following theorem shows that this can’t happen if the convergence is uniform.
Theorem 1.89 Let fn be a sequence of continuous functions from (X, d) to (Y, ⇢),
converging uniformly to a limit f ; then, the limit is continuous. Moreover, if all
the fn are uniformly continuous on X, then f is uniformly continuous on X.
Proof : Fix a point x ∈ X and let xm be a sequence converging to x. For every pair
of indexes n and m,
Let " > 0 be given. Because the fn converge to f uniformly, we can choose n
sufficiently large such that the first term is less than "�2. Having fixed n, there
exists an N such that for all m > N, the second term is less than "�2 (since fn is
Metric Spaces 67
continuous). To conclude, for all " > 0 there exists an N such that for all m > N,
⇢( f (xm ), f (x)) < ", i.e., f is continuous.
Assume next that the fn are uniformly continuous. For x, y ∈ X we write
Since fn converges uniformly to f , given " > 0, there exists an n such that the first
term is less than "�2. Since this fn is uniformly continuous, there exists a > 0
such that d(x, y) < implies ⇢( fn (x), fn (y)) < "�2, i.e., implies ⇢( f (x), f (y)) < ".
n
The importance of uniform convergence is exemplified in the following proposi-
tion:
Proposition 1.90 Let (X, d) and (Y, ⇢) be metric spaces and let fn , f ∶ X → Y. If
fn are continuous and converge uniformly to f , then for every sequence xn in X,
Proof : We have
The first term on the right hand side converges to zero by the uniform convergence
of fn , whereas the second term converges to zero by the continuity of f (which
results from the previous proposition). n —16h(2019)—
Definition 1.91 Let fn be a sequence of functions from a metric space (X, d) into
R (in fact, we only need the target to be a normed space). The series (9&)) ∑∞
n=1 fn
is said to converge uniformly to S if the sequence of partial sums,
n
S n = � fk
k=1
converges uniformly to S .
n
sin kx
S n (x) = �
k=1 k
1.1
for n = 2, 20, 200, 2000. By the Weierstraß M-test, the sequence S n converges
uniformly on [0, 2⇡]. Moreover, since each of the partial sums is a uniformly
continuous function, the limit is uniformly continuous.
Metric Spaces 69
1.5 1.5
1 1
0.5 0.5
0 0
−0.5 −0.5
−1 −1
−1.5 −1.5
0 2 4 6 0 2 4 6
n=2 n=20
1.5 1.5
1 1
0.5 0.5
0 0
−0.5 −0.5
−1 −1
−1.5 −1.5
0 2 4 6 0 2 4 6
n=200 n=2000
▲▲▲
Since the right-hand side is the tail of a convergent series, there exists for every
" > 0 an N ∈ N, such that for all m, n > N,
Proof : The integrals exists because the fn and their limit f are continuous (The-
orem 1.89), hence Riemann integrable. By the linearity of the integral, for every
n,
a a a
≤�
b
� f (x) − fn (x)� dx
a
≤�
b
sup � f (y) − fn (y)� dx
a a≤y≤b
Comments:
(a) We need the first condition, because the non-convergent sequence fn (x) = n
satisfies the second condition with g = 0.
(b) Since we have not assumed the fn to be continuously di↵erentiable, we can’t
assume g to be continuous, and not even integrable. This prevents us from
defining f (x) = ∫a g(y) dy, and then show that fn converges to f uniformly.
x
sup � fm (x) − fn (x)� ≤ (b − a) sup � fm′ (⇠) − fn′ (⇠)� + � fm (c) − fn (c)�.
x ⇠
Since fn′ converges uniformly on (a, b), given " > 0, there exists an N1 ∈ N such
that for all m, n > N1 ,
Likewise, since fn (c) converges, there exists an N2 ∈ N such that for all m, n > N2 ,
i.e., fn satisfies Cauchy’s criterion for uniform convergence; we denote the limit
by f . Since the fn are di↵erentiable, and in particular continuous, f is continuous.
72 Chapter 1
whereas at h = 0,
�'n (0) − 'm (0)� = � fn′ (0) − fm′ (0)� ≤ sup � fn′ (⇠) − fm′ (⇠)�.
⇠∈X
Thus, given " > 0 there exists an N ∈ N such that for all m, n > N,
sup �'n (h) − 'm (h)� ≤ sup � fn′ (⇠) − fm′ (⇠)� < ",
h ⇠∈X
proving that 'n satisfies Cauchy’s criterion, hence converges to ' uniformly. This
concludes the proof. n
(2) Let fn be a sequence of di↵erentiable functions on (a, b) such that the series
of derivatives converges uniformly on (a, b), and there exists a point c ∈ (a, b) at
which the series ∑∞n=1 fn converges, then the series converges uniformly on (a, b)
and ′
∞ ∞
�� fn (x)� = � fn′ (x).
n=1 n=1
Comment: There is no requirement that fn (x) and fn (y) be monotone in the same
direction.
Proof : Suppose, by contradiction, that the convergence was not uniform. Then, it
is not true that
i.e.,
∃" > 0 ∶ ∀k ∈ N ∃nk > k ∃xk ∈ X ∶ � fnk (xk ) − f (xk )� ≥ ",
Since the sequence fn (x) is monotone for every x, it follows that
Putting it together,
∃" > 0 ∶ ∀k ∈ N ∃nk > k ∃xk ∈ X ∶ ∀m � fm (xk )− f (xk )� ≥ " for large enough k.
Since X is compact, the sequence xk has a converging subsequence xkl with limit
x. Since fm and f are continuous, the limit l → ∞ may be taken, yielding
Proof : Here is another proof that uses the “covering version” of compactness.
Since the sequence fn converges pointwise and monotonically to f , then there
exists for every " > 0 and every point x a number N(x, "), such that
� f (y) − f (x)� < � fN(x,") (y) − fN(x,") (x)� < ∀y ∈ B (x,") (x).
" "
and
3 3
The union of all B (x,") (x) is an open covering of X. Since X is compact, there
exists a finite sub-covering,
m
X = �B (xi ,") (xi ).
i=1
Metric Spaces 75
Let now N = maxN(xi ,") (here we exploit the finiteness). Since every y ∈ X is
contained in one of these balls, say the k-th ball, then for all n > N (here we
exploit the monotonicity),
� fn (y) − f (y)� ≤ � fn (y) − fn (xk )� + � fn (xk ) − f (xk )� + � f (xk ) − f (y)� < ",
� f � = max � f (x)�,
x∈K
We have already seen that closed and bounded sets in C(K) are not necessarily
compact. It turns out that if closedness and boundedness are supplemented with
another property, sets in C([0, 1]) are compact.
∀" > 0 ∃ > 0 ∶ ∀ f ∈ A ∀x, y ∶ d(x, y) < � f (x) − f (y)� < ".
That is, all the f ∈ A are uniformly continuous, and the same modulus of continuity
(") applies for all f ∈ A.
76 Chapter 1
Take then the sequence fn (x2 ); by the same argument, there exists a subsequence
(1)
(2) (1)
fn of fn converging at x2 (and by inheritance also at x1 ). We proceed induc-
(k)
tively, constructing a sequence of subsequences, fn , which for given k converge
at x1 , �, xk .
The following picture is helpful:
f1 f2 � fn �
� �
(1) (1) (1)
f1 f2 fn converges at x1
� �
(2) (2) (2)
f1 f2 fn converges at x1 , x2
� � � �
� �
(k) (k) (k)
f1 f2 fn converges at x1 , . . . , xk .
(n)
So far, we have not used equicontinuity. We will use it now to show that fn
converges uniformly on K. Let " > 0 be given, and take > 0 according to the
definition of equicontinuity. Consider the collection of open sets
U = {B (xk ) ∶ k ∈ N}.
As the sequence fn (xk ) converges for all k, there exists for each j an N j , such
(n)
N = max N j .
p
j=1
Let x ∈ K. Since the finite sets of open balls cover K, there exists a j such that
x ∈ B (xk j ).
+ � fm (xk j ) − fm (x)�
(m) (m)
where in the first and the third term we used the definition of . It follows that for
every " > 0 there exists an N such that for all m, n > N
� fn − fm �∞ < ".
(n) (m)
(n)
By Cauchy’s criterion, the sequence fn converges uniformly on K (and its limit
is continuous). Finally, since A is closed, the limit is in A, hence A is compact.
We leave the other direction as an exercise. n
78 Chapter 1
Comment: Note that we used the closedness only in the last step. Without clos-
enedess, we still have that if A ⊂ C(K) is bounded and equicontinuous, then every
sequence in A has a subsequence converging uniformly; the limit is in C(K) but
not necessarily in A.
▲▲▲
xn → x ⇒ fn (xn ) → f (x)
Fn (x) = �
x
fn (y) dy.
a
Show that the sequence (Fn ) has a subsequence that converges uniformly on
[a, b].
Metric Spaces 79
1.5 Completeness
1.5.1 Definitions and properties
Definition 1.100 (Cauchy sequence) Let (X, d) be a metric space. A sequence
of points xn in X is called a Cauchy sequence (*:&8 ;9$2) if there exists for every
" > 0 an N such that d(xn , xm ) < " for all m, n > N.
On the other hand, a Cauchy sequence does not necessarily converge. Take the
sequence xn = 1�n in (0, 1]. Then,
Proof : Suppose that the Cauchy sequence xn has a subsequence xnk that converges
to x. Let " > 0 be given. By the Cauchy property,
Let k be such that k > K and nk > N. Then, for every n > N,
d(xn , x) ≤ d(xn , xnk ) + d(xnk , x) < "�2 + "�2.
n
Definition 1.102 (Complete metric space) A metric space is called complete (.-:)
if every Cauchy sequence in X converges.
—18h(2019)—
Examples:
(a) R is a complete metric space (elementary calculus course).
√ metric space because the sequence of finite decimal
(b) Q is not a complete
approximations of 2 is a Cauchy sequence but it has no limit in Q.
(c) Completeness should not be confused with closedness. The metric space
(Q, � ⋅ �) is closed (as every metric space).
(d) If (X, d) is a complete metric space and Y ⊂ X, then (Y, d) is a complete
metric space if and only if Y is closed in X.
(e) Every compact metric space is complete (a consequence of Proposition 1.101).
(f) A complete normed space is called a Banach space; a complete inner prod-
uct space is called a Hilbert space.
Proof : We have already seen that C(K) is a normed space, hence a metric space.
Let fn be a Cauchy sequence in C(K), i.e.,
∀" > 0 ∃N ∶ ∀m, n > N sup � fn (x) − fm (x)� < ".
x∈K
This is precisely Cauchy’s criterion for uniform convergence, that is, fn converges
uniformly, and its limit is in C(K). n
. Exercise 1.48 Prove that a metric space (X, d) is complete if and only if for
every decreasing sequence of closed balls,
. Exercise 1.49 This exercise shows that the condition rn → 0 in the previous
exercise was necessary. Let X = N, and define
�
�
�0 m=n
d(m, n) = �
�
�1 + m+n m ≠ n.
.
�
1
. Exercise 1.50 Let (X, d) be a metric space and D ⊂ X a dense set. Show that
X is complete if and only if every Cauchy sequence in D converges in X.
. Exercise 1.52 Prove that the following spaces are Banach spaces:
Proof : The first task is to identify the natural candidate for the completion (X̂, D).
Since the “holes” in (X, d) are detected by Cauchy sequences that do not converge,
we would like to define X̂ to be the “set of all limits of Cauchy sequences in X”.
The problem of course is there there are no such limits... Thus, the only plausible
candidates for the elements of the completion would be the Cauchy sequences
themselves.
So let X̂ be temporarily the set of all Cauchy sequences in X. How would we then
define the distance between two Cauchy sequences (xn ) and (yn )? The natural
choice is
D((xn ), (yn )) = lim d(xn , yn ).
n→∞
Since both (xn ) and (yn ) are Cauchy sequence, the sequence of real numbers
(d(xn , yn )) is a Cauchy sequence, hence converges.
Metric Spaces 83
The nest step is to show that D is a metric on the space of Cauchy sequences.
Symmetry is obvious. For the triangle inequality, let (xn ), (yn ) and (zn ) be Cauchy
sequences in X, then
For a sequence (xn ), we denote its equivalence class by [(xn )]. Then, we redefine
X̂ to be the space of all equivalence classes of Cauchy sequences in X, endowed
with the metric
D([(xn )], [(yn )]) = lim d(xn , yn ).
n→∞
We have seen that this definition does not depend on the choice of representatives;
that is, if [(xn )] = [(zn )] and [(yn )] = [(wn )], then
We finally have a bone fide metric space which we will show to be a completion
of (X, d). For x ∈ X we define
◆(x) = [(x)],
where [(x)] stands for the equivalence class of the constant sequence (x, x, . . . ).
This map is distance preserving as
In particular, it is one-to-one. It remains to prove that its image is dense in (X̂, D).
Let [(xn )] be an element of X̂, and consider the sequence of elements of X̂, ◆(xk )
(it is a sequence of equivalence classes of constant sequences). Then,
A ∶ X̂ ∋ Image(◆) → Image( |) ∈ Y
Proof : The proof is constructive: let x0 be an arbitrary point in X and consider the
sequence xn defined inductively by
xn+1 = f (xn ).
Thus, given " > 0, choose N such that N �(1− ) d(x1 , x0 ) < " and for all n, m > N,
which is a contradiction. n
√ interval K = [0, 2p] into itself. Indeed, the mapping is monotonic, and
maps the
2p � 3p ≤ 2p. Thus, ∶ K → K, where K is a complete metric space.
We then show that this mapping is contractive: for x, y ∈ K,
(x) − (y) = ′
(⇠)(x − y),
′ (⇠)
√
where = 1�2 p + ⇠ < 1�2, and ⇠ is a point between x and y. It follows that
1
� (x) − (y)� ≤ �x − y�,
2
√
i.e., the mapping is contractive. Thus xn converges to the unique fixed point,
satisfying x = p + x, i.e.,
1 1�
x= + 1 + 4p.
2 2
▲▲▲
While nothing guarantees that x is a root of f , this suggested the following ap-
proach; start with some initial guess x0 , and then generate a sequence
f (x)
xn+1 = (xn ) where (x) = x −
f ′ (x)
with the hope that it converges to a root of f . This algorithm is called the Newton-
Raphson scheme.
88 Chapter 1
√
Example: Suppose that you want to evaluate R using just the four operations of
arithmetics. The goal then is to find a root of the function
f (x) = x2 − R.
x0 = 1
x1 = 1.5
x2 = 1.4166666666666666666666666666666666666666666666666666666666675
x3 = 1.4142156862745098039215686274509803921568627450980392156862745
x4 = 1.4142135623746899106262955788901349101165596221157440445849057
x5 = 1.4142135623730950488016896235025302436149819257761974284982890
x6 = 1.4142135623730950488016887242096980785696718753772340015610125
x7 = 1.4142135623730950488016887242096980785696718753769480731766796
▲▲▲
Proof : We will use the contractive mapping theorem, showing that there exists a
. > 0 such that
∶ B̂ (r) → B̂ (r)
is contractive. From this will follows that xn converges to a fixed point r of , i.e.,
f (r)
r=r−
f ′ (r)
,
i.e., r is a root of f .
Metric Spaces 89
Note that
f (x) f ′′ (x)
′
(x) = −
( f ′ (x))2
.
Since f (r) = 0, f ′ (r) ≠ 0 and f, f ′ , f ′′ are continuous, there exists a > 0, such
that � ′ (x)� < 1�2 for all x ∈ B̂ (r). For such x,
which explains why each error is of the order of the previous error squared (this
is called a quadratic convergence rate). n
Then, there exists for every (x0 , y0 ) ∈ R2 a > 0 and a unique function y ∈
C([x0 , x0 + ]) satisfying the di↵erential equation,
Proof : Set,
< min(1�M, 1�L),
K = {y ∈ C([x0 , x0 + ]) ∶ �y − y0 �∞ ≤ 1},
defined by
( (y))(x) = y0 + �
x
F(t, y(t)) dt.
x0
We first show that maps K into itself: if y ∈ K, then for every x ∈ [x0 , x0 + ],
�( ( ))(x) − y0 � = ��
x
F(t, y(t)) dt� ≤ �
x
�F(t, y(t))� ds ≤ M < 1,
x0 x0
i.e., (y) ∈ K.
Metric Spaces 91
x0
≤�
x
�F(t, y(t)) − F(t, z(t))� dt
x0
≤ L�
x
�y(t) − z(t)� dt
x0
≤ L�y − z�∞ ,
Taking the supremum over all x,
� (y) − (z)�∞ ≤ (L )�y − z�∞ ,
proving that is indeed contractive.
It follows from the contractive mapping theorem that has a unique fixed point,
y ∈ K, i.e., for every x ∈ [x0 , x0 + ],
y(x) = y0 + �
x
F(t, y(t)) dt.
x0
Comment: Under the conditions of this version of Picard’s theorem, a solution for
the initial value problem can be obtained for all x ∈ R, by continuing the solution
over -intervals. —19h(2019)—
We can say that a dense set is “almost everywhere”, but in many respects, dense
√
sets can be “small”. For example, two dense sets may have an empty intersection
(e.g., Q and 2+Q in R). The rationals and the irrationals are another example of
dense sets in R that do not intersect. It turns out that this could not have happened
if we had added the additional requirement that the sets be open.
First, a lemma:
Lemma 1.112 A metric space (X, d) is complete if and only if every decreasing
sequence of closed balls, B̂rn (xn ) with rn → 0 has a non-empty intersection.
with rn → 0. Taking yn ∈ B̂rn (xn ) we obtain a Cauchy sequence. Since the space
is complete, the sequence converges, yn → y. Fix n; for every k ≥ n, yk ∈ B̂rn (xn );
since the balls are closed, y ∈ B̂rn (xn ) for every n.
Conversely, suppose that the non-empty intersection property holds. Let xn be a
Cauchy sequence. For every n ∈ N let
Since the sequence xn is a Cauchy sequence, it follows that "n → 0. Then, we can
take a subsequence nk of natural number, such that
∞
� "nk < ∞.
k=1
Define
rk = � "n j .
j≥k
is dense.
Proof : Let Br (x) be some open ball. We need to show that it intersects Y. The
idea is to construct a decreasing sequence of closed balls. Since U1 is dense, it
intersects Br (x) and the intersection is open. Hence, there exists a close ball,
Similarly, since U2 is dense, it intersects Br1 (x1 ) and the intersection is open.
Hence there exists a closed ball,
Moreover, we may always let rn → 0. By the lemma, there exists a point in the
intersection of all those closed balls, which belongs to Y ∩ Br (x). n
It should be noted that a countable intersection of open sets is not necessarily
open. We have the following definition:
Comment:
(Explain!)
3. There are G -sets that are neither open nor closed, for example
{−1} ∪ (0, 1) ⊂ R.
4. The requirement that the intersection be countable is crucial; every set can
be represented as an intersection of open sets,
A = �{z}c ,
z�∈A
5. It is not yet clear that there exist sets that are not of class G .
Corollary 1.115 If (X, d) is a complete metric space, then the class of dense G -
sets is closed under countable intersections.
Proof : Let Yn be dense G -sets. Then, for each n there exist open Un,k , such that
∞
Yn = � Un,k .
k=1
Proof : Since Q is countable, we can write its elements as a sequence (qn ). Then,
∞
Qc = � {qn }c ,
n=1
is both dense and of class G . Q is dense. If it were also of class G its intersection
with Qc must have been dense, but it is actually empty. n
We are finally in measure to characterize “large sets”.
Corollary 1.118 Let (X, d) be a complete metric space. Let R be the collection
of all residual sets. Then, R satisfies the following properties:
1. X ∈ R and � ∈� R.
2. If A ∈ R and A ⊂ B then B ∈ R.
The notion of “large sets” has a dual notion of “small sets”, which we now review
briefly:
Proof :
Y is nowhere dense ⇐⇒ (Y)○ = �
⇐⇒ ((Y)○ )c = X
⇐⇒ (Y)c = X
⇐⇒ (Y c )○ = X
⇐⇒ (Y c )○ is dense
⇐⇒ Y c contains an open dense set.
n
Proposition 1.123 Let (X, d) be a complete metric space and let M denote the
collection of sets of the first category. Then,
1. � ∈ M and X ∈� M.
2. If A ∈ M and B ⊂ A then A ∈ M.
1. for every a ∈ X and " > 0 there exists a > 0 such that
(ii) Suppose that the second condition holds and let xn → a. For every " > 0 and n
large enough,
f (xn ) > f (a) − ".
Letting n → ∞,
lim inf f (xn ) ≥ f (a) − ".
n→∞
Since this holds for every " > 0 we obtain the desired result.
(iii) Suppose that the sequential condition holds and consider the set
Suppose that this set was not open. It would imply the existence of a ∈ A such that
for every n there exists an xn ∈ B1�n (a) for which
f (xn ) ≤ t.
Metric Spaces 99
Then, xn → a and
lim inf f (xn ) ≤ t < f (a),
n→∞
which is a contradiction. n
Cn is an open set for all n, because suppose that a ∈ Cn and that for every k there
exists xk ∈ B1�k (a) which is not in Cn . This would imply that for every k there
exists sequences yk` , zk` ∈ B1�` (xk ) such that
Now, xk → a and yk` , zk` → xk . Consider the “diagonal” sequences ykk , zkk ; both
converges to a and
� f (ykk ) − f (zkk )� ≥ 1�n,
contradicting the fact that a ∈ Cn .
100 Chapter 1
Then,
∞
C ≡ � Cn = {a ∈ X ∶ ∀n ∃r > 0, � f (x) − f (y)� < 1�n ∀x, y ∈ Br (a)}
n=1
⊂ {a ∈ X ∶ ∀n ∃r > 0, � f (x) − f (a)� < 1�n ∀x ∈ Br (a)},
is the set of continuity points of f . Since Cn is open for every n, it suffices to show
that Cn is dense.
Let Br (a) be an arbitrary open ball; we need to show that it intersects Cn . Let
M = sup f (x),
x∈Br (a)
Comment: The lemma would still hold if fn were only lower-semicontinuous and
the collection of functions was non-countable.
1. for every a ∈ X and " > 0 there exists a > 0 such that
Theorem 1.129 Let (X, d) be a complete metric space and let fn ∈ C(X) converge
pointwise to f . Then, the continuity points of f form a residual set.