Ask Your Question
0

(Unexpanded) symbolic inequalities yield erroneous results

asked 2015-08-20 11:39:48 -0500

DrNick gravatar image

I'm a SAGE novice, but have at least looked around this forum a bit on this matter. Apologies if this is a FAQ that I missed.

I am working with pretty simple symbolic expressions (type 'sage.symbolic.expression.Expression') involving rational numbers and some square roots. I have encountered several instances in which SAGE returns incorrect booleans when asking about inequalities between these things. For what it's worth, SAGE seems to get the answer right when I expand the expressions (simply by appending a .expand() to the end of them).

In particular, SAGE sometimes returns True when given "A < B" where A and B are symbolic expressions that are (not-obviously) equal. Here's an example that actually came up.

bool((1/8*sqrt(2)*(sqrt(2)*(sqrt(2) - 2) + 4*sqrt(2)) + 1/4*sqrt(2)*(sqrt(2) - 2) + 3/4*sqrt(2) - 1/2) < (1/8*sqrt(2)*(sqrt(2) + 2) + 1/4*sqrt(2) + 1/4))

SAGE returns True to this strict inequality. It also returns True when < is replaced by ==, as it should since these are equal. As mentioned, appending an .expand() to each side causes SAGE to return False to the strict inequality, which it should.

Any idea what's going wrong here?

edit retag flag offensive close merge delete

Comments

No ideas off hand, but I've reported this as http://trac.sagemath.org/ticket/19064

kcrisman gravatar imagekcrisman ( 2015-08-20 12:12:43 -0500 )edit

In particular, if Sage can't verify something, it should return False - so that False is "not True", not a proved falsity.

kcrisman gravatar imagekcrisman ( 2015-08-20 12:13:17 -0500 )edit

For what it's worth, I appear to be running version 6.2. Someone has commented on the ticket kcrisman started that they cannot reproduce this on 6.9beta. I'll update and check.

DrNick gravatar imageDrNick ( 2015-08-20 19:26:41 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
2

answered 2015-08-21 01:28:29 -0500

This was fixed in one of the 6.8 betas so 6.8 or 6.9 should be fine.

edit flag offensive delete link more

Comments

It looks like I need to update, and probably should have done so first. That said, with something so basic going wrong, I just assumed that I was doing something wrong. Thanks!

DrNick gravatar imageDrNick ( 2015-08-21 13:32:15 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-08-20 11:39:48 -0500

Seen: 149 times

Last updated: Aug 20 '15