Loading [MathJax]/jax/element/mml/optable/BasicLatin.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
Hint

Check the triangle inequality for A = 0, B = 1 and C = 2.

Exercise \PageIndex{2}

Prove that the following functions are metrics on \mathbb{R}^2:

(a) d_1;
(b) d_2;
(c) d_{\infty}.

Answer

Only the triangle inequality requires a proof — the rest of conditions in Definition 1.1 are evident. Let A = x_A, y_A), B = (x_B, y_B), and C = (x_C, y_C). Set

x_1 = x_B - x_A, y_1 = y_B - y_A,
x_2 = x_C - x_B, y_2 = y_C - y_B.

(a). The inequality

d_1(A, C) \le d_1(A, B) + d_1(B, C)

can be written as

|x_1 + x_2| + |y_1 + y_2| \le |x_1| + |y_1| + |x_2| + |y_2|.

The latter follows since |x_1 + x_2| \le |x_1| + |x_2| and |y_1 + y_2| \le |y_1| + |y_2|.

(b). The inequality

d_2(A, C) \le d_2 (A, B) + d_2(B, C)

can be written as

\sqrt{(x_1 + x_2)^2 + (y_1 + y_2)^2} \le \sqrt{x_1^2 + y_1^2} + \sqrt{x_2^2 + y_2^2}.

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 \le (x_1 \cdot y_2 - x_2 \cdot y_1)^2,

which is equivalent to 1.3.9 and evidently true.

(c). The inequality

d_{\infty} (A, C) \le d_{\infty} (A, B) + d_{\infty} (B, C)

can be written as

\max \{|x_1 + x_2|, |y_1 + y_2|\} \le \max \{|x_1|, |y_1|\} + \max \{|x_2|, |y_2|\}.

Without loss of generality, we may assume that

\max \{|x_1 + x_2|, |y_1 + y_2|\} = |x_1 + x_2|.

Further,

|x_1 + x_2| \le |x_1| + |x_2| \le \max \{|x_1|, |y_1|\} + \max \{|x_2|, |y_2|\}.

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?