Triangle inequality

{{Short description|Property of geometry, also used to generalize the notion of "distance" in metric spaces}}

{{about|the basic inequality c\le a+b|other inequalities associated with triangles|List of triangle inequalities}}

File:TriangleInequality.svg

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.Wolfram MathWorld – http://mathworld.wolfram.com/TriangleInequality.html

{{cite book |title=An introduction to metric spaces and fixed point theory |author1=Mohamed A. Khamsi |author2=William A. Kirk |chapter-url=https://books.google.com/books?id=4qXbEpAK5eUC&pg=PA8 |chapter=§1.4 The triangle inequality in {{math|Rn}} |isbn=0-471-41825-0 |year=2001 |publisher=Wiley-IEEE}} 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.for instance, {{citation|first=Harold R.|last=Jacobs|title=Geometry|year=1974|publisher=W. H. Freeman & Co.|isbn=0-7167-0456-0|page=246}} If {{mvar|a}}, {{mvar|b}}, and {{mvar|c}} are the lengths of the sides of a triangle then the triangle inequality states that

:c \leq a + b ,

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):

:\|\mathbf u + \mathbf v\| \leq \|\mathbf u\| + \|\mathbf v\| ,

where the length of the third side has been replaced by the length of the vector sum {{math|u + v}}. When {{math|u}} and {{math|v}} are real numbers, they can be viewed as vectors in \R^1, 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 \R^2 or \R^3. 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 {{math|180°}} angle and two {{math|0°}} 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 {{math|{{closed-closed|0, π}}}}) with those endpoints.

{{cite book |title=Robotics: Science and Systems IV |author1=Oliver Brock |author2=Jeff Trinkle |author3=Fabio Ramos |url=https://books.google.com/books?id=fvCaQfBQ7qEC&pg=PA195 |page=195 |isbn=978-0-262-51309-8 |publisher=MIT Press |year=2009}}

{{cite book |title=Introduction to hyperbolic geometry |author1=Arlan Ramsay |author2=Robert D. Richtmyer |url=https://archive.org/details/introductiontohy0000rams |url-access=registration |page=[https://archive.org/details/introductiontohy0000rams/page/17 17] |isbn=0-387-94339-0 |year=1995 |publisher=Springer}}

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 ({{math|p ≥ 1}}), and inner product spaces.

Euclidean geometry

File:Euclid triangle inequality.svg

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. (trans. Joyce, see reference below)

Euclid proved the triangle inequality for distances in plane geometry using the construction in the figure.

{{cite book |page=201 |author=Harold R. Jacobs |title=Geometry: seeing, doing, understanding |url=https://books.google.com/books?id=XhQRgZRDDq0C&pg=PA201 |isbn=0-7167-4361-2 |edition=3rd |publisher=Macmillan |year=2003}}

Beginning with triangle {{mvar|ABC}}, an isosceles triangle is constructed with one side taken as {{mvar|{{overline|BC}}}} and the other equal leg {{mvar|{{overline|BD}}}} along the extension of side {{mvar|{{overline|AB}}}}. It then is argued that angle {{mvar|β}} has larger measure than angle {{mvar|α}}, so side {{mvar|{{overline|AD}}}} is longer than side {{mvar|{{overline|AC}}}}. However:

:\overline{AD} = \overline{AB} + \overline{BD} = \overline{AB} + \overline{BC},

so the sum of the lengths of sides {{mvar|{{overline|AB}}}} and {{mvar|{{overline|BC}}}} is larger than the length of {{mvar|{{overline|AC}}}}. This proof appears in Euclid's Elements, Book 1, Proposition 20.

{{cite web

| url = http://aleph0.clarku.edu/~djoyce/java/elements/bookI/propI20.html

| title = Euclid's elements, Book 1, Proposition 20

| author = David E. Joyce | author-link = David E. Joyce (mathematician)

| year = 1997

| work = Euclid's elements

| publisher = Dept. Math and Computer Science, Clark University

| access-date = 2010-06-25

}}

=Mathematical expression of the constraint on the sides of a triangle=

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

:a + b > c ,\quad b + c > a ,\quad c + a > b .

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

:|a - b| < c < a + b .

Another way to state it is

:\max(a, b, c) < a + b + c - \max(a, b, c)

implying

:2 \max(a, b, c) < a + b + c

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 {{math|a, b, c}} must be a real number greater than zero. Heron's formula for the area is

:

\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}

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 {{math|a, b, c}}, where {{math|abc}} and \phi is the golden ratio, as

:1<\frac{a+c}{b}<3

:1\le\min\left(\frac{a}{b}, \frac{b}{c}\right)<\phi.American Mathematical Monthly, pp. 49-50, 1954.

=Right triangle=

File:Isosceles triangle made of right triangles.svg

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.

{{cite book |title=Practical mathematics for home study: being the essentials of arithmetic, geometry, algebra and trigonometry |author=Claude Irwin Palmer |url=https://archive.org/details/practicalmathema00palmiala |page=[https://archive.org/details/practicalmathema00palmiala/page/422 422] |publisher=McGraw-Hill |year=1919}}

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 {{mvar|ADC}}. An isosceles triangle {{mvar|ABC}} is constructed with equal sides {{math|{{overline|AB}} {{=}} {{overline|AC}}}}. From the triangle postulate, the angles in the right triangle {{math|ADC}} satisfy:

: \alpha + \gamma = \pi /2 \ .

Likewise, in the isosceles triangle {{mvar|ABC}}, the angles satisfy:

:2\beta + \gamma = \pi \ .

Therefore,

: \alpha = \pi/2 - \gamma ,\ \mathrm{while} \ \beta= \pi/2 - \gamma /2 \ ,

and so, in particular,

:\alpha < \beta \ .

That means side {{mvar|AD}}, which is opposite to angle {{mvar|α}}, is shorter than side {{mvar|AB}}, which is opposite to the larger angle {{mvar|β}}. But {{math|{{overline|AB}} {{=}} {{overline|AC}}}}. Hence:

:\overline{AC} > \overline{AD} \ .

A similar construction shows {{math|{{overline|AC}} > {{overline|DC}}}}, establishing the theorem.

An alternative proof (also based upon the triangle postulate) proceeds by considering three positions for point {{mvar|B}}:

{{cite book |title=A primer for mathematics competitions |chapter-url=https://books.google.com/books?id=A21T73sqZ3AC&pg=PA30 |chapter=Lemma 1: In a right-angled triangle the hypotenuse is greater than either of the other two sides |author1=Alexander Zawaira |author2=Gavin Hitchcock |isbn=978-0-19-953988-8 |year=2009 |publisher=Oxford University Press}}

(i) as depicted (which is to be proved), or (ii) {{mvar|B}} coincident with {{mvar|D}} (which would mean the isosceles triangle had two right angles as base angles plus the vertex angle {{mvar|γ}}, which would violate the triangle postulate), or lastly, (iii) {{mvar|B}} interior to the right triangle between points {{mvar|A}} and {{mvar|D}} (in which case angle {{mvar|ABC}} is an exterior angle of a right triangle {{mvar|BDC}} and therefore larger than {{math|π/2}}, meaning the other base angle of the isosceles triangle also is greater than {{math|π/2}} and their sum exceeds {{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 use=

Consider a triangle whose sides are in an arithmetic progression and let the sides be {{math|a, a + d, a + 2d}}. Then the triangle inequality requires that

:\begin{array}{rcccl}

0 &<& a &<& 2a+3d, \\

0 &<& a+d &<& 2a+2d, \\

0 &<& a+2d &<& 2a+d.

\end{array}

To satisfy all these inequalities requires

: a>0 \text{ and } -\frac{a}{3}{{cite journal|title=input: solve 0 |last=Wolfram{{!}}Alpha|journal=Wolfram Research|url=http://www.wolframalpha.com/input/?i=solve%200%3Ca%3C2a%2B3d%2C%200%3Ca%2Bd%3C2a%2B2d%2C%200%3Ca%2B2d%3C2a%2Bd&t=ff3tb01|access-date=2010-09-07}}

When {{mvar|d}} is chosen such that {{math|d {{=}} a/3}}, it generates a right triangle that is always similar to the Pythagorean triple with sides {{math|3}}, {{math|4}}, {{math|5}}.

Now consider a triangle whose sides are in a geometric progression and let the sides be {{math|a, ar, ar2}}. Then the triangle inequality requires that

:\begin{array}{rcccl}

0 &<& a &<& ar+ar^2, \\

0 &<& ar &<& a+ar^2, \\

0 &<& \! ar^2 &<& a+ar.

\end{array}

The first inequality requires {{math|a > 0}}; consequently it can be divided through and eliminated. With {{math|a > 0}}, the middle inequality only requires {{math|r > 0}}. This now leaves the first and third inequalities needing to satisfy

:

\begin{align}

r^2+r-1 & {} >0 \\

r^2-r-1 & {} <0.

\end{align}

The first of these quadratic inequalities requires {{mvar|r}} to range in the region beyond the value of the positive root of the quadratic equation {{math|r2 + r − 1 {{=}} 0}}, i.e. {{math|r > φ − 1}} where {{mvar|φ}} is the golden ratio. The second quadratic inequality requires {{mvar|r}} to range between 0 and the positive root of the quadratic equation {{math|r2r − 1 {{=}} 0}}, i.e. {{math|0 < r < φ}}. The combined requirements result in {{mvar|r}} being confined to the range

:\varphi - 1 < r <\varphi\, \text{ and } a >0.{{cite journal|title=input: solve 02, 02, 02 |last=Wolfram{{!}}Alpha|journal=Wolfram Research|url=http://wolframalpha.com/input?i=solve+0%3Ca%3Car%2Bar^2%2C+0%3Car%3Ca%2Bar^2%2C+0%3Car^2%3Ca%2Bar|access-date=2010-09-07}}

When {{mvar|r}} the common ratio is chosen such that {{math|r {{=}} {{sqrt|φ}}}} it generates a right triangle that is always similar to the Kepler triangle.

=Generalization to any polygon=

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 quadrilateral==

Consider a quadrilateral whose sides are in a geometric progression and let the sides be {{math|a, ar, ar2, ar3}}. Then the generalized polygon inequality requires that

:\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}

These inequalities for {{math|a > 0}} reduce to the following

: r^3+r^2+r-1>0

: r^3-r^2-r-1<0. {{cite journal|title=input: solve 02+ar3, 032 |last=Wolfram{{!}}Alpha|journal=Wolfram Research|url=http://www.wolframalpha.com/input/?i=solve%20{0%3Ca%3Ca*r%2Ba*r^2%2Ba*r^3%2C%200%3Ca*r^3%3Ca%2Ba*r%2Ba*r^2}&t=ff3tb01|access-date=2012-07-29}}

The left-hand side polynomials of these two inequalities have roots that are the tribonacci constant and its reciprocal. Consequently, {{mvar|r}} is limited to the range {{math|1/t < r < t}} where {{mvar|t}} is the tribonacci constant.

==Relationship with shortest paths==

File:Arclength.svg

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.{{cite book|title=Numbers and Geometry|author=John Stillwell|author-link=John Stillwell|year=1997|publisher=Springer|isbn=978-0-387-98289-2|url=https://books.google.com/books?id=4elkHwVS0eUC&pg=PA95}} p. 95.

=Converse=

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 {{mvar|a}}, {{mvar|b}}, {{mvar|c}} 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 {{mvar|h}} consistent with the values {{mvar|a}}, {{mvar|b}}, and {{mvar|c}}, in which case this triangle exists.

Image:Triangle with notations 3.svg

By the Pythagorean theorem we have {{math|b{{sup|2}} {{=}} h{{sup|2}} + d{{sup|2}}}} and {{math|a{{sup|2}} {{=}} h{{sup|2}} + (cd){{sup|2}}}} according to the figure at the right. Subtracting these yields {{math|a{{sup|2}} − b{{sup|2}} {{=}} c{{sup|2}} − 2cd}}. This equation allows us to express {{mvar|d}} in terms of the sides of the triangle:

:d=\frac{-a^2+b^2+c^2}{2c}.

For the height of the triangle we have that {{math|h{{sup|2}} {{=}} b{{sup|2}} − d{{sup|2}}}}. By replacing {{mvar|d}} with the formula given above, we have

:h^2 = b^2-\left(\frac{-a^2+b^2+c^2}{2c}\right)^2.

For a real number {{mvar|h}} to satisfy this, {{math|h{{sup|2}}}} must be non-negative:

:\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}

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

=Generalization to higher dimensions=

{{unreferenced section|date=October 2021}}

{{see also|Distance geometry#Cayley–Menger determinants}}

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 {{math|(n − 1)}}-facet of an {{mvar|n}}-simplex is less than or equal to the sum of the hypervolumes of the other {{mvar|n}} 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 {{mvar|A}}, {{mvar|B}}, {{mvar|C}}, and {{mvar|Z}} in Euclidean space such that distances

:{{math|1=AB = BC = CA = 26}}

and

:{{math|1=AZ = BZ = CZ = 14}}.

However, points with such distances cannot exist: the area of the {{math|26–26–26}} equilateral triangle {{math|ABC}} is 169\sqrt 3, which is larger than three times 39\sqrt 3, the area of a {{math|26–14–14}} isosceles triangle (all by Heron's formula), and so the arrangement is forbidden by the tetrahedral inequality.

Normed vector space

File:Vector-triangle-inequality.svg

In a normed vector space {{mvar|V}}, one of the defining properties of the norm is the triangle inequality:

: \|\mathbf u + \mathbf v\| \leq \|\mathbf u\| + \|\mathbf v\| \quad \forall \, \mathbf u, \mathbf v \in V

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.

{{cite book |title=Numerical analysis |author=Rainer Kress |chapter=§3.1: Normed spaces |chapter-url=https://books.google.com/books?id=e7ZmHRIxum0C&pg=PA26 |page=26 |isbn=0-387-98408-9 |year=1988 |publisher=Springer}}

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

:\|\mathbf u+\mathbf v\|=\|(1,1)\|=|1|+|1|=2=\|\mathbf u\|+\|\mathbf v\|.

=Example norms=

The absolute value is a norm for the real line; as required, the absolute value satisfies the triangle inequality for any real numbers {{mvar|u}} and {{mvar|v}}. If {{mvar|u}} and {{mvar|v}} have the same sign or either of them is zero, then |u + v| = |u|+|v|. If {{mvar|u}} and {{mvar|v}} have opposite signs, then without loss of generality assume |u| > |v|. Then {{nobr||u + v| = |u| - |v| < |u| + |v|. Combining these cases:A proof not requiring separate cases is as follows: Any number is always less than or equal to its own absolute value, so -|u| \leq u \leq |u| and -|v| \leq v \leq |v|. Adding these inequalities together, -\bigl(|u| + |v|\bigr) \leq u+v \leq |u| + |v|, the sum has the form -a \leq b \leq a for a = |u| + |v| and b = u + v. But this always implies | b | \leq a, or, expanded, |u + v| \leq |u|+|v|. {{pb}} {{cite book |page=A10 |author=James Stewart |title=Essential Calculus |url=https://archive.org/details/studentsolutions0000stew |url-access=registration |isbn=978-0-495-10860-3 |publisher=Thomson Brooks/Cole |year=2008}}}}

|u + v| \leq |u|+|v|.

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 {{mvar|u}} and {{mvar|v}}, |u-v| \geq \bigl||u|-|v|\bigr|.

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

The Euclidean norm or 2-norm defines the length of translation vectors in an {{mvar|n}}-dimensional Euclidean space in terms of a Cartesian coordinate system. For a vector v = (v_1, v_2, \ldots v_n ), its length is defined using the {{mvar|n}}-dimensional Pythagorean theorem: \|v\|_2 = \sqrt

v_1|^2 + |v_2|^2 + \dotsb + |v_n|^2}.

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 u and v, and denoting the inner product as \langle u , v\rangle :{{cite book |title=The four pillars of geometry |author=John Stillwell |page=[https://archive.org/details/fourpillarsofgeo0000stil/page/80 80] |url=https://archive.org/details/fourpillarsofgeo0000stil |url-access=registration |isbn=0-387-25530-3 |year=2005 |publisher=Springer}}

:{|

|\|u + v\|^2

= \langle u + v, u + v \rangle
= \|u\|^2 + \langle u, v \rangle + \langle v, u \rangle + \|v\|^2
\le \|u\|^2 + 2|\langle u, v \rangle| + \|v\|^2
\le \|u\|^2 + 2\|u\|\|v\| + \|v\|^2 (by the Cauchy–Schwarz inequality)
= \left(\|u\| + \|v\|\right)^2.

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

The p-norm is a generalization of taxicab and Euclidean norms, using an arbitrary positive integer exponent, \|v\|_p = \bigl(|v_1|^p + |v_2|^p + \dotsb + |v_n|^p\bigr)^{1/p}, where the {{math|vi}} are the components of vector {{mvar|v}}.

Except for the case {{math|1=p = 2}}, the {{mvar|p}}-norm is not an inner product norm, because it does not satisfy the parallelogram law. The triangle inequality for general values of {{mvar|p}} is called Minkowski's inequality.{{cite book |title=Beginning functional analysis |author= Karen Saxe|author-link= Karen Saxe |url=https://books.google.com/books?id=0LeWJ74j8GQC&pg=PA61 |page=61 |isbn=0-387-95224-1 |publisher=Springer |year=2002}} It takes the form:\|u+v\|_p \le \|u\|_p + \|v\|_p \ .

Metric space

In a metric space {{mvar|M}} with metric {{mvar|d}}, the triangle inequality is a requirement upon distance:

:d(A,\ C) \le d(A,\ B) + d(B,\ C) \ ,

for all points {{mvar|A}}, {{mvar|B}}, and {{mvar|C}} in {{mvar|M}}. That is, the distance from {{mvar|A}} to {{mvar|C}} is at most as large as the sum of the distance from {{mvar|A}} to {{mvar|B}} and the distance from {{mvar|B}} to {{mvar|C}}.

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 {{math|xn}} and {{math|xm}} such that {{math|d(xn, x) < ε/2}} and {{math|d(xm, x) < ε/2}}, where {{math|ε > 0}} is given and arbitrary (as in the definition of a limit in a metric space), then by the triangle inequality, {{math|d(xn, xm) ≤ d(xn, x) + d(xm, x) < ε/2 + ε/2 {{=}} ε}}, so that the sequence {{math|{{mset|xn}}}} 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 {{math|d(u, v) ≔ ‖uv‖}}, with {{math|uv}} being the vector pointing from point {{mvar|v}} to {{mvar|u}}.

Reverse triangle inequality

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:

{{cite book |title=The popular educator; fourth volume |chapter-url=https://books.google.com/books?id=lTACAAAAQAAJ&pg=PA196 |page=196 |chapter=Exercise I. to proposition XIX |year=1854 |publisher=John Cassell |location=Ludgate Hill, London |author=Anonymous}}

: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:

: \big|\|u\|-\|v\|\big| \leq \|u-v\|,

or for metric spaces, |d(A, C) - d(B, C)| \leq d(A, B).

This implies that the norm \|\cdot\| as well as the distance-from-z function d(z ,\cdot) are Lipschitz continuous with Lipschitz constant {{math|1}}, and therefore are in particular uniformly continuous.

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

: \|u\| = \|(u-v) + v\| \leq \|u-v\| + \|v\| \Rightarrow \|u\| - \|v\| \leq \|u-v\|,

: \|v\| = \|(v-u) + u\| \leq \|v-u\| + \|u\| \Rightarrow \|u\| - \|v\| \geq -\|u-v\|,

Combining these two statements gives:

: -\|u-v\| \leq \|u\|-\|v\| \leq \|u-v\| \Rightarrow \big|\|u\|-\|v\|\big| \leq \|u-v\|.

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

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

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

Thus, in both cases, we find that \|u\| + \|v\| \geq \|u + v\|.

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

d(A, B) + d(B, C) \geq d(A, C) \Rightarrow d(A, B) \geq d(A, C) - d(B, C)

d(C, A) + d(A, B) \geq d(C, B) \Rightarrow d(A, B) \geq d(B, C) - d(A, C)

Putting these equations together we find:

d(A, B) \geq |d(A, C) - d(B, C)|

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

If d(A, C) - d(B, C) \geq 0, then 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),

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

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

Triangle inequality for cosine similarity

{{further|Cosine similarity}}

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{{cite conference |last=Schubert |first=Erich |title=A Triangle Inequality for Cosine Similarity |conference=International Conference on Similarity Search and Applications |date=2021 |location=Dortmund |doi=10.1007/978-3-030-89657-7_3 |publisher=Springer |arxiv=2107.04071 }}

\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)}

and

\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)}\,.

With these formulas, one needs to compute a square root for each triple of vectors {{math|{u, v, w}}} that is examined rather than {{math|arccos(sim(u,v))}} for each pair of vectors {{math|{u, v}}} examined, and could be a performance improvement when the number of triples examined is less than the number of pairs examined.

Reversal in Minkowski space

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

: \|u+v\| \geq \|u\| + \|v\|.

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 n + 1 dimensions for any n \geq 1. If the plane defined by u and v is space-like (and therefore a Euclidean subspace) then the usual triangle inequality holds.

See also

Notes

{{reflist|30em}}

References

  • {{Cite book|author-link = Daniel Pedoe|last=Pedoe|first=Daniel|title = Geometry: A comprehensive course|publisher=Dover|year=1988|isbn = 0-486-65812-0}}
  • {{Cite book | last1=Rudin | first1=Walter | author1-link=Walter Rudin | title=Principles of Mathematical Analysis | publisher=McGraw-Hill| location=New York | isbn=0-07-054235-X | year=1976 }}

{{DEFAULTSORT:Triangle Inequality}}

Category:Geometric inequalities

Category:Linear algebra

Category:Metric geometry

Category:Articles containing proofs

Category:Theorems in geometry