Let be points on the real line, the distance between them is
If and are points in the plane, the Euclidean distance between them is
A metric or distance function on a set is an assignmen, to each pair of point , of a non-negative real number , such that for all we have
A set on which a distance function is defined is called a metric space. The basic metric space will be the set of real numbers, to be denoted from now on by , and Euclidean p-space , the set of all p-tuples of real numbers. The metric on is given by
When , we have , and .
On any metric space there is a natural notion of convergence: If is a sequence of point in , we say that the sequence coverges to if as
The distance function and the convergence concept allow us to study the structure of various sets in a metric space.
For example, in the set of points whose distance from the origin is less than is the interior of the circle of radius and center at . In general, an open ball in a metric space is a set of the form
The set-theoretic notation is standard, is the set of points in whose distance from is less than . A closed ball is a set of the form
Let be a subset of the metric space , is said to be an open set if for every there is an open ball that is entirely contained in , that is
For example, in , is the interior of an infinite rectangular strip and is therefore open. Intuitively, an open set is one that does not contain any of its boundary points.
Consider : is not open because an open ball in with center at cannot lie entirely with .
However, that is open, because in an open ball is just an open interval:
If is a sequence of points in and , must also be in . If is a subset of the metric space , is said to be closed if whenever is a sequence of points in converging to the point , we must have
Let be closed balls and the closed rectangular boxes . In , the interval is not closed because the sequence of numbers converges to , which is outside the interval.
Theorem: A set is open if and only if its complement is closed.