A metric space is a set X with a map d:X×X→R+ such that, for all x,y,z:
d(x,y)=0⟺x=y,d(x,y)=d(y,x),d(x,z)≤d(x,y)+d(y,z).
Balls: B(a,r)={x:d(a,x)<r} (open), B(a,r)={x:d(a,x)≤r} (closed). A subset A⊆X becomes a metric space with the induced distance.
Examples
Example 4.2
R with ∣x−y∣; Rn with any of
d1(x,y)=i∑∣xi−yi∣,d2(x,y)=(i∑(xi−yi)2)1/2,d∞(x,y)=imax∣xi−yi∣;
the set C([a,b]) of continuous functions with the sup distance d∞(f,g)=sup[a,b]∣f−g∣ (finite: f−g is bounded); any set with the discrete distance (d(x,y)=1 for x=y). Distances coming from norms are the subject of Chapter 5.
Example 4.4 (Interior, closure, boundary on one set)
In R, let A=(0,1]∪{2}. Interior: (0,1) — around any x∈(0,1) a small ball stays in A; around 1, every ball (1−r,1+r) leaks out of A on the right, so 1 is not interior; and the isolated 2 is not interior either. Closure: [0,1]∪{2} (the point 0 is a limit of A, nothing else is added). Boundary (closure minus interior): {0,1,2}. Note the asymmetries worth remembering: an endpoint can belong to a set without being interior (1), can be adherent without belonging (0), and an isolated point is its own boundary (2). The same bookkeeping runs verbatim in any metric space, with balls in place of intervals.
Example 4.19 (Distances between sets: compactness earns its keep)
Let K be compact, F closed, K∩F=∅ in a metric space. Then
d(K,F)=inf{d(x,y):x∈K, y∈F}>0:
the function x↦d(x,F) is continuous (Exercise 4.11) and positive on K (d(x,F)=0 would put x∈F=F), so it attains a positive minimum on the compact K (Theorem 4.16 (3)). Compactness is not decorative: for two closed sets the infimum can vanish without being attained — in R2, the hyperbola F1={xy=1} and the axis F2={y=0} are disjoint closed sets with d(F1,F2)=0 (the points (n,n1) approach the axis). Escape to infinity is exactly what compactness forbids.