1.2 Sets

Definition


A set is a collection of elements.

We denote sets by capital letters like X X and Y Y. If an element x x belongs to the collection X X, we write x∈X x is a member of X. If y y does not belong to X X, we write y∉X y is not a member of X. There is a special set containing no elements. This set is called an empty set and is denoted by ∅ empty set.

If you think of a set you should imagine a sack full of elements. The sack is your set and the elements in the sack are the elements belonging to the set. An empty set becomes a sack with no elements inside.

Constructors


To define a set we need to specify the elements inside the set. For doing that, we use the following notation

X={X| X equals open brace X divides condition on x} x close brace

Here, we mean that the set X X consists of all elements x x such that the condition on x x holds.

e.g. The set of natural numbers

ℕ={x|x the natural numbers equals open brace x divides x is a natural number}={0,1,2,3,⋯,n,⋯} close brace equals the set 0 comma 1 comma 2 comma 3 comma dot dot dot comma n comma dot dot dot

Operations on sets


Intersection


If we are given two sets X X and Y Y, then we define the intersection of X X and Y Y as follows

X∩Y={z|z∈X∧z∈Y} X intersection Y equals the set of all z such that z is a member of X and z is a member of Y

If we denote the sets X X and Y Y by discs on a plain then the intersection of X X and Y Y is denoted as below

Union


If we are given two sets X X and Y Y, then we define the union of X X and Y Y as follows

X∪Y={z|z∈X∨z∈Y} X union Y equals the set of all z such that z is a member of X or z is a member of Y

If we denote the sets X X and Y Y by discs on a plain then the union of X X and Y Y is denoted as below

Difference


If we are given two sets X X and Y Y, then we define the difference between X X and Y Y as follows

X∖Y={z|z∈X∧z∉Y} X set minus Y equals the set of all z such that z is a member of X and z is not a member of Y

If we denote the sets X X and Y Y by discs on a plain then the difference between X X and Y Y is denoted as below

Cartesian product


If we are given two sets X X and Y Y, then their Cartesian product is defined as follows

X×Y={(x,y)|x∈X;y∈Y} X times Y equals open brace open paren x comma y close paren divides x is a member of X semicolon y is a member of Y close brace

The Cartesian product is simply the set of all possible pairs (x,y) open paren x comma y close paren where the first element is taken from X X and the second from Y Y.