Message Boards Message Boards


Comparing result sets from Reduce in Mathematica

Posted 9 years ago
2 Replies
3 Total Likes


Is there a simple way to check whether two result sets are equivalent/the same?

Here's a toy example:

A = x>0; B = -x<0;

I'd like to test if A==B. For example, this command outputs

(x > 0) == (-x < 0).

I've also tried using Complement, with no success.

Thank you! Pedro

POSTED BY: Pedro Gardete
2 Replies

The best way to handle inequalities is to treat them as logic statements and use Resolve:

A = x > 0; B = -x < 0;

Resolve[ForAll[x, Equivalent[A, B]], Reals]


Strictly speaking, depending on what you mean by "Set", it might be impossible to write an algorithm in any programming language that guarantee whether two sets are the same or not.

POSTED BY: Sean Clarke
Posted 9 years ago


This is exactly what I was looking for; it does work for "simple" cases.

Thanks! P

POSTED BY: Pedro Gardete
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract