It's because x > -3 is not the same as -3 < x. Note that == only does exact equality comparison, so the expressions need to be in exactly the same form to get True from it.
Aaron Meurer On Sat, Sep 14, 2013 at 3:26 PM, Pablo Puente <[email protected]> wrote: > Sorry ignore the example there was a mistake. > > Still I can not find why this returns False: > > solve(abs(x) < 3, assume=Q.real(x)) == And(x < 3, x > -3) > > > On Saturday, September 14, 2013 10:18:17 PM UTC+2, Aaron Meurer wrote: >> >> Do you mean abs(x) > 3? >> >> Aaron Meurer >> >> On Sep 14, 2013, at 1:52 PM, Pablo Puente <[email protected]> wrote: >> >> Hi, >> >> >> I am adding Wester test cases. When I run: >> >> >> from sympy import * >> >> x = symbols('x') >> >> print solve(abs(x) < 3, assume=Q.real(x)) >> >> print And(x < 3, x > -3) >> >> print And(Lt(x,3),Gt(x,-3)) >> >> print And(-3 < x, x < 3) >> >> print And(Lt(-3,x),Lt(x,3)) >> >> print solve(abs(x) < 3, assume=Q.real(x)) == And(Lt(-3,x),Lt(x,3)) >> >> print solve(abs(x) < 3, assume=Q.real(x)) == And(x < 3, x > -3) # Should >> return True! >> >> >> I get: >> >> >> And(-3 < x, x < 3) >> >> And(x < 3, x > -3) >> >> And(x < 3, x > -3) >> >> And(x < 3, x > -3) >> >> And(-3 < x, x < 3) >> >> True >> >> False >> >> >> Is this a bug? >> >> Pablo >> >> -- >> You received this message because you are subscribed to the Google Groups >> "sympy" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To post to this group, send email to [email protected]. >> >> Visit this group at http://groups.google.com/group/sympy. >> For more options, visit https://groups.google.com/groups/opt_out. > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/sympy. > For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sympy. For more options, visit https://groups.google.com/groups/opt_out.
