3.1. IntroductionΒΆ

3.1.1. Distance FunctionsΒΆ

Definition 3.1 (Distance function/Metric)

Let X be a nonempty set. A function d:XΓ—Xβ†’R is called a distance function or a metric if it satisfies the following properties for any elements x,y,z∈X:

  1. Non-negativity: d(x,y)β‰₯0

  2. Identity of indiscernibles: d(x,y)=0⟺x=y

  3. Symmetry: d(x,y)=d(y,x)

  4. Triangle inequality: d(x,y)≀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ΒΆ

Definition 3.2 (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 d1 and d2. In that case, the corresponding metric spaces (X,d1) and (X,d2) 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 R.

  • When we say that let Y be a subset of a metric space (X,d), we mean that YβŠ‚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Γ—Xβ†’R+. 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ΒΆ

Proposition 3.1 (Triangle inequality alternate form)

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

|d(x,z)βˆ’d(y,z)|≀d(x,y).

Proof. From triangle inequality:

d(x,z)≀d(x,y)+d(y,z)⟹d(x,z)βˆ’d(y,z)≀d(x,y).

Interchanging x and y gives:

d(y,z)βˆ’d(x,z)≀d(y,x)=d(x,y).

Combining the two, we get:

|d(x,z)βˆ’d(y,z)|≀d(x,y).

3.1.4. Metric SubspacesΒΆ

Definition 3.3 (Metric subspace)

Let (X,d) be a metric space. Let YβŠ‚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Γ—Y, denoted as d|YΓ—Y. We then say that (Y,d|YΓ—Y) or simply Y is a metric subspace of X.

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

Example 3.1

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

3.1.5. ExamplesΒΆ

Example 3.2 (Rn p-distance)

For some 1≀p<∞, the function dp:RnΓ—Rnβ†’R:

dp(x,y)β‰œ(βˆ‘i=1n|xiβˆ’yi|p)1p

is a metric and (Rn,dp) is a metric space.

Example 3.3 (Rn Euclidean space)

The d2 metric over Rn:

d2(x,y)β‰œ(βˆ‘i=1n|xiβˆ’yi|2)12

is known as the Euclidean distance and the metric space (Rn,d2) is known as the n-dimensional Euclidean (metric) space.

The standard metric for Rn is the Euclidean metric.

Example 3.4 (Discrete metric)

Let X be a nonempty set:

Define:

d(x,y)={0x=y1x≠y.

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

Example 3.5 (R― A metric space for the extended real line)

Consider the mapping Ο†:R―→[βˆ’1,1] given by:

Ο†(x)={t1+|t|x∈Rβˆ’1x=βˆ’βˆž1x=∞.

Ο† is a bijection from R― onto [βˆ’1,1].

[βˆ’1,1] is a metric space with the standard metric for the real line dR(x,y)=|xβˆ’y| restricted to [βˆ’1,1].

Consider a function d:R―×R―→R defined as

d(s,t)=|Ο†(s)βˆ’Ο†(t)|.

The function d satisfies all the requirements of a metric. It is the standard metric on R―.

Example 3.6 (β„“p Real sequences)

For any 1≀p<∞, we define:

β„“p={{an}∈RN|βˆ‘i=1∞|ai|p}

as the set of real sequences {an} such that the series βˆ‘anp is absolutely summable.

It can be shown that the set β„“p is closed under sequence addition.

Define a map dp:ℓp×ℓp→R as

dp({an},{bn})=βˆ‘i=1∞|aiβˆ’bi|p.

dp is a valid distance function over β„“p. We metrize β„“p with dp as the standard metric.

3.1.6. Products of Metric SpacesΒΆ

Definition 3.4 (Finite products of metric spaces)

Let (X1,d1),(X2,d2),…,(Xn,dn) be n metric spaces.

Let X=X1Γ—X2Γ—β‹―Γ—Xn. Define a map ρ:XΓ—Xβ†’R as:

ρ((a1,a2,…,an),(b1,b2,…,bn))=βˆ‘i=1ndi(ai,bi).

ρ is a distance function on X. The metric space (X,ρ) is called the product of metric spaces (Xi,di).

3.1.7. Distance between Sets and PointsΒΆ

Definition 3.5 (Distance between a point and a set)

The distance between a nonempty set AβŠ†X and a point x∈X is defined as:

d(x,A)β‰œinf{d(x,a)βˆ€a∈A}.
  • Since A is nonempty, hence the set D={d(x,a)βˆ€a∈A} is not empty.

  • D is bounded from below since d(x,a)β‰₯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∈A.

  • d(x,a)∈D.

  • Thus, D is bounded from above too.

  • Thus, 0≀d(x,A)≀d(x,a).

  • If x∈A, then d(x,A)=0.

Theorem 3.1

If x∈A, then d(x,A)=0.

Example 3.7

  1. Let X=R and A=(0,1).

  2. Let x=0.

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

  4. However, xβˆ‰A.

  5. Thus, d(x,A)=0 doesn’t imply that x∈A.

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

3.1.8. Distance between SetsΒΆ

Definition 3.6 (Distance between sets)

The distance between two nonempty sets A,BβŠ†X is defined as:

d(A,B)β‰œinf{d(a,b)|a∈A,b∈B}.