Processing math: 100%
Ask Your Question
2

Testing inequalities in sage

asked 11 years ago

ensaba gravatar image

updated 2 years ago

tmonteil gravatar image

I wanted to show if: |a+b||a|+|b|

So I wrote this in sage:

var('a','b')
eqn1=abs(a+b)
eqn2=abs(a)+abs(b)
bool(eqn1<=eqn2)

The result is False.

I had expected the result to be True. What is the correct way to test this in sage?

Thank you in advance for any help provided.

Preview: (hide)

Comments

Interesting, bool(abs(a)>=a) is True, but bool(abs(a+b)>=(a+b)) is False. Weird.

rickhg12hs gravatar imagerickhg12hs ( 11 years ago )

Also, assume(a<0,b>0) results in false too: http://pastebin.com/7Gg5xMA8

ensaba gravatar imageensaba ( 11 years ago )

If it can't be determined whether a relation holds, `False` will be returned.

Eviatar Bach gravatar imageEviatar Bach ( 11 years ago )

This is disturbing: assume(a,real) assume(b,real) bool(sqrt((a+b)2)==sqrt(a2)+sqrt(b2)) is True ????

rickhg12hs gravatar imagerickhg12hs ( 11 years ago )

@eviatar-bach returning False in case can't be determined whether a relation holds seems to me unwise ; This should be changed to a tristate-answer, whatever the third state is

jack77 gravatar imagejack77 ( 11 years ago )

1 Answer

Sort by » oldest newest most voted
0

answered 11 years ago

tmonteil gravatar image

updated 7 years ago

As explained in this answer, there is currently no way for Sage to say "I do not know the result", hence the answer 'False', which means 'False or Unknown'.

EDIT See trac ticket 17700

Preview: (hide)
link

Comments

2

but it should!

jack77 gravatar imagejack77 ( 11 years ago )

Your Answer

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

Add Answer

Question Tools

3 followers

Stats

Asked: 11 years ago

Seen: 1,508 times

Last updated: Apr 20 '17