# Assumptions in sage

Hello!

I am a sage beginner and I wish to know that How sage handles assumptions ?

My example is as follows.

a= var('a'); solve((a-1)*x ==3, x);

and sage solves and gives correct solution [x==(3 / (a - 1))]. But here how the assumption (a != 1) is handled ? Because solution is not defined for (a=1).

Best regards

Charmi

edit retag close merge delete

Sort by » oldest newest most voted

I would say that 3 / (a-1) is a "symbolic solution"; meaning it's a solution for a particular value of a if and only if it makes sense for that a (i.e. there is no division by zero, etc..). The solve command will return symbolic solutions when possible because they generally make sense for almost all values of any symbolic parameter. You have to take care that solutions may not make sense for some particular values of the parameters.

more

I got it.. Thank you. I wish to understand something regarding following code. x = var('x'); assume(x>0); print([x>0] == [1==1]) Sage answers it as "False" In the above piece of code "[x>0] == [1==1]" is logically true but it is gives False. I wish to know How does comparison operator "==" works ? Specially when comparing two predicates ? Does there any other function exist for such comparison ? Best regards