ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 23 Feb 2015 02:29:25 -0600What does assume(x, "real")?http://ask.sagemath.org/question/25892/what-does-assumex-real/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. Sun, 22 Feb 2015 04:39:36 -0600http://ask.sagemath.org/question/25892/what-does-assumex-real/Answer by Thorsten for <p>I do not understand what permits the construction <code>assume(x, "real")</code>. For instance,</p>
<pre><code>sage: assume(x, "real")
sage: bool(x*x>0)
False
</code></pre>
<p>I would expect the answer to be <code>True</code>. </p>
<p>Note that Maxima always answers <code>True</code> for the same inequality:</p>
<pre><code>sage: forget()
sage: bool(maxima(x*x>0))
True
</code></pre>
<p>I am not sure this is a better behaviour though. </p>
http://ask.sagemath.org/question/25892/what-does-assumex-real/?answer=25893#post-id-25893It 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. Sun, 22 Feb 2015 05:16:01 -0600http://ask.sagemath.org/question/25892/what-does-assumex-real/?answer=25893#post-id-25893Comment by B r u n o for <p>It is a good thing, that bool(x^2>0) evaluates to false. Just plug in the real value 0.</p>
<p>However in version 6.4 of sage </p>
<pre><code> sage: assume(x,'real')
sage: bool(x*x>=0)
</code></pre>
<p>evaluates to true. </p>
http://ask.sagemath.org/question/25892/what-does-assumex-real/?comment=25900#post-id-25900Just 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?Mon, 23 Feb 2015 02:29:25 -0600http://ask.sagemath.org/question/25892/what-does-assumex-real/?comment=25900#post-id-25900Comment by B r u n o for <p>It is a good thing, that bool(x^2>0) evaluates to false. Just plug in the real value 0.</p>
<p>However in version 6.4 of sage </p>
<pre><code> sage: assume(x,'real')
sage: bool(x*x>=0)
</code></pre>
<p>evaluates to true. </p>
http://ask.sagemath.org/question/25892/what-does-assumex-real/?comment=25894#post-id-25894Of course, sorry for the noise! Thanks!Sun, 22 Feb 2015 05:48:19 -0600http://ask.sagemath.org/question/25892/what-does-assumex-real/?comment=25894#post-id-25894