5
$\begingroup$

How would I get Mathematica to verify the triangle inequality for norms (say, the 2-norm for vectors in $\mathbb{R}^n$)?

For scalars, this suffices:

Reduce[Abs[x + y] <= Abs[x] + Abs[y], {x, y}, Reals] (* True *)

However, I can't get Mathematica to verify Norm[x + y] <= Norm[x] + Norm[y] for fixed- or general-dimension vector spaces, using Reduce or Simplify with appropriate assumptions.

$\endgroup$
  • $\begingroup$ An even simpler version of this would be verifying that Norm[x]==0 implies x is the zero vector. $\endgroup$ – Ross B. Sep 19 '16 at 23:12
2
$\begingroup$

Directly:

x = {a, b};
y = {c, d};
Reduce[Norm[x + y] <= Norm[x] + Norm[y], {a, b, c, d}, Reals]

returns True. Slightly more generally:

x = Array[a, 2];
y = Array[b, 2];
Reduce[Norm[x + y] <= Norm[x] + Norm[y], Flatten@{x, y}, Reals]

works, but I grew tired of waiting when I replaced the "2" with a "3". The "simpler version" is indeed simpler, and works for much larger dimensions:

x = Array[a, 10];
Solve[Norm[x] == 0, x, Reals]

{{a[1] -> 0, a[2] -> 0, a[3] -> 0, a[4] -> 0, a[5] -> 0, 
  a[6] -> 0, a[7] -> 0, a[8] -> 0, a[9] -> 0, a[10] -> 0}}
$\endgroup$
  • $\begingroup$ Sure, but this quickly becomes unwieldy and computationally intensive. Ideally I'd like to specify something like x \[Element] Vectors[10] or x \[Element] Vectors[n]. $\endgroup$ – Ross B. Sep 19 '16 at 23:05
  • $\begingroup$ Was just about to post how it works a little better for the simpler example :)...still can't help but feel that Mathematica can do something smarter than try to brute force a polynomial in $2n$ variables. $\endgroup$ – Ross B. Sep 20 '16 at 0:27
1
$\begingroup$

You can project higher dimensional spaces down to 2D with one vertex at the origin. In this case:

x = {a, b};
y = {c, d};
z = {0, 0};
CylindricalDecomposition[Norm[x - z] + Norm[y - z] >= Norm[x - y], {a, b, c, d}]
(* True *)
$\endgroup$
  • $\begingroup$ The wording is a bit off here. What is true is that a pair of vectors determines a two dimensional space. That is not the same as representing them in two dimensions using the "standard" Cartesian basis. $\endgroup$ – Daniel Lichtblau Sep 19 '16 at 22:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.