AN INTRINSIC CHARACTERIZATION OF FIVE POINTS IN A CAT(0) SPACE

We prove that a metric space that contains at most five points admits an isometric embedding into a CAT(0) space if and only if it satisfies the -inequalities.


. Quadratic metric inequalities that hold true in every CAT( ) space
Homogeneous linear inequalities on the squares of distances among nite points like the -inequalities were called quadratic metric inequalities by Andoni, Naor, and Neiman [2]. In this paper, by slightly modifying their notation, we use the following notation to denote a quadratic metric inequality. For any positive integer n, we denote [n] = { , , . . . , n}, and for any set V, we denote by V the set of all two-element subsets of V.
De nition 1. 10. Fix a positive integer n. Let E = [n] , and let (a ij ) {i,j}∈E be a family of real numbers indexed by E. A metric space (X, d X ) is said to satisfy the (a ij )-quadratic metric inequality if any points x , . . . , xn ∈ X satisfy ≤ {i,j}∈E a ij d X x i , x j .
The following theorem was proved in [2]. Theorem 1.11 (Andoni, Naor, and Neiman [2]). Let n be a positive integer. An n-point metric space X admits an isometric embedding into a CAT( ) space if and only if X satis es the (a ij )-quadratic metric inequality for every family (a ij ) {i,j}∈E of real numbers indexed by E = [n] such that every CAT( ) space satis es the (a ij )-quadratic metric inequality.
For the original statement of Theorem 1.11 in full generality, see [2,Proposition 3]. Theorem 1.11 tells us that characterizations of those metric spaces that admit an isometric embedding into a CAT( ) space follow from characterizations of those quadratic metric inequalities that hold true in every CAT( ) space. We will prove the following lemma in Section 4.

. Organization of the paper
The paper is organized as follows. In Section 2, we recall some de nitions and results from metric geometry. In Section 3, we recall and establish some properties of metric spaces that satisfy the -inequalities. In Section 4, we prove Lemma 1.12 and Proposition 1.9. In Section 5, we prove that the validity of the -inequalities implies the G( ) condition for every graph G containing at most four vertices. Combining this with Proposition 1.9, we obtain another proof of Theorem 1.7. In Section 5, we also specify several graphs G such that every metric space satis es the G( ) condition. Combining this with Lemma 1.12, we obtain a criterion for a quadratic metric inequality to hold true in every metric space whenever it holds true in every CAT( ) space. In Section 6, we prove that the validity of the -inequalities implies the G( ) condition for any graph G with ve vertices except two special graphs. In Section 7, we introduce certain concepts concerning the isometric embeddability of a four-point metric space into a Euclidean space. In Section 8 and Section 9, we prove that the validity of the -inequalities implies the G( ) conditions for the remaining two graphs G with ve vertices by using the concepts introduced in Section 7. Together with Proposition 1.9, this completes the proof of Theorem 1.3.

Preliminaries
In this section, we set up some notations, and review some de nitions and results in metric geometry. Throughout this paper, for every positive integer n, R n is always equipped with the Euclidean metric. For distinct points x, y ∈ R n , we denote by ← → xy the straight line through x and y. For x, y, z ∈ R with x ≠ y and y ≠ z, we denote by ∠xyz ∈ [ , π] the interior angle measure at y of the (possibly degenerate) triangle with vertices x, y and z.
A geodesic in a metric space X is an isometric embedding of an interval of the real line into X. For x, y ∈ X, we call the image of a geodesic γ : [ , d X (x, y)] → X with γ( ) = x and γ(d X (x, y)) = y a geodesic segment with endpoints x and y. A metric space X is called geodesic if for any x, y ∈ X, there exists a geodesic segment with endpoints x and y.
In R n , the inequality (2.1) always holds with equality. A subset S of a geodesic space X is called convex if any geodesic segment in X with endpoints x and y is contained in S whenever x, y ∈ S. Clearly, a convex subset of a CAT( ) space equipped with the induced metric is a CAT( ) space. A geodesic space X is called uniquely geodesic if for any x, y ∈ X, a geodesic segment in X with endpoints x and y is unique. It is easily observed that every CAT( ) space is uniquely geodesic. For any points x and y in a uniquely geodesic space, we denote the geodesic segment with endpoints x and y by [x, y]. We also denote the sets [ , y), (x, y] and [x, y), respectively. For a subset S of a uniquely geodesic space X, the convex hull of S is the intersection of all convex subsets of X containing S, or equivalently, the minimal convex subset of X that contains S. We denote the convex hull of S by conv(S). We usually identify each set Xα with its image under the natural inclusion into α∈A Xα. Suppose (X, d X ) is a metric space with possibly in nite metrics, and ∼ is an equivalence relation on X such that every equivalence class of X by ∼ is closed. Let X = X/ ∼ be the set of all equivalence classes by ∼. For x, y ∈ X, we de ne where the in mum is taken over all sequences x , y , x , y , . . . , x k , y k in X such that x ∈ x, y k ∈ y, and y i ∼ x i+ for every i ∈ Z ∩ [ , k − ]. Then d becomes a metric on X, which is called the quotient metric on X.
Suppose that (X , d ) and (X , d ) are metric spaces, and that Z and Z are closed subsets of X and X , respectively. Suppose further that Z and Z are isometric via an isometry f : Z → Z . De ne ∼ to be the equivalence relation on the disjoint union X X generated by the relations z ∼ f (z) for all z ∈ Z . Let X = (X X )/ ∼ be the set of all equivalence classes by the equivalence relation ∼, and let d be the quotient metric on X . Then (X , d ) is the metric space called the gluing of X and X along the isometry f . We note that the natural inclusions of X and X into X are both isometric embeddings. Assume in addition that X and X are complete locally compact CAT( ) spaces, and that Z and Z are convex subsets of X and X , respectively. Then by Reshetnyak's gluing theorem, the gluing of X and X along f is a CAT( ) space. For a proof of this fact, see [15] or [5,Theorem 9.1.21]. A more general statement is in [4,Chapter II.11,Theorem 11.1]. When two geodesic segments [a, b] ⊆ X and [c, d] ⊆ X are isometric, we mean by "the metric space obtained by gluing X and X by identifying [a, b] with [c, d] are the isometries such that Let T be the quotient of the disjoint union T T T by the equivalence relation ∼ generated by the relations We claim that it is easily observed that the above criterion holds true even if T , T or T is degenerate, or equivalently, even if some of the angles in the right-hand side of (2.2) take values in { , π}. It is also easily observed that under the condition (2.2), the natural inclusions of T , T and T into T are all isometric embeddings although a simplex in a metric simplicial complex is generally not embedded isometrically into the complex.
Let (X, d X ) be a metric space, and let x, y, z ∈ X be points with x ≠ y and y ≠ z. Then there existx,ỹ,z ∈ R such that x −ỹ = d X (x, y), ỹ −z = d X (y, z), z −x = d X (z, x).
We de ne the comparison angle measure∠xyz to be ∠xỹz ∈ [ , π]. Clearly the comparison angle measurẽ ∠xyz does not depend on the choice ofx,ỹ,z ∈ R .

De nition 2.3.
A geodesic space X is said to have nonnegative Alexandrov curvature if, for any p ∈ X, there exists a neighborhood U ⊆ X of p such that any distinct four points x, y, z, w ∈ U satisfỹ ∠yxz +∠zxw +∠wxy ≤ π.
There are many equivalent de nitions of metric spaces with nonnegative Alexandrov curvature. We refer [5] and [6]  . We denote the points in T corresponding to x, y and z by x , y and z , respectively, and the points in T corresponding to x, y and z by x , y and z , respectively. Suppose are the isometries such that Let T be the quotient of the disjoint union T T by the equivalence relation ∼ generated by the relations a ∼ f (a), b ∼ g(b) and c ∼ h(c) for all a ∈ [x , y ], b ∈ [y , z ] and c ∈ [z , x ], and let d T be the quotient metric on T . It is known that (T , d T ) is a complete geodesic space with nonnegative Alexandrov curvature. Clearly the natural inclusions of T and T into T are both isometric embeddings. We call the metric space T de ned above the piecewise Euclidean simplicial complex obtained by gluing T and T along their boundaries.
In [13], Lang and Schroeder generalized the classical Kirszbraun's extension theorem (see also [1]). The following is a part of their result, which we will use in Section 9. For the original statement in full generality, see [13,Theorem A]. Theorem 2.6 (Lang and Schroeder [13]). Suppose that X is a complete geodesic space with nonnegative Alexandrov curvature and Y is a complete CAT( ) space. Suppose that S is a subset of X and f : S → Y is a -Lipschitz map. Then there exists a -Lipschitz mapf : Fix a positive integer n. Let En = [n] be the set of all two-element subsets of [n] = { , . . . , n}. De ne Cn to be the set of all (d ij ) {i,j}∈En ∈ R En such that there exist a CAT( ) space (X, d X ) and points x , . . . , xn ∈ X such that d ij = d X (x i , x j ) for every {i, j} ∈ En. Then Cn is a closed convex cone in R En . This follows immediately from the fact that the CAT( ) property is closed under taking Pythagorean product, taking dilation by a positive constant, and taking ultraproduct (see [17,Lemma 3.9] and [11,Section 2.4]). For completeness, we recall Andoni, Naor, and Neiman's proof of Theorem 1.11.
Proof of Theorem 1.11. Fix a positive integer n. The case in which n = is trivial, so we assume that n ≥ . If an n-point metric space X embeds isometrically into a CAT( ) space, then X clearly satis es every quadratic metric inequality that holds true in every CAT( ) space. We prove the converse direction by contrapositive. Assume that an n-point metric space X = {x , . . . , xn} does not embed isometrically into a CAT( ) space. Then because Cn ⊆ R En is a closed convex cone, and (d X (x i , x j ) ) {i,j}∈En ∉ Cn, the separation theorem implies that there exists (h ij ) {i,j}∈En ∈ R En such that The rst inequality in (2.3) means that the (h ij )-quadratic metric inequality holds true in every CAT( ) space, and the second inequality means that X does not satisfy the (h ij )-quadratic metric inequality, which completes the proof.

Comparison Quadrangles in the Euclidean plane
In this section, we recall and establish some properties of metric spaces that satisfy the -inequalities. First, we recall the following fact, which was established by Sturm when he proved in [17,Theorem 4.9] that a geodesic space is CAT( ) whenever it satis es the -inequalities.
for any w ∈ X.
For the proof of Proposition 3.1, see [18,Proposition 7.1]. The following two lemmas will be used throughout this paper.

Lemma 3.2.
Let (X, d X ) be a metric space that satis es the -inequalities. Suppose x, y, z, w ∈ X and x , y , z , w ∈ R are points such that Assume that there exist subsets S and T of Y that satisfy the following conditions: ( ) There exists a geodesic segment Γ in Y with endpoints y and w such that Γ ∩ Γ ≠ ∅.
We will also use the following lemma.
Lemma 3.5. Let (X, d X ) be a metric space that satis es the -inequalities. Suppose x, y, z, w ∈ X and x , y , z , w ∈ R are points with z ≠ w such that Proof. We consider three cases.
In this case, there exist s ∈ [ , ) and t ∈ [ , ) such that It follows from this equality and the hypotheses of the lemma that On the other hand, because X satis es the -inequalities. Comparing these yields The second equality in (3.1) implies that Hence we can write On the other hand, (3.1), (3.2) and Proposition 3.1 imply that Comparing these yields x − y ≤ d X (x, y).
In this case, we may assume without loss of generality that x = z . Then The above three cases exhaust all possibilities. Remark 3.6. If we omit the condition that z ≠ w from the hypothesis of Lemma 3.5, then the statement becomes false. For example, suppose θ and θ are real numbers such that ≤ θ < θ ≤ π, and de ne points Then However, x − y < x − y .

A criterion for isometric embeddability into a CAT( ) space
In this section, we prove Lemma 1.12 and Proposition 1.9. We rst prove Lemma 1.12.
Proof of Lemma 1.12. Let (X, d X ) be a metric space that satis es the G A ( ) condition, and let x , . . . , xn ∈ X.
Then there exist a CAT( ) space (Y , d Y ) and points y , for any i, j ∈ V. Because Y satis es the (a ij )-quadratic metric inequality by hypothesis, we have which proves that X satis es the (a ij )-quadratic metric inequality. Proposition 1.9 follows from Lemma 1.12 and Theorem 1.11.
Proof of Proposition 1.9. Let (X, d X ) be an n-point metric space. If X admits an isometric embedding into a CAT( ) space, then X satis es the G( ) condition for every graph G with n vertices because every CAT( ) space satis es the G( ) condition. Conversely, suppose that X satis es the G( ) condition for every graph G with n vertices. Let V = [n], and let E = V . Fix a family A = (a ij ) {i,j}∈E of real numbers indexed by E such that every CAT( ) space satis es the (a ij )-quadratic metric inequality. Let E+(A) ⊆ E be the set of all {i, j} ∈ E such that a ij > , and let G A = (V , E+(A)) be the graph with vertex set V and edge set E+(A). Then X satis es the G A ( ) condition, and therefore X satis es the (a ij )-quadratic metric inequality by Lemma 1.12. Thus it follows from Theorem 1.11 that X admits an isometric embedding into a CAT( ) space.

Four points in a CAT( ) space
In this section, we prove that if a metric space satis es the -inequalities, then it satis es the G( ) condition for every graph G with four vertices. Together with Proposition 1.9, this gives another proof of Theorem 1.7. We rst observe that there are many graphs G such that every metric space satis es the G( ) condition. As we declared before, graphs are always assumed to be simple and undirected. Proof. Let (X, d X ) be a metric space. For each map f : V → X, de ne a map g : for any u, v ∈ V, and for any u, v ∈ V. Thus X satis es the G( ) condition.
Proposition 5.1 implies in particular that every metric space satis es the G( ) condition for every complete graph G.
Proposition 5.2. Let G and G be nite graphs, and let G be the graph sum of G and G . In other words, the vertex and edge sets of G are the disjoint union of the vertex sets of G and G and that of the edge sets of G and G , respectively. Suppose X is a metric space that satis es the G ( ) and G ( ) conditions. Then X satis es the G( ) condition.
Proof. Suppose G = (V , E ), G = (V , E ) and G = (V , E) are nite graphs such that V is the disjoint union of V and V , and E is the disjoint union of E and E . Suppose (X, d X ) is a metric space that satis es the G ( ) and G ( ) conditions. Fix f : for any u, u ∈ V and any v, v ∈ V . It follows that Thus X satis es the G( ) condition.

Corollary 5.3. Every metric space satis es the G( ) condition for any disconnected graph G with four vertices.
Proof. Let G be a disconnected graph with four vertices. Then there exist graphs G and G such that G is the graph sum of G and G , and G i contains at most three vertices for each i ∈ { , }. Because every metric space that contains at most three points admits an isometric embedding into R , every metric space satis es the G ( ) and G ( ) conditions clearly. Therefore, it follows from Proposition 5.2 that every metric space satis es the G( ) condition.
for any u, u ∈ V and v, v ∈ V . It follows that Thus X satis es the G( ) condition.
For a nite graph G = (V , E) and a vertex v ∈ V, the degree of v, denoted by deg(v), is the number of edges e ∈ E such that v ∈ e.
Corollary 5.5. Suppose G = (V , E) is a graph such that |V| = , and there exists a vertex v ∈ V with deg(v ) = . Then every metric space satis es the G( ) condition.
Furthermore, max{|V |, |V |} = , and every metric space containing at most three points admits an isometric embedding into R . Therefore, it follows from Proposition 5.4 that every metric space satis es the G( ) condition.
Recall that there are eleven simple undirected graphs on four vertices up to graph isomorphism, which are listed in F 5.1. We call them G ( ) , . . . , G ( ) , respectively as in F 5.1. All graphs listed in F 5.1 except the cycle graph G ( ) satisfy the hypothesis of Proposition 5.1, Corollary 5.3 or Corollary 5.5. Thus every metric space satis es the G( ) conditions for all graphs G with four vertices that is not isomorphic to the cycle graph. The following proposition follows from this observation and Lemma 1.12. Proof. If G A is not isomorphic to the cycle graph G ( ) , then every metric space satis es the G A ( ) condition as we observed above. Therefore, it follows from Lemma 1.12 that every metric space satis es the (a ij )-quadratic metric inequality.
It follows from the above observation and Proposition 1.9 that a four-point metric space admits an isometric embedding into a CAT( ) space if and only if it satis es the G ( ) ( ) condition. This implies in particular that not every metric space satis es the G ( ) ( ) condition because not every four-point metric space admits an isometric embedding into a CAT( ) space as we observed in Example 1.2. The following proposition is an immediate consequence of Theorem 1.6.
Proposition 5.7. If a metric space X satis es the -inequalities, then X satis es the G ( ) ( ) condition.
Proof. If a metric space X satis es the -inequalities, then X satis es the Cycl ( ) condition by Theorem 1.6, which clearly implies that X satis es the G ( ) ( ) condition.
The facts that we have proved so far give another proof of Theorem 1.7.
Proof of Theorem 1.7. Assume that a four-point metric space X admits an isometric embedding into a CAT( ) space. Then X satis es the -inequalities because every CAT( ) space satis es the -inequalities. Conversely, assume that a four-point metric space X satis es the -inequalities. Then it follows from Proposition 5.1, Corollary 5.3, Corollary 5.5 and Proposition 5.7 that X satis es the G( ) conditions for all graphs G with four vertices, which implies that X admits an isometric embedding into a CAT( ) space by Proposition 1.9.
The following facts are worth noting although they are not necessary for our purposes.
Proposition 5.8. Every metric space satis es the G( ) condition for every tree G.
Proof. Let (X, d X ) be a metric space and let G = (V , E) be a tree. For any f : V → X, de ne Y to be the metric tree obtained by assigning the length d X (f (u), f (v)) to each edge {u, v} ∈ E of G. Then Y becomes a CAT( ) space, and the triangle inequality for d X ensures that the natural inclusion g : V → Y satis es that The following corollary follows immediately from Proposition 5.8 and Lemma 1.12.

Five points in a CAT( ) space
In this section, we prove that if a metric space X satis es the -inequalities, then X satis es the G( ) conditions for all graphs G with ve vertices except two special graphs. We start with the following two propositions. Proposition 6.1. If a metric space X satis es the -inequalities, then X satis es the G( ) condition for every disconnected graph G with ve vertices.
Proof. Let X be a metric space that satis es the -inequalities, and let G be a disconnected graph with ve vertices. Then there exist graphs G and G such that G is the graph sum of G and G , and the number of vertices of G i is at most four for each i ∈ { , }. Because every subset S ⊆ X with |S| ≤ admits an isometric embedding into a CAT( ) space by Theorem 1.7, X satis es the G ( ) and G ( ) conditions clearly. Thus it follows from Proposition 5.2 that X satis es the G( ) condition.

Proposition 6.2. Let X be a metric space that satis es the -inequalities. Suppose G = (V , E) is a graph such
that |V| = , and there exists a vertex v ∈ V with deg(v ) = . Then X satis es the G( ) condition.
Because X satis es the -inequalities, every subset S ⊆ X with |S| ≤ admits an isometric embedding into a CAT( ) space by Theorem 1.7. Thus it follows from Proposition 5.4 that X satis es the G( ) condition.
It follows from Proposition 6.1 and Proposition 6.2 that if a ve-vertex graph G has a vertex v with deg(v) ≤ , then a metric space X satis es the G( ) condition whenever X satis es the -inequalities. Up to graph isomorphism, there are eleven ve-vertex graphs G such that every vertex v of G satis es deg(v) ≥ , which are listed in F 6.1. As in F 6.1, we call these graphs G ( ) , . . . , G ( ) , respectively. The ve-vertex graphs each of whose vertex satis es deg ≥ .

Proposition 6.3. If a metric space X satis es the -inequalities, then X satis es the G ( ) ( ) condition.
Proof. If a metric space X satis es the -inequalities, then X satis es the Cycl ( ) condition by Theorem 1.6, which clearly implies that X satis es the G ( ) ( ) condition.

Proposition 6.4. Every metric space satis es the G
Proof. Let V and E be the vertex set and the edge set of G ( ) ( ), respectively. We set Because every metric space containing at most three points admits an isometric embedding into R , it follows from Proposition 5.4 that every metric space satis es the G ( ) ( ) condition.
Before proving that the validity of the -inequalities implies the G ( ) ( ) condition, we prove the following lemma.

Lemma 6.5. Let (X, d X ) be a metric space that satis es the -inequalities, and let (Y , d Y ) be a metric space.
Suppose p, x, y, z, w ∈ X and p , x , y , z , w ∈ Y are points such that Assume that there exist subsets T , T and T of Y that satisfy the following conditions: ( ) T , T and T are isometric to convex subsets of Euclidean spaces.
( ) There exists a geodesic segment Γ in Y with endpoints p and y such that ( ) There exists a geodesic segment Γ in Y with endpoints p and z such that .
Equip the subsets of R with the induced metrics, and regard them as disjoint metric spaces. De ne (Y , d Y ) to be the metric space obtained by gluing T and T by identifying [p , y ] ⊆ T with [p , y ] ⊆ T . Then Y is a CAT( ) space by Reshetnyak's gluing theorem. We denote the points in Y represented by p , x , y ∈ T and z ∈ T by p , x , y and z , respectively. De ne (Ỹ , dỸ ) to be the metric space obtained by gluing Y and T by identifying ThenỸ is a CAT( ) space by Reshetnyak's gluing theorem, which is pictured in F 6.3. We denote the points inỸ represented by p , x , y , z ∈ Y and w ∈ T byp,x,ỹ,z andw, respectively. For each i ∈ { , , }, the natural inclusion of T i intoỸ is clearly an isometric embedding. Let because it follows from the hypothesis of the lemma and the de nition ofỸ that Similarly, Lemma 3.3 also implies that Next, we will prove that To prove this, we rst observe that (6.3) holds whenever one of the following equalities holds: If w = p, then we obtain (6.3) similarly. If x = y, thenx =ỹ by de nition ofỸ, so it follows from (6.2) that by de nition ofỸ, so Lemma 3.3 implies (6.3) because it follows from the hypothesis of the lemma and the de nition ofỸ that So henceforth we assume that any equality in (6.4) does not hold. We consider four cases. C 1: ∠x y p +∠p y z ≤ π and ∠x p y +∠y p z ≤ π. In this case, the subsetT ∪T ofỸ is isometric to a convex subset of the Euclidean plane, and it is clear from the de nition ofỸ that (T ∪T ) ∩T = [p,z] and [p,z] ∩ [x,w] ≠ ∅. Therefore, Lemma 3.3 implies the desired inequality (6.3) because it follows from the hypothesis of the lemma, the de nition ofỸ and (6.1) that 2: ∠y z p + ∠p z w ≤ π and ∠y p z + ∠z p w ≤ π. In this case, the subsetT ∪T is isometric to a convex subset of the Euclidean plane, and it is clear from the de nition ofỸ thatT ∩ (T ∪T ) = [p,ỹ] and [p,ỹ] ∩ [x,w] ≠ ∅. Therefore, Lemma 3.3 implies the desired inequality (6.3) in the same way as in C 1.
C 3: ∠x p y + ∠y p z + ∠z p w ≥ π. In this case, we clearly have C 4: Neither the assumption of C 1, C 2 nor C 3 holds. In this case, ∠x p y + ∠y p z ≤ π, ∠y p z + ∠z p w ≤ π (6.5) because the assumption of C 3 does not hold. Because neither the assumption of C 1 nor C 2 holds, it follows from (6.5) that ∠x y p + ∠p y z > π, ∠y z p + ∠p z w > π (6.6) It clearly follows from (6.6) that which completes the proof of (6.3). It follows from the conditions ( ) and ( ) in the statement of the lemma that there exist isometric embed- Proposition 6.6. If a metric space X satis es the -inequalities, then X satis es the G ( ) ( ) and G ( ) ( ) conditions.
Proof. Let (X, d X ) be a metric space that satis es the -inequalities. Suppose the graphs G ( ) and G ( ) have a common vertex set V, and edge sets E and E , respectively. We set Equip the subsets of R with the induced metrics, and regard them as disjoint metric spaces. De ne (Y , d Y ) to be the metric space obtained by gluing T and T by identifying is a CAT( ) space by Reshetnyak's gluing theorem, and for each i ∈ { , , }, the natural inclusion of T i into Y is clearly an isometric embedding. Let g : V → Y be the map that assigns the point in Y represented by and Lemma 6.5 implies that It follows from (6.7), (6.8) and the de nition of Y that any u, v ∈ V satisfy Thus X satis es the G ( ) ( ) and G ( ) ( ) conditions. Proposition 6.7. If a metric space X satis es the -inequalities, then X satis es the G ( ) ( ) and G ( ) ( ) conditions.
Proof. Let (X, d X ) be a metric space that satis es the -inequalities. Suppose the graphs G ( ) and G ( ) have a common vertex set V, and edge sets E and E , respectively. We set as shown in F 6.5. Fix a map f : V → X, and set Equip the subsets of R with the induced metrics, and regard them as disjoint metric spaces. We de ne Y to be the metric space obtained by gluing T and T by identifying Similarly, Lemma 3.3 also implies that It follows from (6.9), (6.10) and the de nition of Y that any u, v ∈ V satisfy Thus X satis es the G ( ) ( ) and G ( ) ( ) conditions.
The following proposition follows immediately from Proposition 5.1.
Therefore, Proposition 5.1 implies that every metric space satis es the G ( ) i ( ) condition for each i ∈ { , , }. By Propositions 6.1, 6.2, 6.3, 6.4, 6.6, 6.7 and 6.8, to prove that the validity of the -inequalities implies the G( ) condition for every graph G with ve vertices, it only remains to prove that it implies the G ( ) ( ) and G ( ) ( ) conditions.

Embeddability of four points into a Euclidean space
In this section, we introduce certain concepts concerning isometric embeddability of four-point subsets of metric spaces into the three dimensional Euclidean space, and by using those concepts, discuss several properties of metric spaces that satisfy the -inequalities. Those properties will be used to prove that the validity of the -inequalities implies the G ( ) ( ) and G ( ) ( ) conditions. De nition 7.1. Let (X, d X ) be a metric space, and let x, y, z, w ∈ X be four distinct points. We say that It is easily observed that for any four distinct points x y, z and w in any metric space X, there exist x , y , z , w ∈ R satisfying (7.1). Therefore, {x, y, z, w} does not become under-distance and over-distance with respect to {y, w} simultaneously.
The statements (b ) and (c ) follow immediately from the fact that the inequality (7.5) holds true for arbitrary x , y , z , w ∈ R satisfying (7.1). It also follows immediately from this fact that if {x, y, z, w} admits an isometric embedding into R , then (7.2) holds true. If (7.2) holds true, then there exists θ ∈ [ , π] that satis es ỹ −w(θ ) = d X (y, w) because the function θ → ỹ −w(θ) is continuous on [ , π], and therefore the map φ : is an isometric embedding. Thus (a ) is also true.
Before discussing properties of metric spaces that satisfy the -inequalities by using the concepts introduced above, we recall the following two basic facts. Both of them hold clearly, so we omit their proofs.
Lemma 7.3. Suppose x, y, z, x , y , z ∈ R are points such that  In the rest of this section, we discuss several properties of metric spaces that satisfy the -inequalities by using the concepts introduced above.
Lemma 7.5. Let (X, d X ) be a metric space that satis es the -inequalities. Suppose x, y, z, w ∈ X are four distinct points such that {x, y, z, w} is under-distance with respect to {y, w}. Suppose x , y , z , w ∈ R are points such that Then Then and f is continuous on [ , ]. Hence there exists t ∈ ( , ) such that f (t ) = . In the case in which t ≤ , and in the case in which t > , we have This contradicts (7.6) or (7.7). Thus x , y , z and w are not collinear.
The following corollary follows immediately from Lemma 7.5.
and w is not on the opposite side of ← → x z from y . Then Moreover, (7.8) and (7.9) do not hold simultaneously.
Proof. It follows from Lemma 7.5 that and x , y , z and w are not collinear, which clearly implies that (7.8) or (7.9) holds. By (7.10), we have y ≠ w .
Together with the fact that x , y , z and w are not collinear, this implies that (7.8) and (7.9) do not hold simultaneously.
Suppose y = (y ( ) , y ( ) ) and w = (w ( ) , w ( ) ) are the points in R such that Then because {x, y, z, w} is over-distance with respect to {y, w}. It follows that x z . In this case, (7.11) implies that the region determined by the quadrilateral x ] is not convex, and therefore at least one of the interior angle measures of the quadrilateral is greater than π. It follows that ∠yxz +∠zxw = ∠y x z + ∠z x w > π or∠ yzx +∠xzw = ∠y z x + ∠x z w > π.
The above four cases exhaust all possibilities.
and w is not on the opposite side of ← → y z from x . Suppose w ∈ R is a point such that and w is not on the opposite side of ← → x z from y . Then The rst inequality implies that which ensures that w ≠ w . Let L ⊆ R be the perpendicular bisector of the line segment [w , w ]. Then x is on the same side of L as w , y is on the same side of L as w , and z ∈ L because It follows that Then x , y and z are not collinear.
Proof. Choose a point w ∈ R such that and w is not on the opposite side of ← → x z from y . Then Lemma 7.8 implies that w ∈ conv({x , y , z }) because {x, y, z, w} is under-distance with respect to {x, w} and {y, w}. Therefore, if x , y and z were collinear, then x , y ,z and w would be collinear, contradicting Lemma 7.5. Lemma 7.10. Let (X, d X ) be a metric space that satis es the -inequalities. Suppose x, y, z, w ∈ X are four distinct points such that {x, y, z, w} is over-distance with respect to {x, w} and {y, w}. Then π <∠xzy +∠yzw, π <∠xzy +∠xzw. Proof. Choose x , y , z ∈ R such that Suppose w ∈ R is a point such that and w is not on the same side of ← → y z as x . Suppose w ∈ R is a point such that and w is not on the same side of ← → x z as y . Then because {x, y, z, w} is over-distance with respect to {x, w} and {y, w}, The rst inequality implies that which ensures that w ≠ w . Let L ⊆ R be the perpendicular bisector of the line segment [w , w ]. Then x is on the same side of L as w , y is on the same side of L as w , and z ∈ L because We prove that π <∠xzy +∠yzw (7.14) and π <∠xzy +∠xzw (7.15) by contradiction. If (7.14) were not true, then Lemma 7.7 would imply that π <∠xyz +∠zyw = ∠x y z + ∠z y w  Proof. Choose p , x , z ∈ R such that Suppose y ∈ R is a point such that and y is not on the opposite side of ←→ p z from x . Suppose y ∈ R is a point such that and y is not on the opposite side of ←→ p x from z . Then because {p, x, y, z} is under-distance with respect to {x, y} and {y, z}, Lemma 7.8 implies that and w is not on the opposite side of ←→ p y from z . Suppose z ∈ R is a point such that and z is not on the opposite side of We de ne four vectors x, y, z, w ∈ R by Because {p, x, y, z} is under-distance with respect to {x, y} and {y, z}, Corollary 7.9 implies that p , x and z are not collinear, and therefore x and z are linearly independent. Because {p, y, z, w} is under-distance with respect to {y, z} and {z, w}, Corollary 7.9 implies that p , y and w are not collinear, and therefore y and w are linearly independent. Because y ∉ and therefore Lemma 7.3 implies that ∠z p w < ∠z p w . (7.27) Combining (7.25), (7.26) and (7.27) yields ∠xpz +∠zpw = ∠x p z + ∠z p w Clearly the inequality∠ xpy +∠ypw < π is proved in the same way, which completes the proof.
The following corollary follows from Lemma 7.10 and Lemma 7.12, which will play an important role when we prove that the validity of the -inequalities implies the G ( ) ( ) condition in Section 9. We de ne some notations, which will be used several times in the next two sections. Let (X, d X ) be a metric space, and let x, y, z, w ∈ X be four distinct points. Choose points  Proof. Suppose x , y , z , x , z , w , x , w , y ∈ R are points satisfying (7.29). By transforming x , z and w if necessary, we may assume that x = x , z = z , and w is not on the same side of ← − → x z as y , as shown in F 7.4. By (7.31), π < ∠y x z + ∠z x w = ∠y x z + ∠z x w , (7.32) which implies that ∠y x z + ∠z x w + ∠w x y = π. (7.33) Because {x, y, z, w} is over-distance with respect to {y, w}, Hence we have and therefore Lemma 7.3 implies that ∠w x y < ∠w x y .
Combining this with (7.33) yields π < ∠y x z + ∠z x w + ∠w x y = ∠y x z + ∠z x w + ∠w x y . Thus renaming the points if necessary, the points x, y, z and w always satisfy the condition (7.31), and therefore D(x; y, z, w) becomes a CAT( ) space, and the natural inclusion of {x, y, z, w} into D(x; y, z, w) becomes an isometric embedding by Lemma 7.14.

The G ( ) ( ) condition
In this section, we prove that the validity of the -inequalities implies the G ( ) ( ) condition. We start with the following three simple facts. All of them hold clearly, so we omit their proofs.
If in addition x, y, z and w are distinct, and ∠yxw < ∠yxz, then strict inequality holds in (8.1). We use these facts to prove the following lemma, which will play a key role to prove that the validity of the -inequalities implies the G ( ) ( ) condition.
Lemma 8.4. Suppose x, y, z, w ∈ R are four distinct points such that w ∈ conv({x, y, z}). Suppose x , y , z , w ∈ R are points such that Proof. Suppose x, y, z, w ∈ R are four distinct points such that w ∈ conv({x, y, z}), and x , y , z , w ∈ R are points satisfying (8.2). To prove the lemma by contrapositive, we assume that

4)
and z is not on the opposite side of ← → x y from w . If z and w are not on opposite sides of ← → x y , we may choose z = z . Otherwise, z is the point obtained by re ecting z orthogonally across ← → x y . Clearly, Because w ∈ conv({x, y, z}), Lemma 8.1 implies that If ∠y x z were less than ∠y x w , and ∠x y z were less than ∠x y w , then z would lie in conv({x , y , w }), and therefore Lemma 8.1 would imply that contradicting (8.6). Thus ∠y x w ≤ ∠y x z or ∠x y w ≤ ∠x y z. We may assume without loss of generality that ∠y x w ≤ ∠y x z. Then Lemma 8.2 implies that because z is not on the opposite side of ← → x y from w by de nition. We consider two cases. and w is congruent to that with vertices x , y and w . Hence   which implies in particular that To prove that equality does not hold in the inequality in (8.15), suppose to the contrary that z−w = z −w . Then (8.14) implies that Combining this with (8.16) yields z = w . Therefore, Because w ∈ conv({x, y, z}), these equalities imply that z = w, contradicting the hypothesis that z ≠ w. Thus equality does not hold in the inequality in (8.15), which completes the proof of the lemma.
We are ready to prove the following proposition. Proof. Let (X, d X ) be a metric space that satis es the -inequalities. Let V and E be the vertex set and the edge set of G ( ) ( ), respectively. We set

Proposition 8.5. If a metric space X satis es the -inequalities, then X satis es the G
as shown in F 8.2. Fix a map f : V → X, and set Equip the subset P = conv({p , p , p }) of R with the induced metric, and regard it as a metric space in its own right. We consider three cases.
for any i ∈ { , } and any j, k ∈ { , , , }. It is clear from the de nitions of Y and g that for each i ∈ { , }, and conv({g (v j ), g (v ), g (v )}) is isometric to a convex subset of the Euclidean plane for each j ∈ { , , }. Therefore, for each i ∈ { , }, Lemma 3.3 implies that for any i, j ∈ { , , , , }. Thus g is a map from V to a CAT( ) space with the desired properties.
and x is not on the opposite side of Then the assumption of C 2 implies that and Corollary 7.6 implies that x ∈ conv({x , x , x }) or x ∈ conv({x , x , x }). By the symmetry of the graph G ( ) ( ), we may assume without loss of generality that Choose y , y , y ∈ R such that Then because It is clear from the de nitions of Y and g that for each i ∈ { , }, and conv({g (v j ), g (v ), g (v )}) is isometric to a convex subset of the Euclidean plane for each j ∈ { , , }. Therefore, for each i ∈ { , }, Lemma 3.3 implies that for any i, j ∈ { , , , , }. Thus g is a map from V to a CAT( ) space with the desired properties.
By the symmetry of the graph G ( ) , we may assume without loss of generality that the former inequality holds.
be the natural inclusion. Then Y is a CAT( ) space, and ψ is an isometric embedding by Lemma 7.14. It also follows from Lemma 7.14 that are closed convex subsets of Y , all of which are isometric to convex subsets of the Euclidean plane. De ne (Y , d Y ) to be the metric space obtained by gluing Y and P by identifying for any i ∈ { , } and any j, k ∈ { , , , }. Let T , T and T be the images of , respectively under the natural inclusion of Y into Y , and letP be the image of P under the natural inclusion of P into Y . Then it is clear from the de nition of Y that T , T , T andP are all isometric to convex subsets of the Euclidean plane, and It is also clear from the de nition of Y that there exist q , q ∈ [g (v ), g (v )] such that Therefore, (8.29) and Lemma 3.3 imply that (8.27) and (8.28). Clearly, the point q ∈ [g (v ), g (v )] is represented by a point q ∈ [ψ(f (v )), ψ(f (v ))], and by de nition of Y It follows from (8.30) and (8.32) that , ψ(f (v ))], then clearly q ∈ [g (v ), g (v )], and therefore (8.33) and Lemma 6.5 imply that , ψ(f (v ))], then we obtain (8.34) in the same way. By (8.27), (8.28), (8.31) and (8.34), for any i, j ∈ { , , , , }. Thus g is a map from V to a CAT( ) space with the desired properties. By Proposition 7.2, C 1, C 2 and C 3 exhaust all possibilities.

