Sets
There are a lot of things to talk about when it comes to sets.
Since it is assumed that you already know about things like union, intersection, etc., we're not going to go over set operations.
Some popular sets you might know are:
symbols |
set |
elements |
|
the empty set |
none |
|
natural numbers (or, nonnegative integers if you don't like to get political) |
|
|
integers |
|
|
rational numbers |
|
|
real numbers |
|
|
complex numbers |
|
Look at this formula:
This is the subset notation (), and the formula says that for all , if in , then in . It also implies that both sets are equal.
When talking about a proper subset, the notation is , for example . That means is a proper subset of , and they are not equal.
Why is is a subset of every set?
Well, think of this: . That means .
That is an implication. The first part of it is clearly false, there is nothing in an empty set, yet we say . Remember that in an implication, when the antecedent (the "if part") is false, no matter what follows, the whole statement is true. So, both the statements F T and F F are true. It doesn't matter if is in or not, since is clearly false, the whole statement is true.
A power set is the set of all subsets of a set.
For example, if our set is then its power set is .
Another example is . It says that the set of positive integers is in the power set of integers.
Difference is every element in set and not in set :
The complement of a set is the set of all elements that are not in that set. It is denoted with an overline, like .
An example, if the domain we’re working with is the integers, then the complement of the nonnegative integers is the set of negative integers: .
Finite Cardinality
When a set is finite, the number of elements it has is called its size, or cardinality, and it is denoted as .
So, means the "number of elements in set ".
There are number of subsets of a set that has elements:
But, why is that?
Why is the size of a power set is ?
Alright, we are going to use a string representation for all possible subsets, where an element can be in it, or not.
We're going to put where the element exists in the set but not in the subset, and we're going to put where the element exists both in the set and the subset.
Let's say that our set is .
We can say a subset could be the one where none of the elements exist — which is indeed the empty set, so we can represent it as .
Another possibility is a subset where only exists — we will represent it as such: . This is the subset .
Going on like this, let's see all the possibilities:
string |
subset |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This is indeed our power set, which is .
The number of string representations (the number of bit strings) is the same as , which is the size of our power set!
In our case, is , so the size of our power set is .
And, here are some set identities:
Identity Laws |
|
|
Domination Laws |
|
|
Idempotent Laws |
|
|
Complementation Law |
|
Commutative Law |
|
|
Associative Laws |
|
|
Distributive Laws |
|
|
De Morgan's Laws |
|
|
Absorption Laws |
|
|
Complement Laws |
|
|
For a deep dive into an introduction to set theory, you can check out this wonderful book from Open Logic Project.