Introduction to set theory and to methodology and philosophy of
mathematics and computer programming
Power sets
An overview
by Jan Plaza
c 2017 Jan Plaza
Use under the Creative Commons Attribution 4.0 International License
Version of March 5, 2017
A family of sets – a set of sets.
{{0, 1, 2}, {1, 2, 3}, {5}} is a family of sets.
{∅} is a family of sets.
∅ is a family of sets.
Power Set Axiom
∀X ∃Y ∀u (u ∈ Y ↔ u ⊆ X)
For any set X,
there is a family Y of sets, s.t.
u ∈ Y ↔ u ⊆ X, for every u.
For any set X,
there is a family Y of all subsets of X.
Such a family Y is called the power set of X , and is denoted P(X) .
Fact
x ∈ P(X) iff x ⊆ X.
Example
P({0, 1, 2}) = {∅, {0}, {1}, {2}, {0, 1}, {0, 2}, {1, 2}, {0, 1, 2}}.
P({0, 1}) = {∅, {0}, {1}, {0, 1}}.
P({0}) = {∅, {0}}.
P(∅) = {∅}.
Theorem
If X has n elements, then P(X) has 2n elements.
Proof
Consider the following property p(n) of a natural number n:
every set with n elements has 2n subsets.
We will prove that every natural number has this property.
Proof by induction on n.
Base case.
Goal: p(0), i.e. every set with 0 elements has 20 subsets.
Take any set X with 0 elements. X = ∅.
∅ has only 1 subset, namely ∅. So X has 20 subsets.
Proof, continued.
Inductive case.
Take an arbitrary natural number n.
Assume p(n): every set with n elements has 2n subsets; this is the inductive hypothesis.
Goal: p(n + 1), i.e. every set with n + 1 elements has 2n+1 subsets.
Take any set X with n + 1 elements.
As n ∈ N, this implies that X has at least one element.
Select any x ∈ X.
Let Y = X − {x}.
Y has n elements.
By inductive hypothesis, P(Y ) has 2n elements.
Proof, continued.
Now we will count the subsets of X.
First, count the subsets of X that do not contain x:
these are just the subsets of Y ,
so there are 2n such subsets.
Second, count the subsets of X that contain x:
every such subset X0 can be written as Y0 ∪ {x} for exactly one Y0 ⊆ Y ;
so their number equals the number of subsets of Y , i.e. 2n.
Notice that in this way every subset of X was counted exactly once.
So, the total number of subsets of X is 2n + 2n = 2n+1.
Bit-vector representation of subsets
The subsets of {x0, x1, x2} can be represented as bit-vectors v0, v1, v3 .
vi = 1 iff xi is in the subset.
Subsets of {x0, x1, x2} Bit-vectors
∅ 0, 0, 0
{x0} 1, 0, 0
{x1} 0, 1, 0
{x2} 0, 0, 1
{x0, x1} 1, 1, 0
{x0, x2} 1, 0, 1
{x1, x2} 0, 1, 1
{x0, x1, x2} 1, 1, 1
Works also for any set {0, 1, ..., n − 1}.
There are 2n bit-vectors of length n, and there are 2n subsets of an n-element set.
This is used in programming when subsets of a fixed U = {x0, x1, ..., xn−1} are needed.
Set operations ∪, ∩, c are then implemented as bit-wise operations and, or, not.
Exercise
1. True or false? P(X) ∩ P(Y ) = P(X ∩ Y ).
2. True or false? P(X) ∪ P(Y ) ⊆ P(X ∪ Y ).
3. Disprove: P(X) ∪ P(Y ) ⊇ P(X ∪ Y ).

3.2 Power sets

  • 1.
    Introduction to settheory and to methodology and philosophy of mathematics and computer programming Power sets An overview by Jan Plaza c 2017 Jan Plaza Use under the Creative Commons Attribution 4.0 International License Version of March 5, 2017
  • 2.
    A family ofsets – a set of sets. {{0, 1, 2}, {1, 2, 3}, {5}} is a family of sets. {∅} is a family of sets. ∅ is a family of sets.
  • 3.
    Power Set Axiom ∀X∃Y ∀u (u ∈ Y ↔ u ⊆ X) For any set X, there is a family Y of sets, s.t. u ∈ Y ↔ u ⊆ X, for every u. For any set X, there is a family Y of all subsets of X. Such a family Y is called the power set of X , and is denoted P(X) . Fact x ∈ P(X) iff x ⊆ X.
  • 4.
    Example P({0, 1, 2})= {∅, {0}, {1}, {2}, {0, 1}, {0, 2}, {1, 2}, {0, 1, 2}}. P({0, 1}) = {∅, {0}, {1}, {0, 1}}. P({0}) = {∅, {0}}. P(∅) = {∅}. Theorem If X has n elements, then P(X) has 2n elements.
  • 5.
    Proof Consider the followingproperty p(n) of a natural number n: every set with n elements has 2n subsets. We will prove that every natural number has this property. Proof by induction on n. Base case. Goal: p(0), i.e. every set with 0 elements has 20 subsets. Take any set X with 0 elements. X = ∅. ∅ has only 1 subset, namely ∅. So X has 20 subsets.
  • 6.
    Proof, continued. Inductive case. Takean arbitrary natural number n. Assume p(n): every set with n elements has 2n subsets; this is the inductive hypothesis. Goal: p(n + 1), i.e. every set with n + 1 elements has 2n+1 subsets. Take any set X with n + 1 elements. As n ∈ N, this implies that X has at least one element. Select any x ∈ X. Let Y = X − {x}. Y has n elements. By inductive hypothesis, P(Y ) has 2n elements.
  • 7.
    Proof, continued. Now wewill count the subsets of X. First, count the subsets of X that do not contain x: these are just the subsets of Y , so there are 2n such subsets. Second, count the subsets of X that contain x: every such subset X0 can be written as Y0 ∪ {x} for exactly one Y0 ⊆ Y ; so their number equals the number of subsets of Y , i.e. 2n. Notice that in this way every subset of X was counted exactly once. So, the total number of subsets of X is 2n + 2n = 2n+1.
  • 8.
    Bit-vector representation ofsubsets The subsets of {x0, x1, x2} can be represented as bit-vectors v0, v1, v3 . vi = 1 iff xi is in the subset. Subsets of {x0, x1, x2} Bit-vectors ∅ 0, 0, 0 {x0} 1, 0, 0 {x1} 0, 1, 0 {x2} 0, 0, 1 {x0, x1} 1, 1, 0 {x0, x2} 1, 0, 1 {x1, x2} 0, 1, 1 {x0, x1, x2} 1, 1, 1 Works also for any set {0, 1, ..., n − 1}. There are 2n bit-vectors of length n, and there are 2n subsets of an n-element set. This is used in programming when subsets of a fixed U = {x0, x1, ..., xn−1} are needed. Set operations ∪, ∩, c are then implemented as bit-wise operations and, or, not.
  • 9.
    Exercise 1. True orfalse? P(X) ∩ P(Y ) = P(X ∩ Y ). 2. True or false? P(X) ∪ P(Y ) ⊆ P(X ∪ Y ). 3. Disprove: P(X) ∪ P(Y ) ⊇ P(X ∪ Y ).