ASKSAGE: Sage Q&A Forum - Individual question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 11 Oct 2020 16:14:51 -0500Non-polynomial inequality with multi variableshttps://ask.sagemath.org/question/49102/non-polynomial-inequality-with-multi-variables/I write the following piece of code:
x = var('x')
assume(x,'real')
y = var('y')
assume(y,'real')
z = var('z')
assume(z,'real')
expr = abs(x-y)+abs(y-z) >= abs(x-z)
Then I run it:
sage: bool(expr)
False
The `expr` is the triangle inequality, which is `True` for any real `x`, `y`, `z`.
How come SageMath returns `False`?
What should I do to make SageMath work in this case?
Thanks much!Fri, 20 Dec 2019 12:31:55 -0600https://ask.sagemath.org/question/49102/non-polynomial-inequality-with-multi-variables/Comment by slelievre for <p>I write the following piece of code:</p>
<pre><code>x = var('x')
assume(x,'real')
y = var('y')
assume(y,'real')
z = var('z')
assume(z,'real')
expr = abs(x-y)+abs(y-z) >= abs(x-z)
</code></pre>
<p>Then I run it:</p>
<pre><code>sage: bool(expr)
False
</code></pre>
<p>The <code>expr</code> is the triangle inequality, which is <code>True</code> for any real <code>x</code>, <code>y</code>, <code>z</code>.
How come SageMath returns <code>False</code>?
What should I do to make SageMath work in this case?
Thanks much!</p>
https://ask.sagemath.org/question/49102/non-polynomial-inequality-with-multi-variables/?comment=53853#post-id-53853Duplicate of [Ask Sage question 49101](https://ask.sagemath.org/question/49101).Sun, 11 Oct 2020 16:14:51 -0500https://ask.sagemath.org/question/49102/non-polynomial-inequality-with-multi-variables/?comment=53853#post-id-53853