Given a connected smooth manifold $M$ of dimension $m>1$, points $p\_1,\dots,p\_n\in M$ and positive values $\{d\_{i,j};1\leq i<j\leq n\}$ satisfying the strict triangle inequalities $d\_{i,j}<d\_{i,k}+d\_{k,j}$,


Can we give $M$ a complete riemannian metric $g$ so that $d\_g(p\_i,p\_j)=d\_{i,j}$, where $d$ is the geodesic distance?


This can fail in dimension $2$, as shown in the [answer](https://mathoverflow.net/a/417951) by André Henriques. I'm pretty sure it has to be true for $m\geq3$, but I have not been able to prove it.


Some comments:


* This occurred to me while answering [Equidistant points on a compact Riemannian manifold](https://mathoverflow.net/questions/417712/equidistant-points-on-a-compact-riemannian-manifold), [my answer](https://mathoverflow.net/questions/417712/equidistant-points-on-a-compact-riemannian-manifold/417722#417722) to that question contains the ideas I tried for $m\geq3$.
* By homogeneity of manifolds you can suppose the points $P\_1,\dotsc,P\_n$ are any set of $n$ points of $M$, and using that it is not hard to reduce the problem to the case of $M$ being diffeomorphic to $\mathbb{R}^m$. In particular if you prove it for $\mathbb{R}^3$ you will have proved it for any manifold of dimension $\geq 3$.
* One of the first ideas which come to mind is trying to somehow imbed $M$ in $\mathbb{R}^N$ for some big $N$, but [triangle inequalities are not sufficient](https://en.wikipedia.org/wiki/Distance_geometry#Characterization_via_Cayley%E2%80%93Menger_determinants) for a finite set to be isometrically imbedded in some $\mathbb{R}^N$.
* What if we change the strict triangle inequalities for the usual ones?



Can we make distances in a finite subset of a manifold whatever we want?
It is not possible to find $5$ points $x\_1,\ldots,x\_5$ on a genus zero Riemannian 2-manifold (a sphere) such that $d(x\_i,x\_j)=1$ for all $i,j$.


The reason is that the complete graph $K\_5$ is not planar.


Assume by contradiction that we have $5$ points $x\_1,\ldots,x\_5$ with $d(x\_i,x\_j)=1$.
Up to permuting the points, we may assume that the minimal geodesic connecting $x\_1$ and $x\_3$ crosses the minimal geodesic connecting $x\_2$ and $x\_4$.


Let $y$ be the point at which these two geodesics intersect.
Then
\begin{align\*}
2&=d(x\_1,x\_3)+d(x\_2,x\_4)\\
&=d(x\_1,y)+d(y,x\_3)+d(x\_2,y)+d(y,x\_4)\\
&=\tfrac12\big((d(x\_1,y)+d(y,x\_2))\\
&\qquad(d(x\_2,y)+d(y,x\_3))+\\
&\qquad(d(x\_3,y)+d(y,x\_4))+\\
&\qquad(d(x\_4,y)+d(y,x\_1))
\big)\\
&\ge\tfrac12\big(d(x\_1,x\_2)+d(x\_2,x\_3)+d(x\_3,x\_4)+d(x\_4,x\_1)\big)=2
\end{align\*}
with equality iff $y$ lies on all six geodesics (between $x\_i$ and $x\_j$ $\forall i,j\in\{1,2,3,4\})$. But if $y$ lies on all six geodesics, then these six geodesics are all part of a single geodesic line (i.e. the points are "aligned"), which is clearly impossible.


The crucial thing that I'm using here is the fact that geodesics admit unique extensions. If the ambient space was a graph, then my argument for deriving a contradiction wouldn't work as I wouldn't be able to conclude that the points are "aligned".




---


In higher dimensions, the answer is yes.


Take the complete graph $K\_n$ on your set of points. Embed it in $M$. Then put a metric on $M$ that agrees with your desired metric in a neighbourhood of the graph, and which is extremely huge away from the graph. Then minimal geodesics will essentially follow the graph.


This solves the problem "up to $\varepsilon$", as the geodesics don't exactly follow the graph, but do so only approximately.


To finish the argument, do the same thing in families, and invoke some version of the intermediate value theorem.
Here's how the argument goes. Let $D$ be the space of metrics on your fixed finite set.
Instead of doing the above construction for a single choice $d\in D$ of distances between the points $x\_i$, imagine that we adapt it to instead construct a *family* of Riemannian metrics on $M$ parametrised by the space $D$. Starting from $d\in D$, the geodesic distance between the $x\_i$ produces another element $d'\in D$. So we get a self-map $D\to D$ which is $\varepsilon$-away from the identity map on $D$. Now, $D$ is itself a manifold, and any self-map that's $\varepsilon$-away from the identity is surjective.


**[added later: the answer is no]**  

Error in the above argument: $D$ is in fact a manifold with boundary. My argument works for metrics $d\in D\setminus \partial D$. I.e., metrics where the triangle inequality holds strictly.


A counterexample is provided by the metric on $\{x\_1,x\_2,x\_3,x\_4\}$ given by
$d(x\_1,x\_i)=1$, $d(x\_i,x\_j)=2$ (where $i,j\in\{2,3,4\}$)


**[added even later: all is good]**  
 Ha ha! I hadn't noticed that you had assumed the strict triangle inequality to hold. So all is good, and this is a valid argument.


