Group Abstract Group Abstract

Message Boards Message Boards

Simple question about Simplify[] with assumptions

GROUPS:
Hello,
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]
0
Simplify[Sqrt[x^2] - Abs[x],x>0]
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:
Simplify[Sqrt[x^2]-Abs[x],Element[x,Reals]]
0

So, apparently, Element[x,Reals] and (x>0) || (x<=0) is not the same thing, oddly enough...
POSTED BY: Tigran Aivazian
Answer
6 months ago
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
Answer
6 months ago
Thank you for pointing out this oddity.

I forwarded your examples to developers asĀ  a suggestion for a future release.
POSTED BY: Bruce Miller
Answer
6 months ago