1.3: Metric spaces
( \newcommand{\kernel}{\mathrm{null}\,}\)
The notion of metric space provides a rigorous way to say: “we can mea- sure distances between points”. That is, instead of (i) on Section 1.1, we can say “Euclidean plane is a metric space”.
Let X be a nonempty set and d be a function which returns a real number d(A,B) for any pair A,B∈X. Then d is called metric on X if for any A,B,C∈X, the following conditions are satisfied:
(a) Positiveness:
d(A,B)≥0.
(b) A=B if and only if
d(A,B)=0.
(c) Symmetry:
d(A,B)=d(B,A)
(d) Triangle inequality:
d(A,C)≤d(A,B)+d(B,C).
A metric space is a set with a metric on it. More formally, a metric space is a pair (X,d) where X is a set and d is a metric on X.
The elements of X are called points of the metric space. Given two points A,B∈X, the value d(A,B) is called distance from A to B.
Let X be an arbitrary set. For any A,B∈X, set d(A,B)=0 if A=B and d(A,B)=1 otherwise. The metric d is called discrete metric on X.
Set of all real numbers (R) with metric d defined by
d(A,B):=|A−B|.
Exercise 1.3.1
Show that d(A,B)=|A−B|2 is not a metric on R.
Metrics on the plane. Suppose that R2 denotes the set of all pairs (x,y) of real numbers. Assume A=(xA,yA) and B=(xB,yB). Consider the following metrics on R2:
- Euclidean metric, denoted by d2, and defined as
d2(A,B)=√(xA−xB)2+(yA−yB)2. - Manhattan metric, denoted by d1 and defined as
d1(A,B)=|xA−xB|+|yA−yB|. - Maximum metric, denoted by d∞ and defined as
d∞(A,B)=max{|xA−xB|,|yA−yB|}.
- Hint
-
Check the triangle inequality for A=0, B=1 and C=2.
Exercise 1.3.2
Prove that the following functions are metrics on R2:
(a) d1;
(b) d2;
(c) d∞.
- Answer
-
Only the triangle inequality requires a proof — the rest of conditions in Definition 1.1 are evident. Let A=xA,yA), B=(xB,yB), and C=(xC,yC). Set
x1=xB−xA, y1=yB−yA,
x2=xC−xB, y2=yC−yB.(a). The inequality
d1(A,C)≤d1(A,B)+d1(B,C)
can be written as
|x1+x2|+|y1+y2|≤|x1|+|y1|+|x2|+|y2|.
The latter follows since |x1+x2|≤|x1|+|x2| and |y1+y2|≤|y1|+|y2|.
(b). The inequality
d2(A,C)≤d2(A,B)+d2(B,C)
can be written as
√(x1+x2)2+(y1+y2)2≤√x21+y21+√x22+y22.
Take the square of the left and the right hand sides, simplify, take the square again and simplify again. You should get the following inequality
0≤(x1⋅y2−x2⋅y1)2,
which is equivalent to 1.3.9 and evidently true.
(c). The inequality
d∞(A,C)≤d∞(A,B)+d∞(B,C)
can be written as
max{|x1+x2|,|y1+y2|}≤max{|x1|,|y1|}+max{|x2|,|y2|}.
Without loss of generality, we may assume that
max{|x1+x2|,|y1+y2|}=|x1+x2|.
Further,
|x1+x2|≤|x1|+|x2|≤max{|x1|,|y1|}+max{|x2|,|y2|}.
Hence 1.3.13 follows.