The Four Point Condition: An Elementary Tropicalization of Ptolemy’s Inequality

Abstract Ptolemy’s inequality is a classic relationship between the distances among four points in Euclidean space. Another relationship between six distances is the 4-point condition, an inequality satisfied by the lengths of the six paths that join any four points of a metric (or weighted) tree. The 4-point condition also characterizes when a finite metric space can be embedded in such a tree. The curious observer might realize that these inequalities have similar forms: if one replaces addition and multiplication in Ptolemy’s inequality with maximum and addition, respectively, one obtains the 4-point condition. We show that this similarity is more than a coincidence. We identify a family of Ptolemaic inequalities in CAT-spaces parametrized by a real number and show that a certain limit involving these inequalities, as the parameter goes to negative infinity, yields the 4-point condition, giving an elementary proof that the latter is the tropicalization of Ptolemy’s inequality.

Ptolemy's inequality.Ptolemy's inequality is a classical result in Euclidean geometry that relates the six distances among four points in the plane.Given p 1 , p 2 , p 3 , p 4 ∈ R 2 with d ij := p i − p j , the result states d 13 d 24 ≤ d 12 d 34 + d 23 d 41 . (1) The case of equality, known as Ptolemy's Theorem, happens if and only if the points lie on a circle or a line.In fact, the inequality holds in every R n ; see Figure 1.Inequality (1) was discovered by Claudius Ptolemy, a Greek mathematician and astronomer who lived approximately between 100 and 170 AD.His treatise, the Almagest, contains one of the most thorough tables of chords 1 of his time.Much like sin(x) and cos(x) are today, chords were the primary trigonometric function in ancient Greece.Ptolemy computed the length of the chords on a circle of diameter 120 for angles between 0.5 • and 180 • in increments of half a degree.Among other tools, including an approximation similar to sin(x) ≈ x for chords of small angles, he developed formulas for the chord of a half-angle and a double angle using the equality in equation (1).The contemporary equivalent of these formulas is the identity for the sine of a sum of angles which, It suffices to consider R 3 since any 4 points in general position generate a 3-dimensional subspace.With p 1 , p 2 , p 4 fixed, move p 3 along the circle where the distances from p 3 to p 2 and p 4 remain fixed until all four points are coplanar.There are two choices for the ending point p 3 , but if p 1 , p 2 , p 4 are not collinear, we can make the choice where d(p 1 , p 3 ) ≤ d(p 1 , p 3 ).Then the inequality on {p 1 , p 2 , p 3 , p 4 } implies inequality (1) because the only distance that changed was d(p 1 , p 3 ) to d(p 1 , p 3 ).perhaps unsurprisingly, follows from Ptolemy's theorem.The Almagest continued to be an authoritative text for centuries, not only for its mathematical results, but also for its astronomical models, the geocentric view of the universe being one example.The precise computations required for these and subsequent cosmological studies were made possible thanks to the precision in Ptolemy's table of chords.
Trees and the 4-point condition.In a completely different context, a graph G is defined as a pair (V, E), where an element v ∈ V is called a vertex (or node) and e ∈ E is called an edge.Edges e ∈ E connect two distinct vertices2 v 1 , v 2 ∈ V and we denote this by e = {v 1 , v 2 }.A path between two vertices v 1 , v 2 is a sequence of edges e i = {w i , w i } for i = 1, . . ., n, where w 1 = v 1 , w i+1 = w i , and w n = v 2 .If we assign a weight e > 0 to every edge e ∈ E, then the path e 1 , . . ., e n has length e 1 + • • • + en .We define the distance between two vertices v 1 , v 2 to be the length of the shortest path joining them.
Phylogenetics, the study of evolutionary relations between species, is one area that benefits from assigning distances to graphs.The main object in phylogenetics is the evolutionary or phylogenetic tree.This is a graph with no cycles where each point represents a species and an edge connects two species if one evolved from the other.In particular, whenever there is a mutation on a species at a node v, a new vertex appears for the mutated organism with an edge linking it to v. Some phylogenetic trees are rooted, which means that every species represented in the tree has a common evolutionary ancestor at a node v 0 ; see Figure 3. Additionally, by measuring quantities such as the frequency of alleles in a population (that is, gene variations), it is possible to define a distance on this tree quantifies the genetic difference between two species.In that regard, a common problem in this field is finding a good tree representation for a set of species.Mathematically, this means that given a finite set X with a distance function d X , we want to determine whether there exists a tree T and an isometric embedding3 ι : X → T such that ι(x) is a vertex of T for all x ∈ X.The answer is given by the following inequality involving 4-tuples of points.Let x 1 , x 2 , x 3 , x 4 ∈ X and denote their distances by d ij := d X (x i , x j ).Such a tree T exists if and only if the inequality holds for every set of four points in X. Inequality (2) is known as the 4-point condition and such a metric space X is called tree-like.This result was proved by Zaretskii in 1965 [Zar65] in the case of integer distances and extended by Simões Pereira for non-integer distances in 1969 [Sim69].It was also proved independently by Buneman in the 1970's [Bun71,Bun74].There is a generalization of this result where X is not required to be finite.In that case, X might not be embeddable in a tree but instead in a more general object known as an R-tree.We give the definition of R-trees in Section 1.
Ptolemy's inequality and the 4-point condition.The reader might notice that the difference between inequalities (1) and (2) is that the product of two numbers in the former is replaced with addition in the latter; similarly, addition in (1) is replaced with a maximum in (2).In other words, the four-point condition is a tropical version of Ptolemy's inequality.It turns out that this is more than a visual similarity.Tropical Algebraic Geometry is the study of polynomials where the usual addition (+) and multiplication (×) are replaced In particular, see Example 3.46 and the first paragraph of page 128.In this paper, we take a more geometric approach and use a certain generalized notion of curvature to build a link between Ptolemy's inequality and the four-point condition.Curvature and generalizations of Ptolemy's inequality.There exist extensions of Ptolemy's results in Euclidean, spherical, and hyperbolic geometries.In 1947, Haantjes [Haa51] proved a version of Ptolemy's inequality in the spherical and hyperbolic planes.Proofs that equality holds for cyclic quadrilaterals were given by Shirokov [Shi24] in 1924 and Perron [Per64] in 1964 for the case of hyperbolic geometry, and by Zeitler [Zei66] in 1966 for non-Euclidean geometries.The work of Kurnik and Volenic [KV67] in 1967 contains several related results, including an extension of Ptolemy's theorem to n points in any of the three plane geometries using a matrix similar to the P κ (p 1 , . . ., p m ) that we consider in Section 2. These papers, however, do not consider the converse: what can we say about any four points that satisfy the equality in the non-Euclidean Ptolemaic theorem?This question was addressed in 1970 by Joseph E. Valentine [Val70a,Val70b].He gave a proof of the non-Euclidean Ptolemy's inequality and its analogue: if equality holds in the spherical inequality, the four points must lie on a circle [Val70b,Theorem 5.4]; in the hyperbolic case, equality implies that the four points lie on either a circle, a line, a horocycle, or one branch of an equidistant curve [Val70a, p. 1].Andalafte and Valentine further generalized both the theorem and the inequality to higher dimensional hyperbolic space in 1971.In this case, n + 2 points in n-dimensional hyperbolic space lie on an (n − 1)-dimensional subspace, an (n − 1)-dimensional sphere or limiting surface, or a sheet of an (n − 1)-dimensional equidistant surface if and only if the determinant we call The Euclidean Ptolemaic theorem has an extension known as Casey's theorem.Let C 1 , C 2 , C 3 , C 4 be four non-intersecting circles tangent to a fifth circle C 0 in that order.If C i and C j are both in the interior or both in the exterior of C 0 , let t ij be the length of a common outer tangent to C i , C j .Otherwise, let t ij be the length of a common inner tangent 5 .Then, the lengths t ij satisfy the Ptolemaic identity t 13 t 24 = t 12 t 34 + t 23 t 41 . (3) Conversely, for any four circles C 1 , C 2 , C 3 , C 4 and choices of inner or outer tangents, if the lengths t ij satisfy (3), then there exists a circle C 0 that is tangent to all C i .The degenerate case where all circles have radius 0 is Ptolemy's theorem.This is another result that has non-Euclidean generalizations.Casey proved that (3) holds in 1866 [Cas64, Article 1] (see also [Cas86,p. 103]).The proof of the converse appears in a book by Johnson published in 1929 [Joh29, p. 121].The spherical case appears in the book by M'Clelland and Preston from 1886 [MP86] and the hyperbolic case, in an article by Kubota from 1912 [Kub12].Kurnick and Volenic gave a version of Casey's theorem for n circles tangent to a common circle in all three geometries [KV67, Theorem 9].More recently, in 2015 Abromsimov and Mikaiylova [AM15] gave another proof for both non-Euclidean geometries (although the details are written specifically for the hyperbolic case).Abrosimov and Aseev extended the Euclidean theorem to higher dimensions [AA18] in 2018.
The hyperbolic [Val70a] and spherical [Val70b] planes are the prototypical examples of geometries with constant negative and positive curvature.We take this a step further and generalize these inequalities to a class of geodesic metric spaces known as CAT-spaces.For now, let's say that a CAT(κ) space is a metric space with curvature bounded above by κ (see Section 1 for a precise definition).In particular, a CAT(0) space has non-positive curvature.Furthermore, CAT(κ) spaces with κ < 0 are known to satisfy a property known as hyperbolicity, which can be understood as a relaxation of the 4-point condition (2).Indeed, if there exists δ ≥ 0 such that for all x 1 , x 2 , x 3 , x 4 ∈ X, the inequality is satisfied, then X is called δ-hyperbolic6 .The hyperbolicity of X is defined as the infimum δ 0 of all δ that satisfy inequality (4), and we denote it by hyp(X) := δ 0 .CAT(κ) and δ-hyperbolic spaces are, in general, different.For κ < 0, every CAT(κ) space X has hyp(X) ≤ ln(2)/ √ −κ.However, not all δ-hyperbolic spaces for a fixed δ ≥ 0 are CAT(0).For example, every compact metric space is δ-hyperbolic for δ ≥ diam(X).In particular, the unit sphere S 2 with geodesic distance is π-hyperbolic but it is not CAT(0) since its curvature is strictly positive; see do Carmo's book [dC76, Chapter 3, Example 7] or our Remark in Section 1.
Hyperbolic groups.The hyperbolicity of a metric space first appeared in the work of Gromov [Gro87, p. 89].Gromov wanted to define a notion of hyperbolic group with the objective of translating the rich geometry of hyperbolic spaces into group-theoretic results.We describe one of several equivalent constructions.Let G = S be a group generated by a finite set S = {a 1 , a 2 , . . ., a n } ⊂ G. Consider a graph Γ(G, S) with vertex set G, and draw an edge between vertices g 1 and g 2 if there exists a i ∈ S such that g 2 = a i • g 1 .Γ(G, S) is then made into a metric space by assigning a weight of 1 to each edge.Γ(G, S) is known as the Cayley graph of G with respect to S. A Cayley graph induces a metric on G, known as a word metric, by setting the distance between g 1 and g 2 as the length of the shortest path between g 1 and g 2 in Γ(G, S).At this point, one might be tempted  to define a group G to be hyperbolic if its word metric generated by a Cayley graph Γ(G, S) is δ-hyperbolic for some δ > 0. However, the construction of Γ(G, S) depends on the generating set and, in general, two Cayley graphs Γ(G, S 1 ), Γ(G, S 2 ) for the same group might not be isometric.Despite this, the above notion of a hyperbolic group is well-defined under quasi-isometry.A function f : (X, d X ) → (Y, d Y ) between metric spaces is called a quasi-isometry if there exist constants A ≥ 1 and B, C ≥ 0 such that for all x 1 , x 2 ∈ X, and if for all y ∈ Y , there exists x 0 ∈ X such that d Y (y, f (x 0 )) ≤ C. In other words, f is a quasi-isometry if it is almost an isometry and almost surjective as measured by the inequalities above.Returning to our discussion of groups, one of the basic results in geometric group theory says that every pair of Cayley graphs Γ(G, S 1 ) and Γ(G, S 2 ) of the same group are quasi-isometric, irrespective of the generating sets S 1 and S 2 .Furthermore, hyperbolicity is a quasi-isometry invariant.The constants δ corresponding to different quasi-isometric spaces are usually distinct, but the point is that they all exist.Thus, defining a group to be hyperbolic if any of its word metrics is δ-hyperbolic (for some δ ≥ 0) is an unambiguous notion.Hyperbolic groups enjoy several properties.For example, the word problem on a given finitely generated group G = S amounts to the question of constructing an algorithm that can determine whether any element g ∈ G is the identity e ∈ G using only the properties of S. While the word problem is not solvable in general, hyperbolic groups are one class where not only such an algorithm exists, but it runs in quadratic time in the length7 of the word; see Theorems 3.4.5 and 2.3.10 of [Eps92].Hyperbolic groups are also finitely presented and act properly discontinuously and cocompactly by isometries 8 on δ-hyperbolic spaces.This is another setting where the notions of CAT spaces and δ-hyperbolicity differ.We can make an analogous definition and say that a CAT(κ) group is one that has a properly discontinuous and cocompact action by isometries on a CAT(κ) space.Since CAT(κ) spaces are δ-hyperbolic when κ < 0, every CAT(κ) group is hyperbolic.The converse, however, is an important unsolved question in geometric group theory (see Remark 2.3 in Chapter III.Γ of [BH99]).
Going back to metric trees, their relationship with hyperbolicity goes beyond satisfying inequality (4) for δ = 0.One of Gromov's definitions of hyperbolic groups says that, intuitively, a group whose "word metric looks like a tree when observed from infinity" is hyperbolic [Gro87,p. 78].This motivates thinking of trees and their properties as the limit at infinity of the corresponding properties of a certain family of spaces.Indeed, metric trees (and, more generally, R-trees) are CAT(κ) spaces for all κ ∈ R.This raises the question of whether the 4-point condition (2) might be the (−∞)-version of a certain family of inequalities.It turns out that a generalization of Ptolemy's inequality in CAT-spaces gives a family which realizes the idea.
Contributions.For the sake of completeness, in this paper we adapt the proof of the non-Euclidean Ptolemaic inequalities given by Valentine in his 1970 papers [Val70a,Val70b].This proof is valid in any dimension, similar to [AV71], and works simultaneously for positive and negative curvature.We then show that CAT(κ) spaces also satisfy a κ-Ptolemaic inequality, which is either the spherical or hyperbolic inequality depending on whether κ > 0 or κ < 0. Lastly, we show that the four-point condition is indeed the limit of the κ-Ptolemy inequality when κ → −∞, essentially characterizing the former as the (−∞) form of the latter.
These are the usual inner product in R n+1 and the Minkowski bilinear form, respectively.The n-dimensional space with constant curvature κ is defined as: These spaces come equipped with a geodesic distance given by: In other words, if κ > 0, M n κ is the n-dimensional sphere S n ⊂ R n+1 with radius 1/ √ κ.If κ < 0, M n κ is a rescaling of the n-dimensional hyperbolic space H n by a factor of 1/ More generally, we can assign a notion of curvature to a geodesic metric space (X, d X ) by comparing it with the model spaces defined above.We adopt the definitions from Bridson and Haefliger [BH99, Chapter II.1].Given two points x, y ∈ X, let [x, y] denote any geodesic joining x and y.For a set of three points x, y, z ∈ X, consider the geodesic triangle ∆ formed by the three segments ∆ is called a comparison triangle for ∆, and a point p κ (p, x) (similarly for the other two segments).X will be called a CAT(κ) space if for every geodesic triangle ∆ and any two points p, q ∈ ∆, their comparison points satisfy We can summarize the above construction as follows.See also Figure 6.Given a geodesic triangle ∆ ⊂ X (with bounded perimeter if κ > 0), we can find a comparison triangle ∆ ⊂ M 2 κ whose sides have the same length as those of ∆.X is a CAT(κ) space if the triangle ∆ is thinner than ∆ (as specified by inequality (5)).
Following [BH99, Example II.1.15(5)],an R-tree is a metric space T such that: 1.For every pair of points x, y ∈ T , there exists a unique geodesic [x, y] ∈ T joining them.Notation.Throughout the paper, whenever we have points p 1 , . . ., p m in a single fixed metric space (either X or M n κ ), we denote the distance between p i and p j by d ij .However, if X is specifically a CAT-space, we write the points of X as p i and the corresponding comparison points in the model space M 2 κ as p i .Similarly, we use d ij for the distances between points in X and d ij for the distances in the model space M 2 κ (instead of the more verbose notation d M 2 κ (p, q)).
In this section, we adapt the arguments in [AV71,Val70a,Val70b] to give a unified proof of the generalized Ptolemy's inequality in every dimension for positive and negative curvature.Define the functions c κ : R + → R and s κ : R + → R as follows: Notice that s κ is increasing on R + when κ ≤ 0 and on [0, D κ /2] when κ > 0.
Calling Theorem 2.3 the generalization of Ptolemy's inequality is justified for two reasons.First, the geometric results found in [AV71] are analogous to the Euclidean case: Ptolemy's theorem in R 2 holds if and only if the four points are on a line or a circle.Likewise, Theorem 4.7 of [AV71] says that when p 1 , . . ., p n+2 ∈ M n −1 , γ κ (p 1 , . . ., p n+2 ) = 0 if and only if the n + 2 points lie either on a M n−1 −1 subspace, on an (n − 1)-dimensional sphere or limiting surface, or on a sheet of an (n − 1)dimensional equidistant surface.[Val70a,Val70b] have analogous results when n = 2. Speaking of which, the second reason for using Ptolemy's name is that Theorem 2.3 takes a familiar form when n = 2.
Coming back to the main topic, the generalization of Ptolemy's inequality to CAT-spaces follows by extending a classic argument.The case when κ = 0, for instance, appears after the statement of Proposition 3.1 in the paper by Buckley )2 , M 2 κ is the sphere with radius R = 2 + π and diameter D κ = 2π + (recall the definition of M 2 κ in Section 1).Since κ < 1, M 2 κ is CAT(1) by [BH99, Theorem II.1.12].Let p 1 = (0, 0, R), p 2 = (R, 0, 0), p 3 = (x 1 , x 2 , 0), and p 4 = (0, 0, −R) be points of M 2 κ chosen so that d 23 = .Notice that  To answer this, we apply the inverse of s κ (•) to inequality (6) and calculate the limit as κ → −∞ (for κ < 0, this inverse is 2 = 1, so for any function f for which lim κ→−∞ f (κ) = ∞, the limit lim κ→−∞ With this, our proof that the 4-point condition (9) is the tropicalization of Ptolemy's inequality is finished.In so doing, we established a connection between the 4-point condition (and more generally, Gromov hyperbolicity) with one of the great Greek theorems of antiquity.In a way, it is fascinating that stepping out of classical Euclidean geometry provided the bridge needed to link ideas such as trigonometry, curvature, group theory, trees, and genetics.Ultimately, it all started with an elegant theorem from ancient Greece, one that became central in the development of astronomy, trigonometry and mathematics as a whole.

Figure 1 :
Figure 1: Left: A quadrilateral on the plane.Right: A visualization of Ptolemy's inequality in R n .It suffices to consider R 3 since any 4 points in general position generate a 3-dimensional subspace.With p 1 , p 2 , p 4 fixed, move p 3 along the circle where the distances from p 3 to p 2 and p 4 remain fixed until all four points are coplanar.There are two choices for the ending point p 3 , but if p 1 , p 2 , p 4 are not collinear, we can make the choice where d(p 1 , p 3 ) ≤ d(p 1 , p 3 ).Then the inequality on {p 1 , p 2 , p 3 , p 4 } implies inequality (1) because the only distance that changed was d(p 1 , p 3 ) to d(p 1 , p 3 ).
4 with x ⊕ y = max(x, y) and x ⊗ y = x + y [MS15, Section 1.1].In classical Algebraic Geometry, Ptolemy's theorem d 13 d 24 = d 12 d 34 + d 41 d 23 is the Plücker relation that characterizes the Grassmannian G 2,4 ; see Theorem 3.20 and the explanation after Corollary 3.21 in [PS05].On the other hand, the set T n of treelike metric spaces with n points is the tropical Grassmannian T 2,4 [PS05, Theorem 3.45], and its Plücker relation is d 13 + d 24 ≤ max(d 12 + d 34 , d 41 + d 23 ), that is, the four-point condition.These ideas, including the tropicalization of the Plücker relations, are discussed in Section 3.5 of [PS05].
the same length.

Figure 6 :
Figure6: A geodesic triangle ∆ in a CAT(κ) space X with vertices x, y, z ∈ X, and a comparison triangle ∆ in the model space M 2 κ with vertices x, y, z ∈ M 2 κ .There are two points p ∈ [x, y] and q ∈ [x, z], and their corresponding comparison points p ∈ [x, y] and q ∈ [x, z] satisfy d X (p, q) ≤ d M 2 κ (p, q).

2.Figure 7 :
Figure7: Geodesic triangles in spaces with constant curvature.Moving from left to right, the curvature is positive, zero, and then negative until it reaches −∞.Meanwhile, the triangles become increasingly thinner until only the union of three line segments at a common vertex remains when the curvature reaches −∞.

Question 2 .
Analogously to the hyperbolicity of a metric space, we can define the κ-Ptolemaic defect of a metric space as:P κ (X) := sup s κ (d 13 /2)s κ (d 24 /2) − s κ (d 12 /2)s κ (d 34 /2) + s κ (d 41 /2)s κ (d 23 /2) ,where d ij := d X (p i , p j ) and the supremum is taken over all {p 1 , p 2 , p 3 , p 4 } ⊂ X.What properties does this constant have?In particular, is it stable under the Gromov-Hausdorff distance?4The limiting case.R-trees are CAT(κ) for every κ ∈ R [BH99, Example II.1.15(5)].By Theorem 3.4, they satisfy the κ-Ptolemy inequality for all κ and, by the Remark after Corollary 3.2, they also satisfy the 4-point condition.Now we ask the converse: what can we say about a space X that satisfies the κ-Ptolemy inequality for all κ?

√
−κ arcsinh(•)).Let a, b, c, d > 0 such that c + d ≤ a + b.Define e κ (t) := exp( √ −κt) for κ < 0 and t > 0. Notice that lim x→∞ arcsinh(x) ln(x) Figure 4: Casey's theorem.Notice that C 1 and C 2 are in the exterior of C 0 while C 3 and C 4 are in the interior.For this reason, the tangent line between C 1 and C 2 and that between C 3 and C 4 are outer tangents, and every other segment is an inner tangent.