In mathematics a set is said to have a metric if there is a notion of distance on the set that fits our intuition about how distance should behave. More formally, an operation on a set A to the real numbers is said to be a metric if for all and , we have the following three properties.
- and this equality is strict if and only iff
Intuitively property 1 says that distance cannot be negative and two points are zero distance away from each other if and only if they are in fact that the same . Property 2 says that the distance from x to y is the same as the distance from y to x. Property three says that the distance going from x to y to z is at least the distance to go from x to z.