1Metric spaces
IB Metric and Topological Spaces
1.2 Examples of metric spaces
In this section, we will give four different examples of metrics, where the first
two are metrics on
R
2
. There is an obvious generalization to
R
n
, but we will
look at R
2
specifically for the sake of simplicity.
Example (Manhattan metric). Let X = R
2
, and define the metric as
d(x, y) = d((x
1
, x
2
), (y
1
, y
2
)) = x
1
− y
1
 + x
2
− y
2
.
The first three axioms are again trivial. To prove the triangle inequality, we have
d(x, y) + d(y, z) = x
1
− y
1
 + x
2
− y
2
 + y
1
− z
1
 + y
2
− z
2

≥ x
1
− z
1
 + x
2
− z
2

= d(x, z),
using the triangle inequality for R.
This metric represents the distance you have to walk from one point to
another if you are only allowed to move horizontally and vertically (and not
diagonally).
Example (British railway metric). Let X = R
2
. We define
d(x, y) =
(
x − y if x = ky
x + y otherwise
To explain the name of this metric, think of Britain with London as the origin.
Since the railway system is
stupid
less than ideal, all trains go through London.
For example, if you want to go from Oxford to Cambridge (and obviously not
the other way round), you first go from Oxford to London, then London to
Cambridge. So the distance traveled is the distance from London to Oxford plus
the distance from London to Cambridge.
The exception is when the two destinations lie along the same line, in which
case, you can directly take the train from one to the other without going through
London, and hence the “if x = ky” clause.
Example (
p
adic metric). Let
p ∈ Z
be a prime number. We first define the
norm
n
p
to be
p
−k
, where
k
is the highest power of
p
that divides
n
. If
n
= 0,
we let n
p
= 0. For example, 20
2
= 2
2
· 5
2
= 2
−2
.
Now take
X
=
Z
, and let
d
p
(
a, b
) =
a−b
p
. The first three axioms are trivial,
and the triangle inequality can be proved by making some numbertheoretical
arguments about divisibility.
This metric has rather interesting properties. With respect to
d
2
, we have
1
,
2
,
4
,
8
,
16
,
32
, ··· →
0, while 1
,
2
,
3
,
4
, ···
does not converge. We can also use it
to prove certain numbertheoretical results, but we will not go into details here.
Example (Uniform metric). Let
X
=
C
[0
,
1] be the set of all continuous
functions on [0, 1]. Then define
d(f, g) = max
x∈[0,1]
f(x) − g(x).
The maximum always exists since continuous functions on [0
,
1] are bounded
and attain their bounds.
Now let
F
:
C
[0
,
1]
→ R
be defined by
F
(
f
) =
f
(
1
2
). Then this is continuous
with respect to the uniform metric on C[0, 1] and the usual metric on R:
Let
f
n
→ f
in the uniform metric. Then we have to show that
F
(
f
n
)
→ F
(
f
),
i.e. f
n
(
1
2
) → f(
1
2
). This is easy, since we have
0 ≤ F (f
n
) − F (f) = f
n
(
1
2
) − f(
1
2
) ≤ max f
n
(x) − f(x) → 0.
So f
n
(
1
2
) − f(
1
2
) → 0. So f
n
(
1
2
) → f(
1
2
).