Let $X$ be a metrizable topological space, $A\subseteq X\times X$ a nonempty closed subset which is reflexive, symmetric and transitive, $d:A\to \mathbb{R}_+$ a continuous function that satisfies the metric axioms. Does there exist a metric on $X$ which extends $d$ and defines the topology on $X$?

If it makes any difference I can suppose $X$ locally compact second countable.

Edit: As explained in the comments, one needs to add the condition that $d$ defines the topology on $A$. If one restricts to $X$ compact then all such subtleties disappear, and continuity of an extension of $d$ suffices to ensure that it defines the topology.

Edit2: To clarify further the question.

There are two variants of the questions. For both we suppose $A$ is a closed equivalence relation, $d:A\to \mathbb{R}_+$ continuous and satisfies the metric hypothesis.

Q1: Does there exists an extension $d:X\times X\to \mathbb{R}_+$ which is continuous and a metric.

Q2: Does there exists an extension $d:X\times X\to \mathbb{R}_+$ which is a metric and defines the topology on $X$.

Remark that if $X$ is compact Q1 and Q2 are the same.

Q2 is false without further hypothesis on $d$. The further hypothesis is as follows. Since $X$ is metrizable, it can be equipped with the notion of Cauchy sequence (depends on the choice of a metric). The additional hypothesis is that there exists a metric on $X$ such that if $x_n$ is a sequence with $(x_n,x_m)\in A$ for all $n,m$, then $x_n$ is Cauchy for the metric on $X$ if and only if it is Cauchy for the metric $d:A\to \mathbb{R}_+$.

I am interested in both Q1 and Q2.

  • 2
    $\begingroup$ Related: mathoverflow.net/questions/431320/… $\endgroup$
    – YCor
    Nov 3, 2022 at 22:48
  • $\begingroup$ Do you require the extending metric $d'$ to satisfy any condition related to the topology? That $d'$ is continuous on $X\times X$? or, stronger, that $d'$ defines the topology of $X$? $\endgroup$
    – YCor
    Nov 3, 2022 at 22:51
  • 2
    $\begingroup$ There is a trivial counter example to the question as stated. Let $X$ be the reals under the discrete topology, and take $A$ to be everything, defining $d$ as the Euclidean metric. This is continuous, closed, etc. in the discrete topology, but is already total and defines the wrong topology. You need to add the requirement that the partial metric $d$ defines the subspace topology on $A$, not just that the extension defines the topology on $X$. $\endgroup$ Nov 4, 2022 at 14:50
  • 2
    $\begingroup$ With the locally compact second countable condition, we can modify Joel Hamkins counter-example by taking $X$ to be $\mathbb{N}$, $A = \mathbb{N}^2$ and $d$ a metric making $0$ the unique accumulation point. $\endgroup$
    – Arno
    Nov 4, 2022 at 15:04
  • 1
    $\begingroup$ Now I am confused about what the question means. You have set it up so that $A\subseteq X\times X$ is a set of pairs (not requiring that $A$ is the set of all pairs from some subspace $Y\subseteq X$). And you have stated that $d$ generates the topology on $A$, but of course $d$ is not a metric on $A$, so what is meant exactly? It would make sense if $d$ were defined on all pairs from a subspace. Is that what you mean? What exactly is the question? Are you asking: when does a metric realizing the subspace topology on a subspace extend to a metric realizing the whole (metrizable) space? $\endgroup$ Nov 4, 2022 at 18:05

1 Answer 1


Here is a counterexample to Q2, with your stated extra condition.

Let $X$ consist of the half-open unit interval $(0,1]$ on the $x$-axis in the plane, together with the full unit interval $[0,1]$ at height $1$. That is, $$X=B\sqcup T$$ where $B$ is the bottom line segment, having points of the form $(x,0)$ for $0<x\leq 1$, and $T$ is the top line segment, having points of the form $(x,1)$, where $0\leq x\leq 1$. We put the ordinary Euclidean metric on $X$ as embedded in the plane.

Let $A$ be the set of pairs arising from the equivalence relation relating each point on $B$ to the corresponding point on $T$ vertically above. So $A$ has the trivial pairs and the vertical pairs. This is a closed set in $X\times X$, since a convergent sequence of vertical pairs converges to a vertical pair. Note that the point $t=(0,1)$ at upper left is not part of any nontrivial vertical line in $X$, and appears in $A$ only reflexively.

Define $d$ on $A$ so that the vertical distance on the right side is $1$, but the vertical distances decay continuously to $0$ as one approaches the left side (and trivial distances are $0$). This is a continuous function on $A$ in the space $X\times X$, and it obeys the metric conditions on $A$ (note that there are no nontrivial triangles occuring in $A$).

This set $A$ trivially fulfills your Cauchy sequence condition, since if $x_n$ is a sequence of points and $(x_n,x_m)\in A$ for all $n,m$, then every two points of the sequence must either be identical or vertically related, and so the sequence has at most two points on it. So it is Cauchy with respect to $d$ if and only if it is Cauchy in $X$.

But there can be no metric on $X$ extending $d$ and generating the topology of $X$, since the upper-left point $t$ is not in the closure of $B$ in $X$, but in any metrization of $X$ the point $t$ would have other points on $T$ that were close to points vertically below in $B$, according to $d$, so every neighborhood of $t$ would have to contain points in $B$. Contradiction.

  • $\begingroup$ Thank you for your interesting example. $\endgroup$
    – omar
    Nov 4, 2022 at 19:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.