Message Boards Message Boards

2 Replies
0 Total Likes
View groups...
Share this post:

Simple question about Simplify[] with assumptions

Posted 11 years ago
If I try to simplify Sqrt[x^2] - Abs under the assumptions x>0 and x<=0 separately, it works correctly, but if I combine them into one condition it does not:

Simplify[Sqrt[x^2] - Abs[x],x<=0]
Simplify[Sqrt[x^2] - Abs[x],x>0]
Simplify[Sqrt[x^2] - Abs[x],(x>0) || (x<=0)]
Sqrt[x^2] - Abs[x]

Why did it leave the expression unevaluated for (x>0) || (x<=0) case? It should evaluate to 0 like in the other two cases. What am I missing? Thank you.

Curiously, if I use Element[x,Reals] as a condition then it works:

So, apparently, Element[x,Reals] and (x>0) || (x<=0) is not the same thing, oddly enough...
POSTED BY: Tigran Aivazian
2 Replies
Thank you for pointing out this oddity.

I forwarded your examples to developers asĀ  a suggestion for a future release.
POSTED BY: Bruce Miller
I think I understand what's happening here:

When Mathematica encounters the conditio (x>0) it then implies that x is a real number and when it further encounters the part "|| (x<=0)" it implies "x is a real number which is either positive or non-positive" but this is identically True. And when Simplify[] encounters an assumption which is identically True it doesn't detect the "sub-implication" that has led to this truth (namely, the implication that x is real) and so it leaves the expression unevaluated.

So, I understand the mechanics of what is going on here, but, imho, it is not a very intuitive behaviour, i.e. perhaps Simplify[] should automatically detect any knowledge that has "come to light" as a result of evaluating the expression that goes into the assumptions part (i.e. second argument of Simplify[]).

What do you think?
POSTED BY: Tigran Aivazian
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract