Examples of metric spaces with measurable midpoints Given a (separable complete) metric space $X=(X,d)$, let us say $X$ has the measurable (resp. continuous) midpoint property if there exists a measurable (resp. continuous) mapping $m:X \times X \to X$ such that $d(x,m(x,x')) = d(x',m(x,x')) = d(x,x') / 2$ for all $x,x' \in X$.
It seems to be known (e.g see section 6 of this paper) that continuous midpoint spaces (i.e Polish spaces with the continuous midpoint property) include:

*

*Hilbert spaces.

*Closed convex subsets of Banach spaces.

*Hyperconvex spaces.

*CAT(0) spaces.

Hopefully, the collection of measurable midpoint spaces contains much more general examples (for the above list is quite restrictive).

Question. What are some examples of measurable midpoint spaces ?

 A: If $(X,d)$ is a complete metric space with the algebraic midpoint property (i.e. for all $x$ and $y$ in $X$, there exists $z\in X$ such that $d(x,z)=d(y,z)=d(x,y)/2$) then $X$ is a path metric space. Indeed, for all $x,y\in X$ one can iteratively construct a map $\gamma$ from $[0,1]\cap\mathbb D$ to $X$ such that $d(\gamma(s),\gamma(t))=|t-s|$, and extend it using completeness of $X$. Here $\mathbb D$ is the set of dyadic numbers. This result is Theorem 1.8 in [G].

Suppose that $(X,d)$ is complete, locally compact, and has the algebraic midpoint property. Then $X$ has the measurable midpoint property.

Of course, this does not include general closed convex subsets of Banach spaces, but it covers for instance any complete manifold.
Let us $(U_k)_{k\geq0}$ construct a countable basis of $X$; in particular, it will show that $X$ is second countable. I want the diameter of $U_k$ to tend to zero as $k$ goes to infinity, and every fixed $x$ to be contained in an infinite number of $U_k$. By [G, Theorem 1.10 (Hopf-Rinow)], the closed metric balls of $X$ are compact; then one can take a finite open cover of $B(x_0,1)$ by open balls of radius $1/1$, then a finite open cover of $B(x_0,2)$ by open balls of radius $1/2$, etc. Let also $(z_k)_{k\geq0}$ be a sequence such that $z_k\in U_k$.
Note that for any closed set $F$, the set of pairs $(x,y)$ such that $F$ contains at least one midpoint of $\lbrace x,y\rbrace$ is closed, using the compacity of closed bounded sets. Let $k_0(x,y)$ be the first $k$ such that the closure $\overline U_k$ contains at least one midpoint of $\lbrace x,y\rbrace$, and iteratively $k_{n+1}(x,y)$ is the first $k>k_n(x,y)$ such that the closed intersection
$$ \overline U_k\cap\bigcap_{0\leq m\leq n}\overline U_{k_m(x,y)} $$
contains at least one midpoint of $\lbrace x,y\rbrace$.
Note that $k_n(x,y)$ is measurable, since the set of $(x,y)$ such that $k_n(x,y)\leq K$ is a finite union of closed sets. Then obviously $f_n:(x,y)\mapsto z_{k_n(x,y)}$ is measurable as well. Since the diameter of $U_k$ tends to zero, $(f_n(x,y))_{n\geq0}$ is a Cauchy sequence for all $(x,y)$, and $f(x,y):=\lim_{n\to\infty}f_n(x,y)$ is a well-defined midpoint of $\lbrace x,y\rbrace$. As a limit of measurable functions, it is measurable as well.
[G] M. Gromov, Metric structures for Riemannian and non-Riemannian spaces. 3rd printing (2007).
A: Maybe the unit circle embedded in the euclidean plane is an example of a space that has several measurable midpoints structures but no continuous such structure?
Let us choose as the middle point of two points which are not on a diameter
the point in the middle of the shortest arc connecting the two points.
When two points are on a diameter, we may choose one of the middle points
on the two arcs as our middle point, but this cannot be made continuously.
A: Let us construct an example of a measurable midpoint space that is not a continuous midpoint space. The idea is to create a "jump" of midpoints somewhere. One way to do that is to consider a slit rectangle, e.g.
$$ \tilde E = [0,1]\times[0,1]\setminus \{\frac12\}\times(0,1) $$
endowed with the length metric induced by the canonical euclidean scalar product and $E$ is the completion of $\tilde E$ (obtained by adding two copies of the slit interval, one on the right of the slit and one on its left). Any two points in the same half (e.g. $[0,\frac12]\times [0,1]$ have an obvious midpoint, the Euclidean one; two points in different halves are connected by one or two shortest paths, hence have a midpoint. The midpoints are explicit enough to be easily seen to depend measurably on the endpoints. However, the midpoint between $x=(\frac12,1)$ and $y_t=(t,0)$ jumps at $t=\frac12$, from the center of the left copy of the slit interval to the center of its right copy, which are at distance $1$ one from the other. Hence $E$ does not have the continuous midpoint property.
(I must admit have trouble imagining a polish space with the midpoint property, but without the measurable midpoint property.)
A: We are ultimately looking at the complexity of the multivalued function $\mathrm{MidPoint}_\mathbf{X} : \mathbf{X} \times \mathbf{X} \rightrightarrows \mathbf{X}$ assigning some midpoint to the points here. This includes what choice functions there are, but need not be limited to it. The framework to study the complexity of such operations is Weihrauch reducibility.
Just by definition of the midpoint, it follows that the map from a pair of points to the closed set of midpoints (equipped with the lower Vietoris topology) is continuous. This tells us that $\mathrm{MidPoint}_\mathbf{X} \leq_{\mathrm{W}} \mathrm{C}_\mathbf{X}$, where $\mathrm{C}_\mathbf{X}$ is closed choice on $\mathbf{X}$, which maps non-empty closed sets to some element. With  $\mathrm{UC}_\mathbf{X}$ I denote the restriction of $\mathrm{C}_\mathbf{X}$ to singletons.
Everything we need about closed choice for this is found here.
Since we are assuming $\mathbf{X}$ to be Polish1, we immediately get the following:

*

*If $\mathbf{X}$ is sigma-compact and midpoints are unique, then $\mathrm{MidPoint}_\mathbf{X} \leq_{\mathrm{W}} \mathrm{C}_\mathbb{N}$. This implies that the midpoint map is piecewise continuous, ie that there is a countable cover of $\mathbf{X} \times \mathbf{X}$ by closed sets, such that on each piece the map is continuous.

*If $\mathbf{X}$ is sigma-compact, then $\mathrm{MidPoint}_\mathbf{X} \leq_{\mathrm{W}} \mathrm{C}_\mathbb{R}$. This guarantees that there is a Baire class 1 selection function for midpoints, but we get more [Baire class 1 is equivalent to "preimages of opens are $\Sigma^0_2$, so this is much simpler than Borel measurable]. For example, there always is a midpoint which is low (in the computability-theoretic sense) relative to the space.

*If midpoints are unique, then $\mathrm{MidPoint}_\mathbf{X} \leq_{\mathrm{W}} \mathrm{UC}_{\mathbb{N}^\mathbb{N}}$. Since the domain of $\mathrm{MidPoint}_\mathbf{X}$ is a Polish space, this already implies that $\mathrm{MidPoint}_\mathbf{X}$ is Borel measurable.

*Without any restrictions, we just get that $\mathrm{MidPoint}_\mathbf{X} \leq_{\mathrm{W}} \mathrm{C}_{\mathbb{N}^\mathbb{N}}$. This doesnt rule out that we could avoid Borel measurable selection functions for the midpoint, but any construction would need to be very weird. The best starting point I can think of is using diagonally non-arithmetic functions.

1 We don't need that the metric defining our midpoints is complete, we just need some equivalent complete metric around.
A: We will use the Kuratowski–Ryll-Nardzweski selection theorem:
Let $(\Omega, \mathscr{F})$ be a measurable space.  Let $E$ be a Polish space.  Let $\Gamma$ be a set-valued function from $\Omega$ to $E$; that is, for each $\omega \in \Omega$, let a set $\Gamma(\omega) \subseteq E$ be given.  Assume that, for all $\omega \in \Omega$, the set $\Gamma(\omega)$ is nonempyty and closed in $E$.  Assume that $\Gamma$ is $\mathscr F$-measurable in the sense:
$$
\text{for every open set }U\subseteq E,\qquad 
\{\omega\,:\,\Gamma(\omega) \cap U \ne \varnothing\} \in \mathscr F .
$$
Then there is a measurable selection $\gamma$ for $\Gamma$: that is, a
function $\gamma : \Omega \to E$ with
$\bullet $ $\gamma(\omega) \in \Gamma(\omega)$
$\bullet $  for every open set $U \subseteq E,\quad \gamma^{-1}(U) \in \mathscr F$.

Let $X$ be a locally compact complete separable metric space with the midpoint property.  For $a,b \in X$, let $\Gamma(a,b)$ be the midpoint set,
$$
\Gamma(a,b) = \left\{m : d(a,m)=d(b,m) = \frac{d(a,b)}{2}\right\} .
$$
Then $\Gamma$ is a set-valued function from $X \times X$ to $X$.  Note $\Gamma(a,b)$ is nonempty and closed.  Let $\mathscr F$ be the sigma-algebra of Borel sets in $X \times X$.  We will prove (see below) that $\Gamma$ is $\mathscr F$-measurable.  An application of the Kuratowski–Ryll-Nardzweski selection theorem then establishes the existence of an $\mathscr F$-measurable $\gamma : X\times X \to X$ with $\gamma(a,b) \in \Gamma(a,b)$.
Proof that $\Gamma$ is $\mathscr F$-measurable:
Let $U \subseteq X$ be open.  We have to show $T_U \in \mathscr F$, where
$$
T_U := \{(a,b) \in X \times X\,:\,\Gamma(a,b) \cap U \ne \varnothing\} .
$$
The set
$$
Q := \{(a,b,u) \in X \times X \times X \,:\, 
d(a,u) = \textstyle\frac{1}{2}d(a,b)\text{ and }
d(b,u) = \textstyle\frac{1}{2}d(a,b)\}
$$
is a closed set.  Write $\pi$ for the continuous "projection" function $(x,y,u) \mapsto (x,y)$.
Then $T_U$ is the projection
$$
T_U = \pi(Q\cap(X \times X \times U)) = 
\bigcup_{u \in U}\{(a,b) \in X \times X \,:\, 
d(a,u) = \textstyle\frac{1}{2}d(a,b)\text{ and }
d(b,u) = \textstyle\frac{1}{2}d(a,b)\} .
$$
Now in our case, any open set $U$ is a countable union of compact sets,
so the projection is sigma-compact, and therefore Borel.

added
Without assuming locally compact, we do know that the projection of
a Borel set is analytic and thus universally measurable.  So if we are given a Borel measure $\mu$ on $X \times X$, we get a $\mu$-measurable midpoint function.
