# Introduction

## Contents

# 3.1. Introduction#

## 3.1.1. Distance Functions#

(Distance function/Metric)

Let \(X\) be a nonempty set.
A function \(d : X \times X \to \RR\)
is called a *distance function* or a *metric* if it satisfies the
following properties for any elements \(x,y,z \in X\):

Non-negativity: \(d(x, y) \geq 0\)

Identity of indiscernibles: \(d(x, y) = 0 \iff x = y\)

Symmetry: \(d(x, y) = d(y, x)\)

Triangle inequality: \(d(x,y) \leq d(x, z) + d(z, y)\)

It is customary to call the elements of a set \(X\) associated with a distance function as points.

Distance functions are real valued.

Distance functions map an ordered pair of points in \(X\) to a real number.

Distance between two points in the set \(X\) can only be non-negative.

Distance of a point with itself is 0. In other words, if the distance between two points is 0, then the points are identical. i.e. the distance function works as a discriminator between the points of the set \(X\).

Symmetry means that the distance from a point \(x\) to another point \(y\) is same as the distance from \(y\) to \(x\).

Triangle inequality says that the direct distance between two points can never be longer than the distance covered through an intermediate point.

## 3.1.2. Metric Spaces#

(Metric space)

Let \(d\) be a distance function on a set \(X\). Then
we say that \((X, d)\) is a *metric space*. The
elements of \(X\) are called points.

In general, a set \(X\) can be associated with different metrics (distance functions) say \(d_1\) and \(d_2\). In that case, the corresponding metric spaces \((X, d_1)\) and \((X, d_2)\) are different.

When a set \(X\) is equipped with a metric \(d\) to create a metric space \((X, d)\), we say that \(X\) has been

*metrized*.If the metric \(d\) associated with a set \(X\) is obvious from the context, we will denote the corresponding metric space \((X,d)\) by simply \(X\). E.g., \(|x-y|\) is the standard distance function on the set \(\RR\).

When we say that let \(Y\) be a subset of a metric space \((X,d)\), we mean that \(Y \subset X\).

Similarly, a point in a metric space \((X,d)\) means the point in the underlying set \(X\).

Note

Some authors prefer the notation \(d : X \times X \to \RR_+\). With this notation, the non-negativity property is embedded in the type signature of the function (i.e. the codomain specification) and doesn’t need to be stated explicitly.

## 3.1.3. Properties of Metrics#

(Triangle inequality alternate form)

Let \((X, d)\) be a metric space. Let \(x,y,z \in X\).

Proof. From triangle inequality:

Interchanging \(x\) and \(y\) gives:

Combining the two, we get:

## 3.1.4. Metric Subspaces#

(Metric subspace)

Let \((X, d)\) be a metric space. Let \(Y \subset X\) be a nonempty
subset of \(X\). Then, \(Y\) can be viewed as a metric space
in its own right with the distance function \(d\)
restricted
to \(Y \times Y\), denoted as \(d|_{Y \times Y}\). We then say
that \((Y, d|_{Y \times Y})\) or simply \(Y\) is a
*metric subspace* of \(X\).

It is customary to drop the subscript \(Y \times Y\) from the restriction of \(d\) and write the subspace simply as \((Y, d)\).

\([0,1]\) is a metric subspace of \(\RR\) with the standard metric \(d(x, y) = |x -y|\) restricted to \([0,1]\). In other words, the distance between any two points \(x, y \in [0, 1]\) is calculated by viewing \(x,y\) as points in \(\RR\) and using the standard metric for \(\RR\).

## 3.1.5. Examples#

\(\RR^n\) p-distance)

(For some \(1 \leq p \lt \infty\), the function \(d_p : \RR^n \times \RR^n \to \RR\):

is a metric and \((\RR^n, d_p)\) is a metric space.

\(\RR^n\) Euclidean space)

(The \(d_2\) metric over \(\RR^n\):

is known as the *Euclidean distance* and
the metric space \((\RR^n, d_2)\) is known as the
*n-dimensional Euclidean (metric) space*.

The standard metric for \(\RR^n\) is the Euclidean metric.

(Discrete metric)

Let \(X\) be a nonempty set:

Define:

\((X, d)\) is a metric space. This distance is called *discrete distance*
and the metric space is called a *discrete metric space*.

Discrete metric spaces are discussed in depth in Discrete Metric Space. They help clarify many subtle issues in the theory of metric spaces.

\(\ERL\) A metric space for the extended real line)

(Consider the mapping \(\varphi : \ERL \to [-1, 1]\) given by:

\(\varphi\) is a bijection from \(\ERL\) onto \([-1, 1]\).

\([-1, 1]\) is a metric space with the standard metric for the real line \(d_{\RR}(x, y) = |x - y|\) restricted to \([-1, 1]\).

Consider a function \(d: \ERL \times \ERL \to \RR\) defined as

The function \(d\) satisfies all the requirements of a metric. It is the standard metric on \(\ERL\).

\(\ell^p\) Real sequences)

(For any \(1 \leq p < \infty\), we define:

as the set of real sequences \(\{ a_n \}\) such that the series \(\sum a_n^p\) is absolutely summable.

It can be shown that the set \(\ell^p\) is closed under sequence addition.

Define a map \(d_p : \ell^p \times \ell^p \to \RR\) as

\(d_p\) is a valid distance function over \(\ell^p\). We metrize \(\ell^p\) with \(d_p\) as the standard metric.

## 3.1.6. Products of Metric Spaces#

(Finite products of metric spaces)

Let \((X_1, d_1), (X_2, d_2), \dots, (X_n, d_n)\) be \(n\) metric spaces.

Let \(X = X_1 \times X_2 \times \dots \times X_n\). Define a map \(\rho : X \times X \to \RR\) as:

\(\rho\) is a distance function on \(X\). The metric space
\((X, \rho)\) is called the *product* of metric spaces \((X_i, d_i)\).

## 3.1.7. Distance between Sets and Points#

(Distance between a point and a set)

The distance between a nonempty set \(A \subseteq X\) and a point \(x\in X\) is defined as:

Since \(A\) is nonempty, hence the set \(D = \{ d(x,a) \Forall a \in A \}\) is not empty.

\(D\) is bounded from below since \(d(x, a) \geq 0\).

Since \(D\) is bounded from below, hence it does have an infimum.

Thus, \(d(x, A)\) is well-defined and finite.

Since \(A\) is non-empty, hence there exists \(a \in A\).

\(d(x, a) \in D\).

Thus, \(D\) is bounded from above too.

Thus, \(0 \leq d(x, A) \leq d(x, a)\).

If \(x \in A\), then \(d(x, A) = 0\).

If \(x \in A\), then \(d(x, A) = 0\).

Let \(X = \RR\) and \(A = (0, 1)\).

Let \(x = 0\).

Then \(d(x, A) = 0\).

However, \(x \notin A\).

Thus, \(d(x,A) = 0\) doesn’t imply that \(x \in A\).

Distance of a set with its accumulation points is 0. See Theorem 3.21.

## 3.1.8. Distance between Sets#

(Distance between sets)

The distance between two nonempty sets \(A,B \subseteq X\) is defined as: