Skip to main content

simplifying expressions - Using Inequality Assumptions


I'm having getting Mathematica to use my inequality assumptions. Here's a simple example:


$Assumptions = (v-w*x+y*z)>0
FullSimplify[Sign[(v-w*x+y*z)]]

Output: Sign[v-wx+yz] (Meaning that the assumption had no effect)


However, if I put in the pieces separately, it gives me the expected results.


$Assumptions = (v-w*x)>0
FullSimplify[Sign[(v-w*x)]]


Output: 1


$Assumptions = (y*z)>0
FullSimplify[Sign[(y*z)]]

Output: 1



Answer



The number of variables in the nonlinear expression in your first example (5) exceeds the limit set by the system sub-option "AssumptionsMaxNonlinearVariables" (which is 4).


SystemOptions["SimplificationOptions"]



{"SimplificationOptions" -> {"AssumptionsMaxNonlinearVariables" -> 4, "AssumptionsMaxVariables" -> 21, "AutosimplifyTrigs" -> True, "AutosimplifyTwoArgumentLog" -> True, "FiniteSumMaxTerms" -> 30, "FunctionExpandMaxSteps" -> 15, "ListableFirst" -> True, "RestartELProver" -> False, "SimplifyMaxExponents" -> 100, "SimplifyToPiecewise" -> True}}



Set the value of "AssumptionsMaxNonlinearVariables" to a larger number (say, 5) to make FullSimplify handle a larger number of nonlinear variables:


SetSystemOptions["SimplificationOptions" -> {"AssumptionsMaxNonlinearVariables" -> 5}];

$Assumptions = (v - w*x + y*z) > 0;
FullSimplify[Sign[(v - w*x + y*z)]]


1




Reset the value to its default using


SetSystemOptions["SimplificationOptions" -> {"AssumptionsMaxNonlinearVariables" -> 4}];

See also: Simplifying expressions with head Max


Comments