Set operations

We may construct a new set by combining existing sets through set operations. Thus, sets equipped with set operations form an algebra of sets, so to speak. We will see set operations are closely related to logical operations.



Definition (union of sets)

Let A and B be sets. Then, their union, denoted AB, is defined as

AB={x|xAxB}.

That is, AB is a set consisting of elements that are in A or in B.

Remark: "xA" and "xB" are logical propositions (predicates).

Example: If A={1,2,3} and B={1,3,5}, then AB={1,2,3,5}.

Definition (intersection of sets)

Let A and B be sets. Then, their intersection, denoted AB, is defined as

AB={x|xAxB}.

That is, AB is a set consisting of elements that are in A and in B.

Remark: The logical "and" (i.e., conjunction) is often written as a comma (",") so that the above definition is often written as 

AB={x|xA,xB}.

Example: If A={1,2,3} and B={1,3,5}, then AB={1,3}.

Definition (disjoint sets)

The two sets A and B are said to be disjoint if AB=.


We know that addition and multiplication of real numbers are commutative. That is, for any x,yR, we have

x+y=y+x

and

xy=yx.

Similarly, the set union and intersection are commutative:

Lemma

Let A and B be sets. Then,

AB=BAAB=BA.

Proof. Let us prove this for the union. Suppose xAB. Then, by definition of union, xAxB. But this proposition is equivalent to xBxA. Again by the definition of union, this means that xBA. Therefore, ABBA. By reversing this argument, we can also show that BAAB. Therefore, AB=BA. More concisely, we can say

AB={x|xAxB}={x|xBxA}=BA.

The proof for the intersection is left as an exercise. ■


We also know that the addition and multiplication of real numbers are associative. That is, for any x,y,zR, we have

x+(y+z)=(x+y)+z

and

x(yz)=(xy)z.

This means that, if we first add y and z, and then add x, the result is the same as if we first add x and y, and then add z (similar for the multiplication). The associativity also holds for set union and intersection.

Lemma

Let A,B, and C be sets. Then,

A(BC)=(AB)C,A(BC)=(AB)C.

Proof. Exercise. ■

For ordinary numbers, we have the distributive law. That is, for any x,y,zR, we have x(y+z)=xy+xz.

Similar, but different, laws apply to set union and intersection.

Lemma

For any sets A,B, and C, we have A(BC)=(AB)(AC),A(BC)=(AB)(AC).

Proof. Exercise. ■

Note that both the union and intersection distribute over one another. In contrast, addition does not distribute over multiplication: x+(yz)(x+y)(x+z).

In ordinary numbers, the number 0 (zero) plays a special role. For any xR, we have x+0=x,x0=0. In sets, the empty set plays a similar role.

Lemma

For any set A, we have A=A,A=.

Proof.  Noting that x is always false, xAx is true if and only if xA is true (if in doubt, write down the truth table). Thus,

A={x|xAx}={x|xA}=A.

The other equality is an exercise. ■

Definition (Set difference)

Let A and B be sets. The set difference, denoted AB, is defined as

AB={x|xAxB}.

Note that xB may be also written as ¬(xB). 

Lemma

AB and BA are disjoint. That is,

(AB)(BA)=.

Proof. Exercise. Hint: xB may be also written as ¬(xB).  ■

It is often convenient to consider a universal set (or universe), that is, the set of all things we ever want to consider, as long as it makes sense. In other words, everything we consider in mathematics is (supposed to be) an element of that universal set. If U is a universal set, then, by definition, xU is always true for any x.

Definition (Set complement)

Let U be a universal set. For any set A, its complement, denoted Ac, is defined as Ac=UA.

Remark: Some people have different notations for the set complement: instead of Ac, we may use A or A¯, or something else.

Lemma

For any set A, we have (Ac)c=A.

That is, the complement of the complement of A is A itself.

Proof. By definition, Ac={x|xU¬(xA)} and

(Ac)c={x|xU¬(xAc)}.

Since xAcxU¬(xA) (equivalence), we have

¬(xAc)¬(xU¬(xA))¬(xU)¬(¬(xA))  (De Morgan's law for logical operations)xAxA

Thus, (Ac)c={x|xUxA}={x|xA}=A because xU is always true () by definition. ■

Lemma

Let U be a universal set and A be any set. Then,

AAc=U,AAc=.

Proof. Exercise. ■

Theorem (De Morgan's laws (set version))

For any sets A and B, we have (AB)c=AcAc,(AB)c=AcBc.

Proof. Exercise. ■


Set of sets

A set can contain sets as its elements. For example,
{1,2,,{1},{1,2,3}}
is a set. The set of all subsets of a set is called the power set.

Definition (Power set)

Let A be a set. The set of all subsets of A is called the power set of A and denoted P(A) or 2A. That is, P(A)={aaA}.

Example. Let A={1,2}. Then, P(A)={,{1},{2},{1,2}}.

Example. Let B={a,b,c}. Then, P(B)={,{a},{b},{c},{a,b},{b,c},{c,a},{a,b,c}}.

Exercise. What is P(), the power set of the empty set?

Cartesian products and tuples

We can combine two or more sets to make another set.

Definition (Cartesian product)

Let A and B be sets. The Cartesian product of A and B, denoted A×B, is the set defined as
A×B={(a,b)aA,bB}. That is, A×B is the set of all ordered pairs (a,b, one from A, the other from B. (We may simply say "pairs" to mean ordered pairs.)

Example. Let A={1,2} and B={a,b}. Then, A×B={(1,a),(1,b),(2,a),(2,b)}.  □

Note that (a,b)A×B does not imply (b,a)A×B. The order matters! Let (a,b),(c,d)A×B be two (ordered) pairs. We say that two ordered pairs are equal, (a,b)=(c,d) if and only if a=c and b=d.

Since A×B is a set, we can make a Cartesian product between A×B and yet another set, say C: (A×B)×C. That is,
(A×B)×C={((a,b),c)(a,b)A×B,cC}. Note that this set is different from A×(B×C) as
A×(B×C)={(a,(b,c))AA,(b,c)B×C}.
Nevertheless, we may define them to be equal:
(A×B)×C=def.A×(B×C).
More precisely, we regard the pairs ((a1,b1),c1)(A×B)×C and (a2,(b2,c2))A×(B×C) as equal if and only if a1=a2,b1=b2, and c1=c2

Remark: We are actually defining a bijection (A×B)×CA×(B×C) by ((a,b),c)(a,(b,c)). If there exists a bijection between two sets, then these sets are said to be isomorphic. This means they are essentially identical. See the post on maps for some more details about bijections.

Accordingly, we omit the parenthesis:
A×B×C=(A×B)×C=A×(B×C).
So,
A×B×C={(a,b,c)aA,bB,cC}.
The elements of A×B×C are called (ordered) triples

More generally, let A1,A2,,An be sets, and we define
A1×A2××An={(a1,a2,,an)aiAi,i=1,2,,n}, the elements of which are called n-tuples, or simply tuples.

These A1,,An can be the same set. In that case, we define the Cartesian power as 
An=A×A××An times.
For example, A×A=A2, A×A×A=A3.





Comments

Popular posts from this blog

Birth process

Branching processes: Mean and variance

Informal introduction to formal logic