can SymPy be more explicit about assumptions?

36 views
Skip to first unread message

Chris Smith

unread,
Aug 4, 2019, 8:32:42 AM8/4/19
to sympy
Symbols default to commutative=True but I wonder if we should also default to `finite=True` since that is consistent with the behavior of `x - x` being 0. (If x is infinite then `x - x` is nan.) In this discussion here I point out how `x-x->0` without the correct assumption (that x is finite) is inconsistent with unevaluation of `x**2 < 0`. The inequality remains unevaluated because it would be an invalid comparison if `x` had real and imaginary components and produced a comparison like `2*I < 0` when `x = 1 + I`.

I suspect that this might have minimal impact on the current behavior; I suspect that making `real=True` a default assumption, too, would have a greater impact. Without making the latter, all inequalities would continue to be unevaluated for plain/vanilla symbols because they would have to entertain the possibility of an invalid result. e.g. `Eq(1/x, 0)` for finite `x` would not evaluate to True (even though `x` might be finite) when x is not known to be real or imaginary.

/c

Oscar Benjamin

unread,
Aug 5, 2019, 6:33:50 AM8/5/19
to sympy
See also https://github.com/sympy/sympy/issues/17224
> --
> 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 sympy+un...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/12753973-4620-4b2e-8046-8147b4ec2372%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages