Are there any smooth manifolds $M$ with the following property:

There exist a realizing metric $d$ (i.e $d$ induces the topology on $M$), and $d$ is smooth on all of $M \times M$?

If not, is it possibe to guarantee smoothness of the function $x \mapsto d(x,y)$ (for a fixed $y$ ), or smoothness of $d^2$ even on a compact manifold?

(I am trying to see if we can achieve "improved smoothness" if we do not force the metric to be Riemannian.)

Of course, such a metric cannot be induced by a Riemannian metric. (see here and here).

**Update and further questions:**

(1) Joonas Ilmavirta showed $d$ cannot be smooth at a neighbourhood of points on the diagonal. Actually, the proof shows $d$ cannot even be twice continuously differentiable. (This is the regularity needed to bound from above the Taylor remainder*).

Now a natural quesion is whether this regularity can be achieved by some metric? (I suspect not, in fact I think the distance should not even be differentiable once at the diagonal, the intuition is based on the example of absolute value on $\mathbb{R}$).

(2) Is it also necessary for a singularity to exist at the diameter of the metric (for compact manifolds)?

*In fact the proof works even if we only assume $x \mapsto d(x,y)$ is continuously twice differentiable, and continuity of the partial derivatives (as functions of two variables).

$ \frac{d}{dt}f(t,t) = \lim_{\Delta \to 0} \frac {f(t+\Delta,t+\Delta)-f(t,t)}{\Delta} = \lim_{\Delta \to 0} \left( \frac {f(t+\Delta,t+\Delta)-f(t+\Delta,t)}{\Delta} + \frac {f(t+\Delta,t)-f(t,t)}{\Delta} \right) = \lim_{\Delta \to 0} \left( \frac {f(t+\Delta,t+\Delta)-f(t+\Delta,t)}{\Delta} + \frac {f(t+\Delta,t)-f(t,t)}{\Delta} \right) = \lim_{\Delta \to 0} \frac{\partial f}{\partial s}(t+\Delta,t+\alpha(\Delta) \cdot \Delta) + \lim_{\Delta \to 0} \frac{\partial f}{\partial t}(t+\beta(\Delta) \cdot \Delta,t) = \frac{\partial f}{\partial s} (t,t) + \frac{\partial f}{\partial t} (t,t)$

($0 \le \alpha(\Delta), \beta(\Delta) \le 1$ , Lagrange mean value theorem)

squareof the metric be smooth (or, more generally, that $F(d):M\times M\to\mathbb{R}$ be smooth, where $F:[0,\infty)\to[0,\infty)$ is a strictly increasing function satisfying certain other properties). This turns out to be just as good for most purposes (for example, in information geometry) and, for many purposes, is much better than asking that $d$ itself be smooth. $\endgroup$ – Robert Bryant Aug 24 '15 at 11:14