@sym: isAlways (eq) ¶@sym: isAlways (eq, ’Unknown’, ’false’) ¶@sym: isAlways (eq, ’Unknown’, ’true’) ¶@sym: isAlways (eq, ’Unknown’, ’error’) ¶Test if expression is mathematically true.
Example:
syms x y isAlways(x*(1+y) == x+x*y) ⇒ 1
Contrast this with a test for “structural equality“:
logical(x*(1+y) == x+x*y) ⇒ 0
The optional keyword argument 'Unknown' specifies that happens
for expressions that cannot simplify. By default these return
false (that is, cannot verify it is always true). Pass the
strings 'true', 'false' or 'error' to change the behaviour. You
can also pass logical true/false.
If isAlways is called on expressions without relationals,
it will return true for non-zero numbers:
isAlways (sym (10)) ⇒ 1
It is safe to use isAlways even when the expression does not
require simplifying:
syms x isAlways (sin(x) - sin(x) == 0) ⇒ 1
In practice, isAlways might get called on a simple
boolean variable, so this package implements @logical/isAlways
(which is essentially a no-op).
See also: @@sym/logical, @@sym/isequal, @@sym/eq, @@logical/isAlways.
Package: symbolic