An Introduction To Set Theory
Set theory is a branch of mathematics that deals with collections of objects. Set theory mainly deals with, you guessed it, sets! So… what actually is a set?
A set is just a well-defined collection of objects, denoted by curly braces {}. The key word here being “well-defined” meaning there can be no duplicates. Sets also do not necessarily have to be related to mathematics. I could have a set of the numbers from 1 to 5,
or a set of U.S. Presidents,
Here I have introduced a new symbol, “…”, the ellipse. The ellipse is used to denote that there are values in-between, but they are being skipped for convenience. However it cannot always be made clear what these values are without being explicit (More on this later). For example, if I was listing the numbers from 1 to 100 in a set, I could write
which implies that I am listing all numbers from 1 to 100, without explicitly listing them.
Some more important properties of sets:
- Sets can be infinite, for instance, the set of all integers is infinite and is denoted by Z.
- There can be empty sets, which are denoted by ∅.
- Bonus: There is a set that contains everything, the universal set, including itself!
Some important operators
- Element of (∈)
Element of is used to indicate a value is in a set. For example, lets say
x = 3 and A = {1,2,3,4,5}, we can therefore say that x is an element of A, or in mathematical notation x ∈ A. Similarly, I can say 7 is not an element of A, or 7 ∉ A. - The union (∪) and intersection (∩)
The union and intersection operators work on 2 or more sets.
Lets say A = {1,2,3} and B = {3,4,5}
Taking the union of A and B we get:
A∪B = {1,2,3,4,5}
the union acts as an “or” operator, combining the sets. Take note that the answer is well-defined as there is no duplicate 3.
If we take the intersection of A and B:
A∩B = {3}
the intersection acts as an “and” operator, only taking values that are in both sets. Lets say B = {4,5,6}, then A∩B = ∅. - Set difference (\)
The set difference operator can be thought of as a subtraction.
Lets say A = {1,2,3,4,5} and B = {3,4,5} then the set difference is
A\B = {1,2}. Take note that set difference is not commutative like the union and intersection operators. i.e. A\B ≠ B\A, but A∪B = B∪A and A∩B = B∩A. - Subset (⊆)
The subset symbol is used to indicate that one set is a subset of another.
Lets say A = {1,2,3} and B = {1,2,3,4,5} therefore it is true to say
A ⊆ B, but B ⊆ A is false. Additionally if A,B = {1,2,3} then A ⊆ B is still true and B ⊆ A is now also true. - Cardinality (||)
Cardinality indicates the size of a set.
Lets say A = {1,2,3,4,5} therefore the cardinality of A is 5, or |A| = 5.
Set Builder Notation
Using set builder notation allows us to construct interesting, often infinite sets explicitly. Lets say I wanted to write the numbers from 1 to 100 like before, but I want to be entirely explicit. In the case before, I intended for it to be only integer values, but my notation left room for misinterpretation. Another person looking at the set, A = {1, 2, …, 100} might believe that
2.5 ∈ A, when in reality I did not intend for decimal numbers to be part of the set. Set builder notation allows us to be unambiguous when defining sets. Lets redefine the set:
This explicitly shows what I mean by “numbers from 1 to 100”. I want the integer values (Z) of x where/such that (|) 1 ≤ x ≤ 100.
Set builder notation can be used in various ways to show interesting sets, such as the set of all even integers
No matter what x value I give, only values where x = 2k (i.e. x has to be even) will be in the resulting set. It is also important to note I do not have to indicate that x ∈ Z as stating k ∈ Z and the relation x = 2k deals with that potential problem.
To end off…
I hope you learnt something new! This has been a fast, tip-of-the-iceberg introduction to set theory. There are many more operators, proofs and applications of set theory and mathematical logic in general. Feel free to comment any thoughts.
Cheers