04
Set sizes Let X,Y be finite sets, f:XY a function
Theorem: If f is injective then |X||Y|.
Proof by picture (not really a proof, just for intuition): 5 X Y<br>
05
Set sizes Let X,Y be finite sets, f:XY a function
Theorem: If f is injective then |X||Y|.
Actual proof:
Consider the set S={(x,f(x)): xX}. This is called that “graph of f”.
Since f is a function, each xX appears exactly once, hence |S|=|X|.
Since f is injective, the values of f(x) are all distinct, i.e. each value yY appears in at most one pair. Hence |S||Y|.
So, |X||Y|.
QED. 6<br>
06
Set sizes Let X,Y be finite sets, f:XY a function
Theorem: If f is surjective then |X||Y|.
Try and prove yourself first 7<br>
07
Set sizes Let X,Y be finite sets, f:XY a function
Theorem: If f is surjective then |X||Y|.
Proof by picture (not really a proof, just for intuition): 8 X Y<br>
08
Set sizes Let X,Y be finite sets, f:XY a function
Theorem: If f is surjective then |X||Y|.
Proof:
Consider again the set S={(x,f(x)): xX}.
Since f is a function, each xX appears exactly once hence |S|=|X|.
Since f is surjective, all values yY appear in at least one pair. So |S||Y|.
So, |X||Y|.
QED. 9<br>
09
Set sizes Let X,Y be finite sets, f:XY a function
Theorem: If f is bijective then |X|=|Y|.
Try and prove yourself first 10<br>
10
Set sizes Let X,Y be finite sets, f:XY a function
Theorem: If f is bijective then |X|=|Y|.
Proof by picture (not really a proof, just for intuition): 11 X Y<br>
11
Set sizes Let X,Y be finite sets, f:XY a function
Theorem: If f is bijective then |X|=|Y|.
Proof: f is bijective so it is both injective (hence |X||Y|) and surjective (hence |X||Y|). So |X|=|Y|. QED. 12<br>
12
3. Infinite set sizes 13<br>
13
Infinite set sizes Let X,Y be infinite sets (e.g natural numbers, prime numbers, reals)
We want to define a notion of set size (called cardinality) which will make sense
Turns out, it is easier to just define which sets are smaller than other ones 14<br>
14
Infinite set sizes Let X,Y be infinite sets (e.g natural numbers, primes numbers, reals)
We define |X||Y| if there is an injective function f:XY
If Z=integers and E=even integers, is
|Z||E|
|E||Z|
Both
Neither 15<br>
15
Infinite set sizes |Z|=|E|
How do we prove this?
|E||Z| because we can define f:EZ by f(x)=x. It is injective.
|Z||E| because we can define f:ZE by f(x)=2x. It is injective. 16<br>
16
Infinite set sizes Interesting facts:
|Z|=|E|=|prime numbers|=|N|
This “size”, or cardinality, is called countable and denoted as 0
It is the smallest infinite size
These are sets which you can list in a sequence
BUT!
|reals|>|Z|
There are “really” more reals than integers
We will prove that! 17<br>
17
Countable sets Theorem: The rationals are countable, |Q|= 0
Proof: we need to show that we can list the rationals in a sequence
Bad idea: 1,1/2,1/3,1/4,1/5,1/6,…
This way we will never hit, say, 2/3 18<br>
18
Countable sets Theorem: The rationals are countable, |Q|= 0
Proof:
It’s enough to the list positive rationals, because if Q+={x1,x2,x3,…} then we have Q={0,x1,-x1,x2,-x2,x3,-x3,…}
Solution: list x/y by first enumerating s=x+y, then x=1,2,…,s
1/1, 1/2, 2/1, 1/3, 2/2, 3/1, 1/4, 2/3, 3/2, 4/1, … 19 X<br>
19
Enumerating the rationals 20 1 1 2 3 4 1 2 3 4 x y 2 3 X 5 8 9 4 6 7<br>
20
Reals are uncountable Theorem: |R|> 0
Proof: by contradiction
Say we can list all the real numbers in [0,1] in a sequence x1,x2,x3,…
For each number, write its representation in base 10, eg 0.12893453…
Let xi=0.bi,1 bi,2 bi,3 bi,4 … 21<br>
21
Reals are uncountable Theorem: |R|> 0
R={x1,x2,x3,…}. Create a table:
x1=0.b1,1 b1,2 b1,3 b1,4 …
x2=0.b2,1 b2,2 b2,3 b2,4 …
x3=0.b3,1 b3,2 b3,3 b1,4 …
x4=0.b4,1 b4,2 b4,3 b4,4 …
… 22<br>
22
Reals are uncountable Theorem: |R|> 0
R={x1,x2,x3,…}. Create a table:
x1=0.b1,1 b1,2 b1,3 b1,4 …
x2=0.b2,1 b2,2 b2,3 b2,4 …
x3=0.b3,1 b3,2 b3,3 b1,4 …
x4=0.b4,1 b4,2 b4,3 b4,4 …
…
Define a number x=0.c1c2c3c4… such that cibi,i for all i
c cannot be equal to any xi, since their i-th digits differ
Hence, c is a real number which is not in our list
A contradiction. The reals cannot be listed. 23<br>
23
Diagonilaztion This proof technique is called diagonilaztion
It is used to create an object different from all the element in our list
It is very powerful
For example, it can be used to show that it is generally impossible to know whether a computer code is correct, or even simpler questions, like if it loops forever or not 24<br>