A metric space characterizes a set of elements by means of one number value for each pair of elements. (Additional conditions may apply.) It formalizes and broadens the idea of geometric distances, as for instance between particular cities.
A metric space (including its various generalizations) is the mathematical concept of characterizing a set $M$ of elements by assigning one particular number value to each pair of elements. That value is called a distance, $d$; or a separation, $s$; or in total generally "the metric".
The idea of a metric space formalizes and broadens the familiar concept of geometric distances, such as distances between particular cities represented in a distance table.
Formally, a metric space is written as "$( M, s )$", where
$$ s : M \times M \rightarrow \mathbb R.$$
Additional conditions may apply: for a metric space in the strictest, most concrete sense, referring to distance $d$ rather than abstract separation $s$, it is required that for any three (not necessarily distinct) elements $\mathbf a, \mathbf b, \mathbf c \in M$ holds
- $d[ \mathbf a, \mathbf b ] \ge 0 $, i.e. "non-negativity",
- $d[ \mathbf a, \mathbf b ] = 0$ if and only if $ \mathbf a $ and $\mathbf b$ are one and the same element of set $M$,
i.e. "identity if indiscernibles", - $d[ \mathbf a, \mathbf b ] = d[ \mathbf b, \mathbf a ]$, i.e. "symmetry",
- $d[ \mathbf a, \mathbf b ] + d[ \mathbf b, \mathbf c ] \ge d[ \mathbf a, \mathbf c ]$, i.e. the "triangle inequality".
Generalizations arise by dropping one or several of these conditions. If condition 1. is maintained, i.e. in these generalizations, then the metric is still considered and written as a distance $d$. If condition 1. is dropped, however, the metric is more abstractly a separation $s$.