Ask Your Question
1

What does assume(x, "real")?

asked 2015-02-22 11:39:36 +0100

B r u n o gravatar image

I do not understand what permits the construction assume(x, "real"). For instance,

sage: assume(x, "real")
sage: bool(x*x>0)
False

I would expect the answer to be True.

Note that Maxima always answers True for the same inequality:

sage: forget()
sage: bool(maxima(x*x>0))
True

I am not sure this is a better behaviour though.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-02-22 12:16:01 +0100

Thorsten gravatar image

updated 2015-02-22 12:17:51 +0100

It is a good thing, that bool(x^2>0) evaluates to false. Just plug in the real value 0.

However in version 6.4 of sage

 sage:  assume(x,'real')
 sage:  bool(x*x>=0)

evaluates to true.

edit flag offensive delete link more

Comments

Of course, sorry for the noise! Thanks!

B r u n o gravatar imageB r u n o ( 2015-02-22 12:48:19 +0100 )edit

Just another comment: Actually, not assuming x to be "real" yields the same result, so we have the following:

sage: e = x*x >= 0
sage: bool(e)
True
sage: bool(e.subs(x=I))
False

Are there default assumptions for inequalities?

B r u n o gravatar imageB r u n o ( 2015-02-23 09:29:25 +0100 )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-02-22 11:39:36 +0100

Seen: 1,557 times

Last updated: Feb 22 '15