A metric function defines a distance between elements of a set. Besides
non-negativity, isolation, and symmetry, it also has to satisfy triangular
inequality.
- non-negativity:
d(x, y) ≥ 0
- isolation:
d(x, y) = 0
if and only if x = y
- symmetry:
d(x, y) = d(x, y)
- triangular inequality:
d(x, y) + d(y, z) ≥ d(x, z)
.