Metric Spaces

Axiomatizing distance generalizes the ε\varepsilon-ball — the shape of an open ball B(c,r)B(c, r) depends on the metric dd. Compare the Euclidean disk, the max-norm square, and the extreme discrete metric.

d(x,y)≥0,d(x,y)=0  ⟺  x=yd(x,y) \geq 0, \quad d(x,y) = 0 \iff x = y
d(x,y)=d(y,x),d(x,z)≤d(x,y)+d(y,z)d(x,y) = d(y,x), \quad d(x,z) \leq d(x,y) + d(y,z)
B(c,r)={x:d(x,c)<r}B(c, r) = \{x : d(x, c) < r\}

Part of these learning paths

Examples & Exercises

Prove the discrete metric d(x,y)=0d(x,y)=0 if x=yx=y, 11 otherwise, satisfies the metric axioms.

d(x,y)≥0,d(x,y)=0  ⟺  x=yd(x,y) \geq 0,\quad d(x,y)=0 \iff x=y
d(x,y)=d(y,x),d(x,z)≤d(x,y)+d(y,z)d(x,y)=d(y,x),\quad d(x,z) \leq d(x,y)+d(y,z)
Discrete metric, r=0.5r = 0.5 — B(p0,0.5)={p0}B(p_0, 0.5) = \{p_0\}.
Show proof
  1. d(x,y)d(x,y) takes only the values 00 or 11, so d(x,y)≥0d(x,y) \geq 0. By definition d(x,y)=0d(x,y) = 0 exactly when x=yx = y, and d(x,y)=1d(x,y) = 1 when x≠yx \neq y, so d(x,y)=0  ⟺  x=yd(x,y) = 0 \iff x = y.
  2. Symmetry: if x=yx = y then d(x,y)=0=d(y,x)d(x,y) = 0 = d(y,x), and if x≠yx \neq y then d(x,y)=1=d(y,x)d(x,y) = 1 = d(y,x), so d(x,y)=d(y,x)d(x,y) = d(y,x).
  3. For the triangle inequality, argue by cases. If x=zx = z then the left side is d(x,z)=0≤d(x,y)+d(y,z)d(x,z) = 0 \leq d(x,y) + d(y,z). If x≠zx \neq z then the left side is d(x,z)=1d(x,z) = 1. For any yy: if yy equals xx the right side is 0+1=10 + 1 = 1; if yy equals zz it is 1+0=11 + 0 = 1; if yy equals neither it is 1+1=21 + 1 = 2. In every case 1≤d(x,y)+d(y,z)1 \leq d(x,y) + d(y,z).
  4. Hence d(x,z)≤d(x,y)+d(y,z)d(x,z) \leq d(x,y) + d(y,z) holds for all x,y,zx, y, z — the discrete metric satisfies all the metric axioms.

Prove every subset of a discrete metric space is open.

B(x,1/2)={x}B(x, 1/2) = \{x\}
r=0.5<1r = 0.5 < 1 — every singleton is an open ball.
Show proof
  1. Let AA be any subset of a discrete metric space, and take x∈Ax \in A.
  2. With r=1/2r = 1/2 we have B(x,1/2)={x}B(x, 1/2) = \{x\}: if d(x,y)<1/2d(x,y) < 1/2 then, since d(x,y)d(x,y) is only 00 or 11, we must have d(x,y)=0d(x,y) = 0, i.e. y=xy = x.
  3. Hence B(x,1/2)={x}⊆AB(x, 1/2) = \{x\} \subseteq A. Since xx was arbitrary, every point of AA is an interior point — AA is open.

Prove a convergent sequence in a discrete metric space is eventually constant.

d(xn,x)<1/2  ⟹  xn=xd(x_n, x) < 1/2 \implies x_n = x
r=1.5>1r = 1.5 > 1 — the ball becomes all six points.
Show proof
  1. Let xn→xx_n \to x. By the definition of convergence, with ε=1/2\varepsilon = 1/2 there is an NN such that d(xn,x)<1/2d(x_n, x) < 1/2 for all n≥Nn \geq N.
  2. In the discrete metric, d(xn,x)<1/2d(x_n, x) < 1/2 forces d(xn,x)=0d(x_n, x) = 0 since 00 is the only attainable value, and that means xn=xx_n = x.
  3. Thus xn=xx_n = x for all n≥Nn \geq N — the sequence is eventually constant.

4. Topology