A [metric space](/page/Metric%20Space) gives a distance between any two of its points, but mathematics rarely stays inside the original space. We take intervals inside the real line, spheres inside Euclidean space, rational points inside $\mathbb{R}$, solution sets inside function spaces, and compact sets inside larger non-compact spaces. The basic question is not whether the old distance can still be used on the smaller set. It can. The question is what survives when the available points have changed.
The first surprise is that restricting the set can change the meaning of convergence, closedness, and completeness even when the formula for distance has not changed. In $\mathbb{R}$ with its usual metric, the points $1-1/k$ approach $1$. Inside $[0,1)$, the same points still get closer and closer to each other, but the missing endpoint means the sequence has no limit in the subspace. The metric did not change its values; the universe of allowed limits changed.
[example: A Cauchy Sequence Losing Its Limit]
Let $X=\mathbb{R}$ with $d(x,y)=|x-y|$, and let $Y=[0,1)\subset X$ carry the restricted distance. For $k\ge 2$, define $x_k=1-1/k$; then $0\le x_k<1$, so every $x_k$ lies in $Y$.
To show that $(x_k)$ is Cauchy in $Y$, let $\varepsilon>0$ and choose $N\ge 2$ with $2/N<\varepsilon$. If $m,k\ge N$, then
\begin{align*}
d_Y(x_k,x_m)=|x_k-x_m|=\left|\left(1-\frac{1}{k}\right)-\left(1-\frac{1}{m}\right)\right|=\left|\frac{1}{m}-\frac{1}{k}\right|.
\end{align*}
By the triangle inequality in $\mathbb{R}$,
\begin{align*}
\left|\frac{1}{m}-\frac{1}{k}\right|\le \left|\frac{1}{m}\right|+\left|\frac{1}{k}\right|=\frac{1}{m}+\frac{1}{k}.
\end{align*}
Since $m,k\ge N$, we have $1/m\le 1/N$ and $1/k\le 1/N$, hence
\begin{align*}
d_Y(x_k,x_m)\le \frac{1}{N}+\frac{1}{N}=\frac{2}{N}<\varepsilon.
\end{align*}
Thus $(x_k)$ is Cauchy in the metric subspace $Y$.
In the ambient real line, the same sequence converges to $1$, because
\begin{align*}
|x_k-1|=\left|1-\frac{1}{k}-1\right|=\frac{1}{k}\to 0.
\end{align*}
But $1\notin Y$. Moreover, no $y\in Y$ can be a limit of $(x_k)$ in $Y$: if $d_Y(x_k,y)\to 0$, then $|x_k-y|\to 0$, and the triangle inequality gives
\begin{align*}
|y-1|\le |y-x_k|+|x_k-1|.
\end{align*}
Both terms on the right tend to $0$, so $|y-1|=0$ and therefore $y=1$, contradicting $y\in [0,1)$. The sequence is Cauchy inside $Y$ but has no limit inside $Y$, so completeness is not inherited by arbitrary metric subspaces.
[/example]
This page develops the metric subspace as the systematic way to view a subset as a metric space in its own right. The construction is simple, but its consequences are a recurring source of useful distinctions: open in the ambient space versus open in the subspace, complete as a space versus sitting inside a complete space, compact as a subset versus bounded in a larger metric, and continuous on a subset versus extendable to the ambient space.
## Definition
### The Restricted Distance
The aim is to turn a subset into a metric space without inventing new distances. If the ambient space already knows how far apart any two points are, then points inside the subset should keep that same distance. The only change is that all quantifiers now range over the subset.
[definition: Metric Subspace]
Let $(X,d)$ be a metric space and let $Y\subset X$. The metric subspace of $(X,d)$ determined by $Y$ is the metric space $(Y,d_Y)$, where
\begin{align*}
d_Y:Y\times Y\to [0,\infty)
\end{align*}
is defined by
\begin{align*}
d_Y(y_1,y_2)=d(y_1,y_2)
\end{align*}
for all $y_1,y_2\in Y$. The metric $d_Y$ is called the subspace metric, the restricted metric, or the metric inherited from $X$.
[/definition]
The definition is terse because it does only one thing: it restricts the old function $d$ to pairs of points that lie in $Y$. The axioms do not need to be redesigned, but they do need to be checked once so the construction is legitimate.
[quotetheorem:8585]
This theorem says that every subset of a metric space carries a canonical metric structure. It does not say that every metric property of $X$ passes to $Y$. The rest of the page is about exactly which statements are inherited, which must be reformulated relatively, and which fail without extra hypotheses.
### First Examples
The real line gives the first laboratory for the construction because the distance is familiar and the subsets are visible. Intervals show that the inherited distance may be old while the available balls and limits are new.
[example: Intervals as Metric Subspaces]
Let $X=\mathbb{R}$ with $d(x,y)=|x-y|$. For each subset $Y\in\{(0,1),[0,1],[0,1),\mathbb{Z}\}$, the subspace metric is the restriction of $d$ to $Y\times Y$, so for any $a,b\in Y$ we have
\begin{align*}
d_Y(a,b)=d(a,b)=|a-b|.
\end{align*}
Now take $Y=[0,1]$ and compute the open ball of radius $1/2$ about $0$ inside $Y$. By the definition of a subspace ball,
\begin{align*}
B_Y(0,1/2)=\{z\in[0,1]:d_Y(0,z)<1/2\}.
\end{align*}
For $z\in[0,1]$, the restricted metric gives
\begin{align*}
d_Y(0,z)=|0-z|=|z|=z.
\end{align*}
Therefore
\begin{align*}
B_Y(0,1/2)=\{z\in[0,1]:z<1/2\}=[0,1/2).
\end{align*}
Equivalently,
\begin{align*}
[0,1]\cap(-1/2,1/2)=[0,1/2).
\end{align*}
Thus the distance formula is still $|a-b|$, but balls are formed only from points that actually belong to the chosen subset.
[/example]
In Euclidean spaces the inherited metric is usually so familiar that it is invisible. A circle, a sphere, a graph, or a finite point cloud inside $\mathbb{R}^n$ becomes a metric space by measuring distance with the ambient Euclidean norm unless another metric is explicitly specified.
[example: The Unit Circle with the Chordal Metric]
Let
\begin{align*}
S^1=\{x\in\mathbb{R}^2:|x|=1\}.
\end{align*}
As a metric subspace of $\mathbb{R}^2$, the distance between $x,y\in S^1$ is the restricted Euclidean distance
\begin{align*}
d_{S^1}(x,y)=|x-y|.
\end{align*}
The points $(1,0)$ and $(-1,0)$ both lie in $S^1$, since
\begin{align*}
|(1,0)|=\sqrt{1^2+0^2}=1
\end{align*}
and
\begin{align*}
|(-1,0)|=\sqrt{(-1)^2+0^2}=1.
\end{align*}
Their subspace distance is therefore
\begin{align*}
d_{S^1}((1,0),(-1,0))=|(1,0)-(-1,0)|=|(2,0)|=\sqrt{2^2+0^2}=2.
\end{align*}
The shorter path along the unit circle from $(1,0)$ to $(-1,0)$ is a semicircle, so its central angle is $\pi$ radians and its arclength is $1\cdot \pi=\pi$. Thus the metric subspace distance measures the straight chord through the plane, not the distance traveled along the circle.
[/example]
The circle example is a useful warning: a set may carry several natural metrics. The phrase metric subspace always refers to the distance inherited from a specified ambient metric space.
## Open and Closed Sets in a Subspace
### Relative Balls
Open sets are where subspaces first become interesting. A set can be open relative to the smaller universe even if it is not open in the ambient universe. The reason is local: in the subspace, a ball is allowed to contain only points of the subspace, so it may look like an ambient ball with everything outside $Y$ removed.
[definition: Subspace Ball]
Let $(X,d)$ be a metric space, let $Y\subset X$, and let $(Y,d_Y)$ be the metric subspace. For $y\in Y$ and $r>0$, the open ball in $Y$ with centre $y$ and radius $r$ is
\begin{align*}
B_Y(y,r)=\{z\in Y:d_Y(y,z)<r\}.
\end{align*}
[/definition]
Because $d_Y$ is the restriction of $d$, subspace balls are ambient balls cut down to the subset:
\begin{align*}
B_Y(y,r)=Y\cap B_X(y,r).
\end{align*}
This identity is the computational rule behind nearly every elementary fact about metric subspaces.
### Relative Openness
A set inside $Y$ should count as open if every one of its points has room to move inside $Y$ while staying in the set. It need not have room to move in directions that leave $Y$.
[definition: Relatively Open Set]
Let $(X,d)$ be a metric space and let $Y\subset X$. A subset $U\subset Y$ is relatively open in $Y$ if for every $u\in U$ there exists $r>0$ such that
\begin{align*}
B_Y(u,r)\subset U.
\end{align*}
[/definition]
The definition is internal to $Y$, but calculations often begin in $X$. The practical problem is that a ball in the subspace has the form $B_Y(u,r)=Y\cap B_X(u,r)$, so openness in $Y$ should be expressible using ambient open sets cut down to $Y$. The following criterion makes that equivalence precise.
[quotetheorem:8586]
This theorem translates between internal and ambient language. Internally, we see balls in $Y$. Externally, we see intersections with open sets of $X$. It is often the fastest way to decide whether a set is open in a subspace.
[example: The Half-Open Interval Is Open in Itself]
Consider $Y=[0,1)$ as a metric subspace of $X=\mathbb{R}$ with the usual distance. We show that $[0,1/2)$ is open in the subspace $Y$, even though it is not open in $\mathbb{R}$.
Let $u\in[0,1/2)$ and set $r=1/2-u$. Since $u<1/2$, we have $r>0$. If $z\in B_Y(u,r)$, then $z\in Y$ and $d_Y(u,z)<r$, so
\begin{align*}
|z-u|<1/2-u.
\end{align*}
From $|z-u|<1/2-u$ we get $z-u<1/2-u$, hence $z<1/2$. Also $z\in Y=[0,1)$ gives $z\ge 0$. Therefore $z\in[0,1/2)$, so
\begin{align*}
B_Y(u,r)\subset[0,1/2).
\end{align*}
Thus every point of $[0,1/2)$ has a subspace ball contained in $[0,1/2)$, so $[0,1/2)$ is relatively open in $Y$.
The same set is not open in $\mathbb{R}$. If it were open in $\mathbb{R}$, then for the point $0\in[0,1/2)$ there would be some $s>0$ such that $(-s,s)\subset[0,1/2)$. But $-s/2\in(-s,s)$ because $s>0$, while $-s/2<0$, so $-s/2\notin[0,1/2)$. The obstruction is only ambient: in the subspace $Y=[0,1)$, those negative points are not available.
[/example]
### Relative Closedness
Open sets describe where movement is possible. Closed sets describe which limits have been retained. In a subspace this limit test must ignore points that are not part of the smaller universe, so the complement must also be taken inside that universe.
[definition: Relatively Closed Set]
Let $(X,d)$ be a metric space and let $Y\subset X$. A subset $F\subset Y$ is relatively closed in $Y$ if $Y\setminus F$ is relatively open in $Y$.
[/definition]
The complement definition is concise, but it can be awkward for computation. The following intersection criterion gives the closed-set analogue of relative openness and makes it possible to import ambient closed sets into subspaces.
[quotetheorem:8589]
Relative closedness is often less intuitive than relative openness because missing boundary points can make a set closed. The next example is the standard warning.
[example: A Set Both Open and Closed in a Subspace]
Let $X=\mathbb{R}$ with the usual metric and let $Y=(0,1)\cup(2,3)$ carry the subspace metric. We show that $F=(0,1)$ is both relatively open and relatively closed in $Y$.
First let $u\in F$ and set $r=\min\{u,1-u\}$. Since $0<u<1$, both $u$ and $1-u$ are positive, so $r>0$. If $z\in B_Y(u,r)$, then $z\in Y$ and
\begin{align*}
|z-u|<r.
\end{align*}
Because $r\le u$, we have $|z-u|<u$, hence $-u<z-u<u$, so $0<z<2u$. Because $r\le 1-u$, we also have $|z-u|<1-u$, hence $z-u<1-u$, so $z<1$. Therefore $0<z<1$, and so $z\in F$. Thus $B_Y(u,r)\subset F$ for every $u\in F$, which proves that $F$ is relatively open in $Y$.
To prove relative closedness, it is enough by the definition of relatively [closed set](/page/Closed%20Set) to show that $Y\setminus F$ is relatively open in $Y$. Here
\begin{align*}
Y\setminus F=((0,1)\cup(2,3))\setminus(0,1)=(2,3).
\end{align*}
Let $v\in(2,3)$ and set $s=\min\{v-2,3-v\}$. Since $2<v<3$, we have $s>0$. If $z\in B_Y(v,s)$, then $z\in Y$ and
\begin{align*}
|z-v|<s.
\end{align*}
Since $s\le v-2$, the inequality $|z-v|<v-2$ gives $2<z$. Since $s\le 3-v$, the inequality $|z-v|<3-v$ gives $z<3$. Hence $z\in(2,3)=Y\setminus F$, so $B_Y(v,s)\subset Y\setminus F$. Therefore $Y\setminus F$ is relatively open in $Y$, and $F$ is relatively closed in $Y$.
The set $F$ is both open and closed because the subspace $Y$ has two separated components; the gap between $1$ and $2$ removes the ambient boundary points that would connect them.
[/example]
## Convergence and Closure
### Limits Inside the Subspace
Sequences provide the most concrete way to feel the difference between ambient and relative structure. The distances between terms are the same, so convergence to a point of $Y$ is unaffected by passing from $X$ to $Y$. What changes is the list of points that are eligible to be limits.
[definition: Convergence in a Metric Subspace]
Let $(X,d)$ be a metric space, let $Y\subset X$, and let $(y_k)$ be a sequence in $Y$. The sequence $(y_k)$ converges to $y\in Y$ in the metric subspace $Y$ if
\begin{align*}
\lim_{k\to\infty}d_Y(y_k,y)=0.
\end{align*}
[/definition]
The definition repeats the usual metric definition with $d_Y$ in place of $d$. The useful point is that no numerical estimate changes when the proposed limit lies in the subset, so we need a theorem that separates the calculation from the membership condition.
[quotetheorem:8592]
The theorem does not say that every ambient limit is a subspace limit. It says that when the candidate limit belongs to $Y$, the test is identical. This distinction is exactly what failed in the opening example.
### Relative Closure
Once limits are understood, the next task is to record all points that can be reached from a set by limiting processes. Inside a subspace, the closure should collect only reachable points that are still members of the subspace.
[definition: Subspace Closure]
Let $(X,d)$ be a metric space, let $Y\subset X$, and let $A\subset Y$. The closure of $A$ in the metric subspace $Y$, denoted $\overline{A}^{Y}$, is the intersection of all relatively closed subsets of $Y$ that contain $A$.
[/definition]
The notation $\overline{A}^{Y}$ avoids a common ambiguity. The same underlying set $A$ may have an ambient closure in $X$ and a relative closure in $Y$, and these need not be equal as subsets of $X$.
The following quoted result is stated in the language of topology, but here it is being used only for the topology induced by the metric $d$. In that language, $\tau$ denotes the collection of open subsets of $X$, the [subspace topology](/page/Subspace%20Topology) on $Y$ is the collection of all sets $Y\cap U$ with $U\in\tau$, and $\operatorname{cl}_X(A)$ denotes the closure of $A$ in the ambient space $X$. For metric subspaces, this is exactly the same distinction as ambient closure versus relative closure.
[quotetheorem:1011]
This formula is the closure analogue of the intersection description of open and closed sets. It says that the ambient closure is computed first, and then all points outside the subspace are discarded.
[example: Rational Points in an Interval]
Let $X=\mathbb{R}$ and let $A=\mathbb{Q}\cap [0,1)$. First take $Y_1=[0,1]$. In the ambient real line, $\overline{A}^{X}=[0,1]$: the inclusion $A\subset[0,1]$ gives $\overline{A}^{X}\subset[0,1]$ because $[0,1]$ is closed in $\mathbb{R}$, while every $t\in[0,1]$ is approached by points of $A$. For $0\le t<1$ and $\varepsilon>0$, the interval $(t-\varepsilon,t+\varepsilon)\cap[0,1)$ contains a non-empty open interval, so density of $\mathbb{Q}$ in $\mathbb{R}$ gives some $q\in\mathbb{Q}\cap[0,1)$ with $|q-t|<\varepsilon$. For $t=1$, the interval $(1-\varepsilon,1)$ contains a rational $q$, and then $q\in A$ and $|q-1|<\varepsilon$.
Thus, by *Closure in a Metric Subspace*,
\begin{align*}
\overline{A}^{Y_1}=Y_1\cap \overline{A}^{X}.
\end{align*}
Substituting $Y_1=[0,1]$ and $\overline{A}^{X}=[0,1]$ gives
\begin{align*}
\overline{A}^{Y_1}=[0,1]\cap[0,1]=[0,1].
\end{align*}
Although $1\notin A$, the endpoint $1$ belongs to the subspace $Y_1$, and the rational points of $A$ can converge to it.
If instead $Y_2=[0,1)$, the same ambient closure is still $\overline{A}^{X}=[0,1]$. Applying *Closure in a Metric Subspace* again gives
\begin{align*}
\overline{A}^{Y_2}=Y_2\cap \overline{A}^{X}.
\end{align*}
Substituting $Y_2=[0,1)$ and $\overline{A}^{X}=[0,1]$ gives
\begin{align*}
\overline{A}^{Y_2}=[0,1)\cap[0,1]=[0,1).
\end{align*}
The set of rational points is unchanged, but the relative closure changes because $1$ is available as a [limit point](/page/Limit%20Point) in $[0,1]$ and unavailable in $[0,1)$.
[/example]
### Relative Boundary
Closure records where a set accumulates. Boundary records where the set and its complement both accumulate, so it is even more sensitive to the chosen universe. To avoid importing nonexistent outside directions, both closures must be computed in the same subspace.
[definition: Subspace Boundary]
Let $(X,d)$ be a metric space, let $Y\subset X$, and let $A\subset Y$. The boundary of $A$ in $Y$ is
\begin{align*}
\partial_Y A=\overline{A}^{Y}\cap \overline{Y\setminus A}^{Y}.
\end{align*}
[/definition]
The boundary definition uses closures in $Y$ on both sides. This makes it sensitive to the chosen subspace, not just to the ambient picture.
[example: Boundary Depends on the Ambient Universe]
Let $X=\mathbb{R}$, let $Y=[0,1]$ carry the subspace metric, and let $A=[0,1/2)\subset Y$. In the ambient line, the closure of $A$ is $[0,1/2]$ and the closure of $\mathbb{R}\setminus A$ is $(-\infty,0]\cup[1/2,\infty)$, so the ambient boundary is
\begin{align*}
[0,1/2]\cap\bigl((-\infty,0]\cup[1/2,\infty)\bigr)=\{0,1/2\}.
\end{align*}
Inside the subspace $Y$, the point $0$ is not a boundary point of $A$. Indeed,
\begin{align*}
B_Y(0,1/4)=\{z\in[0,1]:d_Y(0,z)<1/4\}=\{z\in[0,1]:|z|<1/4\}=[0,1/4),
\end{align*}
and $[0,1/4)\subset[0,1/2)=A$.
We now compute the two closures in $Y$. First, every point of $[0,1/2)$ belongs to $\overline{A}^{Y}$ because it already belongs to $A$. The endpoint $1/2$ also belongs to $\overline{A}^{Y}$: if $r>0$, choose
\begin{align*}
z=\frac{1}{2}-\min\{r/2,1/4\}.
\end{align*}
Then $0\le z<1/2$, so $z\in A$, and
\begin{align*}
d_Y(z,1/2)=\left|\frac{1}{2}-\min\{r/2,1/4\}-\frac{1}{2}\right|=\min\{r/2,1/4\}\le r/2<r.
\end{align*}
Thus every subspace ball around $1/2$ meets $A$. Conversely, if $y\in(1/2,1]$, set $r=y-1/2>0$. For every $z\in A$ we have $z<1/2$, hence
\begin{align*}
d_Y(y,z)=|y-z|=y-z>y-\frac{1}{2}=r.
\end{align*}
So $B_Y(y,r)$ does not meet $A$, and $y\notin\overline{A}^{Y}$. Therefore
\begin{align*}
\overline{A}^{Y}=[0,1/2].
\end{align*}
Since $Y\setminus A=[1/2,1]$, every point of $[1/2,1]$ belongs to $\overline{Y\setminus A}^{Y}$. If $y\in[0,1/2)$, set $r=1/2-y>0$. For every $z\in Y\setminus A=[1/2,1]$ we have $z\ge1/2$, so
\begin{align*}
d_Y(y,z)=|z-y|=z-y\ge\frac{1}{2}-y=r.
\end{align*}
Thus $B_Y(y,r)$ does not meet $Y\setminus A$, and $y\notin\overline{Y\setminus A}^{Y}$. Hence
\begin{align*}
\overline{Y\setminus A}^{Y}=[1/2,1].
\end{align*}
By the definition of subspace boundary,
\begin{align*}
\partial_Y A=\overline{A}^{Y}\cap\overline{Y\setminus A}^{Y}=[0,1/2]\cap[1/2,1]=\{1/2\}.
\end{align*}
The boundary changed because the ambient direction to the left of $0$ is not present in the subspace $Y=[0,1]$.
[/example]
## Completeness and Compactness
### Complete Subspaces
Completeness is a statement about Cauchy sequences and available limits. Since Cauchy behavior depends only on distances between terms, a sequence in a subspace is Cauchy in the subspace exactly when it is Cauchy in the ambient space. The issue is whether the ambient limit remains inside the subset.
[definition: Complete Metric Subspace]
Let $(X,d)$ be a metric space and let $Y\subset X$. The metric subspace $(Y,d_Y)$ is complete if every [Cauchy sequence](/page/Cauchy%20Sequence) in $(Y,d_Y)$ converges to a point of $Y$.
[/definition]
The opening example showed that arbitrary subspaces of complete spaces need not be complete. The missing condition is closedness: closed subspaces keep all the ambient limits of their sequences. In a metric space, completeness of the subspace also prevents it from omitting a point that is approached by its own sequences.
[quotetheorem:287]
Together, the two implications say that inside a complete ambient metric space, complete subspaces are exactly closed subspaces. This is one of the main reasons closedness is a natural hypothesis in analysis.
[example: The Rational Line Is Not Complete]
Let $Y=\mathbb{Q}$ with the metric inherited from $\mathbb{R}$. For each $k\ge 1$, the interval $(\sqrt{2}-1/k,\sqrt{2}+1/k)$ contains a rational number, so choose $q_k\in\mathbb{Q}$ such that
\begin{align*}
|q_k-\sqrt{2}|<\frac{1}{k}.
\end{align*}
We show that $(q_k)$ is Cauchy in the subspace $Y$. Let $\varepsilon>0$, and choose $N\in\mathbb{N}$ with $2/N<\varepsilon$. If $k,m\ge N$, then the restricted metric gives
\begin{align*}
d_Y(q_k,q_m)=|q_k-q_m|.
\end{align*}
By the triangle inequality in $\mathbb{R}$,
\begin{align*}
|q_k-q_m|=|(q_k-\sqrt{2})+(\sqrt{2}-q_m)|\le |q_k-\sqrt{2}|+|\sqrt{2}-q_m|.
\end{align*}
Using the choice of $q_k$ and $q_m$,
\begin{align*}
d_Y(q_k,q_m)<\frac{1}{k}+\frac{1}{m}.
\end{align*}
Since $k,m\ge N$, we have $1/k\le 1/N$ and $1/m\le 1/N$, hence
\begin{align*}
d_Y(q_k,q_m)<\frac{1}{N}+\frac{1}{N}=\frac{2}{N}<\varepsilon.
\end{align*}
Thus $(q_k)$ is Cauchy in $\mathbb{Q}$.
It remains to show that this Cauchy sequence has no limit in $\mathbb{Q}$. Suppose, for contradiction, that $q_k\to r$ in $Y$ for some $r\in\mathbb{Q}$. Then
\begin{align*}
d_Y(q_k,r)=|q_k-r|\to 0.
\end{align*}
Again by the triangle inequality,
\begin{align*}
|r-\sqrt{2}|=|(r-q_k)+(q_k-\sqrt{2})|\le |r-q_k|+|q_k-\sqrt{2}|.
\end{align*}
The first term tends to $0$ because $q_k\to r$ in $Y$, and the second term tends to $0$ because $|q_k-\sqrt{2}|<1/k$. Therefore $|r-\sqrt{2}|=0$, so $r=\sqrt{2}$. But $\sqrt{2}$ is irrational: if $\sqrt{2}=a/b$ with integers $a,b$ in lowest terms and $b\ne0$, then $a^2=2b^2$, so $a$ is even; writing $a=2c$ gives $4c^2=2b^2$, hence $b^2=2c^2$, so $b$ is even too, contradicting lowest terms. Hence no such rational $r$ exists.
The rational line is therefore not complete: it contains a Cauchy sequence whose missing limit is the ambient point $\sqrt{2}\notin\mathbb{Q}$.
[/example]
### Compact Subspaces
Compactness is a stronger form of finite control. A compact metric subspace can be covered by finitely many members of any relative [open cover](/page/Open%20Cover), so it cannot leak toward a missing endpoint the way $[0,1)$ does.
[definition: Compact Metric Subspace]
Let $(X,d)$ be a metric space and let $K\subset X$. The metric subspace $(K,d_K)$ is compact if every open cover of $K$ by relatively open subsets of $K$ has a finite subcover.
[/definition]
This definition is intrinsic to $K$. It speaks about covers by open sets in $K$, but the relative openness theorem allows us to translate such covers into ambient open covers whenever convenient.
A standard compactness fact is often phrased for general topological spaces rather than metric spaces. The only new term in that statement is Hausdorff: a [topological space](/page/Topological%20Space) is Hausdorff if any two distinct points can be separated by disjoint open neighborhoods. Every metric space is Hausdorff, because two points at positive distance have disjoint small balls around them. Thus the next quoted theorem applies to metric spaces and explains why compact subspaces behave like closed subsets of their ambient metric space.
[quotetheorem:307]
Closedness alone does not identify compact subspaces of $\mathbb{R}^n$: the whole real line is closed but not compact. Boundedness alone also fails, since sets such as $[0,1)$ can approach a missing limit point. In Euclidean space, compactness is exactly the situation where both obstructions are absent: the set is bounded, and it contains all of its ambient limit points.
This raises a useful test for Euclidean subspaces: instead of checking every possible open cover directly, can compactness be recognized from the two geometric failures just described? The Heine--Borel theorem gives exactly that criterion.
[quotetheorem:271]
This theorem explains why $[0,1]$ is compact and $[0,1)$ is not. The latter is bounded, but it has lost an ambient limit point.
[example: Compactness Lost by Removing One Point]
Let $K=[0,1)$ with the metric inherited from $\mathbb{R}$. For each integer $m\ge 2$, define
\begin{align*}
U_m=[0,1)\cap(-1,1-1/m).
\end{align*}
The interval $(-1,1-1/m)$ is open in $\mathbb{R}$, so $U_m$ is relatively open in the subspace $K$. Also,
\begin{align*}
U_m=\{x\in[0,1): -1<x<1-1/m\}=[0,1-1/m).
\end{align*}
We show that the sets $U_m$ cover $K$. Let $x\in K$. Then $0\le x<1$, so $1-x>0$. By the [Archimedean property](/theorems/737), choose an integer $m\ge 2$ such that
\begin{align*}
m>\frac{1}{1-x}.
\end{align*}
Since both sides are positive, taking reciprocals reverses the inequality:
\begin{align*}
\frac{1}{m}<1-x.
\end{align*}
Adding $x-1/m$ to both sides gives
\begin{align*}
x<1-\frac{1}{m}.
\end{align*}
Thus $x\in[0,1-1/m)=U_m$, so $\{U_m:m\ge 2\}$ is a relatively open cover of $K$.
No finite subcollection covers $K$. Suppose $U_{m_1},\dots,U_{m_N}$ are chosen, and set
\begin{align*}
M=\max\{m_1,\dots,m_N\}.
\end{align*}
For each $i$, we have $m_i\le M$, hence
\begin{align*}
\frac{1}{m_i}\ge \frac{1}{M}.
\end{align*}
Subtracting from $1$ gives
\begin{align*}
1-\frac{1}{m_i}\le 1-\frac{1}{M}.
\end{align*}
Therefore
\begin{align*}
U_{m_i}=[0,1-1/m_i)\subset[0,1-1/M)
\end{align*}
for every $i$. Now take
\begin{align*}
x=1-\frac{1}{2M}.
\end{align*}
Since $M\ge 2$, we have $0<x<1$, so $x\in K$. But
\begin{align*}
1-\frac{1}{M}<1-\frac{1}{2M}=x,
\end{align*}
so $x\notin[0,1-1/M)$ and hence $x\notin U_{m_i}$ for every $i$. Thus no finite subcollection covers $K$, and the metric subspace $[0,1)$ is not compact.
[/example]
## Continuity, Embeddings, and Inherited Geometry
### The Inclusion Map
A subspace is not only a metric space; it comes with a canonical map back into the ambient space. This inclusion lets us express the relationship between the subspace and the original space as a statement about continuous maps.
[definition: Subspace Inclusion]
Let $(X,d)$ be a metric space and let $Y\subset X$ carry the subspace metric. The subspace inclusion is the map
\begin{align*}
i:Y\to X
\end{align*}
defined by
\begin{align*}
i(y)=y.
\end{align*}
[/definition]
The inclusion preserves all distances between points of $Y$. To state that preservation in a reusable way, we isolate maps that place one metric space inside another without changing distances.
[definition: Isometric Embedding]
Let $(A,d_A)$ and $(B,d_B)$ be metric spaces. A map $f:A\to B$ is an isometric embedding if $f$ is injective and, for all $a_1,a_2\in A$,
\begin{align*}
d_B(f(a_1),f(a_2))=d_A(a_1,a_2).
\end{align*}
[/definition]
The subspace inclusion is the model example of an isometric embedding. The point to check is that treating $Y$ as its own metric space has not changed the distances used when its points are viewed inside $X$. Once this is verified, arguments about continuity and convergence can pass from the subspace back to the ambient space without altering distances.
There is a small ambiguity to remove before using this idea: a pair of points $y_1,y_2\in Y$ can be measured by the relative metric on $Y$, but the same pair can also be measured after inclusion into $X$. If those two measurements differed, the inclusion would not faithfully represent the subspace geometry inside the ambient space.
The next point is therefore not just an example of the definition. It is the bridge that identifies the relative metric on a subspace with the distances inherited from the ambient space, making the inclusion map the mechanism by which subspace arguments can be compared directly with ambient-space arguments.
[quotetheorem:8595]
Since isometric embeddings are continuous, the subspace inclusion is continuous. This provides the conceptual reason that convergence in $Y$ implies convergence in $X$.
### Restricting Functions
Continuous maps are tested by what they do to nearby points. Restricting the domain to a subspace removes possible inputs but leaves all distances among remaining inputs unchanged, so continuity should survive restriction.
[quotetheorem:1036]
The theorem is used constantly: once a function is continuous on a large space, its behavior on every metric subspace is continuous. The reverse direction is much more delicate. A [continuous function](/page/Continuous%20Function) on a subspace need not extend continuously to the ambient space.
[example: Continuous on a Punctured Subspace but Not Extendable]
Let $Y=\mathbb{R}\setminus\{0\}$ with the metric inherited from $\mathbb{R}$, and define $f:Y\to\mathbb{R}$ by $f(x)=1/x$. We first verify continuity at an arbitrary point $a\in Y$. Since $a\ne 0$, let $\varepsilon>0$ and set
\begin{align*}
\delta=\min\left\{\frac{|a|}{2},\frac{\varepsilon |a|^2}{2}\right\}.
\end{align*}
If $x\in Y$ and $|x-a|<\delta$, then $\delta\le |a|/2$, so
\begin{align*}
|x|\ge |a|-|x-a|>|a|-\frac{|a|}{2}=\frac{|a|}{2}.
\end{align*}
Therefore
\begin{align*}
|f(x)-f(a)|=\left|\frac{1}{x}-\frac{1}{a}\right|=\left|\frac{a-x}{ax}\right|=\frac{|x-a|}{|a||x|}.
\end{align*}
Using $|x|>|a|/2$, we get
\begin{align*}
\frac{|x-a|}{|a||x|}<\frac{|x-a|}{|a|(|a|/2)}=\frac{2|x-a|}{|a|^2}.
\end{align*}
Since $|x-a|<\delta\le \varepsilon |a|^2/2$,
\begin{align*}
|f(x)-f(a)|<\frac{2}{|a|^2}\cdot\frac{\varepsilon |a|^2}{2}=\varepsilon.
\end{align*}
Thus $f$ is continuous at every $a\in Y$.
Now suppose, for contradiction, that there is a continuous extension $F:\mathbb{R}\to\mathbb{R}$ with $F(x)=f(x)$ for every $x\in Y$. Continuity of $F$ at $0$ with $\varepsilon=1$ gives some $\eta>0$ such that
\begin{align*}
|x|<\eta\implies |F(x)-F(0)|<1.
\end{align*}
Choose an integer $k$ such that
\begin{align*}
k>\max\left\{\frac{1}{\eta},|F(0)|+1\right\}.
\end{align*}
Then $1/k\in Y$ and
\begin{align*}
\left|\frac{1}{k}\right|<\eta.
\end{align*}
Since $F$ extends $f$,
\begin{align*}
F(1/k)=f(1/k)=\frac{1}{1/k}=k.
\end{align*}
Hence
\begin{align*}
|F(1/k)-F(0)|=|k-F(0)|\ge k-|F(0)|>1,
\end{align*}
contradicting the inequality forced by continuity at $0$. Therefore $f$ is continuous on the punctured subspace $Y$, but it has no continuous extension to all of $\mathbb{R}$; the obstruction is the omitted ambient point $0$.
[/example]
### Quantitative Control
Some continuity statements come with an explicit distance estimate. These estimates are especially stable under subspaces, because restricting the domain does not alter the distances that appear in the inequality.
[definition: Lipschitz Map]
Let $(A,d_A)$ and $(B,d_B)$ be metric spaces. A map $f:A\to B$ is Lipschitz if there exists $L\ge 0$ such that for all $a_1,a_2\in A$,
\begin{align*}
d_B(f(a_1),f(a_2))\le Ld_A(a_1,a_2).
\end{align*}
[/definition]
The Lipschitz condition is a uniform metric inequality. To use an ambient Lipschitz estimate on a subset, we need the formal inheritance statement saying that the same constant still works after the domain is restricted.
[quotetheorem:8597]
The subspace metric can also hide geometric constraints. A path may be short in the ambient metric because it travels through points outside the subspace. The inherited metric measures straight ambient distance, not distance constrained to move inside the subset.
[example: Chord Distance Versus Path Distance]
Let $S^1\subset\mathbb{R}^2$ have the subspace metric $d_{S^1}(p,q)=|p-q|$. Take $x=(1,0)$ and $y=(\cos\theta,\sin\theta)$ with $0<\theta<\pi$. Both points lie on $S^1$, since $|x|=\sqrt{1^2+0^2}=1$ and $|y|=\sqrt{\cos^2\theta+\sin^2\theta}=1$.
The subspace distance is the Euclidean chord length:
\begin{align*}
d_{S^1}(x,y)=|x-y|=|(1-\cos\theta,-\sin\theta)|.
\end{align*}
Using the Euclidean norm formula,
\begin{align*}
|(1-\cos\theta,-\sin\theta)|=\sqrt{(1-\cos\theta)^2+(-\sin\theta)^2}.
\end{align*}
Expanding the square and using $\sin^2\theta+\cos^2\theta=1$ gives
\begin{align*}
(1-\cos\theta)^2+(-\sin\theta)^2=1-2\cos\theta+\cos^2\theta+\sin^2\theta=2-2\cos\theta.
\end{align*}
Using $1-\cos\theta=2\sin^2(\theta/2)$,
\begin{align*}
2-2\cos\theta=2(1-\cos\theta)=4\sin^2(\theta/2).
\end{align*}
Since $0<\theta/2<\pi/2$, we have $\sin(\theta/2)>0$, so
\begin{align*}
d_{S^1}(x,y)=\sqrt{4\sin^2(\theta/2)}=2\sin(\theta/2).
\end{align*}
The shorter circular arc from $x$ to $y$ is parametrized by $\gamma(t)=(\cos t,\sin t)$ for $0\le t\le\theta$. Its speed is
\begin{align*}
|\gamma'(t)|=|(-\sin t,\cos t)|=\sqrt{\sin^2 t+\cos^2 t}=1,
\end{align*}
so its arclength is
\begin{align*}
\int_0^\theta |\gamma'(t)|\,dt=\int_0^\theta 1\,dt=\theta.
\end{align*}
Finally, if $g(u)=u-\sin u$ on $(0,\pi/2)$, then $g'(u)=1-\cos u>0$ and $g(0)=0$, so $\sin u<u$ for $0<u<\pi/2$. Applying this with $u=\theta/2$ gives
\begin{align*}
2\sin(\theta/2)<2(\theta/2)=\theta.
\end{align*}
Thus the metric subspace distance is the straight chord length through the plane, not the intrinsic path distance along the circle.
[/example]
## Density and Separability
### Dense Subspaces
Some subspaces are small as sets but large from the metric point of view. The rationals are countable, yet every real number is a limit of rational numbers. This phenomenon is captured by density.
[definition: Dense Subspace]
Let $(X,d)$ be a metric space and let $Y\subset X$. The subset $Y$ is dense in $X$ if
\begin{align*}
\overline{Y}^{X}=X.
\end{align*}
[/definition]
Density means that every ambient point can be approximated by points of the subspace. It does not mean that the subspace has the same completeness, compactness, or connectedness properties as the ambient space.
[example: The Rational Line]
Let $\mathbb{Q}$ carry the metric inherited from $\mathbb{R}$. First, $\mathbb{Q}$ is dense in $\mathbb{R}$: if $a<b$, the Archimedean property gives $n\in\mathbb{N}$ with $n(b-a)>1$. Choose an integer $m$ such that
\begin{align*}
na<m<nb.
\end{align*}
Then $q=m/n\in\mathbb{Q}$ and
\begin{align*}
a<\frac{m}{n}<b.
\end{align*}
Thus every non-empty open interval in $\mathbb{R}$ contains a rational number, so every real point is a limit of rational points.
Now define rational decimal truncations of $\sqrt{2}$ by
\begin{align*}
q_k=\frac{\lfloor 10^k\sqrt{2}\rfloor}{10^k}.
\end{align*}
Since $\lfloor 10^k\sqrt{2}\rfloor$ is an integer, $q_k\in\mathbb{Q}$. The defining property of the floor function gives
\begin{align*}
\lfloor 10^k\sqrt{2}\rfloor\le 10^k\sqrt{2}<\lfloor 10^k\sqrt{2}\rfloor+1.
\end{align*}
Dividing by $10^k>0$ gives
\begin{align*}
q_k\le \sqrt{2}<q_k+\frac{1}{10^k}.
\end{align*}
Hence
\begin{align*}
0\le \sqrt{2}-q_k<\frac{1}{10^k}.
\end{align*}
We show that $(q_k)$ is Cauchy in $\mathbb{Q}$. Let $\varepsilon>0$, and choose $N$ so large that $2/10^N<\varepsilon$. If $k,m\ge N$, then the inherited metric gives
\begin{align*}
d_{\mathbb{Q}}(q_k,q_m)=|q_k-q_m|.
\end{align*}
By the triangle inequality in $\mathbb{R}$,
\begin{align*}
|q_k-q_m|=|(q_k-\sqrt{2})+(\sqrt{2}-q_m)|\le |q_k-\sqrt{2}|+|\sqrt{2}-q_m|.
\end{align*}
Using $|q_j-\sqrt{2}|<10^{-j}$ for $j=k,m$ gives
\begin{align*}
d_{\mathbb{Q}}(q_k,q_m)<\frac{1}{10^k}+\frac{1}{10^m}.
\end{align*}
Since $k,m\ge N$, we have $10^{-k}\le 10^{-N}$ and $10^{-m}\le 10^{-N}$, so
\begin{align*}
d_{\mathbb{Q}}(q_k,q_m)<\frac{2}{10^N}<\varepsilon.
\end{align*}
Thus $(q_k)$ is Cauchy in $\mathbb{Q}$.
The same estimates show that $(q_k)$ converges to $\sqrt{2}$ in $\mathbb{R}$, because
\begin{align*}
|q_k-\sqrt{2}|<\frac{1}{10^k}\to 0.
\end{align*}
It has no limit in $\mathbb{Q}$. If $q_k\to r$ in $\mathbb{Q}$ for some $r\in\mathbb{Q}$, then
\begin{align*}
|r-\sqrt{2}|=|(r-q_k)+(q_k-\sqrt{2})|\le |r-q_k|+|q_k-\sqrt{2}|.
\end{align*}
Both terms on the right tend to $0$, so $|r-\sqrt{2}|=0$ and $r=\sqrt{2}$. But $\sqrt{2}$ is irrational: if $\sqrt{2}=a/b$ in lowest terms with integers $a,b$ and $b\ne0$, then $a^2=2b^2$, so $a$ is even; writing $a=2c$ gives $4c^2=2b^2$, hence $b^2=2c^2$, so $b$ is even too, contradicting lowest terms.
Therefore $\mathbb{Q}$ is dense in $\mathbb{R}$ but not complete under the inherited metric: it approximates every real number while still missing Cauchy limits such as $\sqrt{2}$.
[/example]
### Separable Subspaces
Density becomes especially powerful when the dense set is countable. Countable dense sets allow arguments to be reduced to countably many balls, approximations, or test points, which is why separability appears throughout analysis.
[definition: Separable Metric Space]
A metric space $(X,d)$ is separable if there exists a countable subset $D\subset X$ such that
\begin{align*}
\overline{D}^{X}=X.
\end{align*}
[/definition]
Subspaces of separable metric spaces remain separable, but the proof is more subtle than simply intersecting a dense set with the subspace. A countable dense set in $X$ may miss $Y$ entirely, so the theorem needs the metric structure of balls to choose countably many points from $Y$ itself.
[quotetheorem:942]
This theorem is special to metric spaces among general topological spaces: metric balls provide enough structure to choose countably many approximating points from the subspace itself.
[example: Irrational Numbers Are Separable]
Let $Y=\mathbb{R}\setminus\mathbb{Q}$ with the metric inherited from $\mathbb{R}$. The usual countable dense set $\mathbb{Q}$ cannot be used as a [dense subset](/page/Dense%20Subset) of $Y$, because $\mathbb{Q}\cap Y=\varnothing$. We construct a countable dense subset of $Y$ by setting
\begin{align*}
D=\{q+\sqrt{2}/m:q\in\mathbb{Q},\ m\in\mathbb{N}\}.
\end{align*}
First, every element of $D$ lies in $Y$. If $q\in\mathbb{Q}$ and $m\in\mathbb{N}$, then $q+\sqrt{2}/m$ is irrational: if $q+\sqrt{2}/m=r$ for some $r\in\mathbb{Q}$, then
\begin{align*}
\sqrt{2}=m(r-q).
\end{align*}
Since $m\in\mathbb{N}$ and $r-q\in\mathbb{Q}$, the right side is rational, contradicting the irrationality of $\sqrt{2}$. Thus $D\subset Y$. Also, $D$ is countable because it is the image of the [countable set](/page/Countable%20Set) $\mathbb{Q}\times\mathbb{N}$ under the map $(q,m)\mapsto q+\sqrt{2}/m$.
We now show that $D$ is dense in $Y$. Let $y\in Y$ and let $r>0$. Choose $m\in\mathbb{N}$ with
\begin{align*}
\frac{\sqrt{2}}{m}<\frac{r}{2}.
\end{align*}
This is possible by the Archimedean property. Consider the open interval
\begin{align*}
I=\left(y-\frac{\sqrt{2}}{m}-\frac{r}{2},\,y-\frac{\sqrt{2}}{m}+\frac{r}{2}\right).
\end{align*}
It is non-empty and has length $r>0$, so it contains a rational number. Explicitly, if $a<b$, choose $n\in\mathbb{N}$ with $n(b-a)>1$ and set $k=\lfloor na\rfloor+1$. Then $na<k\le na+1<nb$, so $a<k/n<b$ and $k/n\in\mathbb{Q}$. Applying this to the interval $I$, choose $q\in\mathbb{Q}$ such that
\begin{align*}
y-\frac{\sqrt{2}}{m}-\frac{r}{2}<q<y-\frac{\sqrt{2}}{m}+\frac{r}{2}.
\end{align*}
Let
\begin{align*}
z=q+\frac{\sqrt{2}}{m}.
\end{align*}
Then $z\in D$, and adding $\sqrt{2}/m-y$ to the displayed inequalities gives
\begin{align*}
-\frac{r}{2}<z-y<\frac{r}{2}.
\end{align*}
Hence
\begin{align*}
d_Y(z,y)=|z-y|<\frac{r}{2}<r.
\end{align*}
So every subspace ball $B_Y(y,r)$ meets $D$, which means $\overline{D}^{Y}=Y$. Therefore the irrational numbers form a separable metric subspace of $\mathbb{R}$, even though the usual dense set $\mathbb{Q}$ is completely outside the subspace.
[/example]
## Beyond and Connected Topics
Metric subspaces are the metric version of the more general topological subspace construction. The relative-open-set theorem is the bridge: the topology induced by the restricted metric is exactly the collection of intersections $Y\cap G$ with $G$ open in $X$. This connects metric spaces to [Cambridge IB Analysis and Topology](/page/Cambridge%20IB%20Analysis%20and%20Topology), where subspace topology, compactness, and connectedness become part of a broader topological language.
In analysis, subspaces of normed spaces are everywhere. A vector subspace $M\subset X$ of a normed space inherits a metric from the norm by $d_M(u,v)=\|u-v\|_X$. If $M$ is closed and $X$ is Banach, then $M$ is Banach; this is the functional-analytic form of the closed-subspace completeness theorem. This direction is central in [Cambridge II Linear Analysis](/page/Cambridge%20II%20Linear%20Analysis) and [Cambridge III Functional Analysis](/page/Cambridge%20III%20Functional%20Analysis), where closed subspaces, quotient spaces, projections, and duality depend on completeness.
Metric subspaces also clarify the role of dense domains. Many operators in analysis are first defined on dense subspaces such as $C_c^\infty(U)\subset L^p(U)$ or polynomial functions inside spaces of continuous functions. The dense subspace gives enough test objects to determine limits or extensions, but it may not be complete under the inherited norm. This is a recurring theme in [Cambridge II Analysis of Functions](/page/Cambridge%20II%20Analysis%20of%20Functions), especially around approximation and function spaces.
There is also a geometric branch. A subset of Euclidean space with the inherited metric measures ambient chord length, while a manifold or length space may carry an intrinsic metric based on paths constrained to remain inside the set. The unit circle example shows the distinction: the metric subspace distance is $|x-y|$, whereas the intrinsic arclength distance follows the circle. This difference becomes important in Riemannian geometry, geometric measure theory, and metric geometry.
Finally, completion turns incomplete dense subspaces into complete spaces by adding missing limits. The passage from $\mathbb{Q}$ to $\mathbb{R}$ is the model example. In functional analysis, completing normed spaces is how many Banach and Hilbert spaces are constructed from simpler dense subspaces. Metric subspaces therefore sit at the entrance to a larger story: restrict a space, study what is lost, and recover missing limits by completion when needed.
## References
Androma, [Cambridge IB Analysis and Topology](/page/Cambridge%20IB%20Analysis%20and%20Topology).
Androma, [Cambridge II Analysis of Functions](/page/Cambridge%20II%20Analysis%20of%20Functions).
Androma, [Cambridge II Linear Analysis](/page/Cambridge%20II%20Linear%20Analysis).
Androma, [Cambridge III Functional Analysis](/page/Cambridge%20III%20Functional%20Analysis).
Munkres, *Topology* (2000).
Kreyszig, *Introductory Functional Analysis with Applications* (1978).
Rudin, *Principles of Mathematical Analysis* (1976).
Metric Subspace
Also known as: Metric subspace, Subspace metric, Restricted metric space, Metric space subspace, Subspace of a metric space, Relative metric