Ask Your Question

Revision history [back]

Evaluation of triangle inequality

I write the following piece of code

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)

The I run it: sage: bool(expr) False

The expression is obviously mathematically correct. How come Sage returns "False"?

Evaluation of triangle inequality

I write the following piece of code

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')

assume(z,'real')

expr = abs(x-y)+abs(y-z) >= abs(x-z)

abs(x-z)

The I run it:

sage: bool(expr)
False

False

The expression is obviously mathematically correct. How come Sage returns "False"?

click to hide/show revision 3
None

Evaluation of triangle inequality

I write wrote the following piece of code

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)

The I run it:

sage: bool(expr)
False

The expression is obviously mathematically correct. How come Sage returns "False"?

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)

The Then I run it:

sage: bool(expr)
False

The expression is obviously mathematically correct. How come Sage returns "False"?