Triangle inequality

Revision as of 20:23, 13 April 2025 by imported>JayBeeEll (Restored revision 1283519147 by 2600:1700:4268:6030:7839:CF1B:F7C2:7B1D (talk): Previous wording is clearer imo)
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

Template:Short description Template:About

File:TriangleInequality.svg
Three examples of the triangle inequality for triangles with sides of lengths Template:Mvar, Template:Mvar, Template:Mvar. The top example shows a case where Template:Mvar is much less than the sum Template:Math of the other two sides, and the bottom example shows a case where the side Template:Mvar is only slightly less than Template:Math.

In mathematics, the triangle inequality states that for any triangle, the sum of the lengths of any two sides must be greater than or equal to the length of the remaining side.<ref>Wolfram MathWorld – http://mathworld.wolfram.com/TriangleInequality.html</ref><ref name=Khamsi> Template:Cite book</ref> This statement permits the inclusion of degenerate triangles, but some authors, especially those writing about elementary geometry, will exclude this possibility, thus leaving out the possibility of equality.<ref>for instance, Template:Citation</ref> If Template:Mvar, Template:Mvar, and Template:Mvar are the lengths of the sides of a triangle then the triangle inequality states that

<math>c \leq a + b ,</math>

with equality only in the degenerate case of a triangle with zero area.

In Euclidean geometry and some other geometries, the triangle inequality is a theorem about vectors and vector lengths (norms):

<math>\|\mathbf u + \mathbf v\| \leq \|\mathbf u\| + \|\mathbf v\| ,</math>

where the length of the third side has been replaced by the length of the vector sum Template:Math. When Template:Math and Template:Math are real numbers, they can be viewed as vectors in <math>\R^1</math>, and the triangle inequality expresses a relationship between absolute values.

In Euclidean geometry, for right triangles the triangle inequality is a consequence of the Pythagorean theorem, and for general triangles, a consequence of the law of cosines, although it may be proved without these theorems. The inequality can be viewed intuitively in either <math>\R^2</math> or <math>\R^3</math>. The figure at the right shows three examples beginning with clear inequality (top) and approaching equality (bottom). In the Euclidean case, equality occurs only if the triangle has a Template:Math angle and two Template:Math angles, making the three vertices collinear, as shown in the bottom example. Thus, in Euclidean geometry, the shortest distance between two points is a straight line.

In spherical geometry, the shortest distance between two points is an arc of a great circle, but the triangle inequality holds provided the restriction is made that the distance between two points on a sphere is the length of a minor spherical line segment (that is, one with central angle in Template:Math) with those endpoints.<ref name= Ramos> Template:Cite book </ref><ref name=Ramsay> Template:Cite book </ref>

The triangle inequality is a defining property of norms and measures of distance. This property must be established as a theorem for any function proposed for such purposes for each particular space: for example, spaces such as the real numbers, Euclidean spaces, the Lp spaces (Template:Math), and inner product spaces.

Euclidean geometryEdit

File:Euclid triangle inequality.svg
Euclid's construction for proof of the triangle inequality for plane geometry.

The triangle inequality theorem is stated in Euclid's Elements, Book 1, Proposition 20:

[…] in the triangle ABC the sum of any two sides is greater than the remaining one, that is, the sum of BA and AC is greater than BC, the sum of AB and BC is greater than AC, and the sum of BC and CA is greater than AB. <ref>(trans. Joyce, see reference below)</ref>

Euclid proved the triangle inequality for distances in plane geometry using the construction in the figure.<ref name=Jacobs> Template:Cite book </ref> Beginning with triangle Template:Mvar, an isosceles triangle is constructed with one side taken as Template:Mvar and the other equal leg Template:Mvar along the extension of side Template:Mvar. It then is argued that angle Template:Mvar has larger measure than angle Template:Mvar, so side Template:Mvar is longer than side Template:Mvar. However:

<math>\overline{AD} = \overline{AB} + \overline{BD} = \overline{AB} + \overline{BC},</math>

so the sum of the lengths of sides Template:Mvar and Template:Mvar is larger than the length of Template:Mvar. This proof appears in Euclid's Elements, Book 1, Proposition 20.<ref name=Joyce> {{#invoke:citation/CS1|citation |CitationClass=web }} </ref>

Mathematical expression of the constraint on the sides of a triangleEdit

For a proper triangle, the triangle inequality, as stated in words, literally translates into three inequalities (given that a proper triangle has side lengths Template:Math that are all positive and excludes the degenerate case of zero area):

<math>a + b > c ,\quad b + c > a ,\quad c + a > b .</math>

A more succinct form of this inequality system can be shown to be

<math>|a - b| < c < a + b .</math>

Another way to state it is

<math>\max(a, b, c) < a + b + c - \max(a, b, c)</math>

implying

<math>2 \max(a, b, c) < a + b + c</math>

and thus that the longest side length is less than the semiperimeter.

A mathematically equivalent formulation is that the area of a triangle with sides Template:Math must be a real number greater than zero. Heron's formula for the area is

<math>

\begin{align} 4\cdot \text{area} & =\sqrt{(a+b+c)(-a+b+c)(a-b+c)(a+b-c)} \\ & = \sqrt{-a^4-b^4-c^4+2a^2b^2+2a^2c^2+2b^2c^2}. \end{align} </math>

In terms of either area expression, the triangle inequality imposed on all sides is equivalent to the condition that the expression under the square root sign be real and greater than zero (so the area expression is real and greater than zero).

The triangle inequality provides two more interesting constraints for triangles whose sides are Template:Math, where Template:Math and <math>\phi</math> is the golden ratio, as

<math>1<\frac{a+c}{b}<3</math>
<math>1\le\min\left(\frac{a}{b}, \frac{b}{c}\right)<\phi.</math><ref>American Mathematical Monthly, pp. 49-50, 1954.</ref>

Right triangleEdit

File:Isosceles triangle made of right triangles.svg
Isosceles triangle with equal sides Template:Math divided into two right triangles by an altitude drawn from one of the two base angles.

In the case of right triangles, the triangle inequality specializes to the statement that the hypotenuse is greater than either of the two sides and less than their sum.<ref name=Palmer> Template:Cite book </ref>

The second part of this theorem is already established above for any side of any triangle. The first part is established using the lower figure. In the figure, consider the right triangle Template:Mvar. An isosceles triangle Template:Mvar is constructed with equal sides Template:Math. From the triangle postulate, the angles in the right triangle Template:Math satisfy:

<math> \alpha + \gamma = \pi /2 \ . </math>

Likewise, in the isosceles triangle Template:Mvar, the angles satisfy:

<math>2\beta + \gamma = \pi \ . </math>

Therefore,

<math> \alpha = \pi/2 - \gamma ,\ \mathrm{while} \ \beta= \pi/2 - \gamma /2 \ ,</math>

and so, in particular,

<math>\alpha < \beta \ . </math>

That means side Template:Mvar, which is opposite to angle Template:Mvar, is shorter than side Template:Mvar, which is opposite to the larger angle Template:Mvar. But Template:Math. Hence:

<math>\overline{AC} > \overline{AD} \ . </math>

A similar construction shows Template:Math, establishing the theorem.

An alternative proof (also based upon the triangle postulate) proceeds by considering three positions for point Template:Mvar:<ref name=Zawaira> Template:Cite book </ref> (i) as depicted (which is to be proved), or (ii) Template:Mvar coincident with Template:Mvar (which would mean the isosceles triangle had two right angles as base angles plus the vertex angle Template:Mvar, which would violate the triangle postulate), or lastly, (iii) Template:Mvar interior to the right triangle between points Template:Mvar and Template:Mvar (in which case angle Template:Mvar is an exterior angle of a right triangle Template:Mvar and therefore larger than Template:Math, meaning the other base angle of the isosceles triangle also is greater than Template:Math and their sum exceeds Template:Mvar in violation of the triangle postulate).

This theorem establishing inequalities is sharpened by Pythagoras' theorem to the equality that the square of the length of the hypotenuse equals the sum of the squares of the other two sides.

Examples of useEdit

Consider a triangle whose sides are in an arithmetic progression and let the sides be Template:Math. Then the triangle inequality requires that

<math>\begin{array}{rcccl}
 0 &<& a &<& 2a+3d, \\
 0 &<& a+d &<& 2a+2d, \\
 0 &<& a+2d &<& 2a+d. 

\end{array}</math>

To satisfy all these inequalities requires

<math> a>0 \text{ and } -\frac{a}{3}<d<a. </math><ref>Template:Cite journal</ref>

When Template:Mvar is chosen such that Template:Math, it generates a right triangle that is always similar to the Pythagorean triple with sides Template:Math, Template:Math, Template:Math.

Now consider a triangle whose sides are in a geometric progression and let the sides be Template:Math. Then the triangle inequality requires that

<math>\begin{array}{rcccl}
 0 &<& a &<& ar+ar^2, \\
 0 &<& ar &<& a+ar^2, \\
 0 &<& \! ar^2 &<& a+ar. 

\end{array}</math>

The first inequality requires Template:Math; consequently it can be divided through and eliminated. With Template:Math, the middle inequality only requires Template:Math. This now leaves the first and third inequalities needing to satisfy

<math>

\begin{align} r^2+r-1 & {} >0 \\ r^2-r-1 & {} <0. \end{align} </math>

The first of these quadratic inequalities requires Template:Mvar to range in the region beyond the value of the positive root of the quadratic equation Template:Math, i.e. Template:Math where Template:Mvar is the golden ratio. The second quadratic inequality requires Template:Mvar to range between 0 and the positive root of the quadratic equation Template:Math, i.e. Template:Math. The combined requirements result in Template:Mvar being confined to the range

<math>\varphi - 1 < r <\varphi\, \text{ and } a >0.</math><ref>Template:Cite journal</ref>

When Template:Mvar the common ratio is chosen such that Template:Math it generates a right triangle that is always similar to the Kepler triangle.

Generalization to any polygonEdit

The triangle inequality can be extended by mathematical induction to arbitrary polygonal paths, showing that the total length of such a path is no less than the length of the straight line between its endpoints. Consequently, the length of any polygon side is always less than the sum of the other polygon side lengths.

Example of the generalized polygon inequality for a quadrilateralEdit

Consider a quadrilateral whose sides are in a geometric progression and let the sides be Template:Math. Then the generalized polygon inequality requires that

<math>\begin{array}{rcccl}
 0 &<& a &<& ar+ar^2+ar^3 \\
 0 &<& ar &<& a+ar^2+ar^3 \\
 0 &<& ar^2 &<& a+ar+ar^3 \\
 0 &<& ar^3 &<& a+ar+ar^2. 

\end{array}</math>

These inequalities for Template:Math reduce to the following

<math> r^3+r^2+r-1>0 </math>
<math> r^3-r^2-r-1<0. </math><ref>Template:Cite journal</ref>

The left-hand side polynomials of these two inequalities have roots that are the tribonacci constant and its reciprocal. Consequently, Template:Mvar is limited to the range Template:Math where Template:Mvar is the tribonacci constant.

Relationship with shortest pathsEdit

File:Arclength.svg
The arc length of a curve is defined as the least upper bound of the lengths of polygonal approximations.

This generalization can be used to prove that the shortest curve between two points in Euclidean geometry is a straight line.

No polygonal path between two points is shorter than the line between them. This implies that no curve can have an arc length less than the distance between its endpoints. By definition, the arc length of a curve is the least upper bound of the lengths of all polygonal approximations of the curve. The result for polygonal paths shows that the straight line between the endpoints is the shortest of all the polygonal approximations. Because the arc length of the curve is greater than or equal to the length of every polygonal approximation, the curve itself cannot be shorter than the straight line path.<ref>Template:Cite book p. 95.</ref>

ConverseEdit

The converse of the triangle inequality theorem is also true: if three real numbers are such that each is less than the sum of the others, then there exists a triangle with these numbers as its side lengths and with positive area; and if one number equals the sum of the other two, there exists a degenerate triangle (that is, with zero area) with these numbers as its side lengths.

In either case, if the side lengths are Template:Mvar, Template:Mvar, Template:Mvar we can attempt to place a triangle in the Euclidean plane as shown in the diagram. We need to prove that there exists a real number Template:Mvar consistent with the values Template:Mvar, Template:Mvar, and Template:Mvar, in which case this triangle exists.

By the Pythagorean theorem we have Template:Math and Template:Math according to the figure at the right. Subtracting these yields Template:Math. This equation allows us to express Template:Mvar in terms of the sides of the triangle:

<math>d=\frac{-a^2+b^2+c^2}{2c}.</math>

For the height of the triangle we have that Template:Math. By replacing Template:Mvar with the formula given above, we have

<math>h^2 = b^2-\left(\frac{-a^2+b^2+c^2}{2c}\right)^2.</math>

For a real number Template:Mvar to satisfy this, Template:Math must be non-negative:

<math>\begin{align}
 0 &\le b^2-\left(\frac{-a^2+b^2+c^2}{2c}\right)^2 \\[4pt]
 0 &\le \left(b- \frac{-a^2+b^2+c^2}{2c}\right) \left(b + \frac{-a^2+b^2+c^2}{2c}\right) \\[4pt]
 0 &\le \left(a^2-(b-c)^2)((b+c)^2-a^2 \right) \\[6pt]
 0 &\le (a+b-c)(a-b+c)(b+c+a)(b+c-a) \\[6pt]
 0 &\le (a+b-c)(a+c-b)(b+c-a)

\end{align}</math> which holds if the triangle inequality is satisfied for all sides. Therefore, there does exist a real number <math>h</math> consistent with the sides <math>a, b, c</math>, and the triangle exists. If each triangle inequality holds strictly, <math>h > 0</math> and the triangle is non-degenerate (has positive area); but if one of the inequalities holds with equality, so <math>h = 0</math>, the triangle is degenerate.

Generalization to higher dimensionsEdit

