Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #9899 > unrolled thread

Re: Struggling to prove simple triangle inequality

Started byAndrzej Kozlowski <akozlowski@gmail.com>
First post2012-05-01 09:25 +0000
Last post2012-05-02 00:00 +0000
Articles 3 — 2 participants

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Struggling to prove simple triangle inequality Andrzej Kozlowski <akozlowski@gmail.com> - 2012-05-01 09:25 +0000
    Re: Struggling to prove simple triangle inequality Vladimir M <vladimir7523@gmail.com> - 2012-05-01 18:58 +0000
    Re: Struggling to prove simple triangle inequality Vladimir M <vladimir7523@gmail.com> - 2012-05-02 00:00 +0000

#9899 — Re: Struggling to prove simple triangle inequality

FromAndrzej Kozlowski <akozlowski@gmail.com>
Date2012-05-01 09:25 +0000
SubjectRe: Struggling to prove simple triangle inequality
Message-ID<jnoa64$54o$1@smc.vnet.net>
On 30 Apr 2012, at 10:42, Vladimir M wrote:

> Greetings!
>
> Given two 3D vectors A and B, I want to prove that length of their sum
> is less or equal than the sum of their lengths:
>
> length[v_] := Sqrt[v.v];
> a = {ax, ay, az};
> b = {bx, by, bz};
> inequality = length[a + b] <= length[a] + length[b];
>
> This is famous, well-known and quite obvious: triangle side is shorter
> than the sum of other sides, straight line is shorter than non-
> straight, etc. However, proving it formally is hard.
>
> This fails:
>
> assum = Element[ax | ay | az | bx | by | bz, Reals];
> FullSimplify[inequality, assum]
>
>
> This takes ages on a high-end PC with unknown result:
>
> vars = {ax, ay, az, bx, by, bz};
> Reduce[inequality, vars, Reals]
>
> Anyone can help? I think Reduce should somehow make it because it
> actually succeeds at least with 2D vectors.
>
>
> --
> All the best,
> Vladimir
>

Not really. To solve this sort of problem Reduce uses the algorithm 
called cylindrical algebraic decomposition, which is implemented in 
Mathematica as CylindricalDecomposition. This algorithm's complexity is 
double exponential (i.e. 2^n^n where n is the number of variables.). So 
the fact that it works in a reasonable time for 4 variables (two 
dimensional case) is not a good reason to expect it will work for 6 
variables (three dimensional case),
e.g. see here http://en.wikipedia.org/wiki/Double_exponential_function

Andrzej Kozlowski

[toc] | [next] | [standalone]


#9912

FromVladimir M <vladimir7523@gmail.com>
Date2012-05-01 18:58 +0000
Message-ID<jnpboe$agu$1@smc.vnet.net>
In reply to#9899
On May 1, 12:25 pm, Andrzej Kozlowski <akozlow...@gmail.com> wrote:
> > Given two 3D vectors A and B, I want to prove that length of their sum
> > is less or equal than the sum of their lengths:
>
> > length[v_] := Sqrt[v.v];
> > a = {ax, ay, az};
> > b = {bx, by, bz};
> > inequality = length[a + b] <= length[a] + length[b];
>
> > vars = {ax, ay, az, bx, by, bz};
> > Reduce[inequality, vars, Reals]
>
> Not really. To solve this sort of problem Reduce uses the algorithm
> called cylindrical algebraic decomposition, which is implemented in
> Mathematica as CylindricalDecomposition. This algorithm's complexity is
> double exponential (i.e. 2^n^n where n is the number of variables.).

Thanks for explanation. Meanwhile, Reduce has run for a few days
at 3 GHz, taking gigabytes of memory and finally crashed the kernel.
Looks like besides checking many combinations, a huge memory is
needed for something (list-based methods instead of iteration-based?)

Anyway, if not Reduce, maybe something else could help
to automatically prove this seemingly simple problem?

--
All the best,
Vladimir

[toc] | [prev] | [next] | [standalone]


#9914

FromVladimir M <vladimir7523@gmail.com>
Date2012-05-02 00:00 +0000
Message-ID<jnptei$cgk$1@smc.vnet.net>
In reply to#9899
On May 1, 12:25 pm, Andrzej Kozlowski <akozlow...@gmail.com> wrote:
> > Given two 3D vectors A and B, I want to prove that length of their sum
> > is less or equal than the sum of their lengths:
>
> > length[v_] := Sqrt[v.v];
> > a = {ax, ay, az};
> > b = {bx, by, bz};
> > inequality = length[a + b] <= length[a] + length[b];
>
> > vars = {ax, ay, az, bx, by, bz};
> > Reduce[inequality, vars, Reals]
>
> Not really. To solve this sort of problem Reduce uses the algorithm
> called cylindrical algebraic decomposition, which is implemented in
> Mathematica as CylindricalDecomposition. This algorithm's complexity is
> double exponential (i.e. 2^n^n where n is the number of variables.).

Thanks for explanation. Meanwhile, Reduce has run for a few days
at 3 GHz, taking gigabytes of memory and finally crashed the kernel.
Looks like besides checking many combinations, a huge memory is
needed for something (list-based methods instead of iteration-based?)

Anyway, if not Reduce, maybe something else could help
to automatically prove this seemingly simple problem?

--
All the best,
Vladimir

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web