Difference between revisions of "Triangle Inequality"

From Department of Mathematics at UTSA
Jump to navigation Jump to search
 
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:
The triangle inequality is a very important geometric and algebraic property that we will use frequently in the future.
+
[[File:TriangleInequality.svg|thumb|Three examples of the triangle inequality for triangles with sides of lengths {{math|''x''}}, {{math|''y''}}, {{math|''z''}}. The top example shows a case where {{math|''z''}} is much less than the sum {{math|''x'' + ''y''}} of the other two sides,  and the bottom example shows a case where the side {{math|''z''}} is only slightly less than {{math|''x'' + ''y''}}.]]
  
<blockquote style="background: white; border: 1px solid black; padding: 0.5em;">
+
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. 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. If {{math|''x''}}, {{math|''y''}}, and {{math|''z''}} are the lengths of the sides of the triangle, with no side being greater than {{math|''z''}}, then the triangle inequality states that
'''Theorem 1 (Triangle Inequality):''' Let <math>a</math> and <math>b</math> be real numbers. Then <math>\mid a + b \mid \leq \mid a \mid + \mid b \mid</math>.
+
:<math>z \leq x + y ,</math>
</blockquote>
+
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 distances, and it is written using vectors and vector lengths (norms):
 +
:<math>\|\mathbf x + \mathbf y\| \leq \|\mathbf x\| + \|\mathbf y\| ,</math>
 +
where the length {{math|''z''}} of the third side has been replaced by the vector sum {{math|'''x''' + '''y'''}}. When {{math|'''x'''}} and {{math|'''y'''}} are real numbers, they can be viewed as vectors in {{math|'''R'''<sup>1</sup>}}, 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 proven without these theorems. The inequality can be viewed intuitively in either {{math|'''R'''<sup>2</sup>}} or {{math|'''R'''<sup>3</sup>}}. 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.
  
:*'''Proof of Theorem:''' For <math>a</math> and <math>b</math> as real numbers we have that <math>-\mid a \mid \leq a \leq \mid a \mid</math> and <math>-\mid b \mid \leq b \leq \mid b \mid</math>. If we add these inequalities together we get that <math>-\mid a \mid - \mid b \mid \leq a + b \leq \mid a \mid + \mid b \mid</math> or rather <math>-\left ( \mid a \mid + \mid b \mid \right ) \leq a + b \leq \left ( \mid a \mid + \mid b \mid \right )</math> which is equivalent to saying that <math>\mid a + b \mid \leq \mid a \mid + \mid b \mid</math>. <math>\blacksquare</math>
+
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 [0, ''π'']) with those endpoints.
  
 +
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 L<sup>p</sup> spaces ({{math|''p'' ≥ 1}}), and inner product spaces.
  
There are also some other important results similar to the triangle inequality that are important to mention.
+
==Euclidean geometry==
  
 +
[[File:Euclid triangle inequality.svg|thumb|Euclid's construction for proof of the triangle inequality for plane geometry.]]
  
<blockquote style="background: white; border: 1px solid black; padding: 0.5em;">
+
Euclid proved the triangle inequality for distances in plane geometry using the construction in the figure. Beginning with triangle {{math|''ABC''}}, an isosceles triangle is constructed with one side taken as <math>\overline{BC}</math> and the other equal leg <math>\overline{BD}</math> along the extension of side <math>\overline{AB}</math>. It then is argued that angle {{math|''β''}} has larger measure than angle {{math|''α''}}, so side <math>\overline{AD}</math> is longer than side <math>\overline{AC}</math>. But <math> AD = AB + BD = AB + BC </math>, so the sum of the lengths of sides <math>\overline{AB}</math> and <math>\overline{BC}</math> is larger than the length of <math>\overline{AC}</math>. This proof appears in Euclid's Elements, Book 1, Proposition 20.
'''Corollary 1:''' If <math>a</math> and <math>b</math> are real numbers then <math>\mid \mid a \mid - \mid b \mid \mid \leq \mid a - b \mid</math>.
 
</blockquote>
 
  
 +
===Mathematical expression of the constraint on the sides of a triangle===
  
:*'''Proof of Corollary 1:''' We first write <math>a = a - b + b</math> and therefore applying the triangle inequality we get that <math>\mid a \mid = \mid (a - b) + b \mid \leq \mid a - b \mid + \mid b \mid</math> and therefore <math>\mid a \mid \leq \mid a - b \mid + \mid b \mid</math>. Subtracting <math>\mid b \mid</math> from both sides we get that <math>\mid a \mid - \mid b \mid \leq \mid a - b \mid</math>.
+
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''}}, {{math|''b''}}, {{math|''c''}} 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 ''a'', ''b'', ''c'' must be a real number greater than zero. Heron's formula for the area is
  
:*Now we write <math>b = b - a + a</math> and therefore applying the triangle inequality we get that <math>\mid b \mid = \mid (b - a) + a \mid \leq \mid b - a \mid + \mid a \mid</math> and therefore <math>\mid b \mid \leq \mid b - a \mid + \mid a \mid</math> and subtracting <math>\mid a \mid</math> from both sides we get that <math>\mid b \mid - \mid a \mid \leq \mid b - a \mid</math> which is equivalent to <math>\mid a \mid - \mid b \mid \geq - \mid b - a \mid</math>.
+
:<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).
  
:*Therefore <math>\mid \mid a \mid - \mid b \mid \mid \leq \mid a + b \mid</math>. <math>\blacksquare</math>
+
The triangle inequality provides two more interesting constraints for triangles whose sides are ''a, b, c'', where ''a'' ≥ ''b'' ≥ ''c'' 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>
  
<blockquote style="background: white; border: 1px solid black; padding: 0.5em;">
+
===Right triangle===
'''Corollary 2:''' If <math>a</math> and <math>b</math> are real numbers then <math>\mid a - b \mid \leq \mid a \mid + \mid b \mid</math>.
 
</blockquote>
 
  
 +
[[File:Isosceles triangle made of right triangles.svg|thumb|Isosceles triangle with equal sides <math>\overline{AB} = \overline{AC}</math> divided into two right triangles by an altitude drawn from one of the two base angles.]]
  
:*'''Proof of Corollary 2:''' By the triangle inequality we get that <math>\mid a + b \mid \leq \mid a \mid + \mid b \mid</math> and so then <math>\mid a + (-b) \mid \leq \mid a \mid + \mid -b \mid = \mid a \mid + \mid b \mid</math>. Therefore <math>\mid a - b \mid \leq \mid a \mid + \mid b \mid</math>. <math>\blacksquare</math>
+
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.
 +
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 {{math|ADC}}. An isosceles triangle {{math|ABC}} is constructed with equal sides <math>\overline{AB} = \overline{AC}</math>. From the triangle postulate, the angles in the right triangle {{math|ADC}} satisfy:
 +
:<math> \alpha + \gamma = \pi /2 \ . </math>
 +
Likewise, in the isosceles triangle {{math|ABC}}, 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 {{math|AD}} opposite angle {{math|''α''}} is shorter than side {{math|AB}} opposite the larger angle {{math|''β''}}. But <math>\overline{AB} = \overline{AC}</math>. Hence:
 +
:<math>\overline{\mathrm{AC}} > \overline{\mathrm{AD}} \ . </math>
 +
A similar construction shows <math> \overline{AC} > \overline{DC}</math>, establishing the theorem.
  
 +
An alternative proof (also based upon the triangle postulate) proceeds by considering three positions for point {{math|B}}:
 +
