4
$\begingroup$

Here's a simple question. It's no longer high priority that I know this, but it's something that can come in handy later on.

Simplify[a > Sqrt[b]/c + d, a < Sqrt[b]/c + d]

or

Simplify[Sequence @@ ({a > n, a < n} /. {n ->  Sqrt[b]/c + d})]

or

n = Sqrt[b]/c + d;
Simplify[a > n, a < n]

all outputs:

Out: a > Sqrt[b]/c + d

while

Simplify[a > m, a < m]

outputs

Out: False

How come? This isn't an issue of not considering the negative root. The expressions are identical. As demonstrated by Simplify[a > m, a < m], replacing m with more complex expressions aside from having the Sqrt function.

In fact, if I use Surd, no matter the nth root, even or odd, or square root, Simplify will evaluate completely into False.

Why? Is this something that I can fix using Upvalues? -- Finally remember what the "overloading" feature was called.

$\endgroup$
2
  • $\begingroup$ The second part of the function here is the assumptions. Mathematica tries to simplify the expression based on the assumptions, which it can't, so it simply returns the original function. The proper way of formulating this is Simplify[a > Sqrt[b]/c + d && a < Sqrt[b]/c + d], which returns False. $\endgroup$
    – Feyre
    Commented Nov 3, 2016 at 8:58
  • $\begingroup$ It works with the logical negation as an assumption: Simplify[a > Sqrt[b]/c + d, a <= Sqrt[b]/c + d]. Even if you specify that all variables belong to the Reals, there doesn't seem to be a built-in transformation to deal with the trichotomy law in this case, perhaps because Sqrt[] is assumed to be complex-valued (unlike Surd[]). $\endgroup$
    – Michael E2
    Commented Nov 3, 2016 at 11:39

1 Answer 1

7
$\begingroup$

The assumptions mechanism used by Simplify will not try to prove or disprove an inequality if the number of variables involved is higher than a built-in limit. To decide polynomial inequalities the assumptions mechanism uses the cylindrical algebraic decomposition algorithm, which has doubly-exponential complexity, hence the limit on the number of variables is low -- by default it is 4. Your inequality contains 5 polynomial variables, since to reduce it to a polynomial system we need to introduce a new variable v to replace Sqrt[b] and add an equation v^2==b.

The limit on the number of variables can be changed using a system option.

In[3]:= SetSystemOptions["SimplificationOptions"->"AssumptionsMaxNonlinearVariables"->5];

In[4]:= Simplify[a > Sqrt[b]/c + d, a < Sqrt[b]/c + d]
Out[4]= False
$\endgroup$
5
  • $\begingroup$ I don't have the time or energy to actually dig in to "Cylindrical Algebraic Decomposition". But from what I gather, it "bumps up" any polynomial expression until it is at least a linear expression... $\endgroup$
    – kozner
    Commented Nov 4, 2016 at 7:11
  • $\begingroup$ Or does it "bump" it up so the lowest polynomial degree it n - k, where k is the degree of the lowest polynomial and n is a given upper limit for the transform? $\endgroup$
    – kozner
    Commented Nov 4, 2016 at 7:12
  • $\begingroup$ Or does n, as in $R^n$ dimensions actually means the number of variables? $\endgroup$
    – kozner
    Commented Nov 4, 2016 at 7:17
  • $\begingroup$ I've tried DownValue-ing Simplify, as that is already a heavy function, thus used less often: Simplify[Greater[a, b]] := somexpr1;, but Simplify is Protected. Tried Upvalue to Greater: Simplify[Greater[a, b]] ^:= somexpr2;. Greater is also Protected. $\endgroup$
    – kozner
    Commented Nov 4, 2016 at 9:11
  • $\begingroup$ @kozner Just Unprotect? $\endgroup$
    – masterxilo
    Commented Nov 8, 2016 at 23:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.