assume doesn't assume the first time (with limit)

19 views
Skip to first unread message

Francois Maltey

unread,
Apr 17, 2013, 11:58:15 AM4/17/13
to sage-s...@googlegroups.com, Francois Maltey
Hello everyone,

I must declare "assume" twice. First time, I get an unevalued form.
After the second assume, I get the fine result :
I use Sage 5.7

sage: forget () ; var('n')
n
sage: assume ((x<1) and (x>0)) ; limit (n*x^n*(1-x), n=oo) ; limit
(n*x^n*(1-x), n=oo)
-(x - 1)*limit(x^n*n, n, +Infinity) # unevalued
-(x - 1)*limit(x^n*n, n, +Infinity)
sage: assume ((x<1) and (x>0)) ; limit (n*x^n*(1-x), n=oo) ; limit
(n*x^n*(1-x), n=oo)
0 # the right value
0

Must I declare it in the trac.sagemath.org database ?

Have a nice day !

F.

John H Palmieri

unread,
Apr 17, 2013, 12:07:04 PM4/17/13
to sage-s...@googlegroups.com, Francois Maltey


On Wednesday, April 17, 2013 8:58:15 AM UTC-7, Francois Maltey wrote:
Hello everyone,

I must declare "assume" twice. First time, I get an unevalued form.
After the second assume, I get the fine result :
I use Sage 5.7

sage: forget () ;  var('n')
n
sage: assume ((x<1) and (x>0))

Is "assume((x<1) and (x>0))" supported syntax? If you use "assume(x<1, x>0)" instead, I think your example works with just one assume statement.

--
John

Maarten Derickx

unread,
Apr 17, 2013, 2:01:47 PM4/17/13
to sage-s...@googlegroups.com, Francois Maltey
Yes, "(x<1) and (x>0)" is just a python expression, and you can give that as an argument to a function. The reason why he has to assume twice is

sage: (x<1) and (x>0)
x < 1
sage: assume(x<1)
sage: (x<1) and (x>0)
x > 0

The assume changes the truth value of the statement x<1 causing the expresion (x<1) and (x>0) to return x>0 instead of (x<1). 

The problem is that it is not yet possible to do symbolic logic using symbolic expressions in sage.

 
--
John

John H Palmieri

unread,
Apr 17, 2013, 2:45:01 PM4/17/13
to sage-s...@googlegroups.com, Francois Maltey


On Wednesday, April 17, 2013 11:01:47 AM UTC-7, Maarten Derickx wrote:


Le mercredi 17 avril 2013 18:07:04 UTC+2, John H Palmieri a écrit :


On Wednesday, April 17, 2013 8:58:15 AM UTC-7, Francois Maltey wrote:
Hello everyone,

I must declare "assume" twice. First time, I get an unevalued form.
After the second assume, I get the fine result :
I use Sage 5.7

sage: forget () ;  var('n')
n
sage: assume ((x<1) and (x>0))

Is "assume((x<1) and (x>0))" supported syntax? If you use "assume(x<1, x>0)" instead, I think your example works with just one assume statement.


Yes, "(x<1) and (x>0)" is just a python expression, and you can give that as an argument to a function.

That doesn't mean that the function will know what to do with it, as evidenced here. I guess I meant that the documentation for "assume" says that the arguments should be "assumptions", without defining what the means, and includes no examples using "and" or "or". Is "(x<1) and (x>0)" supported syntax for an "assumption"? In practice, the answer is no...

--
John

Reply all
Reply to author
Forward
0 new messages