RemNote Community
Community

Introduction to Metric Spaces

Understand the definition and axioms of metric spaces, typical examples and their induced topology, and key properties such as convergence, continuity, completeness, and compactness.
Summary
Read Summary
Flashcards
Save Flashcards
Quiz
Take Quiz

Quick Practice

What two components form a metric space $(X, d)$?
1 of 25

Summary

Metric Spaces: Definition and Fundamental Concepts What is a Metric Space? A metric space is one of the most fundamental objects in mathematics. It provides a way to measure distances between elements in any set. Formally, a metric space is a pair $(X, d)$ where $X$ is a non-empty set and $d: X \times X \to \mathbb{R}$ is a function called the metric or distance function. The function $d$ assigns a real number $d(x, y)$ to any two points $x, y \in X$, representing the "distance" between them. The key insight is that we don't need to start with a set that already has a notion of distance (like the real line). Instead, we can define distance however we want—as long as the distance function satisfies certain reasonable properties. This flexibility is what makes metric spaces so powerful: the same abstract framework applies to spaces of numbers, points in higher dimensions, functions, and more. The Metric Axioms Not every function can be a distance function. A valid metric must satisfy three essential properties, called the metric axioms: 1. Non-negativity: For all $x, y \in X$, we have $d(x,y) \geq 0$, and $d(x,y) = 0$ if and only if $x = y$. This says distances are always non-negative, and the only way for the distance to be zero is if the two points are actually the same point. This is intuitive: the distance between something and itself is zero. 2. Symmetry: For all $x, y \in X$, we have $d(x,y) = d(y,x)$. Distance should be symmetric: the distance from $x$ to $y$ equals the distance from $y$ to $x$. This prevents one-way distances. 3. Triangle Inequality: For all $x, y, z \in X$, we have $d(x,z) \leq d(x,y) + d(y,z)$. This is the most important axiom. It says the direct distance from $x$ to $z$ cannot be longer than traveling from $x$ to $y$ to $z$. Geometrically, this is the principle that "the shortest path between two points is a straight line." Without this property, distance becomes unreliable. These three properties work together to ensure that the distance function behaves consistently and intuitively, even in abstract settings. Common Examples of Metrics To build intuition, let's examine some concrete metrics you'll encounter frequently. The Real Line On the set of real numbers $\mathbb{R}$, the most natural metric is: $$d(x, y) = |x - y|$$ This is simply the absolute value of the difference, giving the familiar distance between numbers on a number line. Euclidean Space $\mathbb{R}^n$ In $n$-dimensional space, the Euclidean metric (or Euclidean distance) is: $$d(\mathbf{x}, \mathbf{y}) = \sqrt{(x1 - y1)^2 + (x2 - y2)^2 + \cdots + (xn - yn)^2}$$ where $\mathbf{x} = (x1, \ldots, xn)$ and $\mathbf{y} = (y1, \ldots, yn)$. This is what we typically think of as distance: it generalizes the Pythagorean theorem to higher dimensions. For instance, in $\mathbb{R}^2$, the distance between points $(x1, y1)$ and $(x2, y2)$ is $\sqrt{(x1 - x2)^2 + (y1 - y2)^2}$. The Discrete Metric For any set $X$, we can define: $$d(x, y) = \begin{cases} 0 & \text{if } x = y \\ 1 & \text{if } x \neq y \end{cases}$$ This metric says every distinct pair of points is exactly distance 1 apart. While this seems artificial, it satisfies all three axioms and is useful in theoretical contexts. The discrete metric can be placed on any set, making it a universal example. The Taxicab (Manhattan) Metric On $\mathbb{R}^2$, an alternative to Euclidean distance is: $$d\big((x1, y1), (x2, y2)\big) = |x1 - x2| + |y1 - y2|$$ This measures distance as if you can only move horizontally or vertically (like navigating city blocks in Manhattan). The image below illustrates why: the blue path shows taxicab distance (moving only along axes), while the green line shows Euclidean distance (the direct route). Both metrics satisfy all three axioms, but they give different notions of distance. The taxicab metric is useful in discrete settings and optimization problems. The Supremum Metric on Function Spaces For continuous functions $f$ and $g$ defined on some domain, we can define: $$d(f, g) = \sup{t} |f(t) - g(t)|$$ This measures the largest vertical distance between the two function graphs. This metric allows us to study spaces of functions as metric spaces, opening up powerful analytical tools for function analysis. Open Balls and Topology One of the most important features of metric spaces is that they naturally induce a topology, a way of defining what it means for sets to be "open." This is done through open balls. An open ball centered at a point $x \in X$ with radius $r > 0$ is defined as: $$Br(x) = \{y \in X \mid d(x, y) < r\}$$ This is the set of all points whose distance from $x$ is strictly less than $r$. Notice the strict inequality: points at exactly distance $r$ are not included. In $\mathbb{R}$ with the absolute value metric, $Br(x)$ is an open interval: $Br(x) = (x-r, x+r)$. In the plane $\mathbb{R}^2$ with Euclidean distance, $Br(x)$ is a disk (interior only) centered at $x$. With the taxicab metric, $Br(x)$ is a diamond shape. The collection of all open balls forms a basis for a topology on $X$. This means: Any union of open balls is an open set Any open set can be expressed as a union of open balls A set $U \subseteq X$ is called open if for every point $x \in U$, there exists some $r > 0$ such that the entire ball $Br(x)$ fits inside $U$. In other words, every point in $U$ has "room to breathe"—you can find a small neighborhood around it that stays within $U$. This definition of openness is fundamental because it allows us to discuss continuity and convergence in abstract metric spaces using the same epsilon-delta language you're familiar with. Convergence and Continuity Two of the most important concepts in analysis are convergence and continuity. Metric spaces provide precise definitions for both. Convergent Sequences A sequence $(xn)$ of points in a metric space $X$ converges to a point $x \in X$ if: For every $\varepsilon > 0$, there exists a natural number $N$ such that $d(xn, x) < \varepsilon$ for all $n \geq N$. In words: the points get arbitrarily close to $x$. We write this as $xn \to x$ or $\lim{n \to \infty} xn = x$. The $\varepsilon$-$N$ definition says that no matter how close you want the sequence to be to the limit (no matter how small $\varepsilon$ is), eventually all terms beyond some point $N$ are that close. Cauchy Sequences A sequence $(xn)$ is Cauchy if: For every $\varepsilon > 0$, there exists $N$ such that $d(xn, xm) < \varepsilon$ for all $n, m \geq N$. A Cauchy sequence is one where the terms get arbitrarily close to each other, not necessarily to some fixed limit. This is a weaker condition than convergence: convergent sequences are always Cauchy, but the converse is not always true. This leads to the important concept of completeness: a metric space is complete if every Cauchy sequence converges to a point in the space. For instance, $\mathbb{R}$ with the absolute value metric is complete (this is essentially the completeness axiom of the real numbers). However, the open interval $(0, 1)$ with the same metric is not complete: the sequence $1/2, 2/3, 3/4, 4/5, \ldots$ is Cauchy but converges to 1, which is not in $(0, 1)$. Continuity: The $\varepsilon$-$\delta$ Definition Let $f: X \to Y$ be a function between metric spaces $(X, dX)$ and $(Y, dY)$. The function $f$ is continuous at a point $x \in X$ if: For every $\varepsilon > 0$, there exists $\delta > 0$ such that $dX(x', x) < \delta$ implies $dY(f(x'), f(x)) < \varepsilon$. This is the precise epsilon-delta definition you've seen before. In words: points that are close in $X$ map to points that are close in $Y$. The function is continuous on $X$ if it's continuous at every point in $X$. Sequential Characterization of Continuity There's an elegant alternative characterization: $f$ is continuous on $X$ if and only if whenever a sequence $(xn)$ converges to $x$ in $X$, the sequence $(f(xn))$ converges to $f(x)$ in $Y$. This is often easier to use: rather than finding a $\delta$ for each $\varepsilon$, you just need to verify that the function respects convergent sequences. Open-Set Characterization of Continuity Yet another powerful characterization: $f$ is continuous if and only if for every open set $V \subseteq Y$, the preimage $f^{-1}(V) = \{x \in X \mid f(x) \in V\}$ is open in $X$. This definition works purely in terms of open sets, making it the most general (it applies to topological spaces beyond metric spaces). It captures the intuition that continuity means we can pull back openness: open sets in the codomain come from open sets in the domain. Compactness and Related Properties While completeness measures whether Cauchy sequences converge, compactness is a different fundamental property that constrains the "size" of a space in a topological sense. Compactness A metric space is compact if every open cover has a finite subcover. An open cover is a collection of open sets whose union is the entire space. A finite subcover is a finite subcollection whose union still covers the entire space. Intuitively, compactness means: you cannot escape the space using an open cover without using only finitely many sets. Compact spaces are "not too spread out." The Heine-Borel Theorem In Euclidean space $\mathbb{R}^n$, there's a beautiful characterization: a subset is compact if and only if it is closed and bounded. A set is closed if it contains all its limit points (equivalently, if its complement is open). A set is bounded if it fits inside some ball of finite radius. For example, in $\mathbb{R}$, the closed interval $[a, b]$ is compact, but the open interval $(a, b)$, the half-line $[a, \infty)$, and the entire line $\mathbb{R}$ are not compact. <extrainfo> Total Boundedness A related concept is total boundedness: a metric space is totally bounded if for every $\varepsilon > 0$, it can be covered by finitely many open balls of radius $\varepsilon$. This is weaker than boundedness (being inside a single large ball), but stronger in a different direction. The key relationship is: every compact metric space is complete, and every complete and totally bounded metric space is compact. This gives another way to prove compactness. </extrainfo> Compactness and Completeness There's an important relationship: every compact metric space is complete. Intuitively, if a space is compact (sufficiently "small" and well-behaved topologically), then Cauchy sequences must converge. However, the converse is false: $\mathbb{R}$ is complete but not compact. Summary: Metric spaces provide a unified framework for studying distance, convergence, and continuity. The metric axioms ensure reasonable behavior; common examples show the framework's flexibility; open balls connect to topology; convergence distinguishes complete spaces; continuity relates to open sets; and compactness describes spaces with strong finiteness properties. These concepts form the foundation for real analysis and topology.
Flashcards
What two components form a metric space $(X, d)$?
A non-empty set $X$ and a distance function $d: X \times X \to \mathbb{R}$.
What are the three fundamental axioms that a metric $d(x, y)$ must satisfy?
Non-negativity: $d(x, y) \ge 0$, and $d(x, y) = 0$ iff $x = y$ Symmetry: $d(x, y) = d(y, x)$ Triangle inequality: $d(x, z) \le d(x, y) + d(y, z)$
Under what specific condition is the metric $d(x, y)$ equal to $0$?
Only when $x = y$.
Which axiom states that the distance from $x$ to $y$ is the same as the distance from $y$ to $x$?
Symmetry ($d(x, y) = d(y, x)$).
Which axiom states that $d(x, z) \le d(x, y) + d(y, z)$ for all $x, y, z \in X$?
The triangle inequality.
What is the standard metric $d(x, y)$ used on the set of real numbers $\mathbb{R}$?
The absolute value metric: $d(x, y) = |x - y|$.
What is the formula for the Euclidean distance metric on $\mathbb{R}^n$?
$d(\mathbf{x}, \mathbf{y}) = \sqrt{(x1 - y1)^2 + \dots + (xn - yn)^2}$.
How is the discrete metric defined for any two points $x$ and $y$?
$d(x, y) = 0$ if $x = y$, and $d(x, y) = 1$ if $x \neq y$.
How does the Taxicab (Manhattan) metric measure distance on $\mathbb{R}^2$?
By moving along coordinate axes: $d((x1, y1), (x2, y2)) = |x1 - x2| + |y1 - y2|$.
What is the definition of the supremum metric for continuous functions $f$ and $g$?
$d(f, g) = \supt |f(t) - g(t)|$.
What is the formal definition of an open ball $Br(x)$ in a metric space?
$Br(x) = \{y \in X \mid d(x, y) < r\}$.
What role does the collection of all open balls play in the topology of a metric space?
They form a basis for the topology.
What is the open-ball characterization of an open set $U \subseteq X$?
For every $x \in U$, there exists $r > 0$ such that $Br(x) \subseteq U$.
When does a sequence $(xn)$ converge to $x$ in a metric space?
If for every $\varepsilon > 0$, there exists $N$ such that $d(xn, x) < \varepsilon$ for all $n \ge N$.
What is the definition of a Cauchy sequence $(xn)$?
For every $\varepsilon > 0$, there exists $N$ such that $d(xn, xm) < \varepsilon$ for all $n, m \ge N$.
What is the $\varepsilon$-$\delta$ definition of a function $f: X \to Y$ being continuous at $x$?
For every $\varepsilon > 0$, there exists $\delta > 0$ such that $dX(x', x) < \delta$ implies $dY(f(x'), f(x)) < \varepsilon$.
What is the sequential characterization of a continuous function $f$?
Whenever $xn \to x$ in $X$, then $f(xn) \to f(x)$ in $Y$.
What is the open-set characterization of a continuous function $f: X \to Y$?
The preimage $f^{-1}(V)$ of every open set $V \subseteq Y$ is an open set in $X$.
When is a metric space considered complete?
When every Cauchy sequence in the space converges to a point in that space.
Is the real line $\mathbb{R}$ with the absolute value metric a complete space?
Yes.
What is the topological definition of a compact metric space?
Every open cover of the space has a finite subcover.
According to the Heine–Borel theorem, what two conditions make a subset of $\mathbb{R}^n$ compact?
It must be closed and bounded.
What is the relationship between compactness and completeness?
Every compact metric space is complete.
What two properties together guarantee that a metric space is compact?
Completeness and total boundedness.
What is the definition of a totally bounded metric space?
For every $\varepsilon > 0$, the space can be covered by finitely many open balls of radius $\varepsilon$.

Quiz

Which metric on the real line $\mathbb{R}$ gives the usual distance between numbers?
1 of 12
Key Concepts
Fundamentals of Metric Spaces
Metric space
Metric (distance function)
Open ball
Discrete metric
Euclidean metric
Taxicab metric
Supremum metric
Properties of Metric Spaces
Cauchy sequence
Completeness
Compactness
Total boundedness
Heine–Borel theorem