Ask Your Question

Minhtri's profile - activity

2020-10-21 09:45:57 +0200 received badge  Popular Question (source)
2019-12-20 23:08:51 +0200 asked a question 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!

2019-12-20 23:08:50 +0200 asked a question Evaluation of triangle inequality

I wrote the following 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 expression is obviously mathematically correct. How come Sage returns "False"?