(i) as depicted (which is to be proven), or (ii) {{math|B}} coincident with {{math|D}} (which would mean the isosceles triangle had two right angles as base angles plus the vertex angle {{math|''γ''}}, which would violate the triangle postulate), or lastly, (iii) {{math|B}} interior to the right triangle between points {{math|A}} and {{math|D}} (in which case angle {{math|ABC}} is an exterior angle of a right triangle {{math|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 {{math|''π''}} in violation of the triangle postulate).
  
<blockquote style="background: white; border: 1px solid black; padding: 0.5em;">
+
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.
'''Corollary 3:''' If <math>a_1, a_2, ..., a_n \in \mathbb{R}</math> then <math>\mid a_1 + a_2 + ... + a_n \mid \leq \mid a_1 \mid + \mid a_2 \mid + ... + \mid a_n \mid</math>.</blockquote>
 
  
 +
===Examples of use===
 +
Consider a triangle whose sides are in an arithmetic progression and let the sides be {{math|''a''}}, {{math|''a'' + ''d''}}, {{math|''a'' + 2''d''}}. Then the triangle inequality requires that
  
:*'''Proof of Corollary 3:''' We note that <math>\mid a_1 + a_2 + ... + a_n \mid = \mid a_1 + (a_2 + ... + a_n) \mid \leq \mid a_1 \mid + \mid a_2 + ... + a_{n} \mid</math> by the triangle inequality. Applying the triangle inequality multiple times we eventually get that <math>\mid a_1 + a_2 + ... + a_n \mid \leq \mid a_1 \mid + \mid a_2 \mid + ... + \mid a_n \mid</math>. <math>\blacksquare</math>
+
:<math> 0<a<2a+3d </math>
 +
:<math> 0<a+d<2a+2d </math>
 +
:<math> 0<a+2d<2a+d. </math>
  
 +
To satisfy all these inequalities requires
  
''A more formal proof of Corollary 3 can be carried out by Mathematical Induction.''
+
:<math> a>0 \text{ and } -\frac{a}{3}<d<a. </math>
  
 +
When {{math|''d''}} is chosen such that ''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''}}, {{math|''ar''}}, {{math|''ar''<sup>2</sup>}}. Then the triangle inequality requires that
 +
 +
:<math> 0<a<ar+ar^2 </math>
 +
:<math> 0<ar<a+ar^2 </math>
 +
:<math> 0<ar^2<a+ar. </math>
 +
 +
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
 +
 +
:<math>
 +
\begin{align}
 +
r^2+r-1 & {} >0 \\
 +
r^2-r-1 & {} <0.
 +
\end{align}
 +
</math>
 +
 +
The first of these quadratic inequalities requires {{math|''r''}} to range in the region beyond the value of the positive root of the quadratic equation ''r''<sup>2</sup> + ''r'' − 1 = 0, i.e. {{math|''r'' > ''φ'' − 1}}  where {{math|''φ''}} is the golden ratio. The second quadratic inequality requires {{math|''r''}} to range between 0 and the positive root of the quadratic equation
 +
''r''<sup>2</sup> − ''r'' − 1 = 0, i.e. {{math|0 < ''r'' < ''φ''}}. The combined requirements result in {{math|''r''}} being confined to the range
 +
:<math>\varphi - 1 < r <\varphi\, \text{ and } a >0.</math>
 +
 +
When {{math|''r''}} the common ratio is chosen such that <math> r = \sqrt{\phi}</math> 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''}}, {{math|''ar''}}, {{math|''ar''<sup>2</sup>}}, {{math|''ar''<sup>3</sup>}}. Then the generalized polygon inequality requires that
 +
 +
:<math> 0<a<ar+ar^2+ar^3 </math>
 +
:<math> 0<ar<a+ar^2+ar^3 </math>
 +
:<math> 0<ar^2<a+ar+ar^3 </math>
 +
:<math> 0<ar^3<a+ar+ar^2. </math>
 +
 +
These inequalities for {{math|''a'' > 0}} reduce to the following
 +
 +
:<math> r^3+r^2+r-1>0 </math>
 +
:<math> r^3-r^2-r-1<0. </math>
 +
The left-hand side polynomials of these two inequalities have roots that are the tribonacci constant and its reciprocal. Consequently, {{math|''r''}} is limited to the range {{math|1/''t'' < ''r'' < ''t''}} where {{math|''t''}} is the tribonacci constant.
 +
 +
====Relationship with shortest paths====
 +
