There is an irksome shortcoming for Simplify that I encountered: Simplify not evaluating completely with Square roots

-- still not entirely sure if it's because of AssumptionsMaxNonlinearVariables being too low (raising it is NOT an option as that would severely slow down the evaluations) or because some issue about Sqrt being complexed value.

So, I'm trying ot fix it using Up/DownValue but Simplify and Greater, Less, GreaterEqual and LessEqual are all Protected (being built-in functions).

I can just change my existing library, but that would take an amount of work and break the elegance of my automated system.

I can decompose everything using Level[_, {0, Infinity}], then select those that have the Greater, etc heads, apply the a sort of simplifyfalseineq function, then put it all together with the proper heads so it's everything is the same except those self-contradicting inequalities gets False-d. But it's ugly and expensive.

Any other ideas?

  • $\begingroup$ a levelhead function can be created where x < func[a, b]/c can be decomposed to {Greater, {x, {Divide, {{func, {a, b}}, c}}}} with simple recursion. Just spitballing. $\endgroup$
    – kozner
    Nov 4, 2016 at 9:49
  • $\begingroup$ have you looked at TransformationFunctions ? $\endgroup$
    – george2079
    Nov 4, 2016 at 11:50

1 Answer 1


You can remove the protection by


Make any adjustments you need, and then restore the protection with

  • $\begingroup$ Well, that made me look stupid. That's not on the Protected help page. $\endgroup$
    – kozner
    Nov 4, 2016 at 9:51
  • 3
    $\begingroup$ Just be careful about getting into the habit of Unprotecting built-ins, as that can have very hard-to-predict consequences for the internal workings of MMA. Often you are better off using TagSet or TagSetDelayed. E.g. if I want addition to be the same as multiplication for symbols of the form x[_] I don't unprotect Plus; instead I do x /: x[a_] + x[b_] := x[a]*x[b]. This associates the rule with x, not with Plus. $\endgroup$ Nov 4, 2016 at 10:28

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.