CSCI 2824: Lecture 15

This lecture will continue on

  • Partitions of a set: Definition.

  • Proving equivalences of sets (a couple of examples).

Material from book: 3.3.


Given two sets A, and B, we say that A subseteq B if every element of A is an element of B.

A is said to be a proper subset of B (written A subset B) iff A subseteq B but at the same time A not= B.

Two sets are equal, i.e, A = B if and only if A subseteq B and B subseteq A.

Power Sets

The power set of a set P(S) is the set that contains all subsets of S, including the empty set.

Let us first see some examples of power sets:

1. A = {1,2}, its power set is P(A) = { emptyset, {1}, {2}, { 1,2} }.

2. Take the empty set. Its power set is P(emptyset) = { emptyset } the set containing the empty set.

What is the difference between the empty set and set containing it? It is easy to explain through code.

Here is code to create empty set in C++ (you can write equivalent in Java):

Empty Set

   set<int> * s = new set<int>(); // Create an empty set.
   assert( s-> size() == 0); // s has no elements

Here is how we create a set containing the empty set.

Set containing the empty set

   set<int> * emptySet = new set<int>(); // Create empty set.
   set< set<int>* > * emptyEmptySet = new set< set<int> > ();
   emptyEmptySet -> insert (emptySet); // Put the empty set into the empty empty.
   assert( emptyEmptySet -> size() == 1); // The size of the set containing the empty set is 1.

As you can see from the illustration above, the sets emptyset and its power set { emptyset } are indeed two different beasts!! The empty set has cardinality zero whereas the power set of empty has cardinality 1.

Counting the Elements of the Power Set

If set A = { a_1,ldots,a_n } has n > 0 elements, how many elements does its power-set have?

Let us take a smaller example A = { a,b,c }. And look at its power set. Each element of the power set is a subset of A. We can visualize the power-set using the following table where a 0 entry corresponding to a_i column means that a_i has been omitted from the subset.

Power set elt. a? b? c ?
{} 0 0 0
{a} 1 0 0
{b} 0 1 0
{c} 0 0 1
{a,b} 1 1 0
{a,c} 1 0 1
{b,c} 0 1 1
{a,b,c} 1 1 1

Note: We have established a one-one correspondence between the power set of A and a binary number of |A| bits. In the example above,

  • Every element of the power set of {a,b,c} corresponds to a unique 3 bit binary number.

  • Every 3 bit binary to an element of the power-set.

What about A= { a_1,ldots,a_n} with n elements? Every element will correspond to a n bit binary number. How many n bit binary numbers are there?

We have derived sufficient evidence to write the following theorem:

Theorem: The power set of A has 2^{|A|} elements.

We can prove this claim in various ways. The one-one correspondence between elements of the power set and binary strings of |A| bits is the easiest proof. To convince ourselves fully that such correspondences can be used to count elements in a set, we need to explore them further.

This naturally brings us to the topic of functions and one-to-one correspondences. Before that, we take a small diversion to define a partition here. It will be useful later when we study equivalence classes.


A parition, formalizes the idea of dividing up the elements of a set into k disjoint sets. Eg., Take a set S = { 1,2,3,4}. An example of a partition of S is { {1,2}, {3},{4} }. Another example is { {1,4}, {2,3} }.

A partition of a set S is a set of subsets mathcal{T} = {S_1,ldots, S_k} such that

  • None of the S_is are empty: S_i not= emptyset for 1 leq i leq k.

  • Every pair of elements S_i and S_j are disjoint: S_i cap S_j = emptyset for i not= j.

  • The union of all elements gives S: bigcup_{j=1}^k S_j = S.

True or False: Any partition mathcal{T} of a set S is a subset of its power set P(S).


Here is a problem about partitions: You are given a set of numbers S = { 1,2,42,13,61,69,109,-14,29,209 }. The question is whether we can partition S into two subsets mathcal{T} = { S_1, S_2} such that the sum of elements in S_1 is the same as the sum in S_2.

This problem has applications all over the place but is known to be a hard problem (as hard as factoring integers).

Proving Properties of Sets

We are often asked to prove certain relations between two sets: they are the same or that one is a subset of another. These proofs tend to be simple provided our approach to them is systematic. Here are a couple of examples:


Claim For any three sets A,B,C, we have A times (B cup C) = (A times B) cup (A times C).


To prove that two sets are the same, we show that each one is the subset of the other.

  • Prove A times (B cup C) subseteq (A times B) cup (A times C).

    • Take any element (x,y) in A times (B cup C). We will show that (x,y) in (A times B) cup (A times C).

    • We know that by definition, y in B cup C. In other words, y in B or yin C.

      • If y in B, (x,y) in A times B.

      • Otherwise, if y in C, we have (x,y) in A times C.

    • Therefore, we conclude that (x,y) in (A times B) cup (A times C).

  • Prove  (A times B) cup (A times C) subseteq A times (B cup C).

    • Once again, let us take any element (u,v) in (A times B) cup (A times C). We will show that (u,v) in A times (B cup C) .

    • We know that either (u,v) in A times B or (u,v) in A times C.

    • Therefore, we conclude that  vin B or v in C.

    • I.e,  v in (B cup C).

    • Putting this together, we get (u,v) in A times (B cup C).


Claim Given two sets A,B, A subseteq B holds if and only if A cup B = B.

Notice that the claim is an if and only if claim. Such claims are actually two subclaims in disguise. We need to prove each of them.

  • Subclaim-1: For any sets A,B, IF  A subseteq B then A cup B = B.

  • Subclaim-2: For any two sets A,B, IF A cup B = B then A subseteq B.

Proof of Subclaim-1:

Let A,B be any two given sets such that A subseteq B holds. We will show that A cup B = B holds.

To show A cup B = B, we will first show that (1.) A cup B subseteq B and (2.) B subseteq A cup B.

  • Proof of A cup B subseteq B: Take any element of A cup B and show that it also belongs to B.

    • Let a in A cup B. We know that a in A or a in B. However, since A subseteq B, we know that a in A Rightarrow a in B. Therefore, we can safely conclude that a in B. Therefore A cup B subseteq B.

  • Proof of B subseteq A cup B: Take any element of B and show that it also belongs to A cup B.

    • Let b in B. By definition of union, we conclude that b in A cup B.

Proof of Subclaim-2

For any two sets A,B, IF A cup B = B then A subseteq B. We will attempt a proof by contradiction.

  • Let A,B be any two sets such that A cup B = B. However for the sake of contadition, we assume that A notsubseteq B. Therefore, there is some element x in A such that x notin B.

  • However, since x in A, we have that x in A cup B. However, x notin B. Therefore, we have proved that A cup B not= B since one of the sets has x in it and the other does not.

This however, contradicts our assumption that A cup B = B.