2 Sets and functions

2.2 Set operators

2.2.1 Union, intersection, difference, complement

Definition 2.2.1.

Let A and B be sets.

  • AB, the union of A and B, is {x:xAxB}.

  • AB, the intersection of A and B, is {x:xAxB}.

  • AB, the set difference of A and B, is {xA:xB}.

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

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}.

  • AB={0,1,2,3}

  • AB={1,2}

  • AC=

  • AB={0}

  • AC=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.