Predicate expressing the emptyness of a set

MuPAD® notebooks will be removed in a future release. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.




solvelib::isEmpty(S) returns a boolean expression that is equivalent to the statement that S is the empty set.

Since functions operating on boolean expressions like assume, is, or solve cannot handle equations involving sets, it is not possible to pass the expression S={} to them. solvelib::isEmpty(S) helps to get around this problem, as it tries to express the emptyness of S in an equivalent way that can be handled by the aforementioned functions. If no suitable equivalen expression is found, the unevaluated call to solvelib::isEmpty is returned.

S may be a set of any type; see solve for an enumeration of the various types of sets.

The solvelib::isEmpty function always returns Boolean expressions, even if the function cannot resolve an expression. See Example 4.


Example 1

The emptyness of a DOM_SET can be decided immediately:

solvelib::isEmpty({a, b}), solvelib::isEmpty({})

Example 2

The intersection of a finite set with any other set is empty if and only if none of the elements of the finite set is in the other set:

solvelib::isEmpty({a, b} intersect Z_)

Example 3

The output of solve can be entered directly into solvelib::isEmpty:

solvelib::isEmpty(solve(a*x=b, x))

Example 4

Sometimes, no simpler equivalent expression can be found:

result := solvelib::isEmpty(solve(x^2 = sin(x), x))

The returned expression is a Boolean expression:

testtype(result, Type::Boolean)



Any set

Return Values

Boolean expression

Overloaded By


See Also

MuPAD Functions