[[File:Arclength.svg|300px|thumb|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.
 +
 +
===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 ''a, b, 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 ''h'' consistent with the values ''a, b,'' and ''c'', in which case this triangle exists.
 +
 +
[[Image:Triangle with notations 3.svg|thumb|270px|Triangle with altitude {{math|''h''}} cutting base {{math|''c''}} into {{math|''d'' + (''c'' − ''d'')}}.]]
 +
 +
By the Pythagorean theorem we have <math> b^2 = h^2 + d^2 </math> and <math> a^2 = h^2 + (c - d)^2 </math> according to the figure at the right. Subtracting these yields <math> a^2 - b^2 = c^2 - 2cd </math>. This equation allows us to express {{math|''d''}} 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 <math> h^2 = b^2 - d^2 </math>. By replacing {{math|''d''}} 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 ''h'' to satisfy this, <math>h^2</math> must be non-negative:
 +
:<math>b^2-\left (\frac{-a^2+b^2+c^2}{2c}\right) ^2 \ge 0,</math>
 +
:<math>\left( b- \frac{-a^2+b^2+c^2}{2c}\right) \left( b+ \frac{-a^2+b^2+c^2}{2c}\right) \ge 0,</math>
 +
:<math>\left(a^2-(b-c)^2)((b+c)^2-a^2 \right) \ge 0,</math>
 +
:<math>(a+b-c)(a-b+c)(b+c+a)(b+c-a) \ge 0,</math>
 +
:<math>(a+b-c)(a+c-b)(b+c-a) \ge 0,</math>
 +
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===
 +
 +
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 {{math|''n''}}-simplex is less than or equal to the sum of the hypervolumes of the other {{math|''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'' = 7}}
 +
and
 +
:{{math|1=''AZ'' = ''BZ'' = ''CZ'' = 4}}.
 +
However, points with such distances cannot exist: the area of the 7-7-7 equilateral triangle {{math|''ABC''}} would be approximately 21.22, which is larger than three times the area of a 7-4-4 isosceles triangle (approximately 6.78 each, by Heron's formula), and so the arrangement is forbidden by the tetrahedral inequality.
 +
 +
==Normed vector space==
 +
[[File:Vector-triangle-inequality.svg|thumb|300px|Triangle inequality for norms of vectors.]]
 +
In a normed vector space {{math|''V''}}, one of the defining properties of the norm is the triangle inequality:
 +
 +
:<math> \|x + y\| \leq \|x\| + \|y\| \quad \forall \, x, y \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.
 +
If the normed space is euclidean, or, more generally, strictly convex, then <math>\|x+y\|=\|x\|+\|y\|</math> if and
 +
only if the triangle formed by {{math|''x''}}, {{math|''y''}}, and {{math|''x'' + ''y''}}, is degenerate, that is,
 +
{{math|''x''}} and {{math|''y''}} are on the same ray, i.e., ''x'' = 0 or ''y'' = 0, or
 +
''x'' = ''α y'' for some {{math|''α'' > 0}}. This property characterizes strictly convex normed spaces such as
 +
the {{math|''ℓ<sub>p</sub>''}} spaces with {{math|1 < ''p'' < ∞}}. However, there are normed spaces in which this is
 +
not true. For instance, consider the plane with the {{math|''ℓ''<sub>1</sub>}} norm (the Manhattan distance) and
 +
denote ''x'' = (1, 0) and ''y'' = (0, 1). Then the triangle formed by
 +
{{math|''x''}}, {{math|''y''}}, and {{math|''x'' + ''y''}}, is non-degenerate but
 +
 +
:<math>\|x+y\|=\|(1,1)\|=|1|+|1|=2=\|x\|+\|y\|.</math>
 +
 +
===Example norms===
 +
*''Absolute value as norm for the real line.'' To be a norm, the triangle inequality requires that the absolute value satisfy for any real numbers {{math|''x''}} and {{math|''y''}}: <math display="block">|x + y| \leq |x|+|y|,</math> which it does.
 +
 +
Proof:
 +
 +
:<math>-\left\vert x \right\vert \leq x \leq \left\vert x \right\vert</math>
 +
:<math>-\left\vert y \right\vert \leq y \leq \left\vert y \right\vert</math>
 +
After adding,
 +
:<math>-( \left\vert x \right\vert + \left\vert y \right\vert ) \leq x+y \leq \left\vert x \right\vert + \left\vert y \right\vert</math>
 +
Use the fact that <math>\left\vert b \right\vert \leq a \Leftrightarrow -a \leq b \leq a</math>
 +
(with ''b'' replaced by ''x''+''y'' and ''a'' by <math>\left\vert x \right\vert + \left\vert y \right\vert</math>), we have
 +
 +
:<math>|x + y| \leq |x|+|y|</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 {{math|''x''}} and {{math|''y''}}:
 +
 +
:<math>|x-y| \geq \biggl||x|-|y|\biggr|.</math>
 +
 +
*''Inner product as norm in an inner product space.'' If the norm arises from an inner product (as is the case for Euclidean spaces), then the triangle inequality follows from the Cauchy–Schwarz inequality as follows: Given vectors <math>x</math> and <math>y</math>, and denoting the inner product as <math>\langle x , y\rangle </math>:
 +
:{|
 +
|<math>\|x + y\|^2</math> || <math>= \langle x + y, x + y \rangle</math>
 +
|-
 +
| || <math>= \|x\|^2 + \langle x, y \rangle + \langle y, x \rangle + \|y\|^2</math>
 +
|-
 +
| || <math>\le \|x\|^2 + 2|\langle x, y \rangle| + \|y\|^2</math>
 +
|-
 +
| || <math>\le \|x\|^2 + 2\|x\|\|y\| + \|y\|^2</math> (by the Cauchy–Schwarz inequality)
 +
|-
 +
| || <math>=  \left(\|x\| + \|y\|\right)^2</math>.
 +
|}
 +
 +
The Cauchy–Schwarz inequality turns into an equality if and only if {{math|''x''}} and {{math|''y''}}
 +
are linearly dependent. The inequality
 +
<math>\langle x, y \rangle + \langle y, x \rangle \le 2\left|\left\langle x, y \right\rangle\right| </math>
 +
turns into an equality for linearly dependent <math>x</math> and  <math>y</math>
 +
if and only if one of the vectors {{math|''x''}} or {{math|''y''}} is a ''nonnegative'' scalar of the other.
 +
 +
:Taking the square root of the final result gives the triangle inequality.
 +
*{{math|''p''}}-norm: a commonly used norm is the ''p''-norm: <math display="block">\|x\|_p = \left( \sum_{i=1}^n |x_i|^p \right) ^{1/p} \ , </math> where the {{math|''x<sub>i</sub>''}} are the components of vector {{math|''x''}}. For {{math|1=''p'' = 2}} the {{math|''p''}}-norm becomes the ''Euclidean norm'': <math display="block">\|x\|_2 = \left( \sum_{i=1}^n |x_i|^2 \right) ^{1/2} = \left( \sum_{i=1}^n x_{i}^2 \right) ^{1/2} \ , </math> which is Pythagoras' theorem in {{math|''n''}}-dimensions, a very special case corresponding to an inner product norm. Except for the case {{math|1=''p'' = 2}}, the {{math|''p''}}-norm is ''not'' an inner product norm, because it does not satisfy the parallelogram law. The triangle inequality for general values of {{math|''p''}} is called Minkowski's inequality. It takes the form:<math display="block">\|x+y\|_p \le \|x\|_p + \|y\|_p \ .</math>
 +
 +
==Metric space==
 +
In a metric space {{math|''M''}} with metric {{math|''d''}}, the triangle inequality is a requirement upon distance:
 +
:<math>d(x,\ z) \le d(x,\ y) + d(y,\ z) \ , </math>
 +
 +
for all {{math|''x''}}, {{math|''y''}}, {{math|''z''}} in {{math|''M''}}. That is, the distance from {{math|''x''}} to {{math|''z''}} is at most as large as the sum of the distance from {{math|''x''}} to {{math|''y''}} and the distance from {{math|''y''}} to {{math|''z''}}.
 +
 +
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|''x<sub>n</sub>''}} and {{math|''x<sub>m</sub>''}} such that {{math|''d''(''x<sub>n</sub>'', ''x'') < ''ε''/2}} and {{math|''d''(''x<sub>m</sub>'', ''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(x_n, x_m) \leq d(x_n, x) + d(x_m, x) < \epsilon /2 +  \epsilon /2 = \epsilon </math>, so that the sequence {{math|{''x<sub>n</sub>''}}} 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''(''x'', ''y'') ≔ ‖''x'' − ''y''‖}}, with {{math|''x'' − ''y''}} being the vector pointing from point {{math|''y''}} to {{math|''x''}}.
 +
 +
==Reverse triangle inequality==
 +
The '''reverse triangle inequality''' is an elementary consequence of the triangle inequality that gives lower bounds instead of upper bounds. For plane geometry, the statement is:
 +
 +
:''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>\bigg|\|x\|-\|y\|\bigg| \leq \|x-y\|,</math>
 +
or for metric spaces, {{math|{{!}}''d''(''y'', ''x'') − ''d''(''x'', ''z''){{!}} ≤ ''d''(''y'', ''z'')}}.
 +
This implies that the norm <math>\|\cdot\|</math> as well as the distance function <math>d(x,\cdot)</math> are Lipschitz continuous with Lipschitz constant {{math|1}}, and therefore are in particular uniformly continuous.
 +
 +
The proof for the reverse triangle uses the regular triangle inequality, and <math> \|y-x\| = \|{-}1(x-y)\| = |{-}1|\cdot\|x-y\| = \|x-y\| </math>:
 +
: <math> \|x\| = \|(x-y) + y\| \leq \|x-y\| + \|y\| \Rightarrow \|x\| - \|y\| \leq \|x-y\|, </math>
 +
: <math> \|y\| = \|(y-x) + x\| \leq \|y-x\| + \|x\| \Rightarrow \|x\| - \|y\| \geq -\|x-y\|, </math>
 +
 +
Combining these two statements gives:
 +
: <math> -\|x-y\| \leq \|x\|-\|y\| \leq \|x-y\| \Rightarrow \bigg|\|x\|-\|y\|\bigg| \leq \|x-y\|.</math>
 +
 +
==Triangle inequality for 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
 +
 +
<math display="block">\operatorname{sim}(x,z) \geq \operatorname{sim}(x,y) \cdot \operatorname{sim}(y,z) - \sqrt{\left(1-\operatorname{sim}(x,y)^2\right)\cdot\left(1-\operatorname{sim}(y,z)^2\right)}</math>
 +
 +
and
 +
 +
<math display="block">\operatorname{sim}(x,z) \leq \operatorname{sim}(x,y) \cdot \operatorname{sim}(y,z) + \sqrt{\left(1-\operatorname{sim}(x,y)^2\right)\cdot\left(1-\operatorname{sim}(y,z)^2\right)}\,.</math>
 +
 +
With these formulas, one needs to compute a square root for each triple of vectors {{math|{''x'', ''y'', ''z''}}} that is examined rather than {{math|arccos(sim(''x'',''y''))}} for each pair of vectors {{math|{''x'', ''y''}}} 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 <math> \eta_{\mu \nu} </math> is not positive-definite, which means that <math> \|x\|^2 = \eta_{\mu \nu} x^\mu x^\nu</math> can have either sign or vanish, even if the vector ''x'' is non-zero. Moreover, if ''x'' and ''y'' are both timelike vectors lying in the future light cone, the triangle inequality is reversed:
 +
 +
: <math> \|x+y\| \geq \|x\| + \|y\|. </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 ''n'' + 1 dimensions for any ''n'' ≥ 1.  If the plane defined by ''x'' and ''y'' is spacelike (and therefore a Euclidean subspace) then the usual triangle inequality holds.
  
 
== Licensing ==  
 
== Licensing ==  
 
Content obtained and/or adapted from:
 
Content obtained and/or adapted from:
* [http://mathonline.wikidot.com/the-triangle-inequality The Triangle Inequality, mathonline.wikidot.com] under a CC BY-SA license
+
* [https://en.wikipedia.org/wiki/Triangle_inequality Triangle inequality, Wikipedia] under a CC BY-SA license

Latest revision as of 16:35, 13 February 2022

Three examples of the triangle inequality for triangles with sides of lengths x, y, z. The top example shows a case where z is much less than the sum x + y of the other two sides, and the bottom example shows a case where the side z is only slightly less than x + y.

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. 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. If x, y, and z are the lengths of the sides of the triangle, with no side being greater than z, then the triangle inequality states that

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 distances, and it is written using vectors and vector lengths (norms):

where the length z of the third side has been replaced by the vector sum x + y. When x and y are real numbers, they can be viewed as vectors in R1, 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 proven without these theorems. The inequality can be viewed intuitively in either R2 or R3. 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 180° angle and two 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 [0, π]) with those endpoints.

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

Euclidean geometry

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

Euclid proved the triangle inequality for distances in plane geometry using the construction in the figure. Beginning with triangle ABC, an isosceles triangle is constructed with one side taken as and the other equal leg along the extension of side . It then is argued that angle β has larger measure than angle α, so side is longer than side . But , so the sum of the lengths of sides and is larger than the length of . This proof appears in Euclid's Elements, Book 1, Proposition 20.

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 a, b, c that are all positive and excludes the degenerate case of zero area):

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

Another way to state it is

implying

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

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

Right triangle

Isosceles triangle with equal sides 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. 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 ADC. An isosceles triangle ABC is constructed with equal sides . From the triangle postulate, the angles in the right triangle ADC satisfy:

Likewise, in the isosceles triangle ABC, the angles satisfy:

Therefore,

and so, in particular,

That means side AD opposite angle α is shorter than side AB opposite the larger angle β. But . Hence:

A similar construction shows , establishing the theorem.

An alternative proof (also based upon the triangle postulate) proceeds by considering three positions for point B: (i) as depicted (which is to be proven), or (ii) B coincident with D (which would mean the isosceles triangle had two right angles as base angles plus the vertex angle γ, which would violate the triangle postulate), or lastly, (iii) B interior to the right triangle between points A and D (in which case angle ABC is an exterior angle of a right triangle BDC and therefore larger than π/2, meaning the other base angle of the isosceles triangle also is greater than π/2 and their sum exceeds π 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 a, a + d, a + 2d. Then the triangle inequality requires that

To satisfy all these inequalities requires

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

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

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

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

When r the common ratio is chosen such that 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 a, ar, ar2, ar3. Then the generalized polygon inequality requires that

These inequalities for a > 0 reduce to the following

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

Relationship with shortest paths

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.

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

Triangle with altitude h cutting base c into d + (cd).

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

For the height of the triangle we have that . By replacing d with the formula given above, we have

For a real number h to satisfy this, must be non-negative:

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

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

AB = BC = CA = 7

and

AZ = BZ = CZ = 4.

However, points with such distances cannot exist: the area of the 7-7-7 equilateral triangle ABC would be approximately 21.22, which is larger than three times the area of a 7-4-4 isosceles triangle (approximately 6.78 each, by Heron's formula), and so the arrangement is forbidden by the tetrahedral inequality.

Normed vector space

Triangle inequality for norms of vectors.

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

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

Example norms

  • Absolute value as norm for the real line. To be a norm, the triangle inequality requires that the absolute value satisfy for any real numbers x and y:
    which it does.

Proof:

After adding,

Use the fact that (with b replaced by x+y and a by ), we have

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 x and y:

  • Inner product as norm in an inner product space. If the norm arises from an inner product (as is the case for Euclidean spaces), then the triangle inequality follows from the Cauchy–Schwarz inequality as follows: Given vectors and , and denoting the inner product as :
(by the Cauchy–Schwarz inequality)
.

The Cauchy–Schwarz inequality turns into an equality if and only if x and y are linearly dependent. The inequality turns into an equality for linearly dependent and if and only if one of the vectors x or y is a nonnegative scalar of the other.

Taking the square root of the final result gives the triangle inequality.
  • p-norm: a commonly used norm is the p-norm:
    where the xi are the components of vector x. For p = 2 the p-norm becomes the Euclidean norm:
    which is Pythagoras' theorem in n-dimensions, a very special case corresponding to an inner product norm. Except for the case p = 2, the p-norm is not an inner product norm, because it does not satisfy the parallelogram law. The triangle inequality for general values of p is called Minkowski's inequality. It takes the form:

Metric space

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

for all x, y, z in M. That is, the distance from x to z is at most as large as the sum of the distance from x to y and the distance from y to z.

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

Reverse triangle inequality

The reverse triangle inequality is an elementary consequence of the triangle inequality that gives lower bounds instead of upper bounds. For plane geometry, the statement is:

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:

or for metric spaces, |d(y, x) − d(x, z)| ≤ d(y, z). This implies that the norm as well as the distance function are Lipschitz continuous with Lipschitz constant 1, and therefore are in particular uniformly continuous.

The proof for the reverse triangle uses the regular triangle inequality, and :

Combining these two statements gives:

Triangle inequality for 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

and

With these formulas, one needs to compute a square root for each triple of vectors {x, y, z} that is examined rather than arccos(sim(x,y)) for each pair of vectors {x, y} 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 is not positive-definite, which means that can have either sign or vanish, even if the vector x is non-zero. Moreover, if x and y are both timelike vectors lying in the future light cone, the triangle inequality is reversed:

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 ≥ 1. If the plane defined by x and y is spacelike (and therefore a Euclidean subspace) then the usual triangle inequality holds.

Licensing

Content obtained and/or adapted from: