Message Boards Message Boards

Simplify long but easy inequality?

Posted 7 years ago

Note I posted this a few days ago on stackexchange. It seems people there can't help me resolve this.

To make the example reproducible I find I need a number of variables.

All my variables are Reals and greater 0. So I use

$Assumptions = Element[lab, Reals] && Element[q, Reals] && 
  Element[r, Reals] && Element[s, Reals] && Element[t, Reals] && 
  Element[u, Reals] &&  Element[v, Reals] && 
  lab > 0 && q > 0 && r > 0 && s > 0 && t > 0 &&  u > 0 && v > 0 && q < 1 

From an equation system I get lengthy solutions having terms like following and I am interested whether they are smaller 0.

My problem is to weed out the parts that are "obviously" true. So I actually obtain the following expressions as part of a larger expression.

(s (-1 + q - q u)) < 0 // Refine
lab (-1 + q) q u v < 0 // Refine

They instantly evaluate to True

But as things get more complex (here just summing the two expressions) - Simplify (or Refine) fail to find the simplification instantly (in the sense that they immediately give up).

(s (-1 + q - q u)) + lab (-1 + q) q u v < 0 // Refine

I found just if would delete the lab it would evaluate nicely. But since I have many much longer expressions this is not really an option to weed through the sub expressions manually. Is there some magic limit in Mathematica that an expression may only contain 5 variables - or something similar that I could override?

All this calculations happen instantaneously and I could definitely live with Mathematica spending some minutes searching for this simplifications. So I am very open to any suggestions even if they strain my machine a bit.

POSTED BY: Cl Ag
2 Replies
Posted 7 years ago

Thanks, that is very useful for me. Actually I think I can skip the Equivalent - I just want all already fulfilled inequalities removed. Or am I overlooking anything important?

I just feel a little disappointed that Simplify was not able to do this by itself.

POSTED BY: Cl Ag

If you evaluate

Reduce[$Assumptions && (s (-1 + q - q u)) + lab (-1 + q) q u v < 0]

you can recognize that it is equivalent to $Assumptions. Mathematica should know, because

Simplify[Equivalent[$Assumptions, 
  Reduce[$Assumptions && (s (-1 + q - q u)) + lab (-1 + q) q u v < 
     0]]]

gives True. You can automate this idea:

inequalityCheck[ineq_] := 
 Simplify[Equivalent[$Assumptions, Reduce[$Assumptions && ineq]]]

I have not tried it on other inequalities, though.

POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract