# Comparison triangle

In metric geometry, comparison triangles are constructions used to define higher bounds on curvature in the framework of locally geodesic metric spaces, thereby playing a similar role to that of higher bounds on sectional curvature in Riemannian geometry.

## Definitions
### Comparison triangles

Let M$_0$$^2$=E$^2${\textstyle M_{0}^{2}=\mathbb {E} ^{2}} be the euclidean plane, M$_1$$^2$=S$^2${\textstyle M_{1}^{2}=\mathbb {S} ^{2}} be the unit 2-sphere, and M$_{−1}$$^2$=H$^2${\textstyle M_{-1}^{2}=\mathbb {H} ^{2}} be the hyperbolic plane. For k>0{\textstyle k>0}, let M$_k$$^2${\textstyle M_{k}^{2}} and M$_{−k}$$^2${\textstyle M_{-k}^{2}} denote the spaces obtained, respectively, from M$_1$$^2${\textstyle M_{1}^{2}} and M$_{−1}$$^2${\textstyle M_{-1}^{2}} by multiplying the distance by 1/√|k| {\textstyle {\frac {1}{\sqrt {|k|}}}}. For any k∈R{\textstyle k\in \mathbb {R} }, M$_k$$^2${\textstyle M_{k}^{2}} is the unique complete, simply-connected, 2-dimensional Riemannian manifold of constant sectional curvature k{\textstyle k}.
Let $X$ be a metric space. Let $T$ be a geodesic triangle in $X$, i.e. three points $p$, $q$ and $r$ and three geodesic segments [p, q]{\textstyle [p, q]}, [q, r]{\textstyle [q, r]} and [r, p]{\textstyle [r, p]}. A comparison triangle $T*$ in M$_k$$^2${\textstyle M_{k}^{2}} for $T$ is a geodesic triangle in M$_k$$^2${\textstyle M_{k}^{2}} with vertices $p'$, $q'$ and $r'$ such that d(p, q)=d(p$^′$, q$^′$){\textstyle d(p, q)=d(p', q')}, d(p, r)=d(p$^′$, r$^′$){\textstyle d(p, r)=d(p', r')} and d(r, q)=d(r$^′$, q$^′$){\textstyle d(r, q)=d(r', q')}.
Such a triangle, when it exists, is unique up to isometry. The existence is always true for k≤0{\textstyle k\leq 0}. For k>0{\textstyle k>0}, it can be ensured by the additional condition d(p, q)+d(q, r)+d(r, p)≤ 2π/√k {\textstyle d(p, q)+d(q, r)+d(r, p)\leq {\frac {2\pi }{\sqrt {k}}}} (i.e. the length of the triangle does not exceed that of a great circle of the sphere M$_k$$^2${\textstyle M_{k}^{2}}).

#### Comparison angles

The interior angle of T∗{\textstyle T*} at p$^′${\textstyle p'} is called the comparison angle between q{\textstyle q} and r{\textstyle r} at p{\textstyle p}. This is well-defined provided q{\textstyle q} and r{\textstyle r} are both distinct from p{\textstyle p}, and only depends on the lengths d(p, q), d(q, r), d(p, r){\textstyle d(p, q), d(q, r), d(p, r)}. Let it be denoted by ∠$^¯$$_{p, q, r}$$^{(k)}${\textstyle {\overline {\angle }}_{p, q, r}^{(k)}}. Using inverse trigonometry, one has the formulas:$\cos({\overline {\angle }}_{p,q,r}^{(0)})={\frac {d(q,r)^{2}-d(p,q)^{2}-d(p,r)^{2}}{2d(p,q)d(p,r)}},$$\cos({\overline {\angle }}_{p,q,r}^{(k)})={\frac {\cos({\sqrt {k}}d(q,r))-\cos({\sqrt {k}}d(p,q))\cos({\sqrt {k}}d(p,r))}{\sin({\sqrt {k}}d(p,q))\sin({\sqrt {k}}d(p,r))}}~~{\text{for}}~~k>0,$$\cos({\overline {\angle }}_{p,q,r}^{(k)})={\frac {\cosh({\sqrt {-k}}d(p,q))\cosh({\sqrt {-k}}d(p,r))-\cosh({\sqrt {-k}}d(q,r))}{\sinh({\sqrt {-k}}d(p,q))\sinh({\sqrt {-k}}d(p,r))}}~~{\text{for}}~~{k<0}.$

#### Alexandrov angles

Comparison angles provide notions of angles between geodesics that make sense in arbitrary metric spaces. The Alexandrov angle, or outer angle, between two nontrivial geodesics c, c$^′${\textstyle c, c'} with c(0)=c$^′$(0){\textstyle c(0)=c'(0)} is defined as$\angle _{c,c'}=\limsup _{t,t'\rightarrow 0}{\overline {\angle }}_{c(0),c(t),c'(t')}.$

