Package ineq (Maxima 5.45.0 Manual)

Next: Package rducon, Previous: Package functs, Up: simplification-pkg [Contents][Index]

### 84.5 Package ineq

The `ineq` package contains simplification rules for inequalities.

Example session:

    (%i1) load(ineq)$
    tellsimp: warning: rule will treat '+
                              ' as noncommutative and nonassociative.
    tellsimp: warning: rule will treat '+
                              ' as noncommutative and nonassociative.
    tellsimp: warning: rule will treat '+
                              ' as noncommutative and nonassociative.
    tellsimp: warning: rule will treat '+
                              ' as noncommutative and nonassociative.
    tellsimp: warning: rule will treat '+
                              ' as noncommutative and nonassociative.
    tellsimp: warning: rule will treat '+
                              ' as noncommutative and nonassociative.
    tellsimp: warning: rule will treat '+
                              ' as noncommutative and nonassociative.
    tellsimp: warning: rule will treat '+
                              ' as noncommutative and nonassociative.

    (%i2) a>=4;  /* a sample inequality */
    (%o2)                        a >= 4
    (%o3)                     b + a > c + 4
    (%o4)                       7 x < 7 y
    (%o5)                    - 2 x <= - 6 z
                                     2
    (%o6)                      1 <= a  + 1
    (%o8)                       2 x < 3 x
    (%o9)                        a >= b
    (%o10)                   a + 3 >= b + 3
    (%o11)                       a >= b
    (%o12)                     a >= c - b
    (%o13)                     b + a >= c
    (%o14)                 (- c) + b + a >= 0
    (%o15)                   c - b - a <= 0
                                   2
    (%o16)                  (z - 1)  > - 2 z
                                2
    (%o17)                     z  + 1 > 0
    (%o18)                        true

    (%i19) (b>c)+%; /* add a second, strict inequality */

Be careful about using parentheses around the inequalities: when the user types in `(A > B) + (C = 5)` the result is `A + C > B + 5`, but `A > B + C = 5` is a syntax error, and `(A > B + C) = 5` is something else entirely.

Do `disprule (all)` to see a complete listing of the rule definitions.

The user will be queried if Maxima is unable to decide the sign of a quantity multiplying an inequality.

The most common mis-feature is illustrated by:

    (%i1) eq: a > b;
    (%o1)                         a > b

    (%i2) 2*eq;
    (%o2)                       2 (a > b)

    (%i3) % - eq;
    (%o3)                         a > b

Another problem is 0 times an inequality; the default to have this turn into 0 has been left alone. However, if you type `X*some_inequality` and Maxima asks about the sign of `X` and you respond `zero` (or `z`), the program returns `X*some_inequality` and not use the information that `X` is 0. You should do `ev (%, x: 0)` in such a case, as the database will only be used for comparison purposes in decisions, and not for the purpose of evaluating `X`.

The user may note a slower response when this package is loaded, as the simplifier is forced to examine more rules than without the package, so you might wish to remove the rules after making use of them. Do `kill (rules)` to eliminate all of the rules (including any that you might have defined); or you may be more selective by killing only some of them; or use `remrule` on a specific rule.

Note that if you load this package after defining your own rules you will clobber your rules that have the same name. The rules in this package are: `*rule1`, ..., `*rule8`, `+rule1`, ..., `+rule18`, and you must enclose the rulename in quotes to refer to it, as in `remrule ("+", "+rule1")` to specifically remove the first rule on `"+"` or `disprule ("*rule2")` to display the definition of the second multiplicative rule.

Categories: Simplification functions Rules and patterns Share packages Package ineq

Next: Package rducon, Previous: Package functs, Up: simplification-pkg [Contents][Index]