✖

Union, intersection, difference and complement of sets

There are various operations we can carry out on sets. The most basic are union, intersection, difference and complement.

Union of sets

We denote the union of sets by the symbol ∪, so the union of the sets A and B is written in the usual way as A ∪ B. The union of A and B is a new set that contains all the elements of A and also all the elements of B. The definition is:

A∪B={x|x∈A∨x∈B}

An example: take two sets A = {1, 3, 5, 7} and B = {2, 4, 6}. Their union is the set A ∪ B = {1, 2, 3, 4, 5, 6, 7}. The resulting set contains the elements of both sets.

Another example: A = {1, 2, 3} and B = {2, 3, 4}. The union is A ∪ B = {1, 2, 3, 4}. The elements 2 and 3 do not appear twice in the resulting set, because a set never contains the same element more than once.

Some more properties:

  • A ∪ A = A: if we take the union of two identical sets, we get the same set again.
  • A ∪ B = B ∪ A: the union is commutative, so the order doesn’t matter.
  • A ∪ ∅ = A: the empty set has no elements, so there is nothing to add.

Intersection of sets

The intersection of two sets A and B is a new set containing the elements that the two sets have in common. More precisely, the new set contains the elements that belong to A and at the same time belong to B. We denote the intersection by the symbol ∩. The definition is:

A∩B={x|x∈A∧x∈B}

Example: A = {1, 3, 5, 7, 9} and B = {4, 5, 6, 7}. The intersection is A ∩ B = {5, 7}. Another example: A = {a, b, c, d, e} and B = {f, g, h, i, j}. The intersection is A ∩ B = ∅. These sets have no element in common, so their intersection is the empty set.

Some more properties:

  • A ∩ A = A: the intersection of two identical sets is the same set again.
  • A ∩ B = B ∩ A: the intersection is commutative, so the order doesn’t matter.
  • A ∩ ∅ = ∅: the empty set has no elements, so it certainly has no element in common with A.

Difference of sets

We write the difference of sets with the ordinary minus sign − or, better, with a slanted minus ∖. The difference of two sets A and B is the set that contains all the elements of A and none of the elements of B. In short, you look at which elements the first set has in common with the second and remove them. The definition is:

A∖B={x∈A|x∉B}

Example: A = {1, 2, 3, 4, 5} and B = {4, 5, 6, 7, 8}. The difference is then A ∖ B = {1, 2, 3}. These are the elements left over when we remove from A all the elements that are in B. Another example: A = {a, b, d, e}. The difference is A ∖ A = ∅.

Some more properties:

  • A ∖ A = ∅: just as subtracting two equal numbers gives zero (for example 5 − 5 = 0), subtracting two equal sets gives the empty set.
  • A ∖ ∅ = A: the empty set has no elements, so we can’t remove any element from A.

Complement of a set

The complement of a set A is written in various ways, but most often with a superscript c, Ac, or with a bar over the top: A―. For simplicity I’ll use the superscript c. To work out the complement of A, we need to know which set we are taking the complement in. The complement is all the elements that are not in A, so it is a sort of opposite of A.

If the universal set is M = {1, 2, 3, …, 9, 10}, then the complement of A = {2, 4, 6, 8, 10} in M is the set Ac = {1, 3, 5, 7, 9}. It contains all the elements of M that are not in A. We can say that Ac in M is equal to M ∖ A.

If we take the integers as the universal set, then the complement of the set of even numbers is the set of odd numbers. The complement of the set A = {1, 2, 3, 4} is the set Ac = {…, −3, −2, −1, 0, 5, 6, 7, …}.

If we take the complement twice, we get the original set back. For example, within the integers: the complement of the even numbers is the odd numbers, and the complement of the odd numbers is the even numbers again. So A = (Ac)c (the complement of the complement of A).

Chapters: Sets, Union, intersection, difference and complement of sets, Countable sets, Paradoxes of set theory