### Comparison tripods

The following similar construction, which appears in certain possible definitions of Gromov-hyperbolicity, may be regarded as a limit case when k→−∞{\textstyle k\rightarrow -\infty }.
For three points x, y, z{\textstyle x, y, z} in a metric space X{\textstyle X}, the Gromov product of x{\textstyle x} and y{\textstyle y} at z{\textstyle z} is half of the triangle inequality defect:$(x,y)_{z}={\frac {1}{2}}(d(x,z)+d(y,z)-d(x,y))$Given a geodesic triangle Δ{\textstyle \Delta } in X{\textstyle X} with vertices (p, q, r){\textstyle (p, q, r)}, the comparison tripod T$_Δ${\textstyle T_{\Delta }} for Δ{\textstyle \Delta } is the metric graph obtained by gluing three segments [p$^′$, c$_p$], [q$^′$, c$_q$], [r$^′$, c$_r$]{\textstyle [p', c_{p}], [q', c_{q}], [r', c_{r}]} of respective lengths (q, r)$_p$, (r, p)$_q$, (p, q)$_r${\textstyle (q, r)_{p}, (r, p)_{q}, (p, q)_{r}} along a vertex c{\textstyle c}, setting c$_p$=c$_q$=c$_r$=c{\textstyle c_{p}=c_{q}=c_{r}=c}.
One has d(p$^′$, q$^′$)=d(p, q), d(q$^′$, r$^′$)=d(q, r), d(r$^′$, p$^′$)=d(r, p), {\textstyle d(p', q')=d(p, q), ~~d(q', r')=d(q, r), ~~d(r', p')=d(r, p), } and T$_Δ${\textstyle T_{\Delta }} is the union of the three unique geodesic segments [p$^′$, q$^′$], [q$^′$, r$^′$], [r$^′$, p$^′$]{\textstyle [p', q'], [q', r'], [r', p']}. Furthermore, there is a well-defined comparison map f$_Δ$:Δ⟶T$_Δ${\textstyle f_{\Delta }:\Delta \longrightarrow T_{\Delta }} with f$_Δ$(p)=p$^′$, f$_Δ$(q)=q$^′$, f$_Δ$(r)=r$^′$, {\textstyle f_{\Delta }(p)=p', f_{\Delta }(q)=q', f_{\Delta }(r)=r', } such that f$_Δ${\textstyle f_{\Delta }} is isometric on each side of Δ{\textstyle \Delta }. The vertex c{\textstyle c} is called the center of T$_Δ${\textstyle T_{\Delta }}, and its preimage under f$_Δ${\textstyle f_{\Delta }} is called the center of Δ{\textstyle \Delta }, its points the internal points of Δ{\textstyle \Delta }, and its diameter the insize of Δ{\textstyle \Delta }.
One way to formulate Gromov-hyperbolicity is to require f$_Δ${\textstyle f_{\Delta }} not to change the distances by more than a constant δ≥0{\textstyle \delta \geq 0}. Another way is to require the insizes of triangles Δ{\textstyle \Delta } to be bounded above by a uniform constant δ$^′$≥0{\textstyle \delta '\geq 0}.
Equivalently, a tripod is a comparison triangle in a universal real tree of valence ≥3{\textstyle \geq 3}. Such trees appear as ultralimits of the M$_k$$^2${\textstyle M_{k}^{2}} as k→−∞{\textstyle k\rightarrow -\infty }.

## The Alexandrov lemma

In various situations, the Alexandrov lemma (also called the triangle gluing lemma) allows one to decompose a geodesic triangle into smaller triangles for which proving the CAT(k) condition is easier, and then deduce the CAT(k) condition for the bigger triangle. This is done by gluing together comparison triangles for the smaller triangles and then "unfolding" the figure into a comparison triangle for the bigger triangle.