Metric spaces
Math 464: Class 2
Metric spaces
The notion of metric space is a far-reaching generalization of the intuitive spaces Rn . Let us start with a
motivating example.
Consider X “ Rn “ tpx1 , x2 , . . . , xn q : xj P Ru. The Euclidean distance between two points x, y P Rn is
defined by the Pitagorean formula g
f n
def f ÿ
dpx, yq “ e pxj ´ yj q2 (1)
j“1
We can, and shall, regard d above as a function on X ˆ X with values in R` (the nonnegative real numbers); it
is clear from the formula that the distance is never a negative number. What are the properties of d?
0 for any pair x, y P X we have dpx, yq ě 0;
1 the equality dpx, yq “ 0 occurs if and only if x “ y;
2 dpx, yq “ dpy, xq (symmetry);
3 the distance satisfies the triangle inequality, namely, for all x, y, z P X
dpx, yq ď dpx, zq ` dpz, yq. (2)
The first three properties of d are rather obvious. Let us verify the triangle inequality.
We first need the
, Metric spaces
Lemma 1 (Cauchy-Schwartz inequality)
Let x, y P Rn ; then
ˇ ˇ g g
ˇ n
f n f n 2
ˇ f ÿ f ÿ
ˇ ÿ ˇ
ˇ
ˇ x y
j jˇ ď
ˇ e x2
j
e yj (3)
ˇj“1 ˇ j“1 j“1
Furthermore the equality occurs if and only if x “ cy for some scalar number c.
Proof. Let t P R and consider the function
“C
hkkkikkkj “B
hkkkkkikkkkkj “A
hkkkikkkj
n n n n
2 2 2 2
ÿ ÿ ÿ ÿ
f ptq “ pxj ´ tyj q “ xj ´2t xj yj `t yj (4)
j“1 j“1 j“1 j“1
This function is a parabola in t and it is clearly always positive. The minimum of f ptq is for t “ B
A
and this
minimum value must be nonnegative, thus
B2 B2 B2
0 ď f pB{Aq “ C ´ 2 ` A“C´ (5)
A A2 A
This yields AC ´ B 2 ě 0 or B 2 ď AC. This inequality is precisely the square of (3).
As for the second assertion suppose that we have B 2 “ AC; this occurs iff the minimum of f ptq is zero at some
t “ c. But this can only happen if xj “ cyj for all j, namely x “ cy. Q.E.D.
, Metric spaces
We now prove the triangle inequality as a consequence of the Cauchy-Schwartz inequality. To simplify the
computation we notice that dpx, yq is not changed if we add the same vector c to both x, y. Thus it is sufficient
to show the inequality (2) in the case where z is the zero vector. Now, squaring (2) we obtain
n n n n
2 2 2 2
ÿ ÿ ÿ ÿ
dpx, yq “ pxj ´ yj q “ xj ` yj ´ 2 xj yj ď (6)
j“1 j“1 j“1 j“1
ˇ ˇ ¨ ˛1
n n ˇ n ˇ n
ˇ C.S. ÿ n n n 2
2 2 2 2 2 2
ÿ ÿ ˇ ÿ ÿ ÿ ÿ
ď xj ` yj ` 2 ˇˇ xj yj ˇˇ ď xj ` yj ` 2 ˝ xj yj ‚ “ (7)
j“1 j“1 ˇj“1 ˇ j“1 j“1 j“1 j“1
´ ¯2
2 2
“ dpx, 0q ` dpy, 0q ` 2dpx, 0qdpy, 0q “ dpx, 0q ` dpy, 0q (8)
and thus, taking square root,
dpx, yq ď dpx, 0q ` dp0, yq (9)
The general case is obtained by translation.
Now the distance function d tells us how close or far are points; it is also called a metric
The idea
Forget about the details of the formula for d and of the example for X and retain only the four properties above as
a definition.
Math 464: Class 2
Metric spaces
The notion of metric space is a far-reaching generalization of the intuitive spaces Rn . Let us start with a
motivating example.
Consider X “ Rn “ tpx1 , x2 , . . . , xn q : xj P Ru. The Euclidean distance between two points x, y P Rn is
defined by the Pitagorean formula g
f n
def f ÿ
dpx, yq “ e pxj ´ yj q2 (1)
j“1
We can, and shall, regard d above as a function on X ˆ X with values in R` (the nonnegative real numbers); it
is clear from the formula that the distance is never a negative number. What are the properties of d?
0 for any pair x, y P X we have dpx, yq ě 0;
1 the equality dpx, yq “ 0 occurs if and only if x “ y;
2 dpx, yq “ dpy, xq (symmetry);
3 the distance satisfies the triangle inequality, namely, for all x, y, z P X
dpx, yq ď dpx, zq ` dpz, yq. (2)
The first three properties of d are rather obvious. Let us verify the triangle inequality.
We first need the
, Metric spaces
Lemma 1 (Cauchy-Schwartz inequality)
Let x, y P Rn ; then
ˇ ˇ g g
ˇ n
f n f n 2
ˇ f ÿ f ÿ
ˇ ÿ ˇ
ˇ
ˇ x y
j jˇ ď
ˇ e x2
j
e yj (3)
ˇj“1 ˇ j“1 j“1
Furthermore the equality occurs if and only if x “ cy for some scalar number c.
Proof. Let t P R and consider the function
“C
hkkkikkkj “B
hkkkkkikkkkkj “A
hkkkikkkj
n n n n
2 2 2 2
ÿ ÿ ÿ ÿ
f ptq “ pxj ´ tyj q “ xj ´2t xj yj `t yj (4)
j“1 j“1 j“1 j“1
This function is a parabola in t and it is clearly always positive. The minimum of f ptq is for t “ B
A
and this
minimum value must be nonnegative, thus
B2 B2 B2
0 ď f pB{Aq “ C ´ 2 ` A“C´ (5)
A A2 A
This yields AC ´ B 2 ě 0 or B 2 ď AC. This inequality is precisely the square of (3).
As for the second assertion suppose that we have B 2 “ AC; this occurs iff the minimum of f ptq is zero at some
t “ c. But this can only happen if xj “ cyj for all j, namely x “ cy. Q.E.D.
, Metric spaces
We now prove the triangle inequality as a consequence of the Cauchy-Schwartz inequality. To simplify the
computation we notice that dpx, yq is not changed if we add the same vector c to both x, y. Thus it is sufficient
to show the inequality (2) in the case where z is the zero vector. Now, squaring (2) we obtain
n n n n
2 2 2 2
ÿ ÿ ÿ ÿ
dpx, yq “ pxj ´ yj q “ xj ` yj ´ 2 xj yj ď (6)
j“1 j“1 j“1 j“1
ˇ ˇ ¨ ˛1
n n ˇ n ˇ n
ˇ C.S. ÿ n n n 2
2 2 2 2 2 2
ÿ ÿ ˇ ÿ ÿ ÿ ÿ
ď xj ` yj ` 2 ˇˇ xj yj ˇˇ ď xj ` yj ` 2 ˝ xj yj ‚ “ (7)
j“1 j“1 ˇj“1 ˇ j“1 j“1 j“1 j“1
´ ¯2
2 2
“ dpx, 0q ` dpy, 0q ` 2dpx, 0qdpy, 0q “ dpx, 0q ` dpy, 0q (8)
and thus, taking square root,
dpx, yq ď dpx, 0q ` dp0, yq (9)
The general case is obtained by translation.
Now the distance function d tells us how close or far are points; it is also called a metric
The idea
Forget about the details of the formula for d and of the example for X and retain only the four properties above as
a definition.