In mathematics, **convex metric spaces** are, intuitively, metric spaces with the property any "segment" joining two points in that space has other points in it besides the endpoints.

Formally, consider a metric space (*X*, *d*) and let *x* and *y* be two points in *X*. A point *z* in *X* is said to be *between* *x* and *y* if all three points are distinct, and

that is, the triangle inequality becomes an equality. A **convex metric space** is a metric space (*X*, *d*) such that, for any two distinct points *x* and *y* in *X*, there exists a third point *z* in *X* lying between *x* and *y*.

Metric convexity:

- does not imply convexity in the usual sense for subsets of Euclidean space (see the example of the rational numbers)
- nor does it imply path-connectedness (see the example of the rational numbers)
- nor does it imply geodesic convexity for Riemannian manifolds (consider, for example, the Euclidean plane with a closed disc removed).

- Euclidean spaces, that is, the usual three-dimensional space and its analogues for other dimensions, are convex metric spaces. Given any two distinct points and in such a space, the set of all points satisfying the above "triangle equality" forms the line segment between and which always has other points except and in fact, it has a continuum of points.

- Any convex set in a Euclidean space is a convex metric space with the induced Euclidean norm. For closed sets the converse is also true: if a closed subset of a Euclidean space together with the induced distance is a convex metric space, then it is a convex set (this is a particular case of a more general statement to be discussed below).
- A circle is a convex metric space, if the distance between two points is defined as the length of the shortest arc on the circle connecting them.

Let be a metric space (which is not necessarily convex). A subset of is called a **metric segment** between two distinct points and in if there exists a closed interval on the real line and an isometry

such that and

It is clear that any point in such a metric segment except for the "endpoints" and is between and As such, if a metric space admits metric segments between any two distinct points in the space, then it is a convex metric space.

The converse is not true, in general. The rational numbers form a convex metric space with the usual distance, yet there exists no segment connecting two rational numbers which is made up of rational numbers only. If however, is a convex metric space, and, in addition, it is complete, one can prove that for any two points in there exists a metric segment connecting them (which is not necessarily unique).

As mentioned in the examples section, closed subsets of Euclidean spaces are convex metric spaces if and only if they are convex sets. It is then natural to think of convex metric spaces as generalizing the notion of convexity beyond Euclidean spaces, with usual linear segments replaced by metric segments.

It is important to note, however, that metric convexity defined this way does not have one of the most important properties of Euclidean convex sets, that being that the intersection of two convex sets is convex. Indeed, as mentioned in the examples section, a circle, with the distance between two points measured along the shortest arc connecting them, is a (complete) convex metric space. Yet, if and are two points on a circle diametrically opposite to each other, there exist two metric segments connecting them (the two arcs into which these points split the circle), and those two arcs are metrically convex, but their intersection is the set which is not metrically convex.