Analysis II Script v1
Analysis II Script v1
Joaquim Serra
March 1, 2024
Chapter 8.0
Preface
This notes are the continuation of ’Analysis I: One variable’ and follow the same format
and general spirit.
Originally crafted in German for the academic year 2016/2017 by Manfred Einsiedler
and Andreas Wieser, they were designed for the Analysis I and II courses in the Interdis-
ciplinary Natural Sciences, Physics, and Mathematics Bachelor programs. In the academic
year 2019/2020, a substantial revision was undertaken by Peter Jossen.
For the academic year 2023/2024, Joaquim Serra has developed this English version. It
diers from the German original in several aspects: reorganization and alternative proofs of
some materials, rewriting and expansion in certain areas, and a more concise presentation in
others. This version strictly aligns with the material presented in class, oering a streamlined
educational experience.
The courses Analysis I/II and Linear Algebra I/II are fundamental to the mathematics
curriculum at ETH and other universities worldwide. They lay the groundwork upon which
most future studies in mathematics and physics are built.
Throughout Analysis I/II, we will delve into various aspects of dierential and integral
calculus. Although some topics might be familiar from high school, our approach requires
minimal prior knowledge beyond an intuitive understanding of variables and basic algebraic
skills. Contrary to high-school methods, our lectures emphasize the development of mathemat-
ical theory over algorithmic practice. Understanding and exploring topics such as dierential
equations and multidimensional integral theorems is our primary goal. However, students are
encouraged to engage with numerous exercises from these notes and other resources to deepen
their understanding and prociency in these new mathematical concepts.
9 Metric spaces 2
9.1 Basics of Metric Spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
9.1.1 The Euclidean space Rn . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
9.1.2 Denition of metric Space . . . . . . . . . . . . . . . . . . . . . . . . . . 5
9.1.3 Sequences, limits, and completeness . . . . . . . . . . . . . . . . . . . . 7
9.1.4 *The Reals as the Completion of Rationals (extra material; cf. Grund-
strukturen) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
9.2 Topology of Metric Spaces . . . . . . . . . . . . . . . . . . . . . . . . . . 14
9.2.1 Open and closed sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
9.2.2 Continuity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
9.2.3 Banach’s Fixed-Point Theorem . . . . . . . . . . . . . . . . . . . . . . . 19
9.2.4 Compactness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
9.2.5 Compactness and continuity . . . . . . . . . . . . . . . . . . . . . . . . . 26
9.2.6 Connectedness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
1
Chapter 9
Metric spaces
2
Chapter 9.1
For all x, y, z ∈ Rn
∥x − z∥ ≤ ∥x − y∥ + ∥y − z∥
n 1/2
n 1/2
n 1/2
2 2
(xi + yi ) ≤ xi + yi2 ,
i=1 i=1 i=1
Therefore, the Proposition will follow if we can establish the validity of (9.1), or (squaring
it) of:
n
n n n
x i yi xj yj = xi x j yi yj ≤ x2i yj2
i=1 j=1 i,j=1 i,j=1
But this last inequality is easily established summing over all pairs i, j ∈ 1, , n the
inequalities
2xi xj yi yj ≤ x2i yj2 + x2i yj2 ⇔ (xi yj − xj yi )2 ≥ 0;
and observing that ni,j=1 x2i yj2 = ni,j=1 x2j yi2 .
9.4. — A metric d on a set X assigns to each pair of points their distance. In this
interpretation, the deniteness condition states that the only point at zero distance from a
given point x ∈ X is x itself. The symmetry condition states that the distance from x ∈ X to
y ∈ X is the same as from y to x. Interpreting the distance between two points as the length
of a shortest path from one point to the other, the triangle inequality states that the length
of a shortest path from x to y is at most the length of a path one takes by rst going to y
and then from there to z.
Exercise 9.5. — Prove using induction over the number of points that N ≥ 3 that if d
1 satises the triangle inequality then:
N
−1
d(x1 , xN ) ≤ d(xi , xi+1 )
i=1
9.6. — When there is no possible confusion, we will often say “Let X be a metric space...”,
leaving the distance function unspecied. This is a shorter version of the more precise sentence
“Let (X, d) be a metric space...”.
Furthermore, we may refer to the set X as a space and the elements of X as points.
This is because we have in mind that X is some sort of geometric space, like a subset of the
plane or the surface of a sphere. In this setting, “spaces” and “points” will be synonymous
with “sets” and “elements”.
9.7. — Notice that the Euclidean space (Rn , d), with d(x, y) := ∥x − y∥, is a metric space.
In particular R, equipped with the absolute value distance x − y is a metric space.
Exercise 9.8. — Let (X, d) be a metric space and let ϕ : [0, ∞) → [0, ∞) a function which
is concave, increasing, ϕ(0) = 0, and not identically zero. Show that (X, ϕ ◦ d) is again a
√ t
metric space. For example one can take ϕ(t) = t, ϕ(t) = arctan t or ϕ(t) = 1+t . Notice that
the last two choices always give bounded distances.
for x, y ∈ X. Then, (X, d) is a metric space. Indeed, d is denite and symmetric by denition.
Furthermore, d satises the triangle inequality: Let x, y, z be points in X. If d(x, z) = 0, then
d(x, z) ≤ d(x, y) + d(y, z) is trivially satised. If d(x, z) = 1, then x ̸= z, and y is at least
dierent from one point in x, z, so the triangle inequality also holds. This metric d is called
the discrete metric on the set X.
where we put x = (x1 , x2 ) and y = (y1 , y2 ). It can be veried (exercise) that dNY satises all
1 axioms of a metric. The reason why dNY is called the Manhattan metric is that in grid-like
places such as Manhattan, one can reach from (x1 , x2 ) to (y1 , y2 ) in the following way: rst
move ‘horizontaly’ (i.e., with constant second coordinate from x = (x1 , x2 ) to (y1 , x2 ) and
then ‘vertically’ (with constant rst coordinate) from (y1 , x2 ) to y = (y1 , y2 ), or vice versa:
x = (x1 , x2 ) to (x1 , y2 ), and then to y = (y1 , y2 ). Since all streets in Manhattan run either
from west to east or from north to south, dNY measures the relevant distance between two
points.
Exercise 9.12. — Let X be the set of all continuous real-valued functions dened on
[0, 1] ⊂ R. For f, g ∈ X set
1
d1 (f, g) := maxf (x) − g(x) x ∈ [0, 1] and d2 (f, g) := f (x) − g(x)dx
0
Example 9.13. — If (X, d) is a metric space and X0 ⊂ X is some subset then X0 inherits
an structure of metric space from X. Indeed, one can easily verify that (X 0 , d0 ), where d0 the
restriction of d to X0 × X0 ⊂ X × X is a metric space.
For a more concrete instance of this take X = R3 with the Euclidean distance d and let
X0 be the sphere x ∈ R3 x21 + x22 + x23 = R2 , for some R > 0. Then for any pair of points
An arguably more natural metric d1 on the sphere X0 can be dene measuring the length
of the geodesic arc joining x and y. One can see that this metric is given by:
x·y
d1 (x, y) = R arccos ∈ [0, πR]
R2
Let (X, d) be a metric space, x ∈ X and (xn )n∈N be a sequence in X. We say that
(xn )n∈N converges to x, or that x is the limit of the sequence (xn )n∈N , if
lim d(xn , x) = 0
n
9.17. — When the metric space (X, d) is clear from the context, we may write lim n xn = x
or even xn → x to express that (xn )n∈N converges to x.
Exercise 9.18. — In the setting of Exercise 9.8, show that a sequence converges in (X, d)
if and only if it converges in (X, ϕ ◦ d).
n=0 , we
Proof. Let (X, d) be a metric space and let A, B ∈ X be limits of some sequence (xn )∞
mean to show that A = B. Take > 0, then, we can nd NA , NB ∈ N such that d(xn , A) < 2ε
1
for all n ≥ NA , and d(xn , B) < 2ε for all n ≥ NB . Then, for N := maxNA , NB , we have
that
d(A, B) ≤ d(A, xN ) + d(xN , B) < + = ,
2 2
where we used the triangular inequality. Since > 0 was arbitrary, it follows that d(A, B) = 0,
and thus A = B because of the denitness of d.
Let (xn )n∈N be a sequence in a metric space X, and let x ∈ X. (xn )n∈N converges to x
if and only if every subsequence of (xn )n∈N converges to x.
In other words: a sequence in a metric space is convergent if and only if it has a unique
accumulation point.
Proof. We rst prove the “only if” part. Let (xf (n) )n∈N be a subsequence, i.e., f : N → N is
some strictly increasing map. Given > 0 there is N such that d(xn , x) < for all n ≥ N .
Hence, d(xf (n) , x) < for all n ≥ N , as f (n) ≥ n.
We now prove the “if” part we can simply use that (xn )n≥0 is a subsequence (ie, f (n) = n)
and hence it converges to x.
9.23. — A stronger version of the previous Lemma that is useful in some contexts asserts
the following: a sequence (xn )n∈N in a metric space converges to x if and only if every
partial sequence (xf (n) )n∈N (f increasing) has a sub-subsequence (xg(f (n)) )n∈N (g increasing)
converging to x.
While the proof of the “only if” part is similar (g(f (n) ≥ n) the “if” part is less trivial than
in the previous lemma. One can argue by contraposition: If xn does not converge to x then
we want to nd a subsequence such that we cannot extract a sub-subsequence converging to
x.
To do so we start by the negation of “xn converges to x. Recall:
∃ > 0 ∀N ∈ N ∃n ≥ N d(xn , x) ≥
In other words, the set of n ∈ N d(xn , x) ≥ and hence there is an increasing sequence
(nk )k≥0 such that d(xnk , x) ≥ . Notice that any sub-subsequence will still remain at distance
≥ from x and hence will not converge to x.
2 This stronger version can be used, for example, to prove that a continuous function f :
[0, 1] → R has a unique minimum point if and only if all sequences (xn )n≥0 ⊂ [0, 1] such that
f (xn ) → min[0,1] converge to the same limit point.
Proof. Let xk k∈N ⊂ Rn be a sequence. For j = 1, , n, we denote with xk,j the j-th
component of the vector xk .
Assume that xk → x ∈ Rn . By denition, given > 0 and any j, it holds
n 1/2
xk,j − zj ≤ (xk,i − zi )2 = ∥xk − x∥ ≤ eventually in k.
i=1
This proves that, for each j = 1, , n, xk,j → xj when k → ∞ (as sequences of real numbers,
with the standard absolute value distance).
Assume now that for each j = 1, , d it holds
xk,j → xj as k → ∞,
xk,j − xj < for all k ≥ Nj
n
We introduce the concept of completeness for metric spaces. This concept does not
conict with the notion of completeness that we gave for R. We will soon show that R, as
well as C, is complete as a metric space. In contrast, the metric space Q is not complete.
n=0 in a metric space (X, d) is a Cauchy sequence if, for every > 0,
A sequence (xn )∞
there exists N ∈ N such that d(xm , xn ) < for all pair of integers m, n with n ≥ N
and m ≥ N .
2
Exercise 9.26. — Prove the following elementary facts about Cauchy sequences in a metric
space (X, d):
Example 9.28. — The interval (0, 1) ⊂ R, endowed with the standard distance d(x, y) =
x − y, is not complete. However, N ⊂ R is complete, as well as [0, ∞).
Exercise 9.29. — Show that Q, with the distance inherited from the standard distance
on R, is not a complete metric space.
Exercise 9.30. — Show that the space X of all bounded sequences (xn )n≥0 of real numbers,
equipped with the distance
d (xn )n≥0 ), (yn )n≥0 = sup xn − yn
n≥0
is complete. Show also that the subspace X0 of sequences with limit 0 is not complete.
Proof. Similar to the proof Lemma 9.24, a sequence (xk ) in Rn is a Cauchy if and only if xk,j ,
j = 1, , n are Cauchy (in R). It then follows from Theorem 2.124
9.32. — Completion of metric space (extra material) Let (X, d) be a metric space. We
write CX for the set of all Cauchy sequences in X and dene an equivalence relation on CX by
(xn )∞ ∞
n=0 ∼ (yn )n=0 ⇐⇒ lim d(xn , yn ) = 0
n→∞
is called the completion of (X, d). The injection ι : X → X, mapping x ∈ X to the class of
the constant sequence with value x, is called the canonical embedding. For all x, y ∈ X,
we have
d(x, y) = d(ι(x), ι(y)),
Exercise 9.33. — Show that the objects introduced in 9.32 are well-dened. In particular,
verify that d is indeed a metric on X.
Exercise 9.34. — As the name suggests, the completion (X, d) of a metric space is com-
plete, meaning that every Cauchy sequence in X converges. A sequence in X is essentially a
sequence of sequences, i.e.,
[(xm,n )∞ ∞
n=0 ]m=0
Exercise 9.35. — Let (X, d) be a metric space with completion (X, d). Let (Y, dY ) be a
complete metric space, and let f : X → Y be a function such that
for all x, y ∈ X. Show that there exists a unique function f : X → Y such that f = f ◦ ιX
and
d(x, y) = dY (f (x), f (y))
for all x, y ∈ X. This can be interpreted as: “X is the smallest complete metric space
containing X.”
9.1.4 *The Reals as the Completion of Rationals (extra material; cf. Grund-
strukturen)
In the rst semester, we dened R as any complete ordered eld, postulating its existence
(Denitions 2.18 and 2.19).The idea of completion of metric spaces allows one to easily con-
struct a model of R. This constructions shows, in particular, the existence of a complete
ordered eld. One can also prove with a bit of patience (although it is not hard to do so) that
actually there is only one model of R, in the sense that any two complete ordered elds must
2 be isomorphic.
The completion of Q serves as a model for a eld of real numbers. First, note that the
construction of the completion of Q does not necessarily require a eld of real numbers (as
the target space for the standard metric on Q). The set of all Cauchy sequences C in Q is the
n=0 such that
set of all sequences of rational numbers (qn )∞
R = C∼ = CN
in the sense of linear algebra. Thus, R is a vector space over Q. We denote the injective linear
map ι : Q → R by the canonical embedding, which assigns to q ∈ Q the class of the constant
sequence with value q. From now on, elements of R are called real numbers, and we consider
Q as a subset of R via the canonical embedding ι.
x · y = [(pn qn )∞
n=0 ]
It can be veried that this gives a well-dened commutative operation on R, satisfying the
distributive law with respect to addition, and compatible with the multiplication of rational
numbers via the canonical embedding. In particular, 1R = ι(1) = [(1)∞ n=0 ] is the multiplicative
identity in R. If x = [(qn )n=0 ] is non-zero, then (qn )n=0 is a Cauchy sequence in Q that does
∞ ∞
not converge to zero. Therefore, qn ̸= 0 for all but nitely many n ∈ N. The class of the
sequence (pn )∞n=0 given by
1 if qn = 0
pn =
q −1 otherwise
m
serves as a multiplicative inverse for x. This shows that R is a eld with the given operations.
We use the usual order relation on Q to construct an order relation on R. For elements
n=0 ] and y = [(qn )n=0 ] in R, we declare
x = [(pn )∞ ∞
x≤y
if there exists a sequence (rn )∞ n=0 ∈ N such that pn − rn ≤ qn for all n ∈ N. It is left to
2 the diligent reader to verify that this indeed denes a well-dened order relation on R that
is compatible with the eld structure on R. Thus, R is equipped with the structure of an
ordered eld.
It remains to show that the ordered eld R is complete in the sense of Denition 2.198.It
is easy to see that R satises the Archimedean Principle: Let x = [(qn )∞ n=0 ] ∈ R be positive.
Then, (qn )∞n=0 is not a null sequence. Thus, there exists a k ∈ N such that qn > 2
−k for
innitely many n ∈ N. However, (qn )∞ n=0 is also a Cauchy sequence, so there exists N ∈ N
such that m, n ≥ N =⇒ qn − qm < 2−k−1 . This shows that qn > 2−k−1 and even
qn > 2−k−1 for all but nitely many n ∈ N, since x > 0. This demonstrates ι(2−k−1 ) ≤ x, or
simply 2−k−1 ≤ x as we consider Q as a subset of R. Thus, the Archimedean Principle holds,
as stated in Corollary 2.66. Now, let X, Y ⊂ R be non-empty subsets such that x ≤ y for all
x ∈ X and y ∈ Y . We want to nd a real number z = [(rn )∞ n=0 ] ∈ R between X and Y . To
do this, we rst choose arbitrary a0 , b0 ∈ Q such that [a0 , b0 ] X ̸= ∅ and [a0 , b0 ] Y ̸= ∅,
and set r0 = 12 (a0 + b0 ). If x ≤ r0 ≤ Y for all x ∈ X and y ∈ Y , we set z = r0 and we are
done. Otherwise, we dene a1 and b1 as
a = r and b = b if [a0 , r0 ] X ̸= ∅ and [a0 , r0 ] Y ̸= ∅
1 0 1 0
a = a and b = r if [r , b ] X ̸= ∅ and [r , b ] Y ̸= ∅
1 0 1 0 0 0 0 0
and set r1 = 12 (a1 + b1 ). By continuing this process, we either nd an rn such that x ≤ rn ≤ Y
for all x ∈ X and y ∈ Y , and we set z = rn , or we obtain sequences (an )∞ n=0 , (bn )n=0 , and
∞
z = [(an )∞ ∞ ∞
n=0 ] = [(rn )n=0 ] = [(bn )n=0 ]
2
9.2 Topology of Metric Spaces
and refer to the set B(x, r) as the open ball with center x and radius r.
3
9.38. — In particular, ∅ and X are always both open and closed. In general, a subset U
needs not to be neither open nor closed.
It is not true in general that the only “clopen” sets in a space are the empty set ∅ and the
space itself X. A set is termed “clopen” if it is both open and closed. For illustration, take the
space X = (0, 1) (2, 3), equipped with the standard metric from R. Here, the intervals (0, 1)
and (2, 3) are clopen: they are open and closed in X. This example underscores the presence
of other clopen sets beyond just ∅ and X. The signicance of clopen sets will become more
apparent in our discussions on connectedness. As we will see, connected spaces are precisely
characterized by the absence of nontrivial (neither empty nor the whole space) clopen sets.
9.39. — Consider the set X = [0, 2], equipped with the standard metric inherited from
R. In this context, the subset [0, 1) is open within X (an exercise worth verifying). However,
when considered as subset of the whole R, [0, 1) is neither open nor closed. This example
illustrates that statements regarding the openness of a set like [0, 1) require clarity about the
ambient space (X, d) being considered. In practice, though, such nuances are often glossed
over when the context is clear, and delving into these subtleties is usually unnecessary for
typical discussions.
Proof. Set
U= Ui
i∈I
3 and let x ∈ U . Then there exists i ∈ I with x ∈ Ui , and since Ui is open, there exists an
> 0 such that B(x, ) ⊂ Ui , implying B(x, ) ⊂ U . Thus, U is open. Finally, let (Ui )i∈I be
a nite family of open subsets of X. Set
U= Ui
i∈I
and let x ∈ U . Then x ∈ Ui for all i ∈ I, and for each i ∈ I, there exists i > 0 such that
B(x, i ) ⊂ Ui . For := mini i ∈ I, we have > 0 and B(x, ) ⊂ Ui for all i ∈ I. Thus,
B(x, ) ⊂ U , completing the proof.
Proof. Apply Proposition 9.41 to the (open) complements of the closed sets.
Example 9.43. — The intersection of innitely many open sets may not be open. Take
for example R with the standard metric. The intersection of the family of open sets
(−1n, 1n) n ∈ N
gives 0, which is not open. Taking complements you obtain an example where an innite
union of closed sets is not closed.
Exercise 9.45. — Using Proposition 9.41, prove that E ◦ is always open while E and ∂E
are always closed.
Exercise 9.46. — For balls B(x, r) prove that B(x, r) = y ∈ X d(x, y) ≤ r and deduce
∂B(x, r) = y ∈ X d(x, y) = r.
(1) A subset U ⊂ X is open if and only if, for every convergent sequence in X with a
limit in U , the sequence eventually lies in U .
(2) A subset A ⊂ X is closed if and only if, for every convergent sequence (xn )∞
n=0 in
X with xn ∈ A for all n ∈ N, the limit also lies in A. In other words, if and only
if A coincides with the set of all its accumulation points.
Proof. Let U ⊂ X be an open subset of X, and let (xn )∞ n=0 be a sequence in X with a limit x
in U . Then, there exists > 0 such that B(x, ) ⊂ U , and since (xn )∞ n=0 converges to x, there
exists an N ∈ N such that xn ∈ B(x, ) for all n ≥ N . Conversely, let V ⊂ X be a non-open
subset. Then there exists a point x ∈ V such that B(x, ) \ V ̸= ∅ for every > 0. For each
n ∈ N, we can nd xn ∈ B(x, 2−n ) \ V . The sequence (xn )∞ n=0 in X \ V converges to x ∈ V ,
and satises xn ∈ V for every n ∈ N. This completes the proof of the rst statement.
Let A ⊂ X be closed, and let (xn )∞ n=0 be a convergent sequence in X with xn ∈ A for all
n ∈ N. Let x be the limit of the sequence (xn )∞ n=0 . Then, U = X \ A is open and cannot
contain the limit x of (xn )n=0 , as otherwise almost all elements of the sequence (xn )∞
∞
n=0 would
have to lie in U . Therefore, the limit x belongs to A. Finally, suppose A ⊂ X is not closed.
Then U = X \ A is not open, and according to the previous argument, there exists a sequence
n=0 in A = X \ U with a limit x ∈ U .
(xn )∞
Exercise 9.48. — Let (X, d) be a complete metric space and E ⊂ X a closed subset.
Show that E is complete as well.
Proof. Notice that we can rewrite the denition of convergence as follows: x n → x if and only
if for all > 0, xn eventually lies in B(x, ). Now, if U is any open set containing x then
by denition of open set there exists > 0 such that B(x, ) ⊂ U and hence xn → x implies
that xn eventually lies in U , establishing the “only if” direction. For the “if” we just that for
given ϵ > 0 we can take U = B(x, ) (open balls are open) and hence xn eventually lies in
B(x, ).
Let X be a set endowed with two dierent distances d1 and d2 . Then (X, d1 ) and (X, d2 )
have the same convergent sequences if and only if the topologies generated by d1 and d2
coincide.
Proof. By Corollary 9.49 the notion of convergent sequence only depends on the collection of
3
open sets. That is, it only depends on the distance through the topology it generate. Hence
distances generating the same open sets have the same convergent sequences. This proves the
“if” part of the statement.
We prove the “only if” part. Suppose that a set U ⊂ X is open with respect to d1 , but not
with respect to d2 . This means that there is x ∈ U such that we can nd
By construction, the sequence xk is the convergent with respect to d2 and then also with
respect to d1 (they have the same convergent sequences by assumption). By Proposition 9.49
(U is open in d1 !) we discover that xk ∈ U eventually, which contradicts how we constructed
xk .
(i) Assume X is complete and A is closed. Show that the subspace A is also complete.
9.2.2 Continuity
We now aim to generalize the concept of continuity to functions dened between metric
spaces.
(1) We say f is ε − δ continuous if, for all x ∈ X and > 0, there exists a > 0
3
such that if dX (x, x′ ) < , x′ ∈ X =⇒ dY (f (x), f (x′ )) < . In other words,
f (B(x, )) ⊂ B(f (y), ).
(3) We say f is topologically continuous if, for every open subset U ⊂ Y , the
preimage f −1 (U ) = x ∈ X f (x) ∈ U is open in X.
Proof. (1) =⇒ (2): Let (xn )∞ n=0 be a convergent sequence in X with limit x ∈ X, and let
> 0. There exists a > 0 such that f (x′ ) ∈ B(f (x), ) for all x′ ∈ B(x, ). Since (xn )∞ n=0
4 converges to x, there exists an N ∈ N such that xn ∈ B(x, ) for all n ≥ N . In particular, for
n ≥ N , f (xn ) ∈ B(f (x), ). Since > 0 was arbitrary, it follows that lim f (xn ) = f (x), and
n→∞
thus f is sequentially continuous as claimed.
¬(3) =⇒ ¬(2): Assume f is not topologically continuous. Then exists U ⊂ Y open such
that f −1 (U ) is not open. Therefore, there is x ∈ f −1 (U ) and a sequence (xn )n≥0 ⊂ X \f −1 (U )
with xn → x. Then f (x) ∈ U and f (xn ) ∈ Y \ U for all n, but U is open this gives that f (xn )
cannot converge to f (x). In other words, we have found a sequence such that xn → x, but
f (xn ) does not converge to f (x).
(3) =⇒ (1): Let x ∈ X and > 0. The preimage f −1 (B(f (x), )) contains the point x
and is open by assumption, as B(f (x), ) ⊂ Y is open. Thus, there exists a > 0 such that
B(x, ) ⊂ f −1 (B(f (x), )). Therefore, f is --continuous as claimed.
Example 9.55. — In any metric space (X, d) for any given x0 ∈ X the function f (x) =
d(x, x0 ) is Lipchitz (with constant 1). Indeed, the triangle inequality (using also symmetry)
yields:
−d(x, x′ ) ≤ d(x, x0 ) − d(x′ , x0 ) ≤ d(x, x′ )
Exercise 9.56. — Let (X, d) be a metric space, and let E ⊂ X be a non-empty subset.
4
For x ∈ X, dene
fE (x) = infd(x, z) z ∈ E
Exercise 9.57. — Let (X, dX ) and (Y, dY ) be metric spaces. Assume that Y is complete.
Show that if E ⊂ X and f : E → Y is a uniformly continuous function dened on a subset
then there is a unique continuous extension f¯: Ē → Y , which is also uniformly continuous.
Proof. First, we show uniqueness of a putative xed point. Let a ∈ X and b ∈ X be xed
points of T . Then,
d(a, a′ ) = d(T (a), T (a′ )) ≤ λd(a, a′ ),
Cauchy sequence. Iterating the contractivity assumption we nd that, for all integers p ≥ 0,
Pick now any integers m ≥ n ≥ N , then using this observation and the triangular inequality
we nd
m−1
∞
p λN
d(xm , xn ) ≤ λ d(x1 , x0 ) ≤ d(x1 , x0 ) λp = d(x0 , x1 )
p=n
1−λ
p≥N
We crucially used that λ < 1 to sum the geometric series. Now given any > 0 we can nd
λN
some N so large that 1−λ d(x0 , x1 ) < , thus proving that (xn )∞
n=0 is Cauchy (this estimate is
uniform in n, m as long as they are larger than N !).
Now we use the completeness assumption to infer that xn → a for some a ∈ X. Since T is
continuous, we have
9.59. — We remark that the proof is constructive and in concrete situation can be imple-
mented in a an algorithm to nd approximate xed points.
(2) A complete metric space (X, d) and an isometry (i.e., a mapping T : X → X with
d(T (x1 ), T (x2 )) = d(x1 , x2 )) that has no xed point
9.2.4 Compactness
A closed and bounded interval of the real line is is called a compact interval, as we saw
in Analysis I. We proved some fundamental properties of continuous functions on compact
intervals: boundedness, existence of maxima and minima, and uniform continuity. We intend
to investigate these and other properties in the broader context of metric spaces. We start
giving a general denition of compactness that works in metric spaces.
Let us immediately clarify a possible source of confusion.
• Nevertheless when considering Rn with its Euclidean structure, which is the main
focus of this course, it will turn out that a closed and bounded set is indeed
compact, and viceversa.
Interlude: “Cover”
Let E ⊂ X and let U = Ui i∈I be a family of subsets of X, where I is some set of
indices. We say that U covers E if
E⊂ U= Ui
i∈I
(1) K is sequentially compact: every sequence (xn )n∈N in K has a subsequence that
is convergent in K.
4
(2) K is topologically compact: every family of open sets Ui i∈I that cover K, has
a nite subcover.
(3) K is complete (i.e., every Cauchy sequence contained in K has a limit in K) and
totally bounded: for every r > 0, there exist nitely many x1 , , xn ∈ K such
that the balls B(x1 , r), , B(xn , r) cover K.
9.63. — The denition of topological compactness does not explicitly use the distance
function d, but it is formulated only in terms of the collection of open sets (i.e., the topology).
For this reason it is called “topological”.
9.64. — The Bolzano-Weierstrass Theorem ensures that a closed and bounded interval of
R is sequentially compact.
Example 9.65. — Q [0, 2], endowed with the standard distance, is not topologically
compact. Consider the covering
√
Q [0, 2] = (Q [0, 2)) (Q (p, 2])
√
p∈Q, p> 2
5 √
Any nite subcover will miss some rationals > 2.
Exercise 9.66. — Let X be a metric space. Show that if X is totally bounded, then it is
bounded, i.e., supx,x′ ∈X d(x, x′ ) < +∞.
Example 9.67. — The half-open interval X = (0, 1] ⊂ R is not compact. Indeed, the open
cover U = (2−n , 1] n ∈ N has no nite subcover.
The main result of this section is Theorem 9.69, which shows that the denition of compact
metric space is indeed well-posed.
Exercise 9.68. — Show that a totally bounded metric space is bounded, and nd an
example of a bounded metric space that is not totally bounded.
(3) K is totally bounded and complete (in the sense of Cauchy sequences).
Proof that (1) =⇒ (2). We start with a preliminary observation. Consider the function
r(x) := min 1, supr > 0 : B(x, r) ⊂ U for some U ∈ U ,
By assumption (1), we have xnk → z (as k → ∞) for a suitable subsequence. On the other
hand, for each k ≥ 0 we have z ∈ Unk (the complement of a open set is closed, that is
B(xnk ) , r(xnk )2) Combining this information
sequentially closed), and in particular z ∈
with xnk → z, we nd r(xnk ) → 0 and in particular
In order to prove (2) =⇒ (3) we single out a rephrasing of (2) which is useful to keep in
mind.
Proof of Lemma 9.70. Assume X is compact, and let A be a collection of closed subsets of X
with an empty intersection. The collection of complements U = X \ A A ∈ A is then an
open cover of X, and there exists a nite subcover X = U1 · · · Un of it. Set Ai = X \ Ui .
Then A1 · · · An ̸= ∅. Thus, X satises the Nesting Principle.
Now, assume X satises the Nesting Principle, and show that X is compact. Let U be an
open cover of X. Then A = X \ U U ∈ U is a collection of closed subsets with an empty
intersection. According to the Nesting Principle, there exist A1 , , An ∈ A with an empty
5
intersection. Set Ui = X \ Ai . Then X = U1 · · · Un is a nite subcover. Since the cover U
was arbitrary, this shows that X is compact.
Proof that (2) =⇒ (3). We rst prove that X is totally bounded. Pick any r > 0, consider the
open covering U := B(x, r) : x ∈ X and extract a nite subcover B(x1 , r), , B(xN , r).
Now we prove that X must be complete, hence we pick a Cauchy sequence (x n )n∈N and
show that it has a limit point. For each k ≥ 0 there is n(k) so large that
For each k, consider the closed balls Ak := B(xn(k) , 2−k ); any nite intersection of them is
nonempty, indeed for every k1 , , kN one has that xm ∈ Ak1 AkN , provided m ≥
maxk1 , , kN . Hence we can apply the Nesting Principle (see Lemma 9.70) and nd some
z ∈ k≥0 Ak . We claim that xn → z. Indeed if m ≥ n(k) it holds
Proof of Lemma 9.71. Set f (0) equal to an arbitrary element of N0 . Then set inductively
f (k) := minm ∈ Nk : m > f (k − 1), this set is non-empty because each Nk is innite.
Proof that (3) =⇒ (1). We pick any sequence (xn )n∈N and show that admits a Cauchy sub-
sequence, by completeness, this will prove (1).
By assumption, we can cover K by a nite number of balls of radius 1; it follows that
(xn )n∈N will fall innitely many times (at least) one of these balls. Let this ball be B(z1 , 1)
for some z1 ∈ X. Accordingly, we dene the set of indices N0 := j ∈ N : xj ∈ B(z1 , 1),
which is innite.
Now we proceed to do same thing to the restricted sequence (xn )n∈N0 , but we shorten the
5 radius of from 1 to 1/2. Accordingly, we nd a ball B(z2 , 12) such that the set N1 := j ∈
N0 : xj ∈ B(z2 , 12) is innite.
We proceed inductively, halving the radius each time, and construct a descending family
of innite sets N ⊃ N0 ⊃ N1 ⊃ N2 ⊃ with the property that
We apply to these sets Lemma 9.71 and nd f : N → N strictly increasing such that f (k) ∈ Nk
for all k ≥ 0. Then, the subsequence (xf (k) )k∈N is Cauchy: for n, m ≥ k it holds
We also easily get the following version of the Heine Borel theorem in the Euclidean space
Rn .In its statement, a set E ⊂ Rn is called bounded if there there exist N ∈ N such that
E ⊂ [−2N , 2N ]n (prove that this is equivalent to sup d(x, x′ ) (x, x′ ) ∈ E × E < ∞).
Proof. If K is compact, then it is closed by Corollary 9.73; and bounded, because it is totally
bounded.
To show the converse, we show that K is complete and totally bounded. Since Rn is
complete and K is closed, then K is complete as well (see Exercise 9.51).
On the other hand, by assumption K is bounded so there exist N ∈ N such that K ⊂
′ √
[−2N , 2N ]n . Given r > 0, take some large integer N ′ ∈ N large so that such that 2−N < r n.
6
Then the union of the balls Br (x) with x running in the nite grid
′
2−N y y = (y1 , yn ) ∈ Zn with − 2N ≤ yi ≤ 2N
Example 9.75. — We stress that the Heine-Borel Theorem fails for general metric spaces:
take R with the bounded distance d(x, y) := arctan x − y (see Exercise 9.8). Then in this
metric space the set N would be closed and bounded, but it is trivial to construct sequences
that do not converge.
Proof. We will give two proofs. The rst one employs sequential compactness. Suppose that
(yn )n≥0 is a sequence of points in f (K). Then yn = f (xn ) for some (xn )n≥0 . Since K is
compact there is a convergent subsequence xnk → x ∈ K. But then since f is continuous
ynk → y = f (x) ∈ f (K).
The second one employs instead topological compactness. Let U be an open cover of f (A).
For each U ∈ U , the set f −1 (U ) ⊂ X is open due to the continuity of f . The collection
f −1 (U ) U ∈ U is an open cover of A. Since A is compact, there exist U1 , , Un ∈ U such
that f −1 (Ui ) 1 ≤ i ≤ n is a cover of K. This implies that Ui 1 ≤ i ≤ n is a cover of
f (K), and since U was arbitrary, it shows that f (K) is compact.
Proof. Let > 0. Due to the continuity of f , for each x ∈ X, there exists x > 0 such
that f (B(x, x )) ⊂ B(f (x), 2ε ). The collection B(x, 12 x ) x ∈ X forms an open cover of
X. Since X is compact by assumption, there exists a nite subcover of this collection. This
implies the existence of x1 , , xn ∈ X such that
dY (f (x), f (x′ )) ≤ dY (f (x), f (xk )) + dY (f (xk ), f (x′ )) ≤ + = ,
2 2
Proof. f (K) ⊂ R is compact by Theorem 9.77 and nonempty, so sup f (K) ∈ f (K), any
element x̄ ∈ f −1 (sup f (X)) works.
The fact that sup f (K) ∈ f (K) is readily proved: by denition of supremum there is a
sequence (sn ) ⊂ f (K) such that sn → sup f (K), but then sup f (K) ∈ f (K), since f (K) is
closed and so it contains its accumulation points.
9.2.6 Connectedness
Exercise 9.81. — Let X be a metric space, and let E1 and E2 be connected subsets. If the
intersection E1 E2 is non-empty, then the union E1 E2 is connected. Can you generalize
this property to arbitrary unions? Use this property to dene the connected component of a
point as the union of all connected sets that contain the point.
Proof. Assume E ⊂ R is not an interval. Then there exist real numbers x1 < y < x2 with
x1 , x2 ∈ X and y ∈
X. Then the two disjoint open subset
6
U1 = (−∞, y) and U2 = (y, ∞)
since x2 ∈ U2 we have t∗ ∈ [x1 , x2 ). On the one hand t∗ is the supremum (and hence the
limit) of points in R \ U2 , a closed set, and hence t∗ ∈ R \ U2
On the other hand let us show that t∗ ∈ U1 . If t∗ ∈ U1 then t∗ < x2 and, since U1 is open,
we could enlarge a bit t∗ while still satisfying (9.2). This violates the very denition of t∗ in
(9.2).
Therefore we have found two points x1 ,x2 in E and third point t∗ ∈ (x1 , x2 ) with t∗ ∈
R \ (U1 U2 ) ⊂ R \ E. Hence, E cannot be an interval.
Proof. Suppose f (E) is disconnected. There there exists two nonempty, disjoint, open sets
U1 , U2 of Y such that f (E) is covered by U1 U2 . But then f −1 (U1 ) and f −1 (U2 ) are two
nonempty disjoint open sets covering E, contradicting its connectedness.
Proof. Without loss of generality, we can assume a < b. Appling Propositions 9.82 and 9.83
f ([a, b]) is connected. But then, using again Proposition 9.82, f ([a, b]) ⊂ R must be an
interval. As f (a), f (b) ∈ f ([a, b]), all values between f (a) and f (b) lie in f ([a, b]).
Exercise 9.85. — Show the following generalization of the Intermediate Value Theorem:
Let X be a connected topological space, and f : X → R be a continuous function. Let
a, b ∈ X. Then, for every y ∈ R between f (a) and f (b), there exists x ∈ X such that
f (x) = y.
Definition 9.86:
Let X be a metric space. We call E ⊂ X path-connected if, for every two points
x, y ∈ E, there exists a path : [0, 1] → E from x = (0) to y = (1).
Lemma 9.87:
Let X be a metric space. If E ⊂ X is path-connected then it is connected.
Proof. Suppose that E is disconnected topological, Then there exist non-empty, disjoint, open
sets U1 and U2 such that E ⊂ U1 U2 and U1 U2 = X. Let x1 ∈ U1 and x2 ∈ U2 . If X
were path-connected, there would exist a path : [0, 1] → E from x1 to x2 . However, this
implies that V1 = −1 (U1 ) and V2 = −1 (U2 ) are non-empty, disjoint open subsets of [0, 1]
with V1 V2 ⊃ [0, 1]; a contradiction since [0, 1] is connected.
Proposition 9.89:
Let U ⊂ Rn be an open subset. Then U is path-connected if and only if U is connected.
and want to show that G = U . Since U is connected and G is non-empty, it suces to show
that both G and U \ G are open.
Let x ∈ G and : [0, 1] → U be a path from x0 to x. Since U is open, there exists r > 0
such that B(x, r) ⊂ U . For any y ∈ B(x, r), the straight path t → (1 − t)x + ty, connecting x
and y, lies in U . Concatenating these paths yields the path
(2t) if 0 ≤ t ≤ 12
t →
(2 − 2t)x + (2t − 1)y if 1 < t ≤ 1
2
from x0 to y. Thus, y ∈ G, and since y was arbitrary, we have B(x, r) ⊂ G. This shows that
G is open. Using a similar argument, we can show that U \ G is open. If x ∈ U \ G and r > 0
with B(x, r) ⊂ U , then all points in B(x, r) are not in G. If y ∈ G B(x, r), a concatenation
of paths as above would connect x to x0 . Therefore, B(x, r) ⊂ U \ G, and U \ G is open.
Thus, G is closed.
Cauchy sequence, 10
closed, 14
closure, 16
compact, 21
complete, 10
completion, 11
connected component, 28
contraction, 20
converges, 7
discrete metric, 6
distance, 5
xed point, 20
interior, 16
limit, 7
Lipschitz constant, 19
Lipschitz continuous, 19
Manhattan metric, 6
metric, 5
metric space, 5
open, 14
points, 5
sequence, 7
space, 5
standard metric, 6
subsequence, 8
term, 7
topological boundary, 16
topology, 14
uniformly continuous, 19
31
Bibliography
[ACa2003] N. A’Campo, A natural construction for the real numbers arXiv preprint 0301015,
(2003)
[Apo1983] T. Apostol, A proof that Euler missed: Evaluating (2) the easy way The Mathe-
matical Intelligencer 5 no.3, p. 59–60 (1983)
[Aig2014] M. Aigner and G. M. Ziegler, Das BUCH der Beweise Springer, (2014)
[Bol1817] B. Bolzano, Rein analytischer Beweis des Lehrsatzes, daû zwischen je zwei Werthen,
die ein entgegengesetztes Resultat gewähren, wenigstens eine reelle Wurzel der Gleichung
liege, Haase Verl. Prag (1817)
[Cau1821] A.L. Cauchy, Cours d’analyse de l’école royale polytechnique L’Imprimerie Royale,
Debure frères, Libraires du Roi et de la Bibliothèque du Roi. Paris, (1821)
[Ded1872] R. Dedekind, Stetigkeit und irrationale Zahlen Friedrich Vieweg und Sohn, Braun-
schweig (1872)
[Hil1893] D. Hilbert, Über die Transzendenz der Zahlen e und π Mathematische Annalen 43,
216-219 (1893)
[Hos1715] G.F.A. Marquis de l’Hôpital, Analyse des Inniment Petits pour l’Intelligence des
Lignes Courbes 2nde Edition, F. Montalant, Paris (1715)
32
Chapter 9.2 BIBLIOGRAPHY
[Zag1990] D. Zagier, A one-sentence proof that every prime p ≡ 1 mod 4 is a sum of two
squares. Amer. Math. Monthly 97, no.2, p. 144 (1990)