Ask Your Question

What does assume(x, "real")?

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

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 12:16:01 +0200

Thorsten gravatar image

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

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 12:48:19 +0200 )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 09:29:25 +0200 )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 11:39:36 +0200

Seen: 1,142 times

Last updated: Feb 22 '15