Let $(M,g)$ be a connected Riemannian manifold. Let $d_g$ be the induced distance metric of $g$. Now let $d$ be some other metric on $M$.

Suppose that for each $x \in M$, there is a neighborhood $U$ of $x$ so that $d = d_g$ on $U \times U$.

**Question:** Does this imply that $d = d_g$ on $M \times M$?

I am *not* assuming that $d$ is the metric of some Riemannian metric; I know the answer is yes in that case.

Remarks:

It's clear to me that $d = d_g$ on a neighborhood of the diagonal in $M \times M$; this essentially is just a rephrasing of the hypothesis.

Connectedness is necessary to avoid stupid counter examples. For example, we could take two disjoint points $\{x,y\}$. Then $d_g$ between them is infinity, but we can take $d(x,y) = 1$. They both agree in a neighborhood of $x$, namely $x$. (We can build similar examples by taking disjoint unions of non-zero dimensional manifolds.)

Maybe the 'right' question is actually: let X be a (path) connected topological space and consider two metrics $g$ and $h$ on X, compatible with the topology on X. If these metrics are locally equal in the sense of the question (i.e. agree on a neighborhood of the diagonal), are they equal? (I feel like this either has an obvious proof or some terrible counter example. It appears to be true on graphs metrized by assigning edge lengths - oops, this is wrong by the cut off metric example.)

I (think) I can prove a special case. See motivation section below.

**Motivation:** Let $(N,h)$ be a connected Riemannian manifold, with geodesic distance function $d_N$. Let $G$ be the group of a covering space action by isometries on $N$, with quotient map $\pi$, with $G$ **finite**. Then $N / G$ inherits a Riemannian metric $g$ by using local trivializations. $N / G$ also inherits a metric, defined by $d([x], [y]) = \inf_{g \in G} d_N(gx, y)$. Locally $d = d_g$ because of local trivializations. I want to know if $d = d_g$ on all of $N / G$.

I think this is true if the geodesic distance between any two points in $N$ and $N / G$ is always realized by some shortest path, by using the covering space path lifting + being a geodesic is a local condition + isometry of covering actions in order to relate shortest paths in $N$ to those in $N / G$. That is, if $g$ minimizes $d(gx, y)$ let $\gamma : [0,1] \to N$ be a shortest path in $N$ between $gx$ and $y$. Then $\pi( \gamma)$ is a (potentially self intersecting) geodesic, of the same length as $\gamma$, connecting $[x]$ and $[y]$. Hence $d_g \leq d$. On the other hand, if we have a geodesic path $\gamma$ from $[x]$ to $[y]$, we can lift it to a geodesic from $x$ to $hy$ of the same length, for some $h \in G$, and hence $d_g \geq d$.

I would like to be able to drop this condition about there always being shortest path witnesses to shortest distances (I mean that the inf in geodesic distance is achieved). I think that maybe in this covering space case one can achieve this by taking a sequence of paths approximating the geodesic distance, but the argument starts to get a lot fuzzier, and I am already outside my comfort zone and procrastinating on my actual work as it is...

I would appreciate a reference for either the main question or the motivation.

Metric spaces of non-positive curvaturefor details. $\endgroup$