Metric Spaces
Metric Spaces
Lecture Notes
d(f, g)
f
g
a b
Contents
Lecture 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Lecture 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Lecture 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Lecture 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Lecture 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Lecture 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Lecture 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Lecture 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Lecture 9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Lecture 10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Lecture 11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Lecture 12 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2
MATH 487
Lecture 1
Example 1.1
Example 1.2
y
Given two points
n
!1
X 2
d(x, y) = (xi − yi )2 .
i=1
if and only if
n
X
(xi − yi )2 = 0.
i=1
3
Metric Spaces
implies x = y. Furthermore,
n
!1 n
!1
X 2 X 2
= a2i + b2i
i=1 i=1
2
= [d(x, y) + d(y, z)]
by the Cauchy-Schwarz inequality. This implies d(x, z) ≤ d(x, y) + d(y, z) and (Rn , d) is a
metric space. ■
Example 1.3
d(f, g)
f
g
a b
Proof. Let f, g, h ∈ C([a, b]). Then as f − g is continuous on the closed, bounded interval
[a, b], we know {|f (x) − g(x)| : x ∈ [a, b]} has a maximum value by the Maximum-Minimum
Theorem. Hence, {|f (x) − g(x)| : x ∈ [a, b]} is bounded above and
exists by the supremum property. Thus 0 ≤ d(f, g) < ∞ and d is well-defined. Furthermore,
d(f, g) = 0 if and only if sup{|f (x)−g(x)| : x ∈ [a, b]} = 0, which implies 0 ≤ |f (x)−g(x)| ≤ 0
and f (x) = g(x) for all x ∈ [a, b]. Thus f = g on [a, b]. Moreover,
d(f, g) = sup{|f (x) − g(x)| : x ∈ [a, b]} = sup{|g(x) − f (x)| : x ∈ [a, b]} = d(g, f ).
4
MATH 487
Lastly,
for all x ∈ [a, b] by the triangle inequality. Then by the definition of supremum,
Example 1.4
Let
∞
( )
X
X= (xn )∞
n=1 : xi ∈ R, i ∈ N and 2
|xn | < ∞ := l2 (N)
n=1
and !1
∞
X 2
2
d(x, y) = (xi − yi )
i=1
where x = (xn )∞ ∞
n=1 , y = (yn )n=1 ∈ X. Then (X, d) is a metric space.
5
Metric Spaces
Lecture 2
Open Ball Definition
Let (X, d) be a metric space. Then the open ball with radius r > 0 centered at x0 ∈ X is
the set
B(x0 , r) = {y ∈ X : d(x0 , y) < r}.
Below are visualizations of open balls in R and R2 , defined on their usual metrics.
( )
x0
x0 − r x0 + r
y
r
x0
Let O ⊆ X. Then O is open if for all x ∈ O, there exists some r > 0 such that B(x, r) ⊆ O.
Proposition 2.1
Proof. Let x ∈ B(x0 , r) and s = r − d(x, x0 ). Then for all y ∈ B(x, s), we have
6
MATH 487
Lecture 3
Example 3.1
fact, this implies that E does not contain a “largest” closed set.
Proof. We prove the forward through contradiction. Suppose that F ⊂ E is closed but infinite.
Then F must contain a sequence (xn ) such that xn → 0, which implies 0 is a contact point of
F . But as F is closed, then 0 ∈ F ⊂ E, a contradiction. ■
Proposition 3.1
Proof. Let x ∈ A0 . Then x is an interior point of A and there exists some r > 0 such that
x ∈ B(x, r) ⊆ A. ■
Remark
It is possible that A0 = ∅. For example, let A = Q in the space (R, | · |). Then A0 = ∅ as
any open ball around any real number contains irrational numbers.
Proposition 3.2
1. A0 is open.
Proof of 1. Let x ∈ A0 . Then x is an interior point of A and there exists some r > 0 such
that B(x, r) ⊆ A. Now let y ∈ B(x, r). Then as B(x, r) is open, there exists some ε > 0 such
that B(y, ε) ⊆ B(x, r) ⊆ A. Hence, y ∈ A0 , which implies B(x, r) ⊆ A0 and A0 is open. ■
7
Metric Spaces
Proof of 2. Let O ⊆ A be open and x ∈ O. Then there exists some r > 0 such that
B(x, r) ⊆ O ⊆ A which implies x ∈ A0 . Hence, O ⊆ A0 . ■
Proof of 3. Let U = O⊆A O where each O is open. As A0 ⊆ A is open, then clearly A0 ⊆ U
S
by Propositions 3.1, 3.2.1. Furthermore, for every open set O ⊆ A, it follows that O ⊆ A0 by
Proposition 3.2.2. Thus, U ⊆ A0 and A0 = U . ■
Proof of 4. The forward follows from Proposition 3.2.1. Then we prove the converse: suppose
A is open. Note that A0 ⊆ A by Proposition 3.1 and A ⊆ A. Then A ⊆ A0 by Proposition
3.2.2. ■
Proof of 5. Follows from Proposition 3.2.4. ■
8
MATH 487
Lecture 4
Contact Point Definition
Let (X, d) be a metric space and A ⊆ X. Then x ∈ X is a contact point of A if and only
if for all r > 0, there exists some y ∈ A such that y ∈ B(x, r).
Proposition 4.1
Proposition 4.2
Let (X, d) be a metric space and A ⊆ X. Then x ∈ X is a contact point of A if and only
if there is a sequence (xn )∞
n=1 in A such that xn → x.
Corollary
Example 4.1
y
Let
E = (x, y) ∈ R2 : x2 + y 2 ≤ 1 .
Proposition 4.3
Let (X, d) be a metric space and A ⊆ X. Then A is open if and only if Ac is closed.
Proof. To prove the forward, suppose A ⊆ X is open and let x0 be a contact point of Ac .
Then there exists a sequence (xn )∞ c
n=1 in A such that xn → x0 by Proposition 4.2. If, for
sake of contradiction, x0 ∈ A, then there exists some r > 0 such that B(x0 , r) ⊆ A as A is
open. But xn → x0 , hence xn ∈ B(x0 , r) for sufficiently large n. Therefore xn ∈ A ∩ Ac , for
9
Metric Spaces
10
MATH 487
Lecture 5
Remark
In a topological space, Proposition 4.3 is the definition of a closed set. To see why, note
that metric spaces are special cases of topological spaces. To define a closed set in a
metric space, we used contact points, and to define contact points, we needed a metric. A
topological space has no metric in general, and hence we cannot use contact points in our
definition of a closed set.
Recall that in a topological space (X, τ ), the elements in the set τ = {A ⊆ X} are called open
sets. This means E ⊆ X is closed if and only if E c ∈ τ .
Proposition 5.1
E = {x ∈ X : x is a contact point of E}
as the closure of E.
We can also define the closure of a subset sequentially through Proposition 4.2.
E = {x ∈ X : ∃(xn )∞
n=1 s.t. (xn ) is in E and xn → x} = {all sequential limits on E}
as the closure of E.
11
Metric Spaces
Proposition 5.2
1. E ⊆ E.
2. E is closed.
1
0 ≤ d(yn , x) ≤ d(yn , xn ) + d(xn , x) ≤ + d(xn , x)
n
by the triangle inequality. In the limit, d(xn , x) → 0 so d(yn , x) → 0 by the Squeeze Theorem.
Thus yn → x and (yn ) is in E. Hence x ∈ E and E is closed. ■
12
MATH 487
Lecture 6
Let (X, d1 ) and (Y, d2 ) be metric spaces and let f : X → Y be a function. Then f is
continuous at x0 ∈ X if for all ε > 0 there exists some δ(ε) > 0 such that if x ∈ B(x0 , δ(ε)),
then f (x) ∈ B(f (x0 ), ε), or equivalently, if d1 (x, x0 ) < δ(ε), then d2 (f (x), f (x0 )) < ε. If
f is continuous at every x0 ∈ X, then f is continuous on X.
Proposition 6.1
Let (X, d1 ), (Y, d2 ) be metric spaces and f : X → Y be a function. Then the following
are equivalent.
1. f is continuous on X.
2. If (xn )∞
n=1 is in X such that xn → x ∈ X, then f (xn ) → f (x) ∈ Y .
Proposition 6.2
Let (X, d1 ), (Y, d2 ), and (Z, d3 ) be metric spaces. Suppose f : X → Y and g : Y → Z are
continuous functions. Then g ◦ f : X → Z is also continuous on X.
Proposition 6.3
Suppose (X, d1 ), (Y, d2 ) are metric spaces and let f : X → Y be a function. Further,
suppose there exists some c > 0 such that d2 (f (x1 ), f (x2 )) ≤ c d1 (x1 , x2 ) for all x1 , x2 ∈ X.
Then f is continuous on X.
Proof. We will use Proposition 6.1. Suppose xn → x on X, where (xn ), x are in X. Then
for all n ∈ N. In the limit, d1 (xn , x) → 0 so d2 (f (xn ), f (x)) → 0 by the Squeeze Theorem.
Thus f (xn ) → f (x) and the result follows. ■
13
Metric Spaces
1. f is bijective,
2. f is continuous,
Further, we say that (X, τ1 ) and (Y, τ2 ) are homeomorphic if there exists a homeomorphism
between them.
14
MATH 487
Lecture 7
Proposition 7.1
Proof. We prove the converse: let A ⊆ X and suppose f (A) is open. Then A = f −1 (f (A))
as f is bijective. Hence A is open as f is continuous and f (A) is open. To prove the forward,
−1
suppose A ⊆ X is open. Then f (A) = f −1 (A) as f is bijective. But since f −1 is
continuous and A is open, we must have that f (A) is open. ■
Remark
A homeomorphism may not preserve boundedness. For example, consider
x
f : (0, 1) → (0, ∞) where f (x) = .
1−x
Isometry Definition
1. f is bijective,
Proposition 7.2
Proof. As
d2 (f (x1 ), f (x2 )) = d1 (x1 , x2 ) ≤ 1 · d1 (x1 , x2 ),
then f is continuous by Proposition 6.3. Now let f (x1 ) = y1 and f (x2 ) = y2 . Then
for all y1 , y2 ∈ Y . Then (Y, dY ) is also a metric space and dY is called the subspace metric
on Y .
15
Metric Spaces
Are open sets in a subspace still open in the parent metric space?
Example 7.1
Consider the subset [0, 1) ⊂ R and the metric space (R, | · |). Then ([0, 1), | · |) is a metric
space. Hence
1 1 1
BY 0, = y ∈ Y : d(y, 0) < = 0,
2 2 2
is open in Y but not in X.
Likewise, there exist sets that are closed in a subspace but not in the parent metric space.
16
MATH 487
Lecture 8
Cauchy Sequence Definition
Let (X, d) be a metric space. Then a sequence (xn )∞n=1 in X is Cauchy if for all ε > 0,
there exists some N (ε) ∈ N such that if m > n > N (ε), then d(xm , xn ) < ε.
Proposition 8.1
1. If (xn )∞
n=1 converges in (X, d) to some x ∈ X, then (xn ) is a Cauchy sequence.
2. If (xn )∞ ∞
n=1 is a Cauchy sequence and there exists a subsequence (xnk )k=1 of (xn )
such that xnk → x ∈ X, then xn → x.
Proof of 1. Suppose xn → x ∈ X and let ε > 0. Then thereexists some N 2ε ∈ N such that
if n > N 2ε , we have d(xn , x) < 2ε . Hence if m > n > N 2ε , the triangle inequality implies
ε ε
d(xm , xn ) ≤ d(xn , x) + d(x, xm ) < + = ε. ■
2 2
Proof of 2. Let ε > 0. The triangle inequality implies d(xn , x) ≤ d(xn , xnk ) + d(xnk , x). As
(xn ) is Cauchy and xnk → x, then
ε ε
d(xn , xnk ) + d(xnk , x) < + = ε. ■
2 2
Not all Cauchy sequences are convergent. This leads to the following definition.
Example 8.1
Example 8.2
Consider L2 , d where
Z ∞
2 2
L = f :R→R| [f (x)] dx < ∞
−∞
and 1
Z ∞ 2
2
d(f, g) = |f (x) − g(x)| dx
−∞
L2C = L2 ∩ {f : R → R | f is continuous}.
17
Metric Spaces
this, let
0 x < −1,
x + 1 −1 ≤ x < 0,
fn (x) =
−nx + 1 0 ≤ x ≤ n1 ,
x > n1
0
1 1 1
!1
Z ∞ Z ∞ 2
1
2 2
Z
n
d(fm , fn ) = |fm (x) − fn (x)|2 dx = 1 dx = 1 dx =√ .
−∞ −∞ 0 n
which is discontinuous and hence not in L2C . To demonstrate this, see that
1 1 1
!1
Z ∞ Z ∞ 2
1
2 2
Z
n
d(fn , g) = |fn (x) − g(x)|2 dx ≤ 1 dx = 1 dx =√ .
−∞ −∞ 0 n
f ∈ L2C by contradiction. Suppose that fn → f for some f ∈ L2C . Then the triangle
inequality implies d(f, g) ≤ d(f, fn ) + d(fn , g). In the limit, d(f, fn ) → 0 and d(fn , g) → 0,
so the Squeeze Theorem implies d(f, g) → 0. As f, g are independent of n, we must have
d(f, g) = 0 so that f = g ∈/ L2C , a contradiction. Hence, we have found a Cauchy sequence
(fn ) in L2C that does not converge to a function within L2C . In other words, L2C is not
complete.
1.5 y
f1
f2
1 f3
0.5
x
−1 −0.5 0.5 1
−0.5
18
MATH 487
Lecture 9
Remark
If (X, d) is not complete, then there is a unique, complete metric space Y, de such that
X ⊆ Y and d(x e 1 , x2 ) = d(x1 , x2 ) for x1 , x2 ∈ X. We call Y, de the completion of (X, d).
Example 9.1
Consider the space (Q, | · |), which is not complete. Then (R, | · |) is the completion of
(Q, | · |).
for all x, y ∈ X. Then there is a unique x0 ∈ X such that T (x0 ) = x0 . In other words, x0
is a unique, fixed point of T .
The contraction mapping theorem is also known as the Banach fixed-point theorem.
Then
0 ≤ d(x0 , y0 ) = d(T (x0 ), T (y0 )) ≤ α d(x0 , y0 )
This implies d(x0 , y0 ) (1 − α) ≤ 0, and as 1 − α > 0, we must have d(x0 , y0 ) = 0. Hence
x0 = y0 . ■
Proof of Existence. Note that T satisfies the Lipschitz condition with c = α and is hence
continuous. Now define a sequence (xn )∞ n=1 in X inductively as follows: let x1 ∈ X be
arbitrary and let xn+1 = T (xn ). In fact, (xn ) is Cauchy. To this effect, let n > m where
n, m ∈ N. Then
d(xn , xm ) = d(T (xn−1 ), T (xm−1 )) ≤ α d(xn−1 , xm−1 )
and in turn,
α d(xn−1 , xm−1 ) = α d(T (xn−2 ), T (xm−2 )) ≤ α2 d(xn−2 , xm−2 ).
Continuing in this manner and applying the triangle inequality, we see that
d(xn , xm ) ≤ αm−1 d(xn−m+1 , x1 )
≤ αm−1 [d(x1 , x2 ) + d(x2 , x3 ) + d(x3 , x4 ) + · · · + d(xn−m , xn−m+1 )]
≤ αm−1 d(x1 , x2 ) + α d(x1 , x2 ) + α2 d(x1 , x2 ) + · · · + αn−m−1 d(x1 , x2 )
1 − αn−m
m−1
=α d(x1 , x2 )
1−α
α m−1
≤ d(x1 , x2 ).
1−α
19
Metric Spaces
In the limit, the expression in the last inequality approaches 0, as α < 1. Hence, (xn ) is a
Cauchy sequence. As (X, d) is complete, there exists some x0 ∈ X such that xn → x0 . To
close the proof, we will utilize the continuity of T . As T is continuous,
T (x0 ) = T lim xn = lim T (xn ) = lim xn+1 = x0 . ■
n→∞ n→∞ n→∞
Remark
If (X, ∥ · ∥) is a normed space, let d(x, y) = ∥x − y∥ for all x, y ∈ X. Then (X, d) is a
metric space.
20
MATH 487
Lecture 10
Example 10.1
Consider
L1C = L1 ∩ {f : R → R | f is continuous}.
Define ∥ · ∥ : L1C → [0, ∞) where
Z ∞
∥f ∥ = |f (x)| dx.
−∞
a contradiction, and f (x) = 0. This demonstrates that ∥ · ∥ satisfies the first condition.
Furthermore, Z ∞ Z ∞
∥cf ∥ = |cf (x)| dx = |c| |f (x)| dx = |c|∥f ∥
−∞ −∞
for all f ∈ L1Cand c ∈ R. Lastly, the triangle inequality for real numbers implies
Z ∞ Z ∞
∥f + g∥ = |f (x) + g(x)| dx = |f (x)| + |g(x)| dx
−∞ −∞
Z ∞ Z ∞
= |f (x)| dx + |g(x)| dx
−∞ −∞
= ∥f ∥ + ∥g∥.
Proposition 10.1
LpC = Lp ∩ {f : R → R | f is continuous}
( Z ∞ 1 )
p
= f :R→R| |f (x)|p dx < ∞ ∩ {f : R → R | f is continuous}.
−∞
21
Metric Spaces
then 1 Z 1
Z ∞ Z ∞ p ∞ p
p p
|f (x)g(x)| dx ≤ |f (x)| dx |g(x)| dx .
−∞ −∞ −∞
We will again prove ∥f ∥ = 0 implies f (x) = 0 by contradiction. If f (x) ̸= 0, then there exists
some x0 ∈ R such that |f (x0 )| > 0. By the continuity of f , there exists some δ > 0 such that
|f (x)| > 2ε for all x ∈ B(x0 , δ). Hence,
Z ∞ 1 h i1
p ε p p
p
∥f ∥ = |f (x)| dx ≥ 2δ > 0,
−∞ 2
a contradiction, and f (x) = 0. This demonstrates that ∥ · ∥ satisfies the first condition.
Furthermore,
Z ∞ 1 Z ∞ 1
p p
p p
∥cf ∥ = |cf (x)| dx = |c| |f (x)| dx = |c| ∥f ∥
−∞ −∞
for all f ∈ LpC and c ∈ R. The last condition is given by the Minkowski inequality. Therefore
LpC , ∥ · ∥ is a normed space. ■
22
MATH 487
Lecture 11
Example 11.1
recall that
L∞
C = f : R → R| sup |f (x)| < ∞ ∩ {f : R → R | f is continuous}.
x∈R
Let f be a function in L∞
C and let
∥f ∥ = sup |f (x)|.
x∈R
Then (L∞ ∞ ∞
C , ∥ · ∥) is a normed space. We can define a metric d : LC × LC → R by
d(f, g) = ∥f − g∥
where g ∈ L∞
C.
Example 11.2
Let a = (an )∞ p
n=1 be a sequence in l (N) and let
∞
!1
X p
∥a∥ = |an |p .
n=1
Then (lp (N), ∥ · ∥) is a normed space. We can define a metric d : lp (N) × lp (N) → R by
d(a, b) = ∥a − b∥
where b = (bn )∞ p
n=1 ∈ l (N).
Example 11.3
Recall that
∞
l (N) = (an )∞
n=1 : ai ∈ R, i ∈ N and sup |an | < ∞ .
n∈N
Let a = (an )∞
n=1 be a sequence in l∞ (N) and let
Then (l∞ (N), ∥ · ∥) is a normed space. We can define a metric d : l∞ (N) × l∞ (N) → R by
d(a, b) = ∥a − b∥
where b = (bn )∞ ∞
n=1 ∈ l (N).
23
Metric Spaces
Remark
Let (X, d) be a metric space. Then A = X if and only if for all x ∈ X, there exists some
ε > 0 such that B(x, ε) ∩ A ̸= ∅.
A topological space (X, τ ) is separable if there exists a countable subset A ⊆ X such that
A = X. In other words, A is a countable, dense subset of X.
Example 11.4
n
!1 "n
#1 n
!1 n
!1
2
ε 2 2
ε2 2 2
X X X X 1 1
d(x, r) = (xk − rk )2 < √ = =ε = ε(1) 2 = ε.
n n n
k=1 k=1 k=1 k=1
24
MATH 487
Lecture 12
Example 12.1
Let a = (an )∞ ∞ p
n=1 and b = (bn )n=1 be sequences in l (N) and let
∞
!1
X p
p
d(a, b) = |an − bn | .
n=1
Ak = {(r1 , r2 , . . . , rk , 0, 0, . . .) : ri ∈ Q, 1 ≤ i ≤ k}.
is
Palso countable. We claim A = lp (N). To this effect, let x = (xn )∞ p
n=1 ∈ l (N) and ε > 0. As
∞ p
n=1 |xn | < ∞, there exists some N (ε) ∈ N such that
∞
X εp
|xn |p < .
2
n=N (ε)+1
N (ε) ∞ N (ε)
!p N (ε)
p
X
p
X
p
X ε εp X εp εp
d(x, r) = |xk − rk | + |xk | < 1 + = +
(2N (ε)) p 2 2N (ε) 2
k=1 k=N (ε)+1 k=1 k=1
p
ε εp
= N (ε) +
2N (ε) 2
p
=ε .
This implies d(x, r) < ε. We have shown that no matter what element x in lp (N) we choose,
there is some element r in A within the ε-neighborhood of x for arbitrary ε. Hence r → x
and lp (N) ⊆ A. As it is clear that A ⊆ lp (N), we conclude that A = lp (N) and (lp (N), d) is
separable. ■
25
Metric Spaces
Example 12.2
Recall that
∞
l (N) = (an )∞
n=1 : ai ∈ R, i ∈ N and sup |an | < ∞ .
n∈N
Let a = (an )∞
n=1 and b = (bn )∞
n=1 be sequences in l∞ (N) and let
Proof. Let
S = {(xn )∞
n=1 : xi = 1 or 2, i ≥ 1}.
Suppose S is countable. Then we can list its elements as y1 , y2 , y3 , . . . and so on. Now let
z = (zn )∞n=1 be defined as follows: if the ith term of yi is 1, then zi = 2, and if the ith term
of yi is 2, then zi = 1. Then z ∈ / S as z is different from all elements y1 , y2 , y3 , . . . in S, which
demonstrates that S must be uncountable.
Now, if x = (xn )∞ ∞
n=1 , y = (yn )n=1 ∈ S are such that x ̸= y, we know
1
B x, :x∈S
2
is uncountable. If A ⊆ l∞ (N) is dense, then A has at least one point in each open ball B x, 21
where x ∈ S. Hence, A must be uncountable, proving that any dense subset of l∞ (N) must
be uncountable. By taking the contrapositive, we see that (l∞ (N), d) is not separable. ■
26