Tutorials › Topology (Undergraduate) › Restricting a Metric to a Subset

Metric Spaces and Open Balls · Tutorial 46 of 799

Restricting a Metric to a Subset

See why keeping the same distances between points in a subset always gives a metric, and practise computing those distances explicitly.

Beginner 9 min read

What You'll Learn

  • Define the restriction of a metric to a subset.
  • Verify nonnegativity, identity of indiscernibles, symmetry, and the triangle inequality on the restricted domain.
  • Handle empty and singleton subsets without overlooking vacuous cases.
  • Compute induced distances for finite subsets of the real line and plane.
  • Distinguish restricted ambient distance from a distance based on paths within the subset.

Keeping the Distances on a Subset

A metric assigns a distance to every pair of points in a space. If we keep only some of those points, there is a natural way to measure distances among the points that remain: use the same distances they had before. The key fact is that the metric axioms still hold, because each axiom for the smaller set is already an instance of an axiom for the original set.

This operation is called restricting a metric. It does not change the distance formula, and it does not require the subset to contain any points between a given pair. We will prove the claim directly from the metric axioms, including the cases of empty and singleton subsets.

Definition: A metric on a set \(X\) is a function \(d:X\times X\to[0,\infty)\) such that for all \(x,y,z\in X\): (1) \(d(x,y)=0\) if and only if \(x=y\); (2) \(d(x,y)=d(y,x)\); and (3) \(d(x,z)\le d(x,y)+d(y,z)\). If \(A\subseteq X\), the restriction of \(d\) to \(A\) is the function \(d_A:A\times A\to[0,\infty)\) defined by \(d_A(a,b)=d(a,b)\) for all \(a,b\in A\).

In function notation, \(d_A\) is \(d\) restricted to the smaller domain \(A\times A\). It is important that this changes the domain, not the distance values: whenever \(a,b\in A\), their restricted distance is exactly their original distance.

The Restriction Theorem

Theorem (Restriction of a metric): If \(d\) is a metric on \(X\), then \(d_A\) is a metric on every nonempty subset \(A\subseteq X\). If the empty set is allowed as a metric space, its unique function \(\varnothing\times\varnothing\to[0,\infty)\) also satisfies the metric axioms, vacuously.

Proof. Let \(A\) be nonempty, and let \(a,b,c\in A\). Since \(a,b\in X\) and \(d\) takes values in \([0,\infty)\), \(d_A(a,b)=d(a,b)\ge0\). Also, \(d_A(a,b)=0\) if and only if \(d(a,b)=0\), which holds if and only if \(a=b\). Symmetry follows from \(d_A(a,b)=d(a,b)=d(b,a)=d_A(b,a)\). Finally, the triangle inequality for \(d\), applied to the same three points in \(X\), gives \(d_A(a,c)=d(a,c)\le d(a,b)+d(b,c)=d_A(a,b)+d_A(b,c)\). Thus all the metric axioms hold on \(A\). If \(A=\varnothing\), there are no points at which to test any of the axioms, so each universally quantified condition is true. \(\square\)

The proof uses no special property of the subset. In particular, it does not matter whether \(A\) is finite, infinite, or missing many points of \(X\). The only requirement is that every point to which an axiom is applied belongs to \(A\), and therefore also belongs to \(X\).

The triangle inequality deserves a careful reading. For \(a,b,c\in A\), the inequality concerns the same three points and the same three distances as it did in \(X\). Removing other points from the set does not remove any of these distance values or change their sizes.

Worked Example: Three Points on the Real Line

Let \(X=\mathbb{R}\) with the usual metric \(d(x,y)=|x-y|\), and take \(A=\{-2,1,5\}\). The restricted metric is \(d_A(a,b)=|a-b|\) for \(a,b\in A\).

Compute the distances between distinct points: \(d_A(-2,1)=|-2-1|=|-3|=3\); \(d_A(1,5)=|1-5|=|-4|=4\); and \(d_A(-2,5)=|-2-5|=|-7|=7\). The reversed distances have the same values, and each point has distance \(0\) from itself. Thus the distance table is:

