TITLE: Are small $\varepsilon$-balls convex in geodesic metric spaces?
QUESTION [12 upvotes]: Let $(M,d)$ be a complete, separable, compact metric space. Assume $M$ is geodesic, that is for any $x,y \in M$ there exists a distance realizing geodesic between $x$ and $y$ (not necessarily unique). A set $U \subseteq M$ is convex if for any $x,y \in U$ there exists a geodesic between $x$ and $y$ that lies entirely in $U$.
Question: Is it true that for any $x \in M$ there exists an $\varepsilon' >0$ such that all $\varepsilon$-balls around $x$ for $\varepsilon < \varepsilon'$ are convex?
Two examples to illustrate the question:
Let $M= \{(x_1,x_2) \in \mathbb{R}^2 | x_2 \ge 0, x_1^2+x_2^2 \le 1 \} / \sim$ where $\sim$ is the equivalence relation  $(x,0) \sim (-x,0)$, that is $M$ is a flat cone with the standard metric induced from $\mathbb{R}^2$. Then for any $\varepsilon >0$, the $\varepsilon$-ball around the point $(0,\varepsilon/2)$ is not convex. In particular, arbitrarily small non-convex balls exists. However, for every point sufficiently small balls around it are convex.
Let $M= \{(x_1,x_2) \in \mathbb{R}^2 | x_1^2+x_2^2 \le 1 \}$ be the unit disk with the Manhattan metric $d((x_1,x_2),(y_1,y_2)):=|x_1-y_1|+|x_2-y_2|$. Then the $\varepsilon$-balls are diamond shaped and are convex. However, distance realizing geodesics are not unique, in general there exist uncountably many and not all of them lie inside the $\varepsilon$-balls. Consider the radius $1/2$ ball around $(0,0)$ and the points $(2/5,0)$ and $(0,2/5)$. Then the geodesic through the point $(0,0)$ lie inside the ball but the geodesic through $(2/5,2/5)$ does not. Hence the formulation 'there exists a geodesic inside the ball' is crucial, the same statement with 'all geodesics lie inside the ball' is false. 
A theorem that shows this under some additional assumptions on the metric space would also be interesting.

REPLY [7 votes]: There is actually a much more striking result than non-convexity of balls in the Heisenberg group discussed in the answer of
Nate Eldredge.
While the definition of the sub-Riemannian metric on $\mathbb{H}^3$ has been explained by Nate Eldredge, I will skip that part and just formulate the theorem.

Theorem. Let $A=\{(x,y,z_1),(x,y,z_2)\}\subset\mathbb{H}^3$, where $z_1\neq z_2$ be a set consisting of two points in the Heisenberg group. Then the smallest geodesically convex set containing
  $A$ is $\mathbb{H}^3$.

That means there are very few convex sets and in particular the smallest geodesically convex set containing a ball must be $\mathbb{H}^3$.
This is a remarakable result because, the Heisenberg group is one of the nicest non-Euclidean metric spaces that allows one to carry out most of the analysis in Euclidean spaces. It also serves as an ulitmate example for testing new conjectures in analysis on metric spaces. 
The above result is Theorem 1.1 in:
Monti, R. Rickly, M.:
Geodetically convex sets in the Heisenberg group.
J. Convex Anal. 12 (2005), 187-196.  
Remark: The space $\mathbb{H}^3$ considered above is often denoted by $\mathbb{H}^1$. Although, as a linear space it is $\mathbb{R}^3$, it is the first Heisenberg group. Moreover the sub-Riemannian metric discussed above is often called the Carnot-Caratheodory metric.