2.2 Set operators

2.2.1 Union, intersection, difference, complement

Definition 2.2.1.

Let A and B be sets.

  • •

    A∪B, the union of A and B, is {x:x∈A∨x∈B}.

  • •

    A∩B, the intersection of A and B, is {x:x∈A∧x∈B}.

  • •

    A∖B, the set difference of A and B, is {x∈A:x∉B}.

  • •

    If A is a subset of a set Ω then Ac, the complement of A in Ω, is {x∈Ω:x∉A}.

We can express complements using set differences. If A is a subset of Ω then its complement Ac in Ω is equal to Ω∖A.

Example 2.2.1.

Suppose A={0,1,2},B={1,2,3},C={4}.

  • •

    A∪B={0,1,2,3}

  • •

    A∩B={1,2}

  • •

    A∩C=∅

  • •

    A∖B={0}

  • •

    A∖C=A

  • •

    If Ω={0,1,2,…} then Ac would be {3,4,…}.

The set ℕ={0,1,2,…} is called the natural numbers. Some people exclude 0 from ℕ but in MATH0005 the natural numbers include 0.

It’s typical to draw Venn diagrams to represent set operations. We draw a circle, or a blob, for each set. The elements of the set A are represented by the area inside the circle labelled A. Here are some examples:

Figure 2.1: Venn diagram for the set difference of A and B
Figure 2.2: Venn diagram for the union of A and B
Figure 2.3: Venn diagram for the intersection of A and B
Figure 2.4: Venn diagram for the complement of the union of A and B
Figure 2.5: Venn diagram for the complement of the intersection of A and B

2.2.2 Size of a set

Definition 2.2.2.

The size or cardinality of a set X, written |X|, is the number of distinct elements it has.

Example 2.2.2.
  • •

    |{1,2}|=2

  • •

    |∅|=0

  • •

    |{1,2,1,3}|=3

Definition 2.2.3.

A set is finite if it has 0, or 1, or 2, or any other natural number of elements. A set that is not finite is called infinite.

ℕ and ℤ are infinite sets while the sets in Example 2.2.2 are all finite.