Loading [MathJax]/jax/output/HTML-CSS/jax.js
Skip to main content
Library homepage
 

Text Color

Text Size

 

Margin Size

 

Font Type

Enable Dyslexic Font
Mathematics LibreTexts

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”.

Definition

Let X be a nonempty set and d be a function which returns a real number d(A,B) for any pair A,BX. Then d is called metric on X if for any A,B,CX, 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,BX, the value d(A,B) is called distance from A to B.

Example 1.3.1 Discrete metric

Let X be an arbitrary set. For any A,BX, set d(A,B)=0 if A=B and d(A,B)=1 otherwise. The metric d is called discrete metric on X.

Example 1.3.2 Real line

Set of all real numbers (R) with metric d defined by

d(A,B):=|AB|.

Exercise 1.3.1

Show that d(A,B)=|AB|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)=(xAxB)2+(yAyB)2.
  • Manhattan metric, denoted by d1 and defined as
    d1(A,B)=|xAxB|+|yAyB|.
  • Maximum metric, denoted by d and defined as
    d(A,B)=max{|xAxB|,|yAyB|}.
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=xBxA, y1=yByA,
x2=xCxB, y2=yCyB.

(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)2x21+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(x1y2x2y1)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.


This page titled 1.3: Metric spaces is shared under a CC BY-SA 4.0 license and was authored, remixed, and/or curated by Anton Petrunin via source content that was edited to the style and standards of the LibreTexts platform.

Support Center

How can we help?