 # Introduction to Metric Spaces

Metric Spaces are one of those mathematical topics that everyone intuitively understands. The best example of this is that of three dimensional Euclidean space $E^{3}$. This serves as the basis for the intuitive concept of a “space”, and our ability to ascribe a distance between to points in three-dimensional space can be described by a distance function $d: E\times E \rightarrow E$, or a metric. The underlying set $E$ together with the metric $d$ form what is called a metric space $(E,d)$.

To be more mathematically precise, we make the following definition.

Definition. A metric space is a set $E$ together with a rule which associates with pair $p,q\in E$ a real number $d(p,q)$ such that $\displaystyle d(p,q)\geq 0, \forall p,q\in E$ $\displaystyle d(p,q) = 0 \iff p=q$ $\displaystyle d(p,q)=d(q,p) \forall p,q\in E$ $\displaystyle d(p,r) \leq d(p,q)+ d(q,r)$

As an example, suppose that the underlying set $E = \mathbb{R}$ and the metric coupled with this set is defined by $d(p,q)= |p-q|$. To verify that this indeed a metric space we must show that the four axioms are satisfied.

Claim. The mathematical structure $(\mathbb{R},d)$ in which $d:\mathbb{R}\times \mathbb{R}\rightarrow \mathbb{R}$ is defined by $d(p,q)=|p-q|$ is a metric space.
Proof. Let $p,q\in \mathbb{R}$. Then by definition of $d(p,q)$ and by definition of the absolute value function, we have that $|p-q|\geq 0$, so that axiom 1 is satisfied. Suppose now that the points in $\mathbb{R}$ are equal, i.e. that $p=q\in \mathbb{R}$. Then by definition of $d(p,q)$, we have that $|p-q|=|0|=0.$ Conversely, suppose that $|p-q|= 0.$ By the triangle inequality we have that $|p-q|\geq |p|-|q|=0$ This implies that $|p|= |q|$. Thus, condition (2.) is satisfied and hence the distance between two points in $\mathbb{R}$ is zero if and only if the two points are the same. To prove condition (3.), let $p,q\in \mathbb{R}$, so that $d(p,q) = |p-q|$. By virtue of the definition of the absolute value, we can say that $\displaystyle d(p,q) = |p-q| = |-(p+q)|= |-1||q-p|= |q-p|= d(q,p).$
Thus, we see that the arguments of the proposed distance function is symmetric with respect to its arguments, namely any real numbers $p,q\in \mathbb{R}$. To prove condition (4.), consider any three points $p,q,r\in \mathbb{R}$, then the distance function between the points $p,r \in \mathbb{R}$ becomes $\displaystyle d(p,r) = |p-r| = |p-q+q-r|,$
wherein we add zero in the form of adding and subtracting the point q (a very common trick in analysis). Then by the properties of the absolute value it follows that $\displaystyle d(p,r) = |p-q+q+r| \leq |p-q|+|q-r| = d(p,q)+d(q,r)$,
where by the last equality follows from the definition of the distance function. Therefore, all four conditions have been satisfied, and hence by our definition of a metric space, it follows that $(\mathbb{R},d)$ whose distance function $d:\mathbb{R}\times \mathbb{R}\rightarrow \mathbb{R}$ is defined by $d(p,q) = |p-q|$ is indeed a metric space. $\square$