Tutorials › Topology (Undergraduate) › The Discrete Metric Induces the Discrete Topology

Topologies and Open Sets · Tutorial 94 of 799

The Discrete Metric Induces the Discrete Topology

See why distances of zero and one make every subset open in the topology induced by the discrete metric.

Beginner 9 min read

What You'll Learn

  • Define the discrete metric on an arbitrary set.
  • Verify the triangle inequality, including its distinct-point cases.
  • Compute open balls for radii below, equal to, and above one.
  • Prove that the induced topology is the discrete topology.
  • Check the result for finite, infinite, empty, and one-point spaces.

The Discrete Metric

A metric can make every subset of a set open, not only the intervals or balls familiar from the usual real-line metric. The discrete metric does this by assigning the same positive distance to every pair of distinct points. The key calculation is local: a ball of radius less than one around a point contains that point and no other.

Let \(X\) be any set. The discrete metric on \(X\), denoted here by \(d_{\mathrm{disc}}\), is the function on \(X\times X\) given by

$$ d_{\mathrm{disc}}(x,y)= \begin{cases} 0,&x=y,\\ 1,&x\ne y. \end{cases} $$

A metric is a function \(d:X\times X\to[0,\infty)\) such that \(d(x,y)=0\) exactly when \(x=y\), \(d(x,y)=d(y,x)\), and \(d(x,z)\le d(x,y)+d(y,z)\) for all \(x,y,z\in X\). We first check that the discrete metric satisfies these requirements. For a metric \(d\), its open ball of centre \(x\) and radius \(r>0\) is \(B_d(x,r)=\{y\in X:d(x,y)<r\}\). The topology induced by \(d\) consists of the subsets \(U\subseteq X\) such that each \(x\in U\) has some \(r>0\) with \(B_d(x,r)\subseteq U\).

Proposition: The function \(d_{\mathrm{disc}}\) is a metric on every set \(X\), including the empty set.

Proof. For any \(x,y\in X\), the definition gives \(d_{\mathrm{disc}}(x,y)\in\{0,1\}\), so its values are nonnegative. It gives \(d_{\mathrm{disc}}(x,y)=0\) if and only if \(x=y\). The conditions \(x=y\) and \(y=x\) are equivalent, so \(d_{\mathrm{disc}}(x,y)=d_{\mathrm{disc}}(y,x)\). To check the triangle inequality, take \(x,y,z\in X\). If \(x=z\), then \(d_{\mathrm{disc}}(x,z)=0\), which is no greater than the nonnegative sum \(d_{\mathrm{disc}}(x,y)+d_{\mathrm{disc}}(y,z)\). If \(x\ne z\), the left side is \(1\). When \(y=x\), the two terms on the right are \(0\) and \(1\); when \(y=z\), they are \(1\) and \(0\). In either case their sum is \(1\). If \(y\) is different from both \(x\) and \(z\), each term is \(1\), so their sum is \(2\). Thus the triangle inequality holds in every case. If \(X=\varnothing\), there are no points to test and all the metric conditions are vacuous. \(\square\)

Calculating the Open Balls

Fix \(x\in X\). The centre itself always belongs to \(B_{d_{\mathrm{disc}}}(x,r)\), because its distance from \(x\) is \(0\) and \(0<r\) for every allowed radius \(r>0\). If \(y\ne x\), its distance from \(x\) is \(1\), so whether \(y\) belongs to the ball depends on whether \(1<r\). This gives the complete calculation.

Theorem: If \(x\in X\) and \(r>0\), then \(B_{d_{\mathrm{disc}}}(x,r)=\{x\}\) when \(0<r\le1\), and \(B_{d_{\mathrm{disc}}}(x,r)=X\) when \(r>1\).

Proof. Suppose first that \(0<r\le1\). For \(y=x\), \(d_{\mathrm{disc}}(x,y)=0<r\), so \(x\) is in the ball. For each \(y\ne x\), \(d_{\mathrm{disc}}(x,y)=1\), and \(1\ge r\), so \(d_{\mathrm{disc}}(x,y)<r\) is false. Thus the ball is exactly \(\{x\}\). Now suppose \(r>1\). For \(y=x\), \(0<r\); for \(y\ne x\), \(1<r\). Every \(y\in X\) therefore belongs to the ball, so the ball is \(X\). These cases cover every positive radius. \(\square\)

In particular, every radius strictly between zero and one gives a singleton ball. The endpoint \(r=1\) also gives a singleton: open balls use a strict inequality, so a point at distance exactly one is not included. A radius greater than one includes every point, since all distances are at most one.

Worked Example: Three Points and the Radius Threshold

Let \(X=\{a,b,c\}\) and give it the discrete metric. The distances are \(d_{\mathrm{disc}}(a,a)=d_{\mathrm{disc}}(b,b)=d_{\mathrm{disc}}(c,c)=0\), and \(d_{\mathrm{disc}}(a,b)=d_{\mathrm{disc}}(a,c)=d_{\mathrm{disc}}(b,c)=1\), with the reversed pairs also having distance \(1\).

For radius \(r=\frac12\), the tests for the ball centred at \(a\) are \(d_{\mathrm{disc}}(a,a)=0<\frac12\), \(d_{\mathrm{disc}}(a,b)=1\not<\frac12\), and \(d_{\mathrm{disc}}(a,c)=1\not<\frac12\). Hence \(B_{d_{\mathrm{disc}}}(a,\frac12)=\{a\}\). For radius \(r=1\), the same three tests are \(0<1\), \(1\not<1\), and \(1\not<1\), so \(B_{d_{\mathrm{disc}}}(a,1)=\{a\}\). For radius \(r=2\), the tests are \(0<2\), \(1<2\), and \(1<2\), giving \(B_{d_{\mathrm{disc}}}(a,2)=X\).

