 Home Explore the BBC     Life | The Universe | Everything | Advanced Search            Click here to complete your registration. 3. Everything / Maths, Science & Technology / Mathematics

An Introduction to Metric Spaces  Many branches of mathematics are concerned with the continuity and convergence of functions. The study of metric spaces allows mathematicians to put this in a more general setting - the concepts involved in metric spaces are, on the whole, totally abstract. This entry aims to lay the foundations for the study of metric spaces...

What is a Metric Space?

In general terms, a metric space is a space (which could be a plane, the surface of a sphere, three-dimensional space, etc) in which we have a notion of 'distance' which fits in with our geometrical intuition. Formally, we say that:

A metric space M = {Ad} consists of a non-empty set A together with a distance function1 dA×A → R2 which satisfies:
1. d(xy) ≥ 0; d(xy) = 0 if and only if x = y
2. d(xy) = d(yx) for all xy in A
3. d(xy) + d(yz) ≥ d(xz) for all xyz in A

So, what does this actually mean? To start with, we must have a non-empty set A - basically a collection of one or more points. We also need a distance function, d, which can be used to calculate the distance between any two points of A. d must also follow certain rules.

The first rule says that we cannot have a negative distance - and the distance between two points can only be zero if the two points are, in fact, in exactly the same place. The second rule states that the distance between two points must be the same whichever direction we measure - going from x to y covers the same distance as going from y to x. Finally, we get the 'triangle inequality' - the combined distance of two sides of a triangle must not be less than the length of the third side.

Examples of Metric Spaces

Let us start with the most familiar metric space - the Euclidean metric in the plane. This is our intuitive distance function on flat surfaces - to measure a distance between two points, we take a straight line between them, and measure its length. Put formally, we use the distance function

d2(xy) = [(x1 - y1)2 + (x2 - y2)2]½

where x = (x1x2) and y = (y1y2).

This is not the only metric space, though. There are some much less intuitive metrics that we can use. For instance, the so-called 'Manhattan metric' on the plane. To measure a distance, we now measure the horizontal and vertical distances, and add the two together. In formal terms:

d1(xy) = |x1 - y1| + |x2 - y2|

Even more unusual is the 'infinity' metric - again we measure the vertical and horizontal distances, but the overall distance is the maximum of these two. That is:

d(xy) = Max {|x1 - y1|, |x2 - y2|} Using these different definitions of 'distance', think what a 'circle' would look like in each of them. By 'circle', we mean 'the set of all points lying at a given distance from a fixed point'. Look at the diagram - you should see that using the d1 metric, the circle is in fact a diamond, and with the d metric we get a square.

