The reason that the idea of "metric space" was dreamt up was to allow us to define a function that can tell you the distance between two points in a set,
M. So you are always dealing with two points from the *same* set.
Mathematically we package these points up into a single object (an ordered pair) which the metric function associates with a distance i.e. a real number. The ordered pair belongs to the cartesian product of the set
M, which is denoted by
M×M.
M×M is, of course, itself a set (of ordered pairs).
For example the function
d(x,y)=∣x−y∣ where
x,y are real numbers, is a metric on the cartesian product
R×RAny given metric function must behave like the distances we know and love:
1. the distance between x and itself must be 0
2. the distance between x and y must be the distance between y and x
3. distances must obey the triangle inequality.