<<

1 Elementary

Notation: {} enclose a set. {1, 2, 3} = {3, 2, 2, 1, 3} because a set is not defined by or multiplicity. {0, 2, 4,...} = {x|x is an even natural } because two ways of writing a set are equivalent. ∅ is the . x ∈ A denotes x is an of A. N = {0, 1, 2,...} are the natural . Z = {..., −2, −1, 0, 1, 2,...} are the . m Q = { n |m, n ∈ Z and n 6= 0} are the rational numbers. R are the real numbers. 1.1. Axiom of Let A, B be sets. If (∀x)x ∈ A iff x ∈ B then A = B. Definition 1.1 (). Let A, B be sets. Then A is a subset of B, written A ⊆ B iff (∀x) if x ∈ A then x ∈ B. 1.1. If A ⊆ B and B ⊆ A then A = B. . Let x be arbitrary. Because A ⊆ B if x ∈ A then x ∈ B Because B ⊆ A if x ∈ B then x ∈ A Hence, x ∈ A iff x ∈ B, thus A = B. Definition 1.2 (). Let A, B be sets. The Union A ∪ B of A and B is defined by x ∈ A ∪ B if x ∈ A or x ∈ B. Theorem 1.2. A ∪ (B ∪ C) = (A ∪ B) ∪ C Proof. Let x be arbitrary. x ∈ A ∪ (B ∪ C) iff x ∈ A or x ∈ B ∪ C iff x ∈ A or (x ∈ B or x ∈ C) iff x ∈ A or x ∈ B or x ∈ C iff (x ∈ A or x ∈ B) or x ∈ C iff x ∈ A ∪ B or x ∈ C iff x ∈ (A ∪ B) ∪ C Definition 1.3 (). Let A, B be sets. The intersection A ∩ B of A and B is defined by a ∈ A ∩ B iff x ∈ A and x ∈ B Theorem 1.3. A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C) Proof. Let x be arbitrary. Then x ∈ A ∩ (B ∪ C) iff x ∈ A and x ∈ B ∩ C iff x ∈ A and (x ∈ B or x ∈ C) iff (x ∈ A and x ∈ B) or (x ∈ A and x ∈ C) iff x ∈ A ∩ B or x ∈ A ∩ C iff x ∈ (A ∩ B) ∪ (A ∩ C)

1 Definition 1.4 (Set Theoretic Difference). Let A, B be sets. The set theoretic difference A \ B is defined by x ∈ A \ B iff x ∈ A and x 6∈ B. Theorem 1.4. A \ (B ∪ C) = (A \ B) ∩ (A \ C) Proof. Let x be arbitrary. Then x ∈ A \ (B ∪ C) iff x ∈ A and x 6∈ B ∪ C iff x ∈ A and not (x ∈ B or x ∈ C) iff x ∈ A and (x 6∈ B and x 6 inC) iff x ∈ A and x 6∈ B and x 6 inC iff x ∈ A and x 6∈ B and x ∈ A and x 6 inC iff x ∈ (A \ B) and x ∈ (A \ C) iff x ∈ (A \ B) ∩ (A \ C) Provisional definition of : Let A, B be sets. Then f is a function from A to B written f : A → B if f assigns a unique element b ∈ B to each a ∈ A. But what is the of ”assign”? Basic idea is to consider f : R → R defined by f(x) = x2. We shall identify f with its graph. To generalize this to arbitrary sets A and B we first need the concept of an . IE, a ha, bi satisfying ha, bi = hc, di iff a = c and b = d. In particular, h1, 2i= 6 {1, 2}. Definition 1.5 (Cartesian ). If A, B are sets, then their A × B = {ha, bi |a ∈ A, b ∈ B} Definition 1.6 (Function). f is a function from A to B iff f ⊆ A × B and for each a ∈ A, there exists a unique b ∈ B such that ha, bi ∈ f. In this case, the unique value b is called the value of f at a, and we write f(a) = b. It only remains to define ha, bi in terms of . Definition 1.7 (Ordered Pair). ha, bi = {{a}, {a, b}} Theorem 1.5. ha, bi = hc, di iff a = c and b = d. Proof. Clearly if a = c and b = d then ha, bi = {{a}, {a, b}} = {{c}, {c, d}} = hc, di 1. Suppose a = b. Then {{a}, {a, b}} = {{a}, {a, a}} = {{a}, {a}} = {{a}} Since {{a}} = {{c}, {c, d}} we must have {a} = {c} and {a} = {c, d}. So a = c = d, in particular, a = c and b = d. 2. Suppose c = d. Then similarly a = b = c so a = c and b = d. 3. Suppose a 6= b and c 6= d. Since {{a}, {a, b}} = {{c}, {c, d}} we must have {a} = {c} or {a} = {c, d}. The latter is clearly impossible, so a = c. Similarly, {a, b} = {c, d} or {a, b} = {c}. The latter is clearly impossible, and as a = c, then b = d.

2 NB (Note Bene) - It is never necessary in a to remember that a function is literally a set of ordered pairs. Definition 1.8 (Injection). The function f : A → B is an injection iff (∀a, a0 ∈ A) if a 6= a0 then f(a) 6= f(a0) Definition 1.9 (Surjection). The function f : A → B is a surjection iff (∀b ∈ B)(∃a ∈ A) such that f(a) = b Definition 1.10 (Composition). If f : A → B and g : B → C are functions, then their composition g ◦ f : A → C is dined by (g ◦ f)(x) = g(f(x)) Theorem 1.6. If f : A → B and g : B → C are surjections, then g ◦f : A → C is also a surjection. Proof. Let c ∈ C be arbitrary. Since g is surjective, ∃b ∈ B such that g(b) = c. Since f is surjective, ∃a ∈ A such that g(a) = b. Then, (g ◦ f)(a) = g(f(a)) = c, hence g ◦ f is a surjection. Definition 1.11 (). A function f : A → B is a bijection if f is an injection and a surjection. Theorem 1.7. If f : A → B and g : B → C are , then g ◦ f : A → C is a bijection. Proof. Composition of surjections is a surjection, and compositions of injections are injections. Definition 1.12 (). If f : A → B is a bijection, then its inverse, f −1 : B → A is defined by f −1(b) = the unique a ∈ A such that f(a) = b. Remarks - If f : A → B is a bijection, it is easily checked that f −1 : B → A is a bijection. In terms of ordered pairs, f −1 = {hb, ai : ha, bi ∈ f} Definition 1.13 (Equinumerous). Two sets, A and B, are equinumerous, writ- ten A ∼ B iff there exists a bijection f : A → B.

Theorem 1.8 (Galileo). Let = {0, 2, 4,...} be the even natural numbers. Then, N ∼ E Proof. We can define a bijection f : N → E by f(n) = 2n Remark 1.1. If is often extremely difficult to explicitly define a bijection f : N → A. However, suppose that f : N → A is a bijection. For each n ∈ N let an be f(n). Then, a0, a1,... is a list of the elements of A such that every element occurs exactly once, and conversely, if such a list exists, then we can define a bijection f : N → A by f(n) = an

3 Theorem 1.9. N ∼ Z Proof. We can list the elements of Z: 0, 1, −1, 2, −2,... Theorem 1.10. N ∼ Q Proof. We proceed in two steps. First, we prove that N ∼ Q+ = {q ∈ Q : q > 0} and consider the following 1 2 3 1 → 1 1 → 2 2 3 infinite matrix 1 . 2 % 2 . 1 2 3 ↓ 3 % 3 . 3 Proceed through the matrix along the indicated route adding rational num- bers to your list if they have not already occurred. Second, we declare that N ∼ Q. In the first part, we showed that there exists a bijection f : N → Q+ hence we can list Q by 0, f(1), −f(1),.... Definition 1.14 (). If A is any set, then its power set is P(A) = {B : B ⊆ A}, so P({1, 2, . . . , n})is of size 2n. Theorem 1.11 (Cantor). N 6∼ P(N) Proof. This method of proof is called the diagonal . We must show that there does not exist a bijection f : N → P(N). Let f : N → P(N) be any function. So, we shall prove that f is not a surjection. Hence, we must find a set ⊆ N such that ∀n ∈ N f(n) 6= S. We do this via a ”time and motion study” For each n ∈ N we must make the nth decision. That is, if n ∈ S. We perform the nth task, that is, ensure f(n) 6= S. We make the nth decision so that it accomplishes the nth task, ie, n ∈ S iff n 6∈ f(n). Clearly, f(n) and S will differ on whether they contain n, thus, ∀n ∈ N f(n) 6= S, and so f is not a surjection. In general, unattributed are due to Cantor. Theorem 1.12. If A is any set, then A 6∼ P(A) Proof. Suppose that f : A → P(A) is any function. Consider the set S = {a ∈ A : a 6∈ f(a)}. Then, a ∈ S iff a 6∈ f(a), so f(a) = S. Hence, f is not a surjection. Definition 1.15 (). Let A and B be sets. A  B iff there exists an injection f : A → B. A ≺ B iff A  B and A 6∼ B Theorem 1.13. For any set A, A ≺ P(A) Proof. We can define an injection f : A → P(A) by f(a) = {a}. Thus, A  P(A) By Cantor’s Theorem, A 6∼ P(A), thus A ≺ P(A).

4 Corollary 1.14. N ≺ P(N) ≺ P(P(N)) ≺ ... Definition 1.16 (Countable). A set A is countable iff either A is finite or A ∼ N. Otherwise, A is uncountable. Theorem 1.15. Let A, B, C be sets.

1. A ∼ A

2. A ∼ B ⇒ B ∼ A 3. A ∼ B and B ∼ C ⇒ A ∼ C

Proof. 1. Let idA : A → A be the function defined by idA(a) = a. Clearly, idA is a bijection, so A ∼ A 2. Suppose AB. Then there exists a bijection f : A → B. Since f −1 : B → A is also a bijection, B ∼ A

3. Suppose that A ∼ B and B ∼ C. Then, there exist bijections f : A → B and g : B → C. As f, g are bijections, g ◦ f : A → C is also a bijection, so A ∼ C

Theorem 1.16 (Cantor-Bernstein). If A  B and B  A then A ∼ B.

The proof will be delayed. Theorem 1.17 (Zarmelo). If A, B are any sets, then either A  B or B  A. This proof will be omitted, though the theorem is equivalent to the .

Axiom 1.2 (Axiom of Choice). Suppose F is a set of nonempty sets. Then there exists a function f such that f(A) ∈ A for each A ∈ F. We say that f is a choice function for F

Theorem 1.18. N ∼ Q

Proof. We can define an injection f : N → Q by f(n) = n. Hence, N  Q We next define g : Q → N as follows: a If 0 6= q ∈ Q, we can uniquely express q = b where  = ±1 and (a, b) = 1, and a, b > 0. So, g(q) = 2+13a5b. We also define g(0) = 0. Clearly, g is an injection, so Q  N Thus, by the Cantor-Bernstein Theorem, N ∼ Q Lemma 1.19. (0, 1) ∼ R Proof. From elementary claculus, we can define a bijection f : (0, 1) → R by π f(x) = tan(πx − 2 )

5 Theorem 1.20. R ∼ P(N) Proof. By the lemma, it is eanough to show that (0, 1) ∼ P(N). We make use of the fact that each r ∈ (0, 1) has a unique decimal expansion r = 0.r1r2 ... such that 0 ≤ rn < 9 and the expansion doesn’t end in an infinite string of nines. (this is to avoid two expansions such as 0.500 ... = 0.4999 ...) First we define a function f : (0, 1) → P(N) as follows. Suppose that r = 0.r0r1r2 .... Let p0, p1,... be the primes in increasing order. Then f(r) = r0+1 r1+1 {p0 , p1 ,...}. Clearly, f is an injection, hence (0, 1)  P(N) Next, we define a function g : P(N) → (0, 1) as followes: If S ⊂ N then g(S) = 0.S0S1S2 ... where Sn = 7 if n ∈ S and Sn = 5 if n 6∈ S (note, 7 and 5 are arbitrarily chosen), hence P(N)  (0, 1) By the Cantor-Bernstein Theorem, (0, 1) ∼ P(N), hence R ∼ P(N) Theorem 1.21. If S ⊆ N then either S is finite or S ∼ N. That is, N has the least infinite size.

Proof. Suppose S ⊂ N is infinite. Let S0,S1,S2,... be the increasing enumera- tion of S. This list witnesses that N ∼ S Hypothesis 1.1 ( Hypothesis). If X ⊆ R, then either X is count- able or X ∼ R Theorem 1.22 (G¨odeland Cohen). If the of set theory are consistent, then it is impossible to prove or disprove the from these axioms.

Definition 1.17 (Set of Finite ). Fin(N) is the set of finite subsets of N.

Clearly, N  Fin(N)  P(N) Theorem 1.23. N ∼ Fin(N) Proof. We can define an injection f : N → Fin(N) by f(n) = {n}. Next, we can define g : Fin(N) → N as follows. Suppose that S = {s0, s1, . . . , sn} 6= ∅, where s0 < s1 < . . . < sn. Then s0+1 sn+1 g(S) = p0 . . . pn , with p0, . . . , pn being the primes in increasing order, and also g(∅) = 0. Clearly, g is an injection, so Fin(N)  N By Cantor-Bernstein, Fin(N) ∼ N Definition 1.18 (The set of functions between sets). If A, B are sets, then A B = {f|f : A → B} Theorem 1.24. N ∼ ( ) N P N Proof. We first define a function g : ( ) → N as follows: P N N For each subset of N, the characteristic function is χ(x): N → {0, 1} defined by χ (n) = 1 if n ∈ S and χ (n) = 0 if n∈ / S. The set g(S) = χ ∈ N . S S S N Clearly, g is an injection, and so ( )  N P N N

6 f(0)+1 f(n)+1 Next we define π : N → ( ) by π(f) = {p , . . . , pn ,...}, where N P N 0 p0, p1,... are the primes in increasing order. Clearly, π is an injection. Hence, N  ( ). N P N So, by Cantor-Bernstein, N ∼ ( ) N P N And now, a heuristic principle. If S is an infinite set, then, in general, if each s ∈ S is determined by finitely many pieces of data, then S is countable, and if each s ∈ S is determined by infinitely many independent pieces of data, then S is countable.

Definition 1.19 (EC(N)). EC(N) is the set of eventually constant functions f : N → N, ie, functions f such that there exist a, b ∈ N such that f(n) = b ∀n ≥ a

Theorem 1.25. N ∼ EC(N)

Proof. First, we define a mat f : N → EC(N) by f(n) = cn, where cn(t) = n ∀t ∈ N. Clearly, f is an injection, so N  EC(N). f(0)+1 f(a)+1 Next, we define a π : EC(N) → N by π(g) = p0 . . . pa , where a is the least such that f(t) = f(a) ∀t ≥ a. Clearly, π is an injection, so EC(N)  N Thus, by Cantor-Bernstein, N ∼ EC(N) We are almost ready to prove the Cantor-Bernstein Theorem. First, we will require a definition and a lemma. Definition 1.20 ( of Z). If f : X → Y and Z ⊆ X, then f[Z] = {f(z): z ∈ Z} is the image of Z.

Lemma 1.26. If f : A → B is an injection and C ⊆ A, then f[A \ C] = f[A] \ f[C] Proof. First suppose x ∈ f[A\C]. Then, ∃a ∈ A\C such that f(a) = x. Hence, x ∈ f[A]. Suppose x ∈ f[C]. Then, ∃c ∈ C such that f(c) = x. As a 6= c, this contradicts f being an injection, thus x ∈ f[A] \ f[C] Conversely, suppose x ∈ f[A] \ f[C]. Then ∃a ∈ A such that f(a) = x. Since x∈ / f[C], a∈ / C, so a ∈ A \ C, therefore, x ∈ f[A \ C] And now, the proof of the Cantor-Bernstein Theorem. Proof. Since A  B and B  A, there exist injection f : A → B and g : B → A. Let C = g[B] = {g(b): b ∈ B}. Claim 1 - B ∼ C. The map b 7→ g(b) is a bijection from B to C, so the claim is proved. Thus, it is enough to show A ∼ C, because then A ∼ C and C ∼ B, so A ∼ B

7 Let h = g ◦ f : A → A, then h is an injection. Define by induction on n ≥ 0 A0 = A4, An+1 = h[An] and C0 = C, Cn+1 = h[Cn]. Define a function k : A → C by k(x) = h(x) if x ∈ An \ Cn for some n and k(x) = x otherwise. Claim 2 - k is an injection. Suppose that x 6= x0 are distinct elements of A. There are three cases:

0 1. Suppose x ∈ An \ Cn, x ∈ Am \ Cm for some n, m. Since h is an injection, k(x) = h(x) 6= h(x0) = k(x0)

0 0 0 2. Suppose x, x ∈/ An \ Cn ∀n. Then k(x) = x 6= x = k(x )

0 3. Without loss of generality, suppose x ∈ An \ Cn for some n and x ∈/ An \ Cn ∀n. Then, k(x) = h(x) ∈ h[An \ Cn] = h[An] \ h[Cn] = An+1 \ Cn+1. Hence, k(x) = h(x) 6= x0 = k(x0)

Claim 3 - k is a surjection. Let c ∈ C be arbitrary. There are two cases.

1. Suppose c∈ / An \ Cn ∀n, then k(c) = c

2. Suppose c ∈ An \ Cn for some n. Since c ∈ C = C0, ∃m such that n = m+1, since h[Am \Cm] = h[Am]\h[Cm] = An \Cn. So, ∃a ∈ Am \Cm such that k(a) = h(a) = c.

Therefore, k is a bijection, so A ∼ C

Theorem 1.27. R ∼ R × R

Proof. Since R ∼ (0, 1), it is enough to prove that (0, 1) ∼ (0, 1) × (0, 1) 1 We can define an injection f : (0, 1) → (0, 1) × (0, 1) such that f(r) = 2 , r . Next we define an injection g : (0, 1) × (0, 1) → (0, 1) as follows. If r = 0.r0r1 . . . rn ... and s = 0.s0s1 . . . sn ..., then, g(hr, si) = 0.r0s0r1s1 . . . rnsn .... By the Cantor-Bernstein Theorem, (0, 1) ∼ (0, 1) × (0, 1)

Definition 1.21 (Sym( )). Sym( ) = {f ∈ N : f is a bijection } N N N Theorem 1.28. Sym(N) ∼ P(N) Proof. Since Sym( ) ⊆ N ∼ ( ), we have Sym( )  ( ). N N P N N P N Next, we define a function f : P(N) → Sym(N) by S → fS where fS(2n) = 2n + 1 and fS(2n + 1) = 2n if n ∈ S and fS(2n) = 2n and fS(2n + 1) = 2n + 1 otherwise. This is an injection, and so P(N)  Sym(N), so, by Cantor-Bernstein, P(N) ∼ Sym(N)

8 Definition 1.22 (Finite ). Let A be a set. Then a finite sequence of elements of A is an inject ha0, a1, . . . , ani, with ai ∈ A and n ≥ 0. ha0, a1, . . . ani = hb0, b1, . . . bmi n = m and ∀i ai = bi

Definition 1.23 (Finite Sequence). ha0, . . . ani = f : {0, . . . , n} → A : f(i) = ai Definition 1.24 (Finseq(A)). Finseq(A) is the set of finite of el- emetns of A.

Theorem 1.29. If A is a nonempty , then N ∼ Finseq(A)

