Convex metric space
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: Metric segments. Let formula_9 be a metric space (which is not necessarily convex). A subset formula_10 of formula_11 is called a metric segment between two distinct points formula_2 and formula_3 in formula_14 if there exists a closed interval formula_15 on the real line and an isometry such that formula_17 formula_18 and formula_19 It is clear that any point in such a metric segment formula_10 except for the "endpoints" formula_2 and formula_3 is between formula_2 and formula_24 As such, if a metric space formula_9 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, formula_9 is a convex metric space, and, in addition, it is complete, one can prove that for any two points formula_27 in formula_11 there exists a metric segment connecting them (which is not necessarily unique). Convex metric spaces and convex sets. 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 formula_2 and formula_3 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 formula_31 which is not metrically convex.