Metric space

In mathematics, a metric space is a set together with a notion of distance between its points. The distance is measured by a function called a metric or distance function. Metric spaces are a general setting for studying many of the concepts of mathematical analysis and geometry.

The most familiar example of a metric space is 3-dimensional Euclidean space with its usual notion of distance. Other well-known examples are a sphere equipped with the angular distance and the hyperbolic plane. A metric may correspond to a metaphorical, rather than physical, notion of distance. For example, the set of 100-character Unicode strings can be equipped with the Hamming distance, which measures the number of characters that need to be changed to get from one string to another.

Metric spaces appear in many different branches of mathematics. For example, Riemannian manifolds, normed vector spaces, and graphs may be viewed as metric spaces. In abstract algebra, the field of p-adic numbers is the completion of the field of rational numbers with respect to a certain metric. Metric spaces are also studied in their own right in metric geometry and analysis on metric spaces.

Many notions of analysis, including balls, completeness, as well as uniform, Lipschitz, and Hölder continuity can be defined for metric spaces. Other notions, such as continuity, compactness, and open and closed sets can be defined for metric spaces, but also in the even more general setting of topological spaces.