I have this list with some duplicate elements and I want to delete duplicate ones.
mylist = {ConditionalExpression[1, -1 <= x <= 0],
ConditionalExpression[-x, x <= -1],
ConditionalExpression[-x, x <= -1],
ConditionalExpression[Abs[x], x <= -1]};
Now I tried to delete duplicate elements with this.
DeleteDuplicates[mylist]
This doesn't work. I expected that two of these three elements {ConditionalExpression[-x, x <= -1], ConditionalExpression[-x, x <= -1], ConditionalExpression[Abs[x], x <= -1]}
should be deleted.
Then I thought probably that was due to Mathematica thinking that x
is complex, so I added the assumption that x is real, but this didn't work either.
Assuming[x \[Element] Reals, DeleteDuplicates[mylist]]
How can I delete duplicate elements so the three elements above are considered duplicate?