

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


These notes are meant as a supplement to the material found at the end of chapters 2.4 and 3.1. Most of the basic results can be found there.
Theorem 1. Two sets have the same size iff there is a bijection between them.
Definition 1. A set A is called countable iff |A| ≤ |N|. Otherwise, A is called uncountable.
Definition 2. A set A is called countably infinite iff it is countable and infinite
Theorem 2. The integers are countable.
Proof. We will show |Z| = |N| by exhibiting a bijection f : Z → N.
Let f (n) =
2 n n ≥ 0 2(−n) − 1 n < 0
(f is injective) Note that f maps negative integers to odd numbers and positive integers to even numbers. Thus, if f (n) = f (m), n and m are either both positive or both negative. In the first case, we have 2n = 2m, so n = m. In the second, 2(−n) − 1 = 2(−m) − 1, so − 2 n = − 2 m and thus n = m. Thus, f is injective
(f is surjective) Let n ∈ N. If n is even, then n 2 is a non-negative integer and f (n/2) = n. If n is odd, then n + 1 is even and positive so − n+1 2 is a negative integer and f (− n+1 2 ) = 2( n+1 2 ) − 1 = n. Thus, f is surjective.
∴ f is a bijection between Z and N and |Z| = |N|
Theorem 3. The reals are uncountable
Proof. In fact, we’ll show that even the interval [0, 1] is uncountable by showing that any function from N → [0, 1] must not be a surjection. Suppose f : N → [0, 1] were a surjection. Consider the real number r whose decimal expansion is 0.d 1 d 2 d 3 d 4 d 5.... Where
dn =
5 if nth^ digit off (n) = 4 4 otherwise
Note that r ∈ [0, 1]. However, we claim that there is no n such that f (n) = r. In particular, given any n ∈ N, our construction ensured that the nth^ digit of f (n) is different than the nth^ digit of r. Thus, f (n) 6 = r. Thus, there are no surjections from N to [0, 1], so |[0, 1]| > |N| Since [0, 1] ⊆ R, we conclude that R is uncountable.
The following is one of the more surprising results you’ll come accross, and a good example of infinities are just not intuitive:
Theorem 4. The rationals are countable
Proof. We know that each rational number has a unique representation in the form pq where p ∈ Z, q ∈ N, q 6 = 0 and p, q have no common factors. We can thus list all the rational numbers as follows: begin by listing all rationals whose representation has |p|, |q| < 1 in increasing order. Now list all rational numbers with |p|, |q| < 2 in increasing order, but do not repeat any from step 1. Now do the same with |p|, |q| < 3, etc. Note that each rational will eventually be listed, and will in fact be listed exactly once. Thus, the function f : N → Q given by f (n) = the nth^ number listed using the above algorithm is in fact a bijection.
∴ |Q| = |N| and Q is countable.
Using a similar technique, it’s not hard to show that |ZxZ| = |N|. That is, there are the same number of pairs of integers as there are natural numbers. The technique used to show R is uncountable is called “diagonalization” because we make sure r and f (n) differ on the “diagonal” of all the different decimal expansions. The following proof illustrates a similar technique:
Theorem 5. For any set S, |P(S)| > |S|
Proof. Let S be any set. We’ll show that there is no surjection from S to P(S). Let f : S → P(S) be a function and consider the set A = {x ∈ S : x /∈ f (x)}
Note that A ⊆ S. We claim that there is no s ∈ S such that f (s) = A, which we’ll prove by contradiction. AFSOC that there is an s such that f (s) = A. Then if s ∈ f (s)(= A), by the definition of A we would have s /∈ A, which is a contradiction. Similarly, if s /∈ f (s)(= A), then by the definition of A we would have s ∈ A. Thus, in either case we get a contradiction and we conclude that no such s can exist. ∴ there is no surjection from P(S) to S and we must have |P(S)| > |S|
Note that Theorem 5 shows that there are infinitely many infinites, since we have
|N| < |P(N)| < |P(P(N))| < |P(P(P(N)))| < · · ·
This raises the question of how exactly to name all these infinites, which we accomplish as follows:
Definition 3. The symbol ℵ 0 is used to denote |N|. ℵ 1 denotes the cardinality (ie, size) of the smallest uncountable set. ℵ 2 is the size of the smallest set with size ¿ ℵ 1 , etc.
A problem that was open for many, many years was whether |R| = ℵ 1 and is known as the Continuum Hypothesis. It is not hard to show that |R| = |P(N)| = 2ℵ^0 but it in fact turns out to be impossible to decide whether or not this is the same ℵ 1. That is, one can prove that there is no proof that |R| = ℵ 1 and that there is no proof that |R| 6 = ℵ 1.
As another application of diagonalization, we’ll prove the following amazing result:
Theorem 6. There is no computer program that takes in the source code to another program and an input to that program, and correctly determines whether the program ever finishes running on that input.
Proof. We’ll do this by contradiction, so suppose there were such a program called H(P, I) and suppose
1 P (I) eventually finishes 0 otherwise
Since H is a program, we can run it from within other programs. Consider the program K(x) which takes in some source code x and runs the following algorithm:
Run H(x, x). If H(x, x) = 1, then loop forever. Otherwise, stop running.
K is some program, so it has some source code and thus we can feed it to itself and consider what happens when we run K(K). By the definition of K, we’ll first run H(K, K) which from the definition of H will determine whether K(K) ever finishes. However, if H thinks K(K) will finish, it will return 1, and the code for K(K) will thus cause K to loop forever, making H incorrect. Similary, if H thinks K(K) will never finish, it will return 0 and K(K) will immediately stop running, thus also making H incorrect. In either case, we get a contradiction, so H cannot exist. Thus, no program can correctly determine when other programs will finish running.
While the above may seem a little contrived, the following theorem (known as G¨odel’s First Incompleteness Theorem) is one of the cornerstones of Mathematical Logic. It is short, elegant, and is widely accepted as one of the most important results of the 20th century:
Theorem 7. There is no program that will correctly determine whether statements are true or not.
Proof. Suppose there were such a program and suppose its source code were P. Now consider the sentence “Program P thinks this sentence is false”, which we’ll call G for convenience. If in fact P does think G is false, then G is in fact true and thus P is wrong about it. If on the other hand P thinks G is true, then G is in fact false and P is wrong about it again. Thus, the program P cannot exist.
You might be a little sketched out by the self-reference in the sentence G, but it is in fact not hard (though slightly tedious) to show that this is not a problem at all. Take Math 125, a CS theory class, or ask me for some links to the result if you’re curious.