We can also have 'discrete' metric spaces. Our set A may be any collection of points - as many or few as we wish. We now define our metric d by:

 d(x, y) = { 1 if x ≠ y 0 if x = y

We must check that this satisfies our three rules. Clearly rules one and two hold for all points x & y, so it remains only to check rule three, the triangle inequality.

If x = z then d(xz) = 0, so d(xy) + d(yz) ≥  d(xz). If x ≠ z (and therefore d(xz) = 1) then at least one of x ≠ y, y ≠ z must be true. Then we must have d(xy) + d(yz) = 1 or 2, so the rule holds.

Taking things to extremes, we can have a metric space, which contains just one point. It will not make any difference which metric (d) we use on this space, for reasons which will become apparent. Let us examine the three rules for a metric space:

1. d(xy) ≥ 0; d(xy) = 0 if and only if x = y
2. Since d is a metric, the first part of this statement must be true. For the second part, we must remember that our set A has only one point - so x = y is always true. Therefore d(xy) = 0.

3. d(xy) = d(yx) for all xy in A
4. Since we only have one point x in our set, this reduces to 'd(xx) = d(xx) for all x in A', which is trivially true.

5. d(xy) + d(yz) ≥ d(xz) for all xyz in A
6. This reduces to 'd(xx) + d(xx) ≥ d(xx) for all x in A' which is again trivially true.

And so our single-point set is indeed a metric space.

Subspaces

Let M = {Ad} be a metric space, and let H be a non-empty subset of A. Let dHH×H → R be the restriction of d to points of H (ie dH(xy) = d(xy) for all points xy in H).

Since M is a metric space, the three rules for distance functions must hold for all points in A, and therefore for all points in H. Hence dH satisfies our earlier definition of a metric.

The resultant metric space {HdH} is called a subspace of M, and dH is the metric on H induced by d.

Boundedness

In analysis of metric spaces, the concept of an open space is particularly important. In order to properly define this idea, it is useful to first examine boundedness.

A subset S of a metric space M = {Ad} is said to be bounded if there exist a in A and K in R such that d(xa) ≤ K for all x in S.

Put simply, if there is a point a in A such that all the points of A are within a circle of radius K, centred on a (remember how different 'circles' can be depending on the metric being used), then A is bounded.

Notice that if S satisfies this definition for some a in A and K in R, then it will also satisfy the definition with a replaced by any other point a' of A, and K replaced by K' = K + d(aa').

To prove this, let us examine a point x of A. If d(xa) ≤ K (our first definition of boundedness) then:

 d(x, a') ≤ d(x, a) + d(a, a') (By the triangle inequality) ≤ K + d(a, a') (Because A bounded implies d(x, a) ≤ K) = K' (By substitution)

It is interesting to see that the union of any finite number of bounded subsets of a metric space is itself bounded. Note that we only need to prove that the union of two such subsets is bounded, since we may build the union of a finite number of subsets by forming a union of two subsets, then forming a union of our new subset with a third subset, etc.

Let S1S2 be two bounded subsets of a metric space M = {Ad}, and let a1a2 in A and K1K2 in R be such that d(xa1) ≤ K1 for all x in S1, and d(xa2) ≤ K2 for all x in S2.

Let a = a1, and K = Max {K1K2 + d(a1a2)}. Then for any xin the union of S1 and S2 there are two possibilities. Either x is in S1, in which case d(xa) ≤ K1 ≤ K, or x is in S2, in which case

 d(x, a) = d(x, a1) (By substitution) ≤ d(x, a2) + d(a2, a1) (Using the triangle inequality) ≤ K2 + d(a2, a1) (Since S2 is bounded) ≤ K (By definition of K)

Hence our union is indeed bounded.

Open Balls

Let M = {Ad} be a metric space, let a be in A, and let ε > 0. The ε-ball of a in M is defined to be:

Bε(a) = {x in A | d(xa) < ε}

That is, the collection of points x in A within distance ε of a.

It is worth emphasising that Bε(a) does not include the boundary. It consists only of the interior of the 'ball'. If we were to include the boundary, it would become a closed ball. One consequence of the non-inclusion of the boundary of our open balls is the way in which they can be nested. Let Bε(x) be an open ball in a metric space, and let y be a point in Bε(x). Then there is a δ > 0 for which Bδ(y) is contained completely within Bε(x). In R2 this means that we can draw a disc centred on y which lies entirely within the larger disc, centred on x. A look at the diagram should convince you that any δ satisfying δ + d(xy) ≤ ε will do.

For a formal proof of this, let δ = ε - d(xy). This must be greater than zero, since y is a point in Bε(x).

If z is in Bδ(y) then d(yz) < δ, and:

 d(x, z) ≤ d(x, y) + d(y, z) (By the triangle inequality) < d(x, y) + δ (Since z is in Bδ(y)) = ε (By definition of δ)

So z is in Bε(x), and hence Bδ(y) must be contained within Bε(x).

Examples of Open Balls

In R, Bε(a) = (a - ε, a + ε). That is, the collection of points x satisfying a - ε < x < a + ε.

In R2 (the plane), Bε(a) is the interior of a disc of radius ε centred on a.

In R3 (three-dimensional space), Bε(a) is the interior of a solid ball of radius ε centred on a.

The previous three examples have all used the Euclidean metric, that is, our intuitive notion of distance. Let us now look at some examples using other metrics.

In R2, using the d metric, Bε(a) is the interior of a square centred on a, with sides of length 2ε parallel to the co-ordinate axes.

In a discrete metric space M = {Ad}, we have

 Bε(a) = { {a} if ε ≤ 1 A if ε > 1

In other words, if ε ≤ 1, Bε(a) is just the single point a. If ε > 1, Bε(a) is the whole space A.

Open Sets

Let U be a subset of a metric space M. U is open in M if given any point y in U there is a ε(y) > 0 such that Bε(y)(y) is contained entirely in U. Note that for different points y in U the value of ε(y) is allowed to be different. Also, it is important to specify which metric space we are operating in - the reasons will be explained later.

We have already shown that an open ball in a metric space M is open in M, since we can fit another open ball inside it, centred on any point we choose.

Examples (and Non-examples) of Open Sets

Let us look at the 'real line', R, also known as the number line. An open interval (ab)3 is open in R - around any point y in the interval we can fit another open interval, of the form (y - ε, y + ε) for some value of ε.

On the other hand, a closed (or half-closed) interval is not open in R. To see this, let [ab] be a closed interval. We now attempt to find an open interval Bε(a) around point a. By definition, a is in [ab], but no matter how small we take ε to be, Bε(a) would always include points less than the value of a - so Bε(a) is not contained within [ab].

It is important to note that not all open sets are open balls. Let our metric space be R2 with the Euclidean metric, and let U be the interior of a rectangle:

U = {(x1x2) | a < x1 < bc < x2 < d}

U is not an open ball in the Euclidean metric, but U is open in R2. This is easy to check: if x = (x1x2) is in U then Bε(x) is contained in U, where ε = Min{x1 - ab - x1x2 - cd - x2}.

It should be becoming clear that open sets do not include any 'boundary' points - from any point in the set, you can move some distance in M without going outside the set. As with open balls, if the set did include the boundary, it would be a closed set.

In any metric space M, the empty set Ø4 and the whole space M are open in M. Ø is open since it contains no points - so there is nowhere to centre our open ball. M is open since any open ball in M can only contain points of M.

In a discrete metric space, any set U is open in M. If x is in U, we can choose ε ≤ 1 to make certain that Bε(x) = {x} which is contained in U.

By the above, a closed interval [ab] is open in [ab], although (as we have already seen) it is not open in R.

Unions and Finite Intersections of Open Sets

The union of any collection of open sets in ametric space M is open in M. To prove this, let I be an indexing set, and suppose that Ui is open in M for every i in I. Let x be in the union of all the sets Ui. Then x must be in Uk for some k in I, and since Uk is open in M there exists ε > 0 such that Bε(x) is contained in Uk, which is in the union of the Ui as required.

If U1, U2,..., Um are open in a metric space M, then the intersection of these m sets is also open in M.

To prove this, let x be in the intersection of our m open sets. For each i = 1, 2,..., m we must have x in Ui and Ui is open in M, so there exists an εi > 0 such that Bεi(x) is contained in Ui.

Now let ε = Min{ε1, ε2,..., εm}. Then Bε(x) is contained in Bεi(x) which is itself contained in Ui for i = 1, 2,..., m, so Bε(x) is in the intersecion, as required.

Taking Things Further

This entry is only a brief introduction to the world of metric spaces. Other topics within this subject include the continuity and convergence of functions, the Hausdorff condition, compactness, connectedness and completeness. One excellent book on Metric Spaces is Introduction to Metric and Topological Spaces, by WA Sutherland.

1 Also known as a metric.
2 That is, a function which takes two points from our set A, does something with them, and produces as a result a number in R, the set of real numbers.
3 This set consists of all points x satisfying a < x < b. The interval [ab] consists of all points x which satisfy a ≤ x ≤ b. Notice the use of different brackets to denote the exclusion/inclusion of the endpoints.
4 The set which contains no points. People have been talking about this Guide Entry. Here are the most recent Conversations:
 Ultrametric spaces (Last Posting: Oct 29, 2003)      Add your Opinion!There are tens of thousands of h2g2 Guide Entries, written by our Researchers. If you want to be able to add your own opinions to the Guide, simply become a member as an h2g2 Researcher. Tell me More!       Entry Data
Entry ID: A1061353 (Edited)

Written and Researched by:
Researcher 108409

Edited by:
Dr Zen - Chair and Chief cat herder h2g2c2 - Dr Zen (Mrs Zen's Spousal Unit) - Help me judge the h2g2 Booker Prize A87361978

Date: 07   August   2003

 Text only Like this page?Send it to a friend

 Related BBC Pages BBC Learning

Most of the content on this site is created by h2g2's Researchers, who are members of the public. The views expressed are theirs and unless specifically stated are not those of the BBC. The BBC is not responsible for the content of any external sites referenced. In the event that you consider anything on this page to be in breach of the site's House Rules, please click here to alert our Moderation Team. For any other comments, please start a Conversation below.            Most of the content on h2g2 is created by h2g2's Researchers, who are members of the public. The views expressed are theirs and unless specifically stated are not those of the BBC. The BBC is not responsible for the content of any external sites referenced. In the event that you consider anything on this page to be in breach of the site's House Rules, please click here. For any other comments, please start a Conversation above. About the BBC | Help | Terms of Use | Privacy & Cookies Policy