The G ( ) ( ) condition
In this section, we prove that the validity of the -inequalities implies the G ( ) ( ) condition. First we prove several lemmas.
for any a, b ∈ {x, y, z, w}. Then there exist a CAT( ) space (Y , d Y ) and a map g : {p, x, y, z, w} → Y such that for any a, b ∈ {x, y, z, w}.
Proof. Because (X, d X ) satis es the -inequalities, Theorem 1.7 implies that there exist a CAT( ) space (Y , d Y ) and an isometric embedding φ : {x, y, z, w} → Y. De ne a map ψ : for any a, b ∈ {x, y, z, w}. Hence Theorem 2.6 implies that there exists a -Lipschitz mapψ : (f (a)) for every a ∈ {x, y, z, w}. De ne a map g : {p, x, y, z, w} → Y by g(a) =ψ(f (a)). Then for any a, b ∈ {x, y, z, w}, which proves the lemma.
Proof. Let α be the plane in R consisting of all points (t , t , t ) ∈ R with t = . Choose x , y , z ∈ α such that Then because both {p, x, y, z} and {q, x, y, z} admit isometric embeddings into R , there exist points p = (p ( ) , p ( ) , p ( ) ) and q = (q ( ) , q ( ) , q ( ) ) in R such that Let R be the convex hull of {x , y , z } in R . Then R ⊆ α, and the triangle forms the boundary of R as a subset of α. De ne P, Q ⊆ R by We consider three cases.
. Equip the subsets P and Q of R with the induced metrics, and regard them as disjoint metric spaces. De ne (Y , d Y ) to be the metric space obtained by gluing P and Q by identifying R ⊆ P with R ⊆ Q naturally. Then Y is a CAT( ) space by Reshetnyak's gluing theorem, and the natural inclusions of P and Q into Y are isometric embeddings. We denote byP andQ the images of P and Q, respectively under the natural inclusions into Y . De ne a map g : {p, q, x, y, z} → Y by sending x, y, z, p and q to the points in Y represented by x , y , z , p ∈ P and q ∈ Q, respectively. Then for any a, b ∈ {p, q, x, y, z} with {a, b} ≠ {p, q}. By de nition of Y , there exists a point r ∈ R such that Because R is the boundary of R as a subset of α, there exists a point r ∈ R ∩ [r , r ]. Then r ∈ conv({r , p , q }), and therefore Lemma 8.1 implies that wherer is the point in Y represented by r ∈ P (or r ∈ Q). Combining this with (9.2) and the triangle inequality for Y yields d Y (g (p), g (q)) = d Y (g (p),r ) + d Y (r , g (q)). (9.3) If r ∈ [x , y ], thenr clearly lies on the geodesic segment [g (x), g (y)] in Y , and therefore (9.1), (9.3) and Lemma 3.3 imply that d Y (g (p), g (q)) ≥ d X (p, q) (9.4) because [g (x), g (y)] ⊆P ∪Q, andP andQ are isometric to convex subsets of Euclidean spaces. If r ∈ [y , z ] or r ∈ [z , x ], then we obtain (9.4) in the same way. Thus (9.4) always holds in C 1. By (9.1) and (9.4), g is a map from {p, q, x, y, z} to a CAT( ) space with the desired properties.
Hence the subset P ∪ Q of R is not contained in any plane, and [p , q ] ⊆ P ∪ Q. It follows that P ∪ Q is a convex subset of R , and therefore the boundary S of P ∪ Q in R equipped with the induced length metric d S is a complete geodesic space with nonnegative Alexandrov curvature as we mentioned in Example 2.4. Clearly S is the union of six subsets conv({p , x , y }), conv({p , y , z }), conv({p , z , x }), conv({q , x , y }), conv({q , y , z }) and conv({q , z , x }) of R . On each of these six subsets, d S coincides with the Euclidean metric on R . In particular, these six subsets are all isometric to convex subsets of the Euclidean plane even as subsets of (S, d S ).
De ne a map f : {p, q, x, y, z} → S by f (a) = a . Then is a geodesic segment even in (S, d S ). If Γ has a nonempty intersection with [y , z ] or [z , x ], then we obtain (9.6) in the same way. Thus (9.6) always holds in C 2. By (9.5) and (9.6), the map f satis es that for any a, b ∈ {p, q, y, z}. Therefore, Lemma 9.1 implies that there exist a CAT( ) space (Y , d Y ) and a map g : {p, q, x, y, z} → Y such that for any a, b ∈ {p, q, y, z}. Thus g is a map from {p, q, x, y, z} to a CAT( ) space with the desired properties. C 3: [p , q ] ∩ α \ (R \ R ) = ∅ and {p , q } ⊆ α. In this case, {p , q } ⊆ R \ R , which ensures in particular that x , y and z are not collinear. Let R and R be two isometric copies of R. We denote the points in R corresponding to x , y , z , p and q by x , y , z , p and q , respectively, and the points in R corresponding to x , y , z , p and q by x , y , z , p and q , respectively. De ne (R , d R ) to be the piecewise Euclidean simplicial complex constructed from the two simplices R and R by identifying [x , y ] with [x , y ], [y , z ] with [y , z ], and [z , x ] with [z , x ]. In other words, R is the piecewise Euclidean simplicial complex obtained by gluing R and R along their boundaries. As we mentioned in Example 2.5, R is a complete geodesic space with nonnegative Alexandrov curvature, and the natural inclusions of R and R into R are both isometric embeddings. In particular, for each i ∈ { , }, the imageR i of R i under the natural inclusion into R is isometric to a convex subset of the Euclidean plane. De ne a map f : {p, q, x, y, z} → R by sending x, y, z, p and q to the points in R represented by x , y , z , p ∈ R and q ∈ R , respectively. Then for any a, b ∈ {p, q, x, y, z} with {a, b} ≠ {p, q}. It follows from the de nition of R that there exists a point r ∈ R such that d R (f (p), f (q)) = p − r + r − q . Hence because it is clear from the de nition of R that Γ is a geodesic segment in R with endpoints f (x) and f (y), and Γ ⊆R ∪R . If r ∈ [y , z ] or r ∈ [z , x ], then we obtain (9.9) in the same way. Thus (9.9) always holds in C 3. By (9.7) and (9.9), for any a, b ∈ {p, q, y, z}. Therefore, Lemma 9.1 implies that there exist a CAT( ) space (Y , d Y ) and a map g : {p, q, x, y, z} → Y such that for any a, b ∈ {p, q, y, z}. Thus g is a map from {p, q, x, y, z} to a CAT( ) space with the desired properties. C 1, C 2 and C 3 exhaust all possibilities.
Proof. By the hypothesis, we can choose a , a , a , b , b (9.10) such that {p, x, y, z} is over-distance with respect to {p, a }, and {q, x, y, z} is over-distance with respect to {q, b }. Then Lemma 7.7 implies that π <∠a a a +∠a a p, or π <∠a a a +∠a a p, and that π < ∠b b b +∠b b q, or π <∠b b b +∠b b q. Therefore, renaming the points if necessary, we may assume further that π <∠a a a +∠a a p, π <∠b b b +∠b b q.
Let Y = D(a ; a , a , p), and let Y = D(b ; b , b , q). Suppose φ : {p, x, y, z} → Y and φ : {q, x, y, z} → Y are the natural inclusions. Then Lemma 7.14 implies that Y and Y are CAT( ) spaces, and φ and φ are isometric embeddings. It also follows from Lemma 7.14 that are closed convex subsets of Y , all of which are isometric to convex subsets of the Euclidean plane. Similarly, are convex subsets of of Y , all of which are isometric to convex subsets of the Euclidean plane. By (9.10), S and T are isometric via the isometry h : S → T such that It is clear from the de nitions of Y = D(a ; a , a , p) and 14) It follows from (9.12), (9.13), (9.14) and the triangle inequality for Y that wherec ,c andc are the points in Y represented by c , c ∈ Y and c ∈ Y , respectively. Because the geodesic segments [g(a ), g(a i )] and [g(b ), Then T is a convex subset ofS , and therefore T is isometric to convex subset of the Euclidean plane. Clearly By (9.10), we have {a , a i } ∩ {b , b j } ≠ ∅. In other words, at least one of the following equalities holds: If a = b , then (9.15), (9.16), (9.17) and Lemma 6.5 imply that because the subsetsS i , T andT j of Y are all isometric to convex subsets of the Euclidean plane, and by (9.11). If a = b j , a i = b or a i = b j , then we obtain (9.18) in the same way. Thus (9.18) always holds. By (9.11) and (9.18), g is a map from {p, q, x, y, z} to a CAT( ) space with the desired properties.
Proof. Choose x , y , z ∈ R such that Suppose p ∈ R is a point such that and p is not on the opposite side of ← → x z from y . Suppose q ∈ R is a point such that and q is not on the opposite side of ← → x z from y . Suppose q ∈ R is a point such that and q is not on the opposite side of ← → x y from z . Such points p , q and q are uniquely determined whenever x , y and z are not collinear. We consider four cases. C 1: {p, x, y, z} is under-distance with respect to {p, y}, and {q, x, y, z} is under-distance with respect to {q, y}. According to Corollary 7.6, we divide C 1 into the following four subcases. S 1 : p ∈ conv({x , y , z }) and q ∈ conv({x , y , z }). In this subcase, x , y and z are not collinear, because otherwise x , y , z and p would be collinear, contradicting Lemma 7.5. Let T and T be two isometric copies of conv({x , y , z }). For each i ∈ { , } and each c ∈ conv({x , y , z }), we denote by φ i (c) the point in T i corresponding to c. De ne (T, d T ) to be the piecewise Euclidean simplicial complex constructed from the two simplices T and T by identifying [φ (x ), φ (y )] with [φ (x ), φ (y )], [φ (y ), φ (z )] with [φ (y ), φ (z )], and [φ (z ), φ (x )] with [φ (z ), φ (x )]. In other words, T is the piecewise Euclidean simplicial complex obtained by gluing T and T along their boundaries. As we mentioned in Example 2.5, T is a complete geodesic space with nonnegative Alexandrov curvature, and the natural inclusions of T and T into T are both isometric embeddings. In particular, for each i ∈ { , }, the imageT i of T i under the natural inclusion into T is isometric to a convex subset of the Euclidean plane. De ne a map f : {p, q, x, y, z} → T by sending x, y, z, p and q to the points in T represented by φ (x ), φ (y ), φ (z ), φ (p ) ∈ T and φ (q ) ∈ T , respectively. Then clearly Hence  De ne a map f : {p, q, x, y, z} → T by sending x, y, z, p and q to the points in T represented by φ (x ), φ (y ), φ (z ), φ (p ) ∈ T and φ (q ) ∈ T , respectively. Then a similar argument as in S 1 yields for any a, b ∈ {p, q, y, z}. Therefore, because T is a complete geodesic space with nonnegative Alexandrov curvature, Lemma 9.1 implies that there exist a CAT( ) space (Y , d Y ) and a map g : {p, q, x, y, z} → Y such that for any a, b ∈ {p, q, y, z}. Thus g is a map from {p, q, x, y, z} to a CAT( ) space with the desired properties. S 2 : p ∈ conv({x , y , z }) and z ∈ conv({q , x , y }). In this subcase, we de ne a map f : {p, q, x, y, z} → R by Then a similar argument as in S 1 implies that for any a, b ∈ {p, q, y, z}. Therefore, because R is a complete geodesic space with nonnegative Alexandrov curvature, Lemma 9.1 implies that there exist a CAT( ) space (Y , d Y ) and a map g : for any a, b ∈ {p, q, y, z}. Thus g is a map from {p, q, x, y, z} to a CAT( ) space with the desired properties. S 2 : y ∈ conv({x , z , p }) and q ∈ conv({x , y , z }). In this subcase, the existence of a map from {p, q, x, y, z} to a CAT( ) space with the desired properties is proved in exactly the same way as in S 2 .
S 2 : y ∈ conv({p , x , z }) and z ∈ conv({q , x , y }). In this subcase, it follows from the same argument as in S 1 that {p, x, y, z} is over-distance with respect to {p, x}, and {q, x, y, z} is overdistance with respect to {q, x}. Therefore, Lemma 9.3 implies that there exist a CAT( ) space (Y , d Y ) and a map g : {p, q, x, y, z} → Y such that for any a, b ∈ {p, q, x, y, z} with {a, b} ≠ {p, q}. Thus g is a map from {p, q, x, y, z} to a CAT( ) space with the desired properties. By Corollary 7.6, the above four subcases exhaust all possibilities in C 2. C 3: {p, x, y, z} is under-distance with respect to {p, z}, and {q, x, y, z} is under-distance with respect to {q, y}. In this case, the existence of a map from {p, q, x, y, z} to a CAT( ) space with the desired properties is proved in exactly the same way as in C 2. C 4: {p, x, y, z} is under-distance with respect to {p, z}, and {q, x, y, z} is under-distance with respect to {q, z}. In this case, the existence of a map from {p, q, x, y, z} to a CAT( ) space with the desired properties is proved in exactly the same way as in C 1. C 1, C 2, C 3 and C 4 exhaust all possibilities.
We consider two cases. C 1: {q, x, y, z} is over-distance with respect to {q, y} or {q, z}. In this case, we may assume without loss of generality that {q, x, y, z} is over-distance with respect to {q, y}. Then Lemma 7.7 implies that π < ∠yxz +∠zxq or π <∠yzx +∠xzq. We may assume further without loss of generality that the former inequality holds. Let Y = D(x; y, z, q), and let φ : {x, y, z, q} → Y be the natural inclusion. Then Y is a CAT( ) space, and φ is an isometric embedding by Lemma 7.14. We set T = T Y (x, y, z), T = T Y (x, z, q), T = T Y (x, q, y) By Lemma 7.14, T , T and T are closed convex subsets of Y , all of which are isometric to convex subsets of the Euclidean plane. It also follows from Lemma 7.14 that there exists an isometry h : T → T such that h (φ (x)) = φ (x), h (φ (y)) = φ (y), h (φ (z)) = φ (z).
De ne a metric space (Y , d Y ) to be the gluing of Y and R along h . Then Y is a CAT( ) space by Reshetnyak's gluing theorem, and the natural inclusions of Y and R into Y are both isometric embeddings. In particular, for each i ∈ { , , }, the imageT i of T i under the natural inclusion of Y into Y is isometric to a convex subset of the Euclidean plane. De ne a map g : {p, q, x, y, z} → Y by sending x, y, z, p and q to the points in Y represented by φ (x), φ (y), φ (z), φ (p) ∈ R and φ (q) ∈ Y , respectively. Then d Y (g (q), g (a)) = d Y (φ (q), φ (a)) = d X (q, a) (9.29) d Y (g (b), g (c)) = φ (b) − φ (c) = d X (b, c), (9.30) for any a ∈ {x, y, z} and any b, c ∈ {p, x, y, z}. It follows from the de nition of Y that there exists r ∈ T such that d Y (g (p), g (q)) = φ (p) − h (r ) + d Y (r , φ (q)). (9.31) It is clear from the de nition of Y = D(x; y, z, q) that there exists such that d Y (r , φ (q)) = d Y (r , r ) + d Y (r , φ (q)). (9.32) By (9.31), (9.32) and the triangle inequality for Y , d Y (g (p), g (q)) = φ (p) − h (r ) + d Y (r , r ) + d Y (r , φ (q)) (9.33) = d Y (g (p),r ) + d Y (r ,r ) + d Y (r , g (q)) = d Y (g (p),r ) + d Y (r , g (q)), wherer andr are the points in Y represented by r ∈ Y and r ∈ Y , respectively. LetR be the image of R under the natural inclusion of R into Y . If r ∈ [φ (x), φ (y)], thenr lies on the geodesic segment [g (x), g (y)] in Y clearly, and therefore (9.29), (9.30), (9.33) and Lemma 3.3 imply that d Y (g (p), g (q)) ≥ d X (p, q) (9.34) because [g (x), g (y)] ⊆R ∩T . If r ∈ [φ (x), φ (z)], then we obtain (9.34) in the same way. Thus (9.34) always holds in C 1. By (9.29), (9.30), and (9.34), g is a map from {p, q, x, y, z} to a CAT( ) space with the desired properties. C 2: {q, x, y, z} is under-distance with respect to {q, y} and {q, z}. In this case, we choose q , x , y , z ∈ R such that and q is not on the opposite side of ← → x z from y . Then Lemma 7.8, Corollary 7.9 and the assumption of C 2 imply that q ∈ conv({x , y , z }), and that x , y and z are not collinear. Set T = conv({x , y , z }). Then there exists an isometry h : T → T such that h (x ) = φ (x), h (y ) = φ (y), h (z ) = φ (z).
We divide C 2 into three subcases. S 2 : φ (p), φ (x), φ (y) and φ (z) are not coplanar. Let S be the boundary of conv({φ (p), φ (x), φ (y), φ (z)}) in R equipped with the induced length metric d S . As we mentioned in Example 2.4, (S, d S ) is a complete geodesic space with nonnegative Alexandrov curvature. Clearly S is the union of four subsets conv({φ (p), φ (x), φ (y)}), conv({φ (p), φ (y), φ (z)}), conv({φ (p), φ (z), φ (x)}) and T of R . On each of these four subsets, d S coincides with the Euclidean metric on R . In particular, these four subsets are all isometric to convex subsets of the Euclidean plane even as subsets of (S, d S ). De ne a map f : {p, q, x, y, z} → S by sending each a ∈ {p, x, y, z} to φ (a), and q to h (q ). Then for any a, b ∈ {p, q, y, z}. Therefore, because α is a complete geodesic space with nonnegative Alexandrov curvature, Lemma 9.1 implies that there exist a CAT( ) space (Y , d Y ) and a map g : {p, q, x, y, z} → Y such that d Y (g (x), g (a)) ≤ d X (x, a), d Y (g (a), g (b)) = d X (a, b) for any a, b ∈ {p, q, y, z}. Thus g is a map from {p, q, x, y, z} to a CAT( ) space with the desired properties. The above three subcases clearly exhaust all possibilities in C 2. By Proposition 7.2, C 1 and C 2 exhaust all possibilities.
Using the facts that we have proved so far, we now prove the following proposition. Proof. Let (X, d X ) be a metric space that satis es the -inequalities. Let V and E be the vertex set and the edge set of G ( ) ( ), respectively. We set as shown in F 9.1. Fix a map f : V → X, and set for any i, j ∈ { , , , , }. By Theorem 1.7, if d ij = for some i, j ∈ { , , , , } with i ≠ j, then there exist a CAT( ) space (Y , d Y ) and a map g : V → Y such that d Y (g (v i ), g (v j )) = d ij for any i, j ∈ { , , , , }. Therefore, we assume that d ij > for any i, j ∈ { , , , , } with i ≠ j. We de ne V , V , V ⊆ X by We consider three cases. C 1: Both V and V admit isometric embeddings into R . In this case, Lemma 9.2 implies that there exist a CAT( ) space (Y , d Y ) and a map g : V → Y such that d Y (g (x ), g (x )) ≥ d , d Y (g (x ), g (x i )) ≤ d i , d Y (g (x j ), g (x k )) = d jk 3 : V is over-distance with respect to {x , x } and {x , x }, and V is under-distance with respect to {x , x } and {x , x }. In this case, the existence of a map from V to a CAT( ) space with the desired properties is proved in exactly the same way as in S 3 . By Proposition 7.2, the above four subcases exhaust all possibilities in C 3. C 1, C 2 and C 3 exhaust all possibilities.
We have proved that a metric space X satis es the G( ) condition for every graph G containing at most ve vertices whenever X satis es the -inequalities, which implies Theorem 1.3 by Proposition 1.9.
Proof of Theorem 1.3. It follows from Propositions 6.1, 6.2, 6.3, 6.4, 6.6, 6.7, 6.8 8.5 and 9.6 that a metric space X satis es the G( ) condition for every graph G that contains at most ve vertices whenever X satis es the -inequalities. Therefore, Proposition 1.9 implies that a metric space X containing at most ve points admits an isometric embedding into a CAT( ) space whenever X satis es the -inequalities. Conversely, if a metric space X containing at most ve points admits an isometric embedding into a CAT( ) space, then X satis es the -inequalities because every CAT( ) space satis es the -inequalities.