{{ safesubst:#invoke:Unsubst||date=__DATE__ |$B= {{ safesubst:#invoke:Unsubst||date=__DATE__ |$B= Template:Ambox }} }}

Template:See also

The area of a triangular face of a tetrahedron is less than or equal to the sum of the areas of the other three triangular faces. More generally, in Euclidean space the hypervolume of an Template:Math-facet of an Template:Mvar-simplex is less than or equal to the sum of the hypervolumes of the other Template:Mvar facets.

Much as the triangle inequality generalizes to a polygon inequality, the inequality for a simplex of any dimension generalizes to a polytope of any dimension: the hypervolume of any facet of a polytope is less than or equal to the sum of the hypervolumes of the remaining facets.

In some cases the tetrahedral inequality is stronger than several applications of the triangle inequality. For example, the triangle inequality appears to allow the possibility of four points Template:Mvar, Template:Mvar, Template:Mvar, and Template:Mvar in Euclidean space such that distances

Template:Math

and

Template:Math.

However, points with such distances cannot exist: the area of the Template:Math equilateral triangle Template:Math is <math display=inline>169\sqrt 3</math>, which is larger than three times <math display=inline>39\sqrt 3</math>, the area of a Template:Math isosceles triangle (all by Heron's formula), and so the arrangement is forbidden by the tetrahedral inequality.

Normed vector spaceEdit

File:Vector-triangle-inequality.svg
Triangle inequality for norms of vectors.

In a normed vector space Template:Mvar, one of the defining properties of the norm is the triangle inequality:

<math> \|\mathbf u + \mathbf v\| \leq \|\mathbf u\| + \|\mathbf v\| \quad \forall \, \mathbf u, \mathbf v \in V</math>

That is, the norm of the sum of two vectors is at most as large as the sum of the norms of the two vectors. This is also referred to as subadditivity. For any proposed function to behave as a norm, it must satisfy this requirement.<ref name=Kress> Template:Cite book</ref>

If the normed space is Euclidean, or, more generally, strictly convex, then <math>\|\mathbf u+\mathbf v\|=\|\mathbf u\|+\|\mathbf v\|</math> if and only if the triangle formed by Template:Math, Template:Math, and Template:Math, is degenerate, that is, Template:Math and Template:Math are on the same ray, i.e., Template:Math or Template:Math, or Template:Math for some Template:Math. This property characterizes strictly convex normed spaces such as the Template:Math spaces with Template:Math. However, there are normed spaces in which this is not true. For instance, consider the plane with the Template:Math norm (the Manhattan distance) and denote Template:Math and Template:Math. Then the triangle formed by Template:Math, Template:Math, and Template:Math, is non-degenerate but

<math>\|\mathbf u+\mathbf v\|=\|(1,1)\|=|1|+|1|=2=\|\mathbf u\|+\|\mathbf v\|.</math>

Example normsEdit

The absolute value is a norm for the real line; as required, the absolute value satisfies the triangle inequality for any real numbers Template:Mvar and Template:Mvar. If Template:Mvar and Template:Mvar have the same sign or either of them is zero, then <math>|u + v| = |u|+|v|.</math> If Template:Mvar and Template:Mvar have opposite signs, then without loss of generality assume <math>|u| > |v|.</math> Then Template:Nobr

<math display="block">|u + v| \leq |u|+|v|.</math>

The triangle inequality is useful in mathematical analysis for determining the best upper estimate on the size of the sum of two numbers, in terms of the sizes of the individual numbers. There is also a lower estimate, which can be found using the reverse triangle inequality which states that for any real numbers Template:Mvar and Template:Mvar, <math>|u-v| \geq \bigl||u|-|v|\bigr|.</math>

The taxicab norm or 1-norm is one generalization absolute value to higher dimensions. To find the norm of a vector <math>v = (v_1, v_2, \ldots v_n ),</math> just add the absolute value of each component separately, <math display="block">\|v\|_1 = |v_1| + |v_2| + \dotsb + |v_n|.</math>

The Euclidean norm or 2-norm defines the length of translation vectors in an Template:Mvar-dimensional Euclidean space in terms of a Cartesian coordinate system. For a vector <math>v = (v_1, v_2, \ldots v_n ),</math> its length is defined using the Template:Mvar-dimensional Pythagorean theorem: <math display="block">\|v\|_2 = \sqrt{|v_1|^2 + |v_2|^2 + \dotsb + |v_n|^2}.</math>

The inner product is norm in any inner product space, a generalization of Euclidean vector spaces including infinite-dimensional examples. The triangle inequality follows from the Cauchy–Schwarz inequality as follows: Given vectors <math>u</math> and <math>v</math>, and denoting the inner product as <math>\langle u , v\rangle </math>:<ref name= Stillwell>Template:Cite book</ref>

u + v\|^2</math> <math>= \langle u + v, u + v \rangle</math>
u\|^2 + \langle u, v \rangle + \langle v, u \rangle + \|v\|^2</math>
u\|^2 + 2|\langle u, v \rangle| + \|v\|^2</math>
u\|^2 + 2\|u\|\|v\| + \|v\|^2</math> (by the Cauchy–Schwarz inequality)
u\| + \|v\|\right)^2</math>.

The Cauchy–Schwarz inequality turns into an equality if and only if Template:Mvar and Template:Mvar are linearly dependent. The inequality <math>\langle u, v \rangle + \langle v, u \rangle \le 2\left|\left\langle u, v \right\rangle\right| </math> turns into an equality for linearly dependent <math>u</math> and <math>v</math> if and only if one of the vectors Template:Mvar or Template:Mvar is a nonnegative scalar of the other. Taking the square root of the final result gives the triangle inequality.

The [[p-norm|Template:Mvar-norm]] is a generalization of taxicab and Euclidean norms, using an arbitrary positive integer exponent, <math display="block">\|v\|_p = \bigl(|v_1|^p + |v_2|^p + \dotsb + |v_n|^p\bigr)^{1/p}, </math> where the Template:Math are the components of vector Template:Mvar.

Except for the case Template:Math, the Template:Mvar-norm is not an inner product norm, because it does not satisfy the parallelogram law. The triangle inequality for general values of Template:Mvar is called Minkowski's inequality.<ref name=Saxe>Template:Cite book</ref> It takes the form:<math display="block">\|u+v\|_p \le \|u\|_p + \|v\|_p \ .</math>

Metric spaceEdit

In a metric space Template:Mvar with metric Template:Mvar, the triangle inequality is a requirement upon distance:

<math>d(A,\ C) \le d(A,\ B) + d(B,\ C) \ , </math>

for all points Template:Mvar, Template:Mvar, and Template:Mvar in Template:Mvar. That is, the distance from Template:Mvar to Template:Mvar is at most as large as the sum of the distance from Template:Mvar to Template:Mvar and the distance from Template:Mvar to Template:Mvar.

The triangle inequality is responsible for most of the interesting structure on a metric space, namely, convergence. This is because the remaining requirements for a metric are rather simplistic in comparison. For example, the fact that any convergent sequence in a metric space is a Cauchy sequence is a direct consequence of the triangle inequality, because if we choose any Template:Math and Template:Math such that Template:Math and Template:Math, where Template:Math is given and arbitrary (as in the definition of a limit in a metric space), then by the triangle inequality, Template:Math, so that the sequence Template:Math is a Cauchy sequence, by definition.

This version of the triangle inequality reduces to the one stated above in case of normed vector spaces where a metric is induced via Template:Math, with Template:Math being the vector pointing from point Template:Mvar to Template:Mvar.

Reverse triangle inequalityEdit

The reverse triangle inequality is an equivalent alternative formulation of the triangle inequality that gives lower bounds instead of upper bounds. For plane geometry, the statement is:<ref name=inequality> Template:Cite book </ref>

Any side of a triangle is greater than or equal to the difference between the other two sides.

In the case of a normed vector space, the statement is:

<math>\big|\|u\|-\|v\|\big| \leq \|u-v\|,</math>

or for metric spaces, <math>|d(A, C) - d(B, C)| \leq d(A, B)</math>. This implies that the norm <math>\|\cdot\|</math> as well as the distance-from-<math>z</math> function <math>d(z ,\cdot)</math> are Lipschitz continuous with Lipschitz constant Template:Math, and therefore are in particular uniformly continuous.

The proof of the reverse triangle inequality from the usual one uses <math> \|v-u\| = \|{-}1(u-v)\| = |{-}1|\cdot\|u-v\| = \|u-v\| </math> to find:

<math> \|u\| = \|(u-v) + v\| \leq \|u-v\| + \|v\| \Rightarrow \|u\| - \|v\| \leq \|u-v\|, </math>
<math> \|v\| = \|(v-u) + u\| \leq \|v-u\| + \|u\| \Rightarrow \|u\| - \|v\| \geq -\|u-v\|, </math>

Combining these two statements gives:

<math> -\|u-v\| \leq \|u\|-\|v\| \leq \|u-v\| \Rightarrow \big|\|u\|-\|v\|\big| \leq \|u-v\|.</math>

In the converse, the proof of the triangle inequality from the reverse triangle inequality works in two cases:

If <math>\|u +v\| - \|u\| \geq 0,</math> then by the reverse triangle inequality, <math>\|u +v\| - \|u\| = {\big|}\|u + v\|-\|u\|{\big|} \leq \|(u + v) - u\| = \|v\| \Rightarrow \|u + v\| \leq \|u\| + \|v\|</math>,

and if <math>\|u +v\| - \|u\| < 0,</math> then trivially <math>\|u\| +\|v\| \geq \|u\| > \|u + v\|</math> by the nonnegativity of the norm.

Thus, in both cases, we find that <math>\|u\| + \|v\| \geq \|u + v\|</math>.

For metric spaces, the proof of the reverse triangle inequality is found similarly by:

<math>d(A, B) + d(B, C) \geq d(A, C) \Rightarrow d(A, B) \geq d(A, C) - d(B, C)</math>

<math>d(C, A) + d(A, B) \geq d(C, B) \Rightarrow d(A, B) \geq d(B, C) - d(A, C)</math>

Putting these equations together we find:

<math>d(A, B) \geq |d(A, C) - d(B, C)|</math>

And in the converse, beginning from the reverse triangle inequality, we can again use two cases:

If <math>d(A, C) - d(B, C) \geq 0</math>, then <math>d(A, B) \geq |d(A, C) - d(B, C)| = d(A, C) - d(B, C) \Rightarrow d(A, B) + d(B, C) \geq d(A, C)</math>,

and if <math>d(A, C) - d(B, C) < 0,</math> then <math>d(A, B) + d(B, C) \geq d(B, C) > d(A, C)</math> again by the nonnegativity of the metric.

Thus, in both cases, we find that <math>d(A, B) + d(B, C) \geq d(A, C)</math>.

Triangle inequality for cosine similarityEdit

Template:Further By applying the cosine function to the triangle inequality and reverse triangle inequality for arc lengths and employing the angle addition and subtraction formulas for cosines, it follows immediately that<ref>Template:Cite conference</ref>

<math display="block">\operatorname{sim}(u,w) \geq \operatorname{sim}(u,v) \cdot \operatorname{sim}(v,w) - \sqrt{\left(1-\operatorname{sim}(u,v)^2\right)\cdot\left(1-\operatorname{sim}(v,w)^2\right)}</math>

and

<math display="block">\operatorname{sim}(u,w) \leq \operatorname{sim}(u,v) \cdot \operatorname{sim}(v,w) + \sqrt{\left(1-\operatorname{sim}(u,v)^2\right)\cdot\left(1-\operatorname{sim}(v,w)^2\right)}\,.</math>

With these formulas, one needs to compute a square root for each triple of vectors Template:Math that is examined rather than Template:Math for each pair of vectors Template:Math examined, and could be a performance improvement when the number of triples examined is less than the number of pairs examined.

Reversal in Minkowski spaceEdit

The Minkowski space metric <math> \eta_{\mu \nu} </math> is not positive-definite, which means that <math> \|u\|^2 = \eta_{\mu \nu} u^\mu u^\nu</math> can have either sign or vanish, even if the vector Template:Mvar is non-zero. Moreover, if Template:Mvar and Template:Mvar are both timelike vectors lying in the future light cone, the triangle inequality is reversed:

<math> \|u+v\| \geq \|u\| + \|v\|. </math>

A physical example of this inequality is the twin paradox in special relativity. The same reversed form of the inequality holds if both vectors lie in the past light cone, and if one or both are null vectors. The result holds in <math>n + 1</math> dimensions for any <math>n \geq 1</math>. If the plane defined by <math>u</math> and <math>v</math> is space-like (and therefore a Euclidean subspace) then the usual triangle inequality holds.

See alsoEdit

NotesEdit

Template:Reflist

ReferencesEdit