Operations on Sets

In the Wolfram Language, sets are represented by sorted lists.


Union find the union of any number of sets

Intersection find the intersection of any number of sets

Complement find the complement with respect to a universal set

Subsets find all possible subsets of a set (the powerset)

Tuples find all possible tuples of n elements from a set

Groupings find all possible groupings of elements

Testing Relations between Sets

IntersectingQ  ▪  DisjointQ  ▪  SubsetQ

Testing Set Containment

ContainsAll  ▪  ContainsNone  ▪  ContainsAny  ▪  ContainsOnly  ▪  ContainsExactly

Testing Elements in Sets

Element  ▪  MemberQ  ▪  FreeQ

Constructing Sets from Lists

DeleteDuplicates  ▪  Sort  ▪  DuplicateFreeQ

Symbolic Set Theory

ForAll  ▪  Exists  ▪  Resolve