2.2 Algebra of Sets

There are operations that we can do on sets to form new sets. These operations can be interpreted as set-theoretic implementations of the Boolean operations and, or, & not. They also have satisfying parallels with operations and relations that we are familiar with for numbers. For the next three definitions, let A and B be sets.

Definition 2.6.

The union of A and B, AB, is defined as

{x:xAorxB}.

Where ‘or’ is inclusive, so the union includes all elements of both A and B.

Definition 2.7.

The intersection of A and B, AB, is defined as

{x:xAandxB}.

So the intersection includes only elements that are in both sets. A and B are said to be disjoint if and only if AB=, i.e. they have no elements in common.

Definition 2.8.

The difference of A and B, AB, is defined as

{x:xAandxB}.

We can also use this operation to define the complement of a set. For example, if A is a subset of some set X, then the complement of A in X is given by XA, i.e. the elements of X that are not in A.

Definition 2.9.

The Cartesian product of A and B, A×B, is defined as

{(a,b):aAandbB}.

So in plain speech, the Cartesian product of two sets is the set of all ordered pairs where the first component is a member of the first set and the second component is a member of the second set. It can be seen as a generalisation of the notion of Cartesian coordinates in the plane. Sometimes the Cartesian product of a set X with itself is noted as X2 instead of X×X, for example 2=× denoting the set of all integer points in the plane.