Now take \(A=\{a,c\}\). Each of its points has a radius-\(\frac12\) ball contained in \(A\), since \(B_{d_{\mathrm{disc}}}(a,\frac12)=\{a\}\subseteq A\) and \(B_{d_{\mathrm{disc}}}(c,\frac12)=\{c\}\subseteq A\). The point \(b\) is not in \(A\), so it needs no ball for the openness test. Thus \(A\) is open in the induced topology.

Check: the union of the two balls just computed is \(\{a\}\cup\{c\}=\{a,c\}=A\). This verifies directly that \(A\) is open.

Every Subset Is Open

Theorem: The topology induced by the discrete metric on \(X\) is the discrete topology \(\mathcal{P}(X)\), the collection of all subsets of \(X\).

Proof. Let \(A\subseteq X\). If \(A=\varnothing\), it is open by the local definition: there is no \(x\in A\) for which a ball must be chosen. If \(A\ne\varnothing\), take any \(x\in A\) and choose the positive radius \(r=\frac12\). Since \(0<\frac12\le1\), the ball calculation gives \(B_{d_{\mathrm{disc}}}(x,\frac12)=\{x\}\). Because \(x\in A\), we have \(\{x\}\subseteq A\). This choice works for every \(x\in A\), so \(A\) is open in the induced topology. Therefore every subset of \(X\) is open. Conversely, every open set in the induced topology is, by definition, a subset of \(X\). The induced topology is consequently exactly \(\mathcal{P}(X)\), which is the discrete topology. \(\square\)

Worked Example: An Infinite Set of Integers

Take \(X=\mathbb{Z}\) with the discrete metric, not with the usual distance between integers. Let \(A=\{2k:k\in\mathbb{Z}\}\), the set of even integers. For any \(k\in\mathbb{Z}\), \(d_{\mathrm{disc}}(2k,2k)=0<\frac13\). If \(m\in\mathbb{Z}\) and \(m\ne k\), then \(2m\ne2k\), so \(d_{\mathrm{disc}}(2k,2m)=1\not<\frac13\). Thus \(B_{d_{\mathrm{disc}}}(2k,\frac13)=\{2k\}\).

Every point of \(A\) therefore has a ball of radius \(\frac13\) contained in \(A\), and \(A\) is open. The same calculation also shows that its complement is open: for each odd integer \(2k+1\), its radius-\(\frac13\) ball is \(\{2k+1\}\), which is contained in \(\mathbb{Z}\setminus A\).

Check: the union of the balls centred at the even integers is \(\bigcup_{k\in\mathbb{Z}}\{2k\}=\{2k:k\in\mathbb{Z}\}=A\). The ball calculation excludes every odd integer from each of these singleton balls, as required.

Worked Example: The Empty and One-Point Spaces

If \(X=\varnothing\), the only subset is \(\varnothing\). There are no centres and therefore no open balls to calculate. The metric conditions are vacuous, and the induced topology is \(\{\varnothing\}=\mathcal{P}(\varnothing)\).

Now let \(X=\{p\}\). The only distance is \(d_{\mathrm{disc}}(p,p)=0\). For radius \(r=\frac12\), \(0<\frac12\), so \(B_{d_{\mathrm{disc}}}(p,\frac12)=\{p\}\). The subsets are \(\varnothing\) and \(\{p\}\): the empty set is open by the local definition, and the ball just computed shows that \(\{p\}\) is open.

Check: the induced topology on the one-point set is \(\{\varnothing,\{p\}\}=\mathcal{P}(\{p\})\), including both possible subsets.

A Common Radius Mistake

Common pitfall. One might argue that \(B_{d_{\mathrm{disc}}}(x,1)=X\) because every point has distance at most \(1\) from \(x\). That calculation uses the wrong membership test: an open ball contains \(y\) when \(d_{\mathrm{disc}}(x,y)<1\), not when \(d_{\mathrm{disc}}(x,y)\le1\). For \(y\ne x\), the actual test is \(1<1\), which is false. Thus \(B_{d_{\mathrm{disc}}}(x,1)=\{x\}\); the ball becomes all of \(X\) only when its radius is strictly greater than \(1\).

The defining feature of the discrete metric is therefore not that all balls are singletons: balls of radius greater than one are the whole space. Rather, arbitrarily small positive balls isolate their centres. That local fact is exactly what lets each subset satisfy the openness test, even when the set is infinite.

Check Your Understanding

Use the strict inequality in the definition of an open ball in each calculation.

  1. Let \(X=\{u,v\}\) have the discrete metric. Compute \(B_{d_{\mathrm{disc}}}(u,\frac34)\), \(B_{d_{\mathrm{disc}}}(u,1)\), and \(B_{d_{\mathrm{disc}}}(u,\frac54)\).
  2. For \(X=\mathbb{N}\) with the discrete metric, explain why the set of multiples of \(3\) is open.
  3. Why does the local test for openness hold for the empty subset without choosing any balls?
  4. On a set \(X\) with at least two points, what is \(B_{d_{\mathrm{disc}}}(x,r)\) when \(r=1\)? Explain why the answer differs from the ball when \(r>1\).
  5. State the induced topology when \(X\) is a one-point set and when \(X\) is empty.