Ask Your Question

What does assume(x, "real")?

asked 2015-02-22 04:39:36 -0600

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)

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

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

answered 2015-02-22 05:16:01 -0600

Thorsten gravatar image

updated 2015-02-22 05:17:51 -0600

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


Of course, sorry for the noise! Thanks!

B r u n o gravatar imageB r u n o ( 2015-02-22 05:48:19 -0600 )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)
sage: bool(e.subs(x=I))

Are there default assumptions for inequalities?

B r u n o gravatar imageB r u n o ( 2015-02-23 02:29:25 -0600 )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


Asked: 2015-02-22 04:39:36 -0600

Seen: 546 times

Last updated: Feb 22 '15