Maths WorkshopMaths problems with full solutions
Exercise 254Topology › Metric and normed spacesL1Added 3 Nov 2026

Metric spaces

#metric#definition#axioms

Statement

Define a metric space and give two examples.

Hint

A metric d:X×X→[0,∞)d:X\times X\to[0,\infty) satisfies positivity, symmetry, and the triangle inequality.

Show solutionHide solution

Solution

Definition. A metric on XX is a map d:X×X→[0,+∞[d:X\times X\to[0,+\infty[ such that for all x,y,z∈Xx,y,z\in X:
1. d(x,y)=0  ⟺  x=yd(x,y)=0\iff x=y;
2. d(x,y)=d(y,x)d(x,y)=d(y,x);
3. d(x,z)≤d(x,y)+d(y,z)d(x,z)\le d(x,y)+d(y,z).

Examples.
- Euclidean metric on Rn\mathbb{R}^n: d(x,y)=∥x−y∥2d(x,y)=\|x-y\|_2.
- Discrete metric: d(x,y)=0d(x,y)=0 if x=yx=y, d(x,y)=1d(x,y)=1 otherwise.

Conclusion. A metric space is a pair (X,d)(X,d); the metric encodes distance and topology.