\(d_A\)\(-2\)\(1\)\(5\)
\(-2\)037
\(1\)304
\(5\)740

For the triangle inequality with three distinct points, the three possible inequalities, up to reversing the order of the points, are \(7\le3+4=7\), \(3\le7+4=11\), and \(4\le7+3=10\). They all hold. Cases with repeated points also satisfy the inequality: for example, if the first and last points are equal, the left side is \(0\), while the right side is nonnegative. This calculation agrees with the restriction theorem.

Check: the table is symmetric, all off-diagonal entries are positive, and every diagonal entry is \(0\). The three distinct-point triangle inequalities just computed verify the only nontrivial cases.

Distances in a Subset of the Plane

For a subset of the plane, the same rule applies: retain the Euclidean distances between the points that remain. The formula is unchanged, but the points used as inputs must belong to the subset.

Worked Example: A Right Triangle in the Plane

Let \(X=\mathbb{R}^2\) with Euclidean metric \(d((x_1,x_2),(y_1,y_2))=\sqrt{(x_1-y_1)^2+(x_2-y_2)^2}\). Take \(A=\{P,Q,R\}\), where \(P=(0,0)\), \(Q=(3,0)\), and \(R=(3,4)\). We compute each distance between distinct points by substitution.

For \(P,Q\), the coordinate differences are \(0-3=-3\) and \(0-0=0\). Hence \(d_A(P,Q)=\sqrt{(-3)^2+0^2}=\sqrt{9}=3\).

For \(Q,R\), the differences are \(3-3=0\) and \(0-4=-4\). Hence \(d_A(Q,R)=\sqrt{0^2+(-4)^2}=\sqrt{16}=4\).

For \(P,R\), the differences are \(0-3=-3\) and \(0-4=-4\). Hence \(d_A(P,R)=\sqrt{(-3)^2+(-4)^2}=\sqrt{9+16}=\sqrt{25}=5\).

The triangle inequalities for the three distinct points are \(5\le3+4=7\), \(3\le5+4=9\), and \(4\le5+3=8\). The first inequality is strict here. Repeated-point cases hold because the distance from a point to itself is \(0\) and all distances are nonnegative. The reverse distances agree with those computed because the Euclidean distance formula is symmetric.

Check: the restricted distance table has diagonal entries \(0\), with \(d_A(P,Q)=d_A(Q,P)=3\), \(d_A(Q,R)=d_A(R,Q)=4\), and \(d_A(P,R)=d_A(R,P)=5\). These values match the coordinate calculations and satisfy all triangle inequalities.

This example illustrates a general point: the triangle inequality for a restricted metric is not a new geometric claim about which points lie inside \(A\). It follows because the three chosen points already lie in the original metric space, where the inequality holds.

Worked Example: The Four Vertices of a Square

Let \(X=\mathbb{R}^2\) with the Euclidean metric, and let \(A=\{P,Q,R,S\}\), where \(P=(0,0)\), \(Q=(1,0)\), \(R=(1,1)\), and \(S=(0,1)\). We calculate the six distances between distinct points.

The four side distances are \(d_A(P,Q)=\sqrt{(0-1)^2+(0-0)^2}=\sqrt{1}=1\), \(d_A(Q,R)=\sqrt{(1-1)^2+(0-1)^2}=\sqrt{1}=1\), \(d_A(R,S)=\sqrt{(1-0)^2+(1-1)^2}=\sqrt{1}=1\), and \(d_A(S,P)=\sqrt{(0-0)^2+(1-0)^2}=\sqrt{1}=1\).

The two diagonal distances are \(d_A(P,R)=\sqrt{(0-1)^2+(0-1)^2}=\sqrt{1+1}=\sqrt{2}\) and \(d_A(Q,S)=\sqrt{(1-0)^2+(0-1)^2}=\sqrt{1+1}=\sqrt{2}\). The reverse distances have the same values.

Each choice of three distinct vertices has two side lengths equal to \(1\) and one diagonal length equal to \(\sqrt{2}\). The triangle inequalities are therefore \(\sqrt{2}\le1+1=2\) and \(1\le1+\sqrt{2}\), with the latter inequality applying to either side of length \(1\). Since \(\sqrt{2}\le2\) (both sides are nonnegative and \(2\le4\) after squaring), all these inequalities hold. Cases with repeated vertices again reduce either to \(0\le u+u\) or to \(u\le u+0\), where \(u\ge0\).

Check: every distinct pair has positive distance, the distance table is symmetric, and the triangle inequalities hold for every triple. This is the restricted Euclidean metric on these four points; no other points of the square are required.

Restricting in Stages

Restriction is consistent if we first choose a subset and then choose a smaller subset inside it. This means that it does not matter whether we restrict directly to the final set or perform the restriction in two stages.

Proposition: Let \(d\) be a metric on \(X\), and let \(B\subseteq A\subseteq X\). Then restricting \(d\) directly to \(B\) gives the same function as first restricting to \(A\) and then restricting to \(B\).

Proof. Take any \(b_1,b_2\in B\). Since \(B\subseteq A\subseteq X\), both points belong to \(X\). The direct restriction gives \(d_B(b_1,b_2)=d(b_1,b_2)\). The two-stage restriction gives \((d_A)|_{B\times B}(b_1,b_2)=d_A(b_1,b_2)=d(b_1,b_2)\). The functions agree on every input pair in \(B\times B\), so they are equal. If \(B=\varnothing\), both functions have empty domain and are equal as well. \(\square\)

The inclusion of a subset also preserves distances in a precise sense: for \(a,b\in A\), the distance measured by \(d_A\) is exactly the distance measured by \(d\). This follows immediately from \(d_A(a,b)=d(a,b)\); it does not say that every point of \(X\) belongs to \(A\), only that pairs from \(A\) retain their original measurements.

A Common Mistake: Recounting Points Instead of Restricting Distances

A tempting but incorrect approach is to list the points of a subset in order and use the difference between their list positions as their distance. That defines a different function, not necessarily the restriction of the original metric.

For example, take \(A=\{0,2,5\}\subseteq\mathbb{R}\) and restrict the usual metric \(d(x,y)=|x-y|\). The correct computations are \(d_A(0,2)=|0-2|=2\), \(d_A(2,5)=|2-5|=3\), and \(d_A(0,5)=|0-5|=5\). If we incorrectly use the difference in positions in the ordered list \(0,2,5\), we would assign distances \(1,1,2\). That is not the restricted usual metric: for instance, the original distance from \(0\) to \(2\) is \(2\), not \(1\).

The mistaken values happen to satisfy the metric axioms, but that does not make them the restriction of the given metric. Restriction has a specific meaning: keep the original function values for pairs in the subset. A different formula must be checked and identified as a different proposed metric.

Likewise, the restricted distance is not defined by searching for a route through points that remain in the subset. In \(A=\{0,5\}\subseteq\mathbb{R}\), the restricted distance from \(0\) to \(5\) is \(|0-5|=5\). The subset has no point strictly between \(0\) and \(5\), but that absence does not alter the ambient distance or prevent the restriction from being a metric.

Takeaway: To restrict a metric, keep its formula and limit its domain to pairs of points in the subset. The metric axioms remain true because every relevant pair or triple in the subset is also a pair or triple in the original space.

Check Your Understanding

For each question, state the domain of the restricted metric and show the distance calculations needed to support your answer.

  1. Let \(d(x,y)=|x-y|\) on \(\mathbb{R}\) and \(A=\{-3,0,4\}\). Compute every distance between distinct points of \(A\), and verify the triangle inequalities.
  2. Let \(X=\mathbb{R}^2\) with the Euclidean metric and \(A=\{(0,0),(0,2),(2,2)\}\). Compute the three distances between distinct points and check the triangle inequalities.
  3. What does the restriction theorem say when \(A\) contains exactly one point? Which metric axiom conditions have no distinct-point cases to test?
  4. If \(B\subseteq A\subseteq X\), explain why the direct restriction to \(B\) agrees with restriction first to \(A\) and then to \(B\).
  5. For \(A=\{1,4,9\}\subseteq\mathbb{R}\), identify the error in assigning distances by differences in positions in the ordered list rather than by restricting \(d(x,y)=|x-y|\).