A Short Introduction to Metric Spaces
Section 2: Subspaces and Product Spaces


One of the things that we can do with metric spaces is to make "new spaces from old." For example, a subset of a metric space can be made into a metric space in its own right in a natural way. And given two metric spaces, their cross product can be made into a metric space; in fact, there are several reasonable ways to do that. This section looks at subspaces and products of metric spaces. The material on subspaces will be needed in later sections of this web site. The material on product spaces, although interesting, will not be needed and can be skipped.


Subspaces

It should be clear that if (M,d) is a metric space, then a subset of M can be made into a metric space by using the same measure of distance on the subset as is used on M. The subset with that inherited metric is called a "subspace."

Definition 2.1: Let (M,d) be a metric space, and let X be a subset of M. We define a metric d on X by d(x,y)=d(x,y) for x,yX. Then (X,d) is a metric space, which is said to be a subspace of (M,d).

The metric d:X×XR is just the function d restricted to the subset X×X of M×M. In practice, we will often use the same name for the distance function on a subspace as is used for the distance function on the containing space, but in this section, for clarity, I will avoid doing that.

A big part of understanding a metric space is understanding its open sets and closed sets. To understand a subspace (X,d) of (M,d), we can start by noting that for xX, the open ball Brd(x) in (X,d) is just the intersection with X of the corresponding open ball in (M,d). That is, Brd(x)=Brd(x)X. This is clear because for yX, d(x,y)=d(x,y) and therefore d(x,y)<r if and only if d(x,y)<r. In fact, we get the following similar characterization for all open and closed sets in (X,d).

Theorem 2.1: Let (M,d) be a metric space and X a subset of M, and let d be the subspace metric on X. A subset U of X is open in the subspace (X,d) if and only if there is an open subset O of M such that U=XO. A subset F of X is closed in the subspace (X,d) if and only if there is a closed subset C of M such that F=XC.

Proof: Suppose that U is an open subset in the subspace (X,d). For every uU, there is an ϵu>0 such that Bϵud(u)U. Let O be the union of the corresponding open balls in M. That is, O=uUBϵud(u). Note that O is an open subset of M because it is a union of open balls in M. We have XO=X(uUBϵud(u))=uU(XBϵud(u)),by the distributive law=uUBϵud(u)=U The last equality follows since Bϵud(u)U for all u, and their union includes every uU because uBϵud(u).

Conversely, Suppose that O is an open subset of M, and let U=XO. We must show that U is open in (X,d). Let uU. We need to find ϵ>0 such that Bϵd(u)U. Since uO and O is open in M, there is an ϵ>0 such that Bϵd(u)O. But then Bϵd(u)=XBϵd(u)XO=U. That is, Bϵd(u)U.

Turning to the case of closed subsets, note first that for a subset A of M and a subset B of X, XA=XB if and only if X(MA)=B. So, applying the first part of the theorem,

F is closed in X XF is open in X
  XF=XO, for some open OM
  F=X(MO), for some open OM
  F=XC, for some closed CM

and that completes the proof. ∎

As an example, we can make the set of rational numbers, Q, into a metric space (Q,d) using the subspace metric inherited from (R,d). Let A={xQ|2<x<2}. Then A is the intersection with Q of the open interval (2,2), which is an open set in (R,d). By the theorem, A is open in (Q,d). But since 2 is not a rational number, A is also a closed set in (Q,d) because A=Q[2,2]. There are many subsets of Q that are both open and closed in (Q,d). On the other hand, it can be shown that the only subsets of R that are both open an closed in (R,d) are and R. (These facts will become significant have we have defined connected sets.)

It might also be instructive to note that [1,2) is an open subset of the subspace ([1,3],d) of (R,d), even though it is not an open set in (R,d). You are asked to verify this in one of the exercises in this section.


Product Spaces

R2 is the cross product R×R. The usual metric on R2 can be defined in terms of the metric on R. The usual distance, ρ, between the points x1,y1 and x2,y2 of R2 is given by ρ(x1,y1,x2,y2)=(x1x2)2+(y1y2)2=d(x1,x2)2+d(y1,y2)2. This can be generalized to the cross product of any two metric spaces, (M1,d1) and (M2,d2). That is, we can define a metric space (M1×M2,ρ) where ρ(x1,y1,x2,y2)=d1(x1,x2)2+d2(y1,y2)2 for any x1,x2M1 and y1,y2M2. However, ρ is not the only natural metric on M1×M2, In particular, we can define two alternative metric spaces (M1×M2,μ) and (M1×M2,σ) by μ(x1,y1,x2,y2)=max(d1(x1,x2),d2(y1,y2))σ(x1,y1,x2,y2)=d1(x1,x2)+d2(y1,y2)

This illustration shows the open balls of radius ε about a point aR2 for each of the three product spaces (R2,ρ), (R2,μ), and (R2,σ):

(However, I should note that all three metrics have the same open sets. That is, they produce the same topology on M1×M2.)

We should prove that ρ, μ, and σ are in fact metrics on M1×M2. I will leave μ and σ as exercises, but here is a proof for ρ.

Theorem 2.2: Suppose that (M1,d1) and (M2,d2) are metric spaces. Define the function ρ:(M1×M2)×(M1×M2)R by ρ(x1,y1,x2,y2)=d1(x1,x2)2+d2(y1,y2)2. Then ρ is a metric on M1×M2.

Proof: We need to show that ρ satisfies the three properties that define a metric space. The proofs for the first two properties are straightforward: For property 1, ρ(x1,y1,x2,y2)0 for all x1,y1 and x2,y2 because a square root is always non-negative. And d1(x1,x2)2+d2(y1,y2)2=0 if and only if d1(x1,x2)=0 and d2(y1,y2)=0, which is in turn true if and only if x1=x2 and y1=y2 because d1 and d2 are metrics. Finally, x1=x2 and y1=y2 if and only if x1,y1=x2,y2 by the definition of equality of ordered pairs. For property 2, the symmetry of ρ follows immediately from the symmetry of d1 and d2.

To prove property 3 for ρ, let x1,y1, x2,y2 and x3,y3 be elements of M1×M2. From the triangle inequality for d1, we know that d1(x1,x3)d1(x1,x2)+d1(x2,x3). Squaring both sides, we get d1(x1,x3)2(d1(x1,x2)+d1(x2,x3))2=d1(x1,x2)2+2d1(x1,x2)d1(x2,x3)+d1(x2,x3)2d1(x1,x2)2+d1(x2,x3)2 and similarly for d2, d2(y1,y3)2(d2(y1,y2)2+d2(y2,y3))2 Adding these two inequalities and taking the square root gives ρ(x1,y1,x3,y3)=d1(x1,x3)2+d2(y1,y3)2(d1(x1,x2)2+d1(x2,x3)2)+((d2(y1,y2)+d2(y2,y3))2)=(d1(x1,x2)2+d2(y1,y2)2)+((d1(x2,x3)2+d2(y2,y3))2)(**)d1(x1,x2)2+d2(y1,y2)2+(d1(x2,x3)2+d2(y2,y3))2=ρ(x1,y1,x2,y2)+ρ(x2,y2,x3,y3) which is the triangle inequality for ρ. (The inequality (**) follows because for any non-negative numbers a and b, a+ba+2ab+b=(a+b)2=a+b.) ∎

Of course, it is possible to define metrics on cross products of more than two metric spaces. For example, if (M1,d1), (M2,d2), ,(Mn,dn) are metric spaces, we can define the metric ρ on M1×M2××Mn by ρ(x1,x2,xn,y1,y2,yn)=d1(x1,y1)2+d2(x2,y2)2++dn(xn,yn)2 The fact that this is a metric for all n2 can be proved by induction, noting that d1(x1,y1)2+d2(x2,y2)2++dn(xn,yn)2=(d1(x1,y1)2+d2(x2,y2)2++dn1(xn1,yn1n)2)2+dn(xn,yn)2 This definition, of course, gives us the usual metric on Rn. The metrics μ and σ on M1×M2 can similarly be extended to metrics on M1×M2××Mn.


Exercises

Exercise 2.1: Consider the closed interval [1,3] as a subspace of (R,d). Verify that [1,2) is an open set in the subspace ([1,3],d).

Exercise 2.2: Let U be an open subset of the metric space (M,d). Show that a subset A of U is an open set in the subspace (U,d) if and only if A is an open set in the space (M,d). (The previous exercise shows that the fact that U is open is essential here.) State and prove a similar result for closed subsets.

Exercise 2.3: Let Z be the set of all integers, and consider the subspace (Z,d) of (R,d). What are the open sets in (Z,d)? How does the metric space (Z,d) compare to the metric space (Z,δ), where δ is the discrete metric, as defined in Exercise 1.5?

Exercise 2.4: Let (M1,d1) and (M2,d2) be metric spaces, and consider the metric space (M1×M2,ρ) where ρ(x1,y1,x2,y2)=d1(x1,x2)2+d2(y1,y2)2. Suppose that U1 is an open set in (M1,d1) and U2 is an open set in (M2,d2). Show that U1×U2 is an open set in (M1×M2,ρ). Is every open subset of (M1×M2,ρ) of this form?

Exercise 2.5: Explain why the pictures are correct in the illustration in this section of the open balls Bεμ(a) and Bεσ(a) in R2.

Exercise 2.6: Let (M1,d1) and (M2,d2) be metric spaces and let σ be the metric on M1×M2 defined as σ(x1,y1,x2,y2)=d1(x1,x2)+d2(y1,y2). Show that σ is in fact a metric.