Proof. Fix some a ∈ A. Then, we can define an injection f : N → Finseq(A): n z }| { n 7→ ha, . . . , ai So, N ∼ Finseq(A) Next, we define an injection g : Finseq(A) → N as follows: Since A is countable, there exists an injection e : A → N. We define e(a0)+1 e(an)+1 th ha0, . . . , ani 7→ 2 . . . pn , where pi is the i prime. Thus, Finseq(A)  N, and so, by the Cantor-Bernstein Theorem, N ∼ Finseq(A) And now, we move on to Cardinal . Definition 1.25 (). To each set A we associate an object, its car- dinality, denoted card(A) or |A| such that |A| = |B| iff A ∼ B

Examples

1. If A is a finite set, then |A| is its usual size.

2. |N| = ℵ0

3. The infinite cardinals begin ℵ0, ℵ1,..., ℵω, ℵω+1,...

Definition 1.26 (Cardinal ). Let κ, λ be cardinal numbers, then κ + λ = card(A ∪ B) where card(A) = κ, card(B) = λ and A ∩ B = ∅ Theorem 1.30. If A ∼ A0 and B ∼ B0 and A ∩ B = A0 ∩ B0 = ∅, then A ∪ B ∼ A0 ∪ B0

Proof. Since A ∼ A0 and B ∼ B0, there exist bijections f : A → A0 and g : B → B0, then we can define a bijection h : A ∪ B → A0 ∪ B0 by h(x) = f(x) if x ∈ A and h(x) = g(x) if x ∈ B.

Theorem 1.31. ℵ0 + ℵ0 = ℵ0

Proof. Let E be the even natural numbers and O be the odd natural numbers. So ℵ0 + ℵ0 = card(E ∪ O) = card N = ℵ0

9 In fact, if κ, λ are cardinal numbers, at least one of which is infinite, then κ + λ = max{κ, λ} And it is clearly impossible to sensibly define an operation of cardinal sub- traction. Definition 1.27 (Cardinal Multiplication). Let λ, κ be cardinals. Then λκ = card(A × B) when |A| = κ and |B| = λ. We have already checked that this is well defined.

Theorem 1.32. ℵ0 × ℵ0 = ℵ0

Proof. Since N ∼ N × N, we have ℵ0 × ℵ0 = card(N × N) = card(N) = ℵ0 In fact, if κ, λ are cardinals, at least one of which is infinite, and neither is zero, then κλ = max{κ, λ} Definition 1.28 (Cardinal ). If κ, λ are cardinal numbers, then λ A κ = card( B) where |A| = λ and |B| = κ. Theorem 1.33. |R| = 2ℵ0

N ℵ0 N Proof. We know R ∼ P(N) ∼ {0,1}, hence 2 = card( {0,1} = |R| In fact, if κ is any , then κ < 2κ. This just restates that A  P(A)

2 Relations

Definition 2.1 (Binary ). A on a set A is a subset R ⊆ A × A. We usually write aRb instead of ha, bi ∈ R

Example 2.1. 1. The order relation on N is <= {hn, mi : n, m ∈ N, n < m} 2. divisibility relation on N+ is D = {hn, mi : n, m ∈ N+, m divides n} Observation: Thus P(N × N) is the set of binary relations on N. Since N × N ∼ N, it follows that P(N × N) ∼ P(N), in particular, P(N × N) is uncountable. Let R be a binary relation on A. Definition 2.2 (Reflexive Property). R is reflexive if (∀a ∈ A)aRa Definition 2.3 (Symmetric Property). R is symmetric if (∀a, b ∈ A)aRb ⇒ bRa Definition 2.4 (Transitive Property). R is transitive if (∀a, b, c ∈ A)aRb ∧ bRc ⇒ aRc Definition 2.5 (). R is an equivalence relation iff R is reflexive, symmetric and transitive.

10 Example: Consider the relation R defined on Z by aRb iff 3|a − b Theorem 2.1. R is an equivalence relation on Z.

Proof. Let a ∈ Z, then 3|a − a = 0. Hence, aRa, thus R is reflexive. Let a, b ∈ Z. Suppose aRb, so 3|a − b, so 3|b − a = −(a − b), so bRa, thus, R is symmetric. Let a, b, c ∈ Z. Suppose aRb and bRc, so 3|a − b and 3|b − c, so, 3|(a − b) + (b − c) = a − c, so aRc, and so R is transitive. Definition 2.6 (Equivalence ). Let R be an equivalence relation on A. For each x ∈ A, the corresponding is [x] = {y ∈ A : xRy} Example continued: The equivalence classes of R above are: [0] = {..., −6, −3, 0, 3, 6,...} [1] = {..., −5, −2, 1, 4, 7,...} [2] = {..., −4, −1, 2, 5, 8,...} Definition 2.7 (Partition). Let A be a nonempty set. Then, a partition of A is a collection {Bi : i ∈ I} such that

1. (∀i ∈ I)Bi 6= ∅

2. (∀i, j ∈ I) if i 6= j then Bi ∩ Bj = ∅

3. (∀a ∈ A)(∃i ∈ I) such that a ∈ Bi. That is, A = ∪i∈I Bi

Theorem 2.2. Let R be an equivalence relation on A. Then, (∀a ∈ A)a ∈ [a] and If a, b ∈ A and [a]∩[b] 6= ∅, then [a] = [b]. Hence, the set of equivalence classes {[a]: a ∈ A} forms a partition of A.

Theorem 2.3. Let {Bi : i ∈ I} be a partition of A. Define the binary relation E on A by aEb iff (∃i ∈ I) such that a, b ∈ Bi. Then, E is an equivalence relation and the E−equivalence classes are precisely {Bi : i ∈ I} Example: How many equivalence classes are there on {1, 2, 3}? Answer: There are exactly five equivalence relation, corresponding to {{1, 2, 3}}, {{1}, {2, 3}}, {{2}, {1, 3}}, {{3}, {1, 2}}, {{1}, {2}, {3}} Definition 2.8 (Irreflexive Property). R is irreflexive iff (∀a) ha, ai ∈/ R Definition 2.9 (Trichotomy Property). R satisfies the Trichotomy Property if (∀a, b ∈ A) exactly one of the following holds, aRb, a = b, bRa.

Definition 2.10 (Linear Order). hA, Ri is a linear order if R is irreflexive, transitive, and satisfies the trichotomy property. Definition 2.11 (Partial Order). Let R be a binary relation on A, then hA, Ri is a partial order if R is irreflexive and transitive.

11 Definition 2.12 (). Let hA,

1. f is a bijection 2. (∀a, b ∈ A)a < b iff f(a) ≺ f(b)

In this case, we say that hA,

Theorem 2.4. hZ, i Proof. Define f : Z → Z by f(z) = −z, then a < b iff −a > −b iff f(a) > f(b). Thus, f is an isomorphism

Notation - Let D be the strict divisibility relation on N+. that is, aDb ⇔ a < b&a|b

Theorem 2.5. hN+,Di=∼ 6 hP(N), ⊂i Proof. N+ 6∼ P(N), so no bijection exists. Theorem 2.6. hR \{0}, r2 > . . . rk > . . . f(−1) Let s be the greatest lower bound of {rn : n ≥ 1}. ∃t ∈ R \{0} such that f(t) = s t Clearly, t < 0, thus 2 > t t t f( 2 ) > s, hence ∃n ≥ 1 such that rn < f( 2 ). t 1 1 t But then 2 < n and f( n ) < f( 2 ), so a contradiction. a Definition 2.13. For each prime p, let Z[1/p] = { pn : a ∈ Z, n ≥ 0} Definition 2.14 (Dense Linear Order without Endpoints). A linear order hD,

1. if a, b ∈ D and a < b then ∃c ∈ D such that a < c < b 2. if a ∈ D then ∃b ∈ D such that a < b 3. if a ∈ D then ∃c ∈ D such that c < a

Theorem 2.7. For each prime p, hZ[1/p],

12 Theorem 2.8. If hA,

0 0 0 1. If an+1 ∈ An, then An = An, Bn = Bn and fn = fn.

If an+1 ∈/ An, then say c0 < c1 < . . . , an+1 < . . . < cm where An = {c0, . . . , cm} 0 ∃d ∈ B such that f(c0) <...

Finally, let f = ∪nfn, then f is an order preserving bijection between A and B.

Corollary 2.9. 1. hQ,

2. hZ[1/2],

Theorem 2.10. If hA, ≺i is a partial order, then there exists a binary relation < extending ≺ such that hA,

3 Propositional

Definition 3.1 ( Language). We define our formal alphabet as the fol- lowing symbols

1. The sentence connectives ∨, ∧, ¬, ⇒, ⇔ 2. The punctuation symbols (, )

13 3. The sentence symbols A0,A1,...,An,... for n ≥ 0

Definition 3.2 (Expression). An expression is a finite sequence of symbols from the alphabet. Definition 3.3 (Well Formed Formulas). The set of well-formed formulas, or wffs, is defined recursively as follows

1. Every sentence An is a wff. 2. If α, β are wffs, then (α ∧ β), (α ∨ β), (6 α), (α ⇒ β), (α ⇔ β)

3. No expression is a wff unless compelled to be so by finitely many applica- tions of 1 and 2.

Remark 3.1. From now on, we will omit 3 in recursive definitions. Clearly, the set of wffs is countable, and since the definition of a wff is recursive, many of the basic properties of wffs are proved by induction.

Example 3.1. (A1 ⇒ A2) is a wff, but (A1 ⇒ A2)) is not. Theorem 3.1. If α is a wff, then α has the same number of left and right parentheses. Proof. We argue by induction on the length of the wff α. If n = 1, then α is a sentence symbol, say, As. So the result holds. Suppose n > 1 and the result holds for all wffs of length less than n. Then there exist wffs β, γ such that α has one of the following forms: (β ∧ γ), (β ∨ γ), (¬β), (β ⇒ γ), (β ⇔ γ) By induction, the result holds for β and γ, hence, the result also holds for α.

Definition 3.4. L is the set of sentence symbols L is the set of wffs. {T,F } is the set of values.

Definition 3.5 (Truth Assignment). A truth assignment is a function ν : L → {T,F } Definition 3.6 ( of ν). Let ν be a truth assignment. Then we define the extension ν : L → {T,F } recursively as follows

1. If An ∈ L , then ν(An) = ν(An)

2. ν ((An)) = T of ν(α) = F

ν ((An)) = F of ν(α) = T 3. ν((α ∧ β)) = T if ν(α) = T and ν(β) = T ν((α ∧ β)) = F else.

14 4. ν((α ∨ β)) = F if ν(α) = ν(β) = F ν((α ∨ β)) = T else. 5. ν((α ⇒ β)) = F if ν(α) = T and ν(β) = F ν((α ⇒ β)) = T else. 6. ν((α ⇔ β)) = T if ν(α) = v(β) ν((α ⇔ β)) = F else.

Definition 3.7 (Proper Initial Segment). If ha0, . . . , ani is a finite sequence, then a proper initial segment has the form ha0, . . . , asi where 0 ≤ s < n Lemma 3.2. Any proper initial segment of a wff has more left than right paren- theses. Thus, no proper initial segment of a wff is a wff. Proof. We argue by induction on the length n ≥ 1 of the wff α. First, suppose n = 1, then α is a sentence symbol, say, As. As As has no proper initial segments, the result holds vacuously. Suppose n > 1, and the result holds for all wffs of length less than n. Then, α has the form (β∧γ), (β∨γ), (¬γ), (β ⇒ γ), (β ⇔ γ) for some shorter wffs β and γ. Since all the cases are similar, we just consider the case when α is (β ∧ γ). The proper initial segments are (,(β0 where β0 is a not necessarily proper initial segment of β,(β∧,(β ∧ γ0 where γ0 is a not necessarily proper initial segment of γ. So, using the inductive hypothesis and the previous theorem, we see that the result also holds for α. Theorem 3.3 (Unique Readability Theorem). If α is a wff of length greater than one, then there exists exactly one way of expressing α in the form (¬β), (β∨ γ), (β ∧ γ), (β ⇒ γ), (β ⇔ γ) for shorter wffs β, γ. Proof. Suppose α is both (β ∧ γ) and (θ ∧ ψ). Then, (β ∧γ) = (θ ∧ψ), and so deleting the first parenthesis, β ∧γ) = θ ∧ψ). Suppose β 6= θ, then without loss of generality, β is a proper initial segment of θ. By the lemma, β is not a wff. This is a , so β = θ. Hence, deleting β, θ, we have ∧γ) = ∧ψ). So γ = ψ The other cases are similar. From now on, we will use common sense in writing proofs, and may omit parentheses when there is no ambiguity. These are not wffs, however, just representations of them.

Definition 3.8 (Satisfiable). Let ν : L → {T,F } be a truth assignment. 1. If ϕ is a wff, then ν satisfies ϕ if ν(ϕ) = T . 2. If Σ is a set of wffs, then ν satisfies Σ if ν(σ) = T for all σ ∈ Σ

15 3. Σ is satisfiable if there exists a truth assignment ν which satisfies Σ.

Definition 3.9 (Tautological Implication). Let Σ be a set of wffs and ϕ be a wff. Then Σ tautologically implies ϕ, written Σ |= ϕ iff every truth assignment which satisfies Σ also satisfies ϕ. Definition 3.10 (). ϕ is a tautology iff ∅ |= ϕ, ie, every truth as- signment satisfies ϕ. Definition 3.11 (Tautological Equivalence). The wffs ϕ, ψ are tautologically equivalent iff {ϕ} |= ψ and {ψ} |= ϕ Definition 3.12 (Finitely Satisfiable). Σ is finitely satisfiable if every finite subset Σ0 is satisfiable. Theorem 3.4 (The ). If Σ is finitely satisfiable, then Σ is satisfiable. Before proving the Compactness Theorem, we will make a number of appli- cations. Theorem 3.5. Suppose Σ is an infinite set of wffs and Σ |= ϕ. Then, there exists a finite subset Σ0 such that Σ0 |= ϕ. Proof. Suppose not. Then, for every finite subset Σ0 ⊂ Σ, we have Σ0 6|= ϕ, and so Σ0 ∪ {(¬ϕ)} is satisfiable. Thus, Σ ∪ {(¬ϕ)} is finitely satisfiable. By compactness, Σ ∪ {(¬ϕ)} is satisfiable, but this contradicts Σ |= ϕ. Definition 3.13 (Graph). Let E be a binary relation on a set V . Then, Γ = hV,Ri is a graph iff E is symmetric and irreflexive. Definition 3.14 (k-colorable). Let k ≥ 1. Then, the graph Γ = hV,Ri is k-colorable if there exists a function

χ : V → {1, 2, . . . , k} such that if aEb then χ(a) 6= χ(b) Theorem 3.6 (Erd¨os). Let Γ = hV,Ri be a countably infinite graph, and k ≥ 1. Then, Γ is k-colorable iff every finite subgraph Γ0 of Γ is k-colorable. Proof. Suppose that χ : V → {1, 2, . . . , k} is a one coloring of Γ. Let Γ0 = hV0,E0i be a finite subgraph. Then, let χ0 = χ  V0 be the restriction of χ to V0. Then, χ0 is a k-coloring of Γ0. First, we must choose a suitable propositional language. We need a sentence symbol for each decision we must make. In this case, we take sentence symbols Cv,i v ∈ V and 1 ≤ i ≤ k Next, we write down the set of wffs Σ which imposes suitable constraints on truth assignments. In this case, Σ consists of the wffs

16 1. (¬(Cv,i ∧ Cv,j)) for v ∈ V and 1 ≤ i 6= j ≤ k

2. (Cv,1 ∨ ... ∨ Cv,k) for v ∈ V

3. (¬(Cv,i ∧ Cw,i)) for all v, w ∈ V with vEw and 1 ≤ i ≤ k. We check that Σ is indeed a suitable collection of wffs. So, by 1 and 2, for each v ∈ V there exists a unique 1 ≤ i ≤ k such that v(Cv,i) = T , hence, χ is a function. Suppose vEw. By 3, they cannot be assigned the same color. That is, we cannot have v(Cv,i) = T = v(Cw,i) for any 1 ≤ i ≤ k. So now we check that Σ is satisfiable. Let Σ0 ⊂ Σ be any finite subset. Let Γ0 = hV0,E0i be the finite subgraph consisting of the vertices which were mentioned in Σ0. By assumption, Γ0 is k-colorable. Let χ : V0 → {1, . . . , k} be a k-coloring of Γ0. Then, let ν0 be a truth assignment such that for all v ∈ V0, and 1 ≤ i ≤ k, ν0(Cv,i) = T iff χ0(v) = i. Then clearly, ν0 satisfies Σ0. Thus, Σ is finitely satisfiable. By compactness, Σ is satisfiable. Thus, Γ is k-colorable. Theorem 3.7. Let hA, ≺i be a countably infinite partial ordering. Then, there exists a linear ordering hA,

1. (La,b ∧ Lb,c) ⇒ La,c for a, b, c ∈ A distinct.

2. ¬(La,b ∧ Lb,a) for a 6= b ∈ A.

3. (La,b ∨ Lb,a) for a 6= b ∈ A.

4. La,b for a ≺ b Clearly, < is irreflexive, and 2 and 3 show that < has the trichotomy property. By 1, < is transitive, and by 4, <⊃≺. Thus, it is enough to show that Σ is satisfiable. By the compactness theorem, it is enough to show that Σ is finitely satisfi- able. Let Σ0 ⊂ Σ be any finite subset. Let A0 be the finite subset of A which is actually mentioned in Σ0. Let ≺0 be the restriction of ≺ to A0. By the homework, there exists a linear ordering <0 of A0 which extends ≺0. Let ν0 be a truth assignment such that for all a 6= b ∈ A0, ν0(La,b) = T iff a <0 b. So ν0 satisfies Σ0. hence, Σ is finitely satisfiable.

17 Theorem 3.8 (clearly ). If hA,

Definition 3.15 (Distinct Representatives). Suppose that S is a set. Suppose hSi : i ∈ Ii is an indexed collection of not necessarily distinct subsets of S. A system of distinct representatives is a choice of elements ∈ Si such that if i 6= j then xi 6= xj.

Theorem 3.9 (Hall’s Matching Theorem 1935). Let S be any set and n ∈ N+. Let hs1, . . . , sni be an indexed collection of subsets of S. Then, the necessary and sufficient condition for the existence of a system of distinct representatives is For any 1 ≤ k ≤ n and choice of k distinct indices i1, . . . , ik, then we have

|Si1 ∪ ... ∪ Sik | ≥ k Theorem 3.10 (clearly false attempt at an infinite Hall’s theorem). As above, but cross out all to n.

Counterexample is S = N. Theorem 3.11 (Infinite Version of Hall’s Matching Theorem). Let S be any set. + Let hS:i ∈ N i be an indexed collection of finite subsets of S. Then, a necessary and sufficient condition for the existence of a system of distinct representatives is for every 1 ≤ k and choice of k distinct indices, i1, . . . ik we have |Si1 ∪ ... ∪ Sik | ≥ k Proof. Clearly, if a system exists, then the condition holds. Conversely, suppose the condition holds. We work with the propositional language with sentence symbols Cn,x for x ∈ Sn and n ≥ 1. Let Σ be the set of wffs of the following form

1. ¬(Cn,x ∧ Cm,x), x ∈ Sn ∩ Sm

2. ¬(Cn,x ∧ Cn,y), x 6= y ∈ Sn 3. For each n ≥ 1, letting S = {x , . . . x } we add C ∨ ... ∨ C n 1 tn n,x n,xtn By 2 and 3 we choose exactly one element from each set, and by 1 they are distinct. It only remains to check that Σ is satisfiable. By compactness, it is enough to check that Σ is finitely satisfiable. Let Σ0 ⊂ Σ be any finite subset of Σ. Let n1, . . . nN be the finitely many indices mentioned in Σ0.

18 Then, Sn1 ,...SnN clearly satisfies Hall’s Condition. By Hall’s Theorem, for finite collection, there exists a system of distinct representatives xni ∈ Sni , 1 ≤ i ≤ N.

Let ν0 be a truth assignment such that if 1 ≤ i ≤ N and x ∈ Sni then

ν0(Cni,x) = T iff x = xni . Then ν0 satisfies Σ0. We are now almost ready to prove the compactness theorem. The basic idea is that it would be much easier if for every sentence symbol An, either An ∈ Σ or (¬An) ∈ Σ. Then, the only possible truth assignment satisfying Σ is ν(An) = T iff An ∈ Σ. Presumably, this works. So our strategy will be to extend Σ until we reach this special case. For technical , we extend Σ so that for every α, either α ∈ Σ or (¬α) ∈ Σ. Lemma 3.12. Let Σ be a finite satisfiable set of wffs. For each wff α, either Σ ∪ {α} is finitely satisfiable or Σ ∪ {(¬α)} is finitely satisfiable. Proof. Suppose Σ ∪ {α} isn’t finitely satisfiable. Then, there exists a finite subset Σ0 ⊂ Σ such that Σ0 ∪{α} is not satisfiable. Thus, Σ0 |= {(¬α)} We claim that Σ ∪ {(¬α)} is finitely satisfiable. Let ∆ ⊆ Σ ∪ {¬α} be any finite subset. If ∆ ⊂ Σ, then ∆ is satisfiable, so we can suppose ∆ = ∆0 ∪ {¬α} for some finite set ∆0 ⊂ Σ. Let ν be a truth assignment which satisfies the finite subset Σ0 ∪ ∆0 of Σ. since Σ0 |= ¬α, we must have ν(¬α) = T . Hence, ν satisfies ∆0 and ¬α. So, Σ ∪ {¬α} is finitely satisfiable. Now, we shall prove the compactness theorem.

Proof. Let α1, . . . , αn,... be an of all wffs. We shall inductively define and increasing sequence of sets of wffs ∆0 ⊆ ∆1 ⊆ ... such that

1. ∆0 = Σ

2. ∆n is finitely satisfiable

3. Either αn ∈ ∆n or ¬αn ∈ ∆n

Assume inductively that we have defined ∆n. Then, define ∆n+1 = ∆n ∪ {αn+1} if ∆n ∪ {αn+1} is finitely satisfiable and ∆n+1 = ∆n ∪ {¬αn+1} otherwise. By lemma, ∆n+1 is finitely satisfiable. So, the inductive construction can be accomplished. Finally, let ∆ = ∪n∆n

19 Suppose Φ ⊂ ∆ is a finite subset. Then, ∃n such that Φ ⊂ ∆n. Since ∆n is satisfiable, we know that Φ is satisfiable, so ∆ is finitely satisfiable. Let α = αn, then either αn ∈ ∆n or ¬αn ∈ ∆n. Since ∆n ⊂ ∆, for each wff α either α ∈ ∆ or ¬α ∈ ∆ Finally, define a truth assignment by ν(A`) if true iff A` ∈ ∆. Then, we want to show that for any wff α,ν = T iff α ∈ ∆. We argue by induction on the length m ≥ 1 of the wff α. First, suppose m = 1, then, α is a sentence symbol At and the result follows. Now, suppose m > 1, and result holds for all shorter wffs. Then, α has one of the following forms (¬β), (β∧γ), (β∨γ), (β ⇒ γ), (β ⇔ γ) Case I - Suppose α is ¬β. Then, ν(¬β) = T iff ν(β) = F , which is iff β∈ / ∆, which is iff ¬β ∈ ∆ Case II - Suppose α is β ∧ γ. First suppose ν(β ∧ γ) = T , Then, ν(β) = T or ν(γ) = T , and so β ∈ ∆ or γ ∈ ∆. Since ∆ is finitely satisfiable, {β, ¬(β ∨ γ)} 6⊂ ∆ and {γ, ¬(β ∨ γ)} 6⊂ ∆ so ¬(β ∨ γ) ∈/ ∆, thus, β ∨ γ ∈ ∆ Suppose β ∨ γ ∈ ∆. Since {¬β, ¬γ, β ∨ γ} 6⊂ ∆, it follows that ¬β∈ / ∆ or ¬γ∈ / ∆. Hence, β ∈ ∆ or γ ∈ ∆. By induction hypothesis, ν(β) = T or ν(γ) = T . Hence, ν(β ∨ γ) = T The other cases are similar.

Definition 3.16 (). A partial order hT,

1. There exists a least element t0 ∈ T called the root.

2. For each t ∈ T the set of its predecessors, PrT (t) = {s ∈ T : s < t} is a finite set which is linearly ordered by <.

Definition 3.17 (Complete ). The complete binary tree T2 is T2 = {f|f : {0, . . . , n − 1} → {0, 1} for some n ≥ 0} ordered by f < g iff f ⊂ g Definition 3.18. Let hT,

1. If t ∈ T , then the height of t is defined to be htT (t) = |PrT (t)|

th 2. For each n ≥ 0, the n level of T is Levn(T ) = {t ∈ T : htT (t) = n}

3. For each t ∈ T , the set of immediate successors is succT (t) = {s ∈ T : t < s, htT (s) = htT (t) + 1} 4. T is finitely branching if each t ∈ T has a finitely, possibly empty, set of immediate successors.

5. A branch B of T is a maximal linearly ordered subset of T .

20 Theorem 3.13. Consider the complete binary tree T2. if f : N → {0, 1} is any function, then we obtain a corresponding branch Bf = {f  {0, . . . , n − 1} : n ≥ 0} Every branch has this form.

Does every infinite tree have an infinite branch? Clearly not, as there is the tree with a root, and then a countable set of successors to that root, and nothing else. Lemma 3.14 (K¨onig’sLemma). If T is an infinite, finitely branching tree, then T has an infinite branch.

Remark - if B is such a branch, then necessarily, |B ∩ Levn(T )| = 1 for all n ∈ N. First, we will prove that Compactness implies K¨onig.

Proof. Let T be an infinite finitely branching tree. Then Levn(T ) is finite for all n ∈ N, so T is countable. We use the propositional language with sentence symbols Bt for t ∈ T . Let Σ be the following set of wffs for each n ≥ 0, if Levn(T ) = {t1, . . . , t`} then we include:

1. Bt1 ∨ ... ∨ Bt`

2. ¬(Bti ∧ Btj ) for 1 ≤ i < j ≤ `

3. Bs ⇒ Bt for all s, t ∈ T such that t < s

So, by compactness, it is enough to show that Σ is finitely satisfiable. Let Σ0 ⊂ Σ be an arbitrary finite subset. There exists n ∈ N such that if t ∈ T is mentioned in Σ0 then htT (t) < n then v0(Bt) = T iff t < t0. Clearly, v0 satisfies Σ0, thus Σ is finitely satisfiable. Now, we shall prove K¨onig’sLemma without using compactness.

Proof. We define an induction on n ≥ 0, a sequence of elements tn ∈ Levn(T ) such that

1. t0 is the root

2. if m < n then tm < tn

3. {s ∈ T : tn < s} is infinite.

Clearly, t0 satisfies 2 and 3. Suppose, inductively, that we have defined tn. Let {a1, . . . , ar} be the set of immediate successors to tn. If tn < s, and htT (s) > n + 1 then there exists 1 ≤ i ≤ r such that ai < s. By the Pigeon Hole Principle, there exists 1 ≤ i ≤ r such that {s ∈ T : ai < s} is infinite.

21 So, we can choose tn+1 = ai. Then, tn+1 satisfies 2 and 3 above. And so, by induction, we have B = {tn : n ≥ 0}, an infinite branch. So now, an application of K¨onig’sLemma Theorem 3.15 (Erd¨os). Let Γ = hV,Ei be a countably infinite graph. Then, Γ is k-colorable iff every finite subgraph of Γ is k-colorable. Proof. It is obvious that if it is k-colorable then every finite subgraph is. Suppose that every finite subgraph is k-colorable. Let V = {v0, v1,...} For each n ≥ 1, let Γn = {v1, . . . , vn} Let Cn be the nonempty set of colorings χ :Γn → {1, . . . , k} n Then |Cn| < k , so Cn is finite. Let T be the tree such that Lev0(T ) = ∅ and Levn(T ) = Cn for n ≥ 1. If n < m and χ ∈ Cn, θ ∈ Cm we define χ < θ iff θ  {v1, . . . vn} = χ Then, T is an infinite, finitely branching tree. By K¨onig’sLemma, there exists an infinite branch B through T . For each n ≥ 1, let χn ∈ B ∩ Levn(T ). S Define χ = n≥1 χn Clearly, χ : v → {1, . . . , k}, and suppose s, t ∈ v are adjacent vertices. Then, there is some n ≥ 1 such that s, t ∈ Γn. Since χn is a k-coloring of Γn, χ(s) = χn(s) 6= χn(t) = χ(t) Thus, χ is a k-coloring. Now we will finish proving that K¨onig’sLemma is equivalent to the Com- pactness Theorem

Proof. Let {A1,A2,...,An,...} be the sentences in our language. Let T be the tree such that

1. Lev0(T ) = ∅

2. for n ≥ 1, Levn(T ) = the partial truth assignments ν : {A1,...,An} → {T,F } such that if α ∈ Σ only involves a subset of {A1,...,An}, then ν(α) = T

3. If ν, τ ∈ T with ν ∈ Levm(T ) and τ ∈ Levn(T ) with m < n, we set ν < τ iff τ  {A1,...,An} = ν

Clearly each level Levn(T ) is finite, so T is finitely branching. Let Σn be the set of wffs α ∈ Σ which only involve A1,...,An. If Σn if finite, then Σn is satisfiable. Hence, we can suppose Σn = {α1, . . . , αn,...} is infinite. For each ` ≥ 1, let ∆` = {α1, . . . , α`} Then there exists w` : {A1,...,An} → {T,F } satisfying ∆` By the Pigeonhole Principle, there exists a fixed w such that w` > w for infinitely many ` ≥ 1

22 S Clearly w satisfies Σn = ` ∆` Thus, T is an infinite, finitely branching tree. By K¨onig’sLemma, there exists an infinite branch B through T . S Let νn ∈ B ∩ Levn(T ) and define ν = n νn is a truth assignment which satisfies Σ.

4 First Order Logic

Definition 4.1 (Alphabet of a First Order Language). The Alphabet of a First Order Language consists of

1. Symbols Common to All Languages (a) Parentheses (, ) (b) Connectives ⇒, ¬

(c) Variables v1, v2,... (d) Quantifier ∀ (e) = 2. Symbols Particular to the Language (Non logical Symbols) (a) For each n ≥ 1 a possibly empty countable set of n−place predicate symbols (b) A possibly empty countable set of constant symbols (c) For each n ≥ 1 a possibly empty countable set of n−ary function symbols

Example 4.1. The language of arithmetic is {+, ×, <, 0, 1}, where +, × are 2-ary function symbols, < is a 2-ary predicate symbol and 0, 1 are constants. Remark 4.1. Clearly, an alphabet is countable. Definition 4.2 (Expression). An expression is a finite sequence of symbols from the alphabet.

Definition 4.3 (Terms). The set T of terms is defined inductively as follows

1. Each constant symbol and each variable is a term

2. If f is an n-ary function symbol and t1, . . . , tn are terms, then ft1, . . . , tn is a term.

Definition 4.4 (). An atomic formula is an expression of the form P t1, . . . , tn where P is an n-ary predicate symbol. Remark- = is a 2-ary predicate symbol, so every language has atomic for- mulas.

23 Definition 4.5 (Well-Formed Formulas). The set of wffs is defined inductively by

1. Each atomic formula is a wff 2. if α, β are wffs, and v is a variable, then (¬α), (α ⇒ β), ∀vα are wffs

As usual, there exists a unique readability theorem. Abbreviations We usually write

1. (α ∨ β) instead of ((¬α) ⇒ β) 2. (α ∧ β) instead of (¬(α ⇒ (¬β)))

3. ∃vα instead of (¬∀v(¬α)) 4. u = t instead of = ut 5. u 6= t instead of (¬ = ut) 6. etc

We also use common sense in the use of parentheses.

Definition 4.6 (Free Variable). Let x be a variable and α be a wff

1. if α is atomic then x occurs free in α iff x occurs in α

2. x occurs free in (¬α) iff x occurs free in α 3. x occurs free in (α → β) iff x occurs free in α or x occurs free in β 4. x occurs free in ∀vα iff x occurs free in α and x 6= v.

Definition 4.7 (Sentence). A sentence σ is a wff with no free variables.

4.1 Truth and Models Definition 4.8 (A structure for a first order language). A structure A for the first order language L consists of

1. A nonempty set A, the of A 2. For each n-place predicate symbol P , an n-ary relation P A ⊂ A × A × ... × A = An

3. For each constant symbol c, an element cA ∈ A 4. For each n-ary function symbol, an n-ary operation f A : An → A

24 An Example: Suppose L has the following non logical symbols: A 2-place predicate symbol R, a constant c and a 1-ary function symbol f. Then, A is a structure for L where: A = {1, 2, 3, 4} RA = {h1, 2i, h2, 3i, h3, 4i, h4, 1i} cA = 2 and f A : A → A is 1 7→ 2 7→ 3 7→ 4 7→ 1 Now, we will attempt to define what it means for a to be true in a first order language. Let L be a first order language. For each sentence σ of L , and each structure A for L , we want to define A |= σ as ”A satisfies σ”, or ”σ is true in A ” Example N = hN, +, ×, <, 0, 1i, clearly, N |= ∃x(x + 1 = 1 + 1 + 1) First, we are forced to define a more general notion.

Definition 4.9 (A |= ϕ with s). Let ϕ be any wff, A a structure for L , and s : V → A where V is the set of variables. Then, we define A |= ϕ[s],”A satisfies ϕ with s” The intuitive meaning is that: ϕ is true in A when each free variable v of ϕ is interpreted as s(v) ∈ A.

Step 1 Let T be the set of terms of L . We first define an extension s : T → A as follows: 1. For each variable v, s(v) = s(v) 2. For each constant symbol c, s(c) = cA

3. If f is an n-place function symbol and t1, . . . , tn are terms, then

A s(ft1, . . . , tn) = f (s(t1),..., s(tn))

Step 2 Atomic formulas:

1. A |== t1t2[s] iff s(t1) = s(t2)

2. If P is an n-ary predicate symbol and t1, . . . , tn are terms, then A |= P t1, . . . , tn[s] A iff hs(t1),..., s(tn)i ∈ P Step 3 Other wffs

1. A |= (¬ϕ)[s] iff A 6|= ϕ[s] 2. A |= (ϕ → ψ)[s] iff A 6|= ϕ[s] or A |= ψ[s] 3. A |= ∀vϕ[s] iff for all a ∈ A, A |= ϕ[s(v|a)] where s(v, a): V → A, s(v|a)(x) = s(x) for x 6= v and = a for x = v.

Theorem 4.1. Assume s1, s2 : V → A agree on all free variables (if any) on the wff ϕ. Then, A |= ϕ[s1] iff A |= ϕ[s2]

25 Proof. We argue by induction on the complexity of ϕ. Suppose ϕ is atomic. First suppose ϕ is = t1t2. Then, by the homework, s1(t1) = s2(t1) and s1(t2) = s2(t2). Hence, A |== t1t2[s1] iff s1(t1) = s1(t2) iff s2(t1) = s2(t2) iff A |== t1t2[s2] Next, suppose ϕ is P t1, t2, . . . tn Then, s1(ti) = s2(ti) for 1 ≤ i ≤ n. A Hence, A |= P t1, . . . , tn[s1] iff hs1(t1),..., s1(t2)i ∈ P iff A hs2(t1),..., s2(t2)i ∈ P iff A |= P t1, . . . , tn[s2] Next, suppose ϕ = (¬ψ) Then, A |= ¬ψ[s1] iff A 6|= ψ[s1] iff A 6|= ψ[s2] by the inductive hypothesis, iff A |= (¬ψ)[s2] The case where ϕ = (ψ ⇒ θ) is similar. Finally, we suppose that ϕ = ∀xψ Clearly, if a ∈ A, then s1(x|a) and s2(x|a) agree on all free variables of ψ. A |= ∀xψ[s1] iff for all a ∈ A, A |= ψ[s1(x|a)] iff for all a ∈ A A |= ψ[s2(x|a)] iff A |= ∀xψ[s1]. Corollary 4.2. If σ is a sentence, then either A |= σ[s] for all s : V → A or A 6|= σ[s] for all s : V → A. Definition 4.10 (A |= σ). Let σ be a sentence. Then, A |= σ iff A |= σ[s] for all s : V → A

Definition 4.11 (Satisfies). Let Σ be a set of wffs

1. A satisfies Σ with s iff A |= σ[s] for all σ ∈ Σ 2. Σ is satisfiable iff there exists a structure A for L and a function s : V → A such that A satisfies Σ with s. 3. Σ is finitely satisfiable iff any finite subset of Σ is satisfiable

Theorem 4.3 (Compactness Theorem). If Σ is finitely satisfiable, then Σ is satisfiable.

An Application of Compactness Let L be the language of arithmetic mentioned before. Let Th(N) = {σ : σ is a sentence which is true in hN, +, ×, <, 0, 1i} Consider the following set Σ of wffs: Th(N) ∪ {x > 1 + ... + 1 : n ≥ 1} | {z } n We claim that Σ is finitely satisfiable. Let Σ0 ⊂ Σ be finite. Then, Σ0 = T ∪ {x > 1 + ... + 1, . . . , x > 1 + ... + 1} with T ⊂ Th(N) is a | {z } | {z } n1 nt finite subset and n1, . . . , nt ≥ 1 Let m > max{n1, . . . , nt}. Let s : V → N satisfy s(x) = m. Then, hN, +, ×, <, 0, 1i satisfies Σ0.

26 By compactness, Σ is satisfiable. Then, A satisfies Th(N) and yet s(x) = c > 1A + ... + 1A for any number | {z } n n So, c is an infinite, or nonstandard, . Furthermore, we can assume A is countable, and so we get the structure N < Q × Z. Thus, the statements that are true about N in first order logic do not uniquely identify N. Definition 4.12 (Isomorphism). Let A , B be structures for the first order language L A function f : A → B is an isomorphism iff the following conditions are satisfied:

1. f is a bijection

2. for each n-ary predicate symbol P and a1, . . . , an ∈ A, then ha1, . . . , ani ∈ A B P iff hf(a1), . . . , f(an)i ∈ P 3. for each constant symbol c, f(cA ) = cB

A 4. For each n-ary function symbol h and a1, . . . , an ∈ A, f(h (a1, . . . , an)) = B h (f(a1), . . . , f(an))

Theorem 4.4. Suppose ϕ : A → B is an isomorphism if σ is any sentence, then A |= σ iff B |= σ We will actually prove the more general statement: Theorem 4.5. Suppose ϕ : A → B is an isomorphism, and s : V → A. If α is any wff, then A |= α[s] iff B |= α[ϕ ◦ s] We shall need the following technical lemma:

Lemma 4.6. With the above hypotheses, for each term t, ϕ(s(t)) = ϕ ◦ s(t) Proof. We argue by induction on the complexity of t. First suppose that t is a variable x. Then, ϕ(s(x)) = ϕ(s(x)) = (ϕ ◦ s)(x) = ϕ(s(x)) = ϕ ◦ s(x) Next, suppose that t is a constant symbol c. Then, ϕ(s(c)) = ϕ(cA ) = cB = ϕ ◦ s(c) Suppose that t is ft1, . . . , tn, by the inductive hypothesis, we know ϕ(s(ti)) = ϕ ◦ s(ti). A Thus, ϕ(s(ft1, . . . , tn)) = ϕ(f (s(t1),..., s(tn))) = ϕ ◦ s(ft1, . . . , tn)) And now we can prove the theorem

Proof. We argue by induction on complexity of a wff α. Assume α is atomic, say, P t1, . . . , tn A A |= P t1, . . . , tn[s] iff hs(t1), . . . , s(tn)i ∈ P

27 B iff hϕ(s(t1)), . . . , ϕ(s(tn))i ∈ P B iff hϕ ◦ s(t1),..., ϕ ◦ s(tn)i ∈ P Next, suppose α = ¬β, which is similar, as is α = β ⇒ γ Finally, suppose α = ∀vβ. Then, A |= ∀vβ[s] iff for all a ∈ A, A |= β[s(v|a)] iff for all a ∈ A, B |= β[ϕ ◦ s(v|a)] iff for all a ∈ A, B |= β[(ϕ ◦ s)(v|ϕ(a))] As ϕ is surjective, for all b ∈ B, B |= β[(ϕ ◦ s)(v|b)] Definition 4.13 (Models). Let T be a set of sentences A is a model of T iff A |= σ for all σ ∈ T Mod(T ) is the class of models of T . Abbreviation: if E is a binary predicate symbol, then we write xEy instead of Exy. Example 4.2. Let T be the following: ¬(∃x)xEx (∀x)(∀y)xEy ⇒ yEx Then, Mod(T ) is the class of graphs

Definition 4.14 (Axiomatizable). Let C be a class of structures. C is axiomatizable iff there exists a set of sentences T such that C = Mod(T ) If there exists a finite set of sentences T , such that ϕ = Mod(T ) then ϕ is finitely axiomatizable.

Theorem 4.7. C is finitely axiomatizable iff C can be axiomatized by a single sentence. Example 4.3. The class of graphs is finitely axiomatizable The class of infinite graphs is axiomatizable Is the class of finite graphs axiomatizable? Is the class of infinite graphs finitely axiomatizable? Theorem 4.8. Let T be a set of sentences in a first order language. If T has arbitrarily large finite models, then T has an infinite model.

Proof. For each n ≥ 1, let θn be the sentence which says ”There exist at least n elements”. Consider the set of sentences Σ = T ∪ {θn : n ≥ 1} We claim that Σ is finitely satisfiable

Suppose Σ0 ⊂ Σ is any finite subset. Then, Σ0 = T0 ∪ {θn1 , . . . , θnt } Let m = max{n1, . . . , nt}, then T has a finite models A of size greater than m. Clearly, A is a model of Σ0. By compactness, there exists a model B of Σ. Thus, B is an infinite model of T .

Corollary 4.9. The class F of finite graphs is not axiomatizable.

28 Corollary 4.10. The class C of infinite graphs is not finitely axiomatizable. Definition 4.15 (Semantically Implies). Let Σ be a set of wffs and let ϕ be a wff. Then, Σ logically/semantically implies ϕ, written Σ |= ϕ iff for every struc- ture A for L and every s : V → A, if A satisfies Σ with s, then A satisfies ϕ with s. Definition 4.16 (Valid). The wff ϕ is valid iff ∅ |= ϕ Now we will return to the development of . Λ will denote the set of logical axioms, defined later. Definition 4.17 (Deduction). Let Γ be a set of wffs and let ϕ be a wff. A deduction of ϕ from Γ is a finite sequence of wffs hα1, α2, . . . , αni such that αn = ϕ and for each 1 ≤ i ≤ n either αi ∈ Γ ∪ Λ or there exist k, j < i such that αk is αj ⇒ αi In the latter case, we say that αi follows from αj and αj ⇒ αi by modus ponens (MP). Definition 4.18 (Theorem). ϕ is a theorem of Γ, written, Γ ` ϕ iff there exists a deduction of ϕ from Γ. And now we finally arrive at the two main theorems of the course. Theorem 4.11 (The Theorem). If Γ ` ϕ then Γ |= ϕ Theorem 4.12 (G¨odel’sCompleteness Theorem). If Γ |= ϕ then Γ ` ϕ. Definition 4.19 (The Logical Axioms, Λ). ϕ is a generalization of ψ iff for some n ≥ 0 and variables x1, . . . , xn we have that ϕ is ∀x1 ... ∀xnψ. When n = 0 we see that ψ is a generalization of ψ. The logical axioms are all generalizations of all wffs of the following forms: 1. Tautologies

x x 2. (∀xα ⇒ αt ), where αt means to substitute t for all instances of x in α when t is substitutable for x in α. 3. (∀x(α ⇒ β)) ⇒ (∀xα ⇒ ∀xβ) 4. (α ⇒ ∀xα) where x does not occur free in α. 5. x = x 6. (x = y ⇒ (α ⇒ α0)) where α is atomic and α0 is the result of replacing some, possibly none, of the occurrences of x with y. Explanations. A tautology is a wff which can be obtained from a propositional tautology by substituting wffs. x αt is the result of substituting t for each free occurrence of x in α. We say t is substitutable for x in α if no variable of t becomes bound by a quantifier in x αt .

29 Now, we will prove the Soundness theorem, which is easy. We will make use of the following result Lemma 4.13. Each logical axiom is valid.

And now, the proof of Soundness. Proof. We argue by the minimum length n ≥ 1 of a deduction of ϕ from Γ, that Γ |= ϕ. If n = 1, then ϕ ∈ Γ ∪ Λ. Clearly, if ϕ ∈ Γ, then Γ |= ϕ Suppose ϕ ∈ Λ. Then ϕ is valid, and so Γ |= ϕ. Next suppose n > 1. Let hα1, . . . , αni be a deduction of ϕ from Γ. Then, ϕ must follow by modus ponens, and so there are earlier wffs ψ and (ψ ⇒ ϕ). Since initial segments of deductions are also deductions, we have that Γ ` ψ and Γ ` (ψ ⇒ ϕ) by deductions of length less than n. Let A be any structure and s : V → A. Suppose A |= Γ[s]. By the inductive hypothesis, A |= ψ and A |= (ψ ⇒ ϕ) Hence, Γ |= ϕ Definition 4.20 (Inconsistent). A set Γ of wffs is inconsistent iff there exists a wff β such that Γ ` β and Γ ` ¬β. Otherwise, Γ is consistent. Corollary 4.14. If Γ is satisfiable, then Γ is consistent.

Proof. Suppose that Γ is satisfiable, say, A is a structure, s : V → A and A |= Γ[s]. Suppose Γ is inconsistent, then Γ ` β and Γ ` ¬β By Soundness, Γ |= β and Γ |= ¬β Then, Γ |= β[s] and Γ |= ¬β[s], which is impossible. Now, we shall begin working toward Completeness. First, we must prove a number of meta-theorems. Theorem 4.15 (Generalization Theorem). If Γ ` ϕ and x does not occur free in Γ then Γ ` ∀xϕ Proof. We argue by induction on the minimum length of a deduction of ϕ from Γ. Suppose that n = 1. Then, ϕ ∈ Γ ∪ Λ. If ϕ ∈ Λ, then ∀xϕ ∈ Λ, so done. If ϕ ∈ Γ, then, as x is not free in Γ, x does not occur free in ϕ. So ϕ ⇒ ∀xϕ is in Λ. And so a deduction from Γ of ∀xϕ is 1-ϕ, 2-ϕ ⇒ ∀xϕ and 3-∀xϕ, by modus ponens. Next, suppose that n > 1. Then, in a proof of minimum length n, ϕ follows from earlier wffs ψ and ψ ⇒ ϕ.

30 By the induction hypothesis, Γ ` ∀xψ and Γ ` ∀x(ψ ⇒ ϕ). So, a deduction of ∀xϕ from Γ would proceed by first deducing ∀xψ, then ∀x(ψ ⇒ ϕ). Then, by the logical axioms, we have ∀x(ψ ⇒ ϕ) ⇒ (∀xψ ⇒ ∀xϕ). And so, by modus ponens, we get ∀xψ ⇒ ∀xϕ, and another modus ponens gives us ∀xϕ.

Definition 4.21 (Tautologically Implies). {α1, . . . , αn} tautologically implies β iff (α1 ⇒ (α2 ⇒ (... (αn ⇒ β))) ...) is a tautology.

Theorem 4.16 (Rule T). If Γ ` α1,..., Γ ` αn and {α1, . . . , αn} tautologically implies β, then Γ ` β.

Proof. Obvious, by repeated application of modus ponens. Theorem 4.17 (Deduction Theorem). If Γ ∪ {γ} ` ϕ then Γ ` (γ ⇒ ϕ) Proof. We argue by induction on the minimal length of a deduction of ϕ from Γ ∪ {γ}. Suppose n = 1. First, suppose ϕ ∈ Γ ∪ Λ. Then, the following is a deduction of γ ⇒ ϕ. 1-ϕ, 2-(ϕ ⇒ (γ ⇒ ϕ)) and 3-γ ⇒ ϕ Second, assume ϕ = γ. Then, γ ⇒ ϕ is a tautology, and so of course Γ ` (γ ⇒ ϕ) Suppose n > 1. Then, in a proof of minimal length n, we must have that ϕ follows from earlier wffs ψ and (ψ ⇒ ϕ) by modus ponens. By induction hypothesis, Γ ` (γ ⇒ ψ) and Γ ` (γ ⇒ (ψ ⇒ ϕ)) Clearly, {(γ ⇒ ψ), (γ ⇒ (ψ ⇒ ϕ))} tautologically implies γ ⇒ ϕ. By Rule T, Γ ` (γ ⇒ ϕ)

Theorem 4.18 (Contraposition). Γ ∪ {ϕ} ` ¬ψ iff Γ ∪ {ψ} ` ¬ϕ Proof. Suppose Γ ∪ {ϕ} ` ¬ψ By deduction theorem, Γ ` (ϕ ⇒ ¬ψ) By rule T, Γ ` (ψ ⇒ ¬ϕ) Hence, Γ ∪ {ψ} ` ψ, so Γ ` (ψ ⇒ ¬ϕ) Hence, Γ ∪ {ψ} ` ϕ The other direction is similar. Theorem 4.19 (Reductio Ad Absurdum). If Γ ∪ {ϕ} is inconsistent, then Γ ` ¬ϕ Proof. Since Γ ∪ {ϕ} is inconsistent, there exists a wff β such that Γ ∪ {ϕ} ` β and Γ ∪ {ϕ} ` ¬β By deduction theorem, Γ ` (ϕ ⇒ β) and Γ ` (ϕ ⇒ ¬β) Clearly, {(ϕ ⇒ β), (ϕ ⇒ ¬β)} tautologically implies ¬ϕ By rule T, Γ ` ¬ϕ Remark 4.2. If Γ is inconsistant, then Γ ` α for every wff α

31 Proof. Suppose that Γ ` β and Γ ` ¬β. Clearly (β ⇒ (¬β ⇒ α)) is a tautology. By Rule T ,Γ ` α. Remark 4.3. Thus, to prove the consistancy of ZFC, it is enough to show that ZFC6` 0 = 1.

Applications: Some theorems about equality:

1. ` ∀x(x = x)

Proof. ∀x(x = x) ∈ Λ

2. ∀x∀y(x = y ⇒ y = x)

Proof. ` x = y ⇒ (x = x ⇒ y = x) by axiom 6. ` x = x by axiom 5, ` x = y ⇒ y = x by Rule T and axioms 1,2. ` ∀y(x = y ⇒ y = x) by Generalization

3. ∀x∀y∀z(x = y ⇒ (y = z ⇒ x = z))

Proof. We have y = x ⇒ (y = z ⇒ x = z) by axiom 6. Then ` x = y ⇒ y = x by the previous statement, so we have by Rule T and 1,2 ` (x = y ⇒ (y = z ⇒ z = x)), and so by Generalization three applied three times, we have ` ∀x∀y∀z(x = y ⇒ (y = z ⇒ z = x)).

Theorem 4.20 (Generalization on Constants). Assume that Γ ` ϕ and c is a constant symbol which doesn’t occur in Γ. Then there exists a variable y which c doesn’t occur in ϕ scuh that Γ ` ∀yϕy. Furthermore, there exists a deduction of c ∀yϕy from Γ in which c doesn’t occur. Remark 4.4. This says that if we suppose Γ ` ϕ(c) and c does not occur in Γ, then for a suitable variable y, we have that Γ ` ∀yϕ(y). More importantly, suppose that Γ is a consistant set of formulas in the lan- guage L . Let L + = L ∪{c} where c is a new constant symol. Then Γ remains constant in L +.

Proof. Suppose that (*)=hα1, . . . , αni is a deduction of ϕ from Γ. Let y be a c c variable with any αi. We claim that (**)=h(α1)y,..., (αn)yi is a deduction of c c ϕy from Γ. We will check that for all i ≤ n, either (αi)y ∈ Γ ∪ Λ or follows by MP. We will break into cases.

c 1. Suppose that αi ∈ Γ. Then αi doesn’t involve c, and so (αi)y = αi ∈ Γ. c 2. Suppose αi ∈ Λ. Then it is easily checked that (αi)y ∈ Λ. c 3. Suppose that there exist j, k < i such that αk is (αj ⇒ αi). Then (αk)y is c c c c c ((αj)y ⇒ (αi)y). So (αi)y follows by Modus Ponens from (αj)y and (αk)y.

32 c Let Φ be the elements of Γ which actually occur in (**). Then Φ ` ϕy. As c y does not occur free in Φ, By generalization, Φ ` ∀yϕy. c Hence Γ ` ∀yϕy. Finally note that c certainly doesn’t occur in (**). Recall the proof of generalization, and we see that c also doesn’t occur in c the proof of ∀yϕy from Γ. x Corollary 4.21. Suppose that Γ ` ϕc where c is a constant that doesn’t occur in Γ ∪ {ϕ}. Then Γ ` ∀xϕ via a deduction in which c does not occur.

x c Proof. By the above theorem, Γ ` ∀y(ϕc )y for some variable y which doesn’t x x c x occur in ϕc . Since c doesn’t occur in ϕ, we have that (ϕc )y = ϕy . Thus, x Γ ` ∀yϕy . x x By the exercise, teh following is a logical axiom: ∀yϕy ⇒ ϕ. Thus ∀xϕy ` ϕ. x x Since x doesn’t occur free in ∀yϕy , generalization igves ∀yϕy ` ∀xϕ. x x By deduction, ` (∀yϕy ⇒ ∀xϕ), and since Γ ` ∀yϕy by Modus Ponens, wE get Γ ` ∀xϕ.

Theorem 4.22 (Existence of Alphabetic Variants). Let ϕ be a wff, t a term and x a variable. Then there exists a wff ϕ0 (which differs from ϕ only in the quantified variables) such that 1. ϕ ` ϕ0 and ϕ0 ` ϕ 2. t is a substitute for x in ϕ0

Proof. Omitted, see Enderton

4.2 The Completeness Theorem Finally, we are ready to begin a proof of the completeness theorem. Theorem 4.23 (The Completeness Theorem). If Γ |= ϕ then Γ ` ϕ. We will make use of the following: Lemma 4.24. The following are equivalent:

1. The Completeness Theorem 2. If Γ is consistant then Γ is satisfiable.

Proof. 1 ⇒ 2: Suppose that Γ is consistant. Then there exists a wff ϕ such that Γ 6` ϕ. By completeness, Γ 6|= ϕ. Hence there exists a structure A and a function s : V → A such that A satisfies Γ with s, but A 6|= ϕ[s]. In particular, A satisfies Γ with s. 2 ⇒ 1: Suppose that Γ 6` ϕ. By reductio ad absurdum, Γ∪{¬ϕ} is consistent. Thus, it is satisfiable, and so Γ 6|= ϕ. We now prove the following version of the completeness theorem:

33 Theorem 4.25 (Completeness). If Γ is a consistent set of wffs in a countable language L , then there exists a countable structure A for L and a function s : V → A such that A satisfies Γ with s. We will proceed in several lemmas.

Lemma 4.26. Expand L to a language L + by adding a countably infinite set of new constant symbols. Then Γ remains consistant in L +. Proof. Suppose not. Then there exists a wff β of L + such that Γ ` (β ∧ ¬β) in L +. Suppose that c1, . . . , cn include the new constants, if any, which appear in β. By generalization on constants, there exist variables y1, . . . , yn such that 0 0 0 Γ ` ∀y1,..., ∀yn, β ∧ ¬β in L where β is the result of replacing each ci 0 0 0 with yi. Since yi is substitutable for yi in β ,Γ ` β ∧ ¬β in L . This is a contradiction.

Lemma 4.27 (Add Witnesses). Let hϕ1, x1i,..., hϕn, xni enumerate all pairs + hϕ, xi where ϕ si a wff of L and x is a variable. Let θ1 be the wff ¬∀x1ϕ1 ⇒ (¬ϕ )x1 where c is the first new constnat which doesn’t occur in ϕ. If n > 1 1 c1 1 then θ is the wff ¬∀x ϕ ⇒ (¬ϕ )xn where c is the first new constant symbol n n n n cn n which doesn’t occur in ϕ1, . . . , ϕn, θ1, . . . , θn−1. Let Θ = Γ ∪ {θn|n ≥ 1}. Then Θ is consistant.

Proof. Suppose not. Then let n ≥ 0 be the least integer such that Γ∪{θ1, . . . , θn+1} is inconsistant. Then by reductio ad absurdum, Γ∪{θ1, . . . , θn} ` ¬θn+1. Recall x that θn+1 has the form ¬∀xϕ ⇒ (¬ϕ)c . By rule T, we have Γ ∪ {θ1, . . . , θn} ` x ¬∀xϕ adn Γ ∪ {θ1, . . . , θn} ` ϕc . Since c doesn’t occur in Γ ∪ {θ1, . . . , θn} ∪ {ϕ}, we have Γ ∪ {θ1, . . . , θn} ⇒ ∀xϕ. This contradicts θn+1 being the first contradiction, or the of Γ if n = 0. Lemma 4.28. We can extend Θ to a consistent set of wffs ∆ such that for every wff ϕ of L +, either ϕ ∈ ∆ or ¬ϕ ∈ ∆.

+ Proof. Let α1, . . . , αn,... be an enumeration of the wffs of L . We shall define inductively an increasing sequence ∆0 ⊂ ∆1 ⊂ ... of consistent sets of wffs. Let ∆0 = Θ. Suppose inductively that ∆n has been defined. If ∆n ∪ {αn+1} is consitent, then let ∆n+1 = ∆n ∪ {αn+1}. If it is inconsistent, then by reductio ad absur- dum, ∆n ` ¬αn+1, and so we let ∆n+1 = ∆n ∪ {¬αn+1}. Clearly ∆ = ∪∆n satisfies our requirements.

Notice now that ∆ is deductively closed. That is, if ∆ ` ϕ, then ϕ ∈ ∆. Otherwise if ϕ∈ / ∆, then ¬ϕ ∈ ∆, and so ∆ ` ϕ and ∆ ` ¬ϕ, contradicting the consistency. Lemma 4.29. For each of the following wffs, ∆ ` ϕ and so ϕ ∈ ∆:

34 1. ∀x(x = x) 2. (∀x)(∀y)(x = y ⇒ y = x) 3. (∀x)(∀y)(∀z)((x = y ∧ y = z) ⇒ x = z)

4. For each n-ary preducate symbol P , ∀x1,..., ∀xn, ∀y1,..., ∀yn((x1 = y1 ∧ ... ∧ xn = yn) ⇒ P x1 . . . xn = P y1 . . . yn)

5. For each n-ary function symbol f, ∀x1,..., ∀xn, ∀y1,... ∀yn((x1 = y1 ∧ ... ∧ xn = yn) ⇒ fx1 . . . xn = fy1 . . . yn)

Similarly, since ∆ is deductively closed and ∀x∀y(x = y ⇒ y = x) ∈ ∆, we have that if t1, t2 are terms, then (t1 = t2 ⇒ t2 = t1) ∈ ∆.

Lemma 4.30. We construct a structure A for our language L + as follows: + Let T be the set of terms of L and define a binary relation E on T by t1Et2 iff (t1 = t2) ∈ ∆. Then E is an equivalence relation. Proof. Let t ∈ T . Then (t = t) ∈ ∆, and so tEt for all t, so E is reflexive. Suppose that t1Et2. Then (t1 = t2) ∈ ∆, and so (t2 = t1) ∈ ∆, so t2Et2, so E is symmetric. Transitivity is similar. For each t ∈ T , we define [t] = {s ∈ T |tEs}, then we define A = {[t]|t ∈ T }. For any n-ary predicate symbol, we define an n-ary relation P A on A by A h[t1],..., [tn]i ∈ P iff P t1, . . . , tn ∈ ∆. Lemma 4.31. P A is well defined.

Proof. Suppose that [s1] = [t1],..., [sn] = [tn]. We must show that P s1, . . . , sn ∈ ∆ iff P t1, . . . , tn ∈ ∆. By hypothesis (si = ti) ∈ ∆ for each i. Since ((si = ti ∧ ... ∧ sn = tn) ⇒ (P s1, . . . , sn ⇐⇒ P t1, . . . , tn)) ∈ ∆, the result follows. For each constant symbol c, we define cA = [c], and for each n-ary func- A A tion symbol f, we define an n-ary operation f on A by f ([t1],..., [tn]) = A [ft1, . . . , tn]. As above, f is well-defined. Finally, we define s : V → A by s(x) = [x].

Lemma 4.32. For every term t, s¯(t) = [t]. Proof. By definition this is true when t is a constant symbol or a variable. Suppose that t = ft1, . . . , tn. By induction, we assume thats ¯(ti) = [ti] A A for each i. Thuss ¯(ft1, . . . , tn) = f (¯s(t1),..., s¯(tn)) = f ([t1],..., [tn]) = [ft1, . . . , tn]. Lemma 4.33 ( Lemma). If the term t is substitutable for x in ψ, x then A |= ψt [s] iff A |= ψ[s(x|s¯(t))].

35 And our final claim:

Lemma 4.34. For each wff ϕ of L +, A |= ϕ[s] iff ϕ ∈ ∆ Proof. We argue by deduction on the complexity of ϕ. First suppose that ϕ is atomic. Assume that ϕ is t1 = t2. Then A |= (t1 = t2)[s] iffs ¯(t1) =s ¯(t2), iff [t1] = [t2], iff (t1 = t2) ∈ ∆. Now suppose that ϕ is P t1, . . . , tn. Then A |= (P t1, . . . , tn)[s] iff hs¯(t1),..., s¯(tn)i ∈ A A P , iff h[t1],..., [tn]i ∈ P iff P t1, . . . , tn ∈ ∆. Next we consider the cases where ϕ is not atomic. Suppose that ϕ is ¬ψ. Then A |= ¬ψ[s] iff A 6|= ψ[s] iff ψ∈ / ∆, iff ¬ψ ∈ A . The case ϕ is ψ ⇒ θ is similar. Finally, suppose ϕ is ∀xψ. By construction, for some constant c,(¬∀xϕ ⇒ x ¬ϕc ) ∈ ∆. Call this (*). First suppose that A |= ∀xϕ[s], then in particular, A |= ψ[s(x|[c])], that is, A |= ψ[s(x|s¯(x))]. x By the substitution lemma, A |= ψc [s], and hence by the induction hypoth- x x esis, ψc ∈ ∆. Thus ¬ψc ∈/ ∆, so (*) implies that ¬∀xψ∈ / ∆. Thus ∀xψ ∈ ∆. Conversely, suppose that A 6|= ∀xψ[s]. Then there exists a term t ∈ T such that A 6|= ψ[s(x|[t])], that is, A 6|= ψ[s(x|s¯(t))]. Let ψ0 be an alphabetic variant of ψ such that t is substitutable for x in ψ0. 0 0 x Then A 6|= ψ [s(x|s¯(t))]. By the substitution lemma, A 6|= (ψ )t [s], and by the 0 c 0 0 x induction hypothesis, (ψ )t ∈ ∆. Since (∀xψ ⇒ (ψ )t ) ∈ Λ ⊂ ∆, we must have ∀xψ0 ∈/ ∆. Thus ∀xψ∈ / ∆. Finally, let A0 be the structure for L obtained by forgetting the interpre- tations of the new constants. Then A0 satisfies Γ with s. Thus, the completeness theorem holds.

Corollary 4.35. Γ |= ϕ ⇐⇒ Γ ` ϕ. Theorem 4.36 (Compactness Theorem). Let Γ be a set of wffs in a countable first order language. If Γ is finitely satifiable, then Γ is satisfiable in some countable structure.

Proof. Suppose that Γ is finitely satisfiable. Let Γ0 ⊂ Γ be any finite subset, then Γ0 is satisfiable. Hence, by soundness, Γ0 is consistent. Since every finite subset of Γ is consistent, Γ is consistent. By completeness, Γ is satisfiable in a countable structure. Theorem 4.37. Let T be a set of sentences in a first order language. If the class C = Mod(T ) is finitely axiomatizable, then there exists a finite subset T0 ⊂ T such that C = Mod(T0) Proof. Suppose that C = Mod(T ) is finitely axiomatizable. Then there exists a sentence σ such that C = Mod(σ), since Mot(T ) = Mod(σ), we have T |= σ. Hence by completeness, T ` σ. Thus, there is a finite set T0 ⊂ T such that T0 ` σ. By soundness T0 |= σ. Hence, C = Mod(T ) ⊂ Mod(T0) ⊂ Mod(σ) = C .

36 Definition 4.22. Let A , B be structures for the first order language L . Then A and B are elementarily equivalent, written A ≡ B iff for every sentence σ ∈ L , A |= σ iff B |= σ. Remark 4.5. A ' B implies A ≡ B, but the is false (eg, nonstan- dard arithmetic.) Definition 4.23 (Complete Set). A consistent set of sentences is said to be complete iff for every sentence σ, either T ` σ or T ` ¬σ. Definition 4.24 (Theory). A theory is a set of sentences. A consistant theory is complete if it is as a set of sentences.

Theorem 4.38. Let T be a in a first order langague L . If A and B are models of T , then A ≡ B. Proof. Let σ be any sentence. Then T ` σ or T ` ¬σ. Suppose that T ` σ. By soundness if T is true then σ is true. So A |= σ and B |= σ. On the other hand, if T ` ¬σ, then by soundness we have A |= ¬σ and B |= ¬σ. Theorem 4.39 (Los-Vaught Test). Let T be a consistent theory in a countable language L . Suppose 1. T has no finite models

2. If A are countably infinite models of T , then A ' B. Then T is complete. Proof. Suppose that T satisfies the two conditions. Assume for contradiction that T is not complete. Then there is a sentence σ such that T 6` σ and T 6` ¬σ. By reduction ad absurdum, T ∪ {σ} and T ∪ {¬σ} are both consistent. BY completeness, there exist countable models A and B of T ∪ {σ} and T ∪ {¬σ} respectively. By the first property, they are countably infinite, and by the second, A ' B, contradiction.

Corollary 4.40. TDLO is complete.

Proof. TDLO has no finite models. Also we have seen by the back and forth argument that any two countable dense linear orders are isomorphism, and so by L-V, we are done.

Corollary 4.41. hQ,

Proof. Both are models of the complete theory TDLO. The rationals are a linear order win which ”every conceivable finite configu- ration is realized.” We next seek a graph theoretic analogue: the infinite random graph.

37 Definition 4.25. For k ≥ 1, let Pk be the dfirst order sentence in the language of graphs which says that if x1, . . . , xk, y1, . . . , yk are distinct vertices, there ex- ists a vertex z such that z 6= xi, yi for all i, z is joined to xi for all i, and zis not joined to yi for all i. We define the theory TR to be the theory {(∃x)(∃y)(x 6= y)} ∪ {Pk|k ≥ 1}.

Theorem 4.42. TR is consistant. Proof. By soundness, it is enough to show that it is satisfiable. Consider the graph Γ = hN,Ei where n is joind to m iff 2n appears in the binary expansion of m, or vice versa. We claim that Γ satisfies Pk for all k ≥ 1. So let n1, . . . , nk, m1, . . . , mk be distinct natural numbers. Let ` ≥ max{m1, . . . , mk, n1, . . . , nk}. Then z = n1 n ` 2 +...+2 k +2 is joined to all of n1, . . . , nk, and none of the m1, . . . , mk.

Question: Why is TR called the theory of the random graph? Answer: Consider a graph Γ∗ = hN,E∗i defined as follows. For each pair n 6= m, we toss a coin. If heads, we join, if tails we don’t.

4.43. Γ is a model of TR with 1.

Proof. Suppose that x1, . . . , xk, y1, . . . , yk ∈ N are distinct. Fix some z∈ / F = −2k {x1, . . . , xk, y1, . . . , yk}. Then the probability that z works is 2 , and so the −2k probability that z doesn’t work is 1 − 2 . Let N \ F = {z1, . . . , zn,...}. −2k n Then the probability that none of the z1, . . . , zn works is (1 − 2 ) , and −2k n limn→∞(1 − 2 ) = 0, and so with probability 1, one of them will work.

Question: Why is TR claled the theory of THE random graph?

Theorem 4.44. If G, H are countably infinite models of TR, then G ' H. Proof. By the back and forth argument.

Theorem 4.45. TR is complete. Proof. L-V. And now for (apparently) completely different. We’ll study the basics of finite random .

Definition 4.26. Gn is the set of all graphs with vertex set {1, . . . , n}.

Remark 4.6. Each G ∈ Gn is uniquely deterined by the edge set E ∈ P(T ) |T | (n) n(n−1)/2 where T = {{k, `}|1 ≤ k < ` ≤ n}. Hence |Gn| = 2 = 2 2 = 2 . Definition 4.27. If ϕ is any sentence in the language of graph theory, then |{G∈Gn:G|=ϕ}| Probn(ϕ) = |Gn| This is the same probability as if we joined each pair of vertices independently with probability 1/2.

38 Theorem 4.46 (Zero-One Law). Let ϕ be any sentence in the langauge of graph theory. THen either limn→∞ Probn(ϕ) = 1 or limn→∞ Probn(ϕ) = 0. We will first prove the following special case:

Theorem 4.47. For each k ≥ 1, limn→∞ Probn(Pk) = 1.

Proof. Let n ≥ 2k + 1. Suppose that G ∈ Gn and G 6|= Pk. Then there exists X = {x1, . . . , xk, y1, . . . , yk} such that no z in {1, . . . , n}\ X is joined to pre- n−2k  1 2k cisely the first k. For fixed X, probability of this is 1 − 2 . So summing over all possible 2k subsets of X, we see that Probn(¬Pk) = n−2k n   1 2k 2k 1 − 2 . This is a polynomial times an exponential, and so Probn(¬Pk) → 0, so Probn(Pk) → 1 as n → ∞. Now we prove the Zero-One Law.

Proof. The axioms of TR are true with probability 1. As TR is complete by L-V, either TR ` ϕ or TR ` ¬ϕ. Assume that TR ` ϕ. Then there exists k1 < . . . < ks such that Γ =

(∃x)(∃y)(x 6= y),Pk1 ,...,Pks } ` ϕ, and hence Γ |= ϕ. Let θ be the sentence which says that there are at least 2ks + 1 elements.

Then clearly {θ, Pks } |= ϕ. Hence, if n ≥ 2ks+1 then Probn(PkS ) ≤ Probn(ϕ) ≤ limn→∞ Probn(Pks ) = 1, and so 1 ≤ Prob(ϕ) ≤ 1. The other case is similar. Open Problem: Let T be a complete theory in a countable first order lan- guage. How many countable models can T have up to isomorphism? Theorem 4.48 (Vaught). If T is a complete theory in a countable language, then T cannot have exactly two countable models. Theorem 4.49. There exists a complete theory in a countable language which has exactly 3 countable models up to isomorphism.

Proof. Let L be the language with nonlogical symbols: a binary predicate + symbol <, constant symbols c1, . . . , cn, . . . , n ∈ N . And let T be the theory + which says < is a DLO without end points adn cn < cn+1 for n ∈ N . Clearly, T is consistent. −n Pn 1 Three models are hQ, <, ni, hQ, <, 1 − 2 i and hQ, <, k=1 k2 i. A A These are the only models, as if A = hQ, <, cn i, then limn→∞ cn = ∞, A A limn→∞ cn ∈ Q or limn→∞ cn ∈/ Q, and each corresponds to Let Ln be the language consisting of <, c1, . . . , cn. Let Tn be a theory such that < is a DLO and c1 < . . . < cn. Clearly L = ∪Ln, and T = ∪Tn. Note that Tn has no finite models, is consistent, and has a unique countable model up to isomorphism, and so by L-V, T is complete. Let ϕ be any sentence in L . Then there exists an n ∈ N+ such that ϕ is a sentence in Ln, and hence Tn ` ϕ or Tn ` ¬ϕ, and hence T ` ϕ or T ` ¬ϕ. Thus T is complete.

39 Theorem 4.50. For each n ≥ 3, there exists a complete theory in a countable language which hs exactly n models up to isomorphism.

40