$\newcommand\abs[1]{\lvert#1\rvert}$Let $(X,d_X)$ be a countable metric space such that $X\cap\mathbb Z=\{0\}$.

Problem. Is there a metric $d$ on the union $Y=X\cup\mathbb Z$ such that

  • $d(x,y)=d_X(x,y)$ for all $x,y\in X$;

  • $d(n,m)=\abs{n-m}$ for all $n,m\in\mathbb Z$;

  • $d(x,y)\notin d_X[X^2]\cup\mathbb N$ for any points $x\in X\setminus\mathbb Z$ and $y\in\mathbb Z\setminus X$;

  • for any distinct pairs $(x,y),(x',y')\in (X\setminus\mathbb Z)\times(\mathbb Z\setminus X)$ we have $d(x,y)\ne d(x',y')$?

So, the problem is to find an extension of the metrics of the spaces $X$ and $\mathbb Z$ to a metric on the union $X\cup\mathbb Z$ so that all distances between points of the sets $X\setminus \mathbb Z$ and $\mathbb Z\setminus X$ are pairwise distinct and do not belong to the set $d_X[X^2]\cup\mathbb N$.

Remark. If $r:=\inf (d_X[X^2]\setminus\{0\})>0$, then a desirable metric $d$ on $X\cup\mathbb Z$ can be defined by the formula $$d(x,y)=\begin{cases} d_X(x,y)&\text{if $x,y\in X$;}\\ \abs{x-y}&\text{if $x,y\in \mathbb Z$;}\\ d_X(x,0)+\abs y-\varepsilon_+(x)&\text{if $x\in X\setminus\{0\}$ and $y\in \mathbb N$;}\\ d_X(x,0)+\abs y-\varepsilon_-(x)&\text{if $x\in X\setminus\{0\}$ and $y\in -\mathbb N$;}\\ d_X(y,0)+\abs x-\varepsilon_+(y)&\text{if $x\in \mathbb N$ and $y\in X\setminus\{0\}$;}\\ d_X(y,0)+\abs x-\varepsilon_-(y)&\text{if $x\in -\mathbb N$ and $y\in X\setminus\{0\}$} \end{cases} $$ for suitable injective functions $\varepsilon_+,\varepsilon_-:X\to (0,r)$ such that $\varepsilon_\pm(x)< \varepsilon_\pm(y)$ for any points $x,y\in X$ with $d_X(0,x)< d_X(0,y)$.

Added in Edit. However, the general case seems to be still open.

  • 1
    $\begingroup$ Noticed where? Assuming it has an affirmative answer, it'd be reassuringly pro-social to let us see it. $\endgroup$
    – jdc
    Commented May 11, 2023 at 17:26
  • 3
    $\begingroup$ @jdc There was an answer by JoelDavidHamkins which he later deleted because it was incomplete. $\endgroup$
    – Gro-Tsen
    Commented May 11, 2023 at 17:37
  • 1
    $\begingroup$ @jdc I have deleted my remark in "Added in Edit" because of a gap in my argument for the general case. Nonetheless, the case $\inf (d_X[X^2]\setminus\{0\})>0$ seems to be valid (with monotone $\varepsilon_+$ and $\varepsilon_-$). $\endgroup$ Commented May 11, 2023 at 19:14
  • $\begingroup$ @TarasBanakh I see, thanks for clarifying. $\endgroup$
    – jdc
    Commented May 11, 2023 at 22:10
  • 2
    $\begingroup$ Are you asking about $\mathbb{Z}$ as the second metric space, rather than some arbitrary countable $\mathbf{Y}$ because that's the case you are interested in, or because you know it doesn't work in general? $\endgroup$
    – Arno
    Commented May 22, 2023 at 9:17

2 Answers 2


The affirmative answer to this problem follows from a general result on extension of graph metrics. In the following definitions, the unordered pair $\{x,y\}$ of two elements $x,y$ is denoted by $xy$.

A graph metric on a set $X$ is any function $d:\mathrm{dom}[d]\to\mathbb R_+$ defined on a subset $\mathrm{dom}[d]\subseteq [X]^2:=\{A\subseteq X:|A|=2\}$ such that the following two conditions are satisfied:

  1. for every $x,y\in X$ there exist points $x_0,\dots,x_n\in X$ such that $x_0=x$, $x_n=y$ and $\{x_{i-1}x_i:0<i\le n\}\subseteq \mathrm{dom}[d]$;

  2. for every $xy\in\mathrm{dom}[X]$ we have $d(xy)\le\hat d(x,y)$, where $\hat d:X\times X\to\mathbb R$ is the pseudometric on $X$, defined by the formula $$\hat d(x,y):=\inf\Big\{\sum_{i=1}^nd(x_{i-1}x):xy=x_0x_n\;\wedge\;\{x_{i-1}x_i:0<i\le n\}\subseteq\mathrm{dom}[d]\Big\}.$$

A graph metric $d:\mathrm{dom}[d]\to\mathbb R_+$ is a full metric if $\mathrm{dom}[d]=[X]^2$.

A graph metric $d:\mathrm{dom}[d]\to\mathbb R_+$ is floppy if for every $xy\in[X]^2\setminus\mathrm{dom}[d]$ we have $\check d(x,y)<\hat d(x,y)$, where $$\check d(x,y):=\sup\big\{\min\{0,d(uv)-\hat d(u,x)-\hat d(v,y)\}:uv\in \mathrm{dom}[X]^2\big\}.$$

The proof of the following theorem can be found in this preprint.

Theorem. Let $d:\mathrm{dom}[d]\to\mathbb R_+$ be a floppy graph metric on a set $X$ and $(D_{xy})_{xy\in[X]^2\setminus\mathrm{dom}[d]}$ be an indexed family of dense sets in $\mathbb R_+$. If the set $[X]^2\setminus\mathrm{dom}[d]$ is at most countable, then there exists a full metric $\tilde d:[X]^2\to\mathbb R_+$ such that $d\subseteq\tilde d$ and $\tilde d(xy)\in D_{xy}$ for every $xy\in [X]^2\setminus\mathrm{dom}[d]$.

This theorem easily implies the affirmative answer to the MO-question because $d_X\cup d_{\mathbb Z}$ is a floppy graph metric on the union $X\cup\mathbb Z$.

Question. Is the above Theorem indeed new, or it has been already proved by some classics (Frechet, Hausdorff, Menger, Sierpinski...)?

Remark. The Theorem cannot be generalized to floppy graph metrics on uncountable sets.


Let's apply the classical favorite Stefan Banach's method:

The set $\ M\ $ of all metrics $\ \delta\ $ that extend the given metrics $\ d\ $ in $\ X,\ $ and the standard metrics in $\ \mathbb Z\ $ in $\ \mathbb Z,\ $ form a non-empty functional complete metric space with respect to the uniform distance between functions.

The 3rd and 4th OP's conditions (they feature the symbols $\ \notin\ $ and $\ \ne)\ $ amount to defining a countable number of open subsets of space $\ M.\ $ The (countable) intersection of all these open dense subsets of $\ M\ $ is a (non-empty) dense G$_\delta$ in $\ M\ $ -- but this is the set of all required solutions, such solutions exist.

  • 2
    $\begingroup$ The main question to your solution is why those open sets are dense in your functional complete metric space of metrics? $\endgroup$ Commented Nov 20, 2023 at 8:52
  • $\begingroup$ Taras, I am very-very slow (and dense :-) )these days but I will try to address your q. anyway. $\endgroup$
    – Wlod AA
    Commented Nov 20, 2023 at 19:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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