Logic and Set Theory
Total Page:16
File Type:pdf, Size:1020Kb
University of Cambridge Mathematics Tripos Part II Logic and Set Theory Lent, 2018 Lectures by I. B. Leader Notes by Qiangru Kuang Contents Contents 1 Propositional Logic 2 1.1 Semantic Entailment ......................... 2 1.2 Syntactic Implication ......................... 4 2 Well-orderings and Ordinals 9 2.1 Definitions ............................... 9 2.2 Constructing well-orderings ..................... 13 2.3 Ordinals ................................ 13 2.4 Some ordinals ............................. 15 2.5 Successors and Limits ........................ 16 2.6 Ordinal arithmetics .......................... 17 3 Posets and Zorn’s Lemma 20 3.1 Partial Orders ............................. 20 3.2 Zorn’s Lemma ............................. 23 3.3 Zorn’s Lemma and Axiom of Choice ................ 25 3.4 Bourbaki-Witt Theorem* ...................... 26 4 Predicate Logic 28 4.1 Definitions ............................... 28 4.2 Semantic Entailment ......................... 30 4.3 Syntactic Implication ......................... 32 4.4 Gödel Completeness Theorem* ................... 34 4.5 Peano Arithmetic ........................... 38 5 Set Theory 40 5.1 Zermelo-Fraenkel Set Theory .................... 40 5.2 Properties of ZF ........................... 44 5.3 Picture of the Universe ........................ 48 6 Cardinals 50 6.1 Definitions ............................... 50 6.2 Cardinal Arithmetics ......................... 51 7 Gödel Incompleteness Theorem* 54 A Classes 57 Index 58 1 1 Propositional Logic 1 Propositional Logic Let 푃 be a set of primitive propositions. Unless otherwise stated, 푃 = {푝1, 푝2,…}. Definition (Language). The language or set of propositions 퐿 = 퐿(푃 ) is defined inductively by 1. for every 푝 ∈ 푃, 푝 ∈ 퐿, 2. ⊥ ∈ 퐿 (reads “false”), 3. if 푝, 푞 ∈ 퐿 then (푝 ⟹ 푞) ∈ 퐿. Example. (푝1 ⟹ ⊥), ((푝1 ⟹ 푝2) ⟹ (푝1 ⟹ 푝3)), ((푝1 ⟹ ⊥) ⟹ ⊥) are elements of 퐿. Note. 1. Each proposition is a finite string of symbols from the alphabet (, ), ⟹ , 푝1, 푝2,…. 2. “Inductively defined” means more precisely that we set 퐿1 = 푃 ∪ {⊥} 퐿푛+1 = 퐿푛 ∪ {(푝 ⟹ 푞) ∶ 푝, 푞 ∈ 퐿푛} and then set 퐿 = 퐿1 ∪ 퐿2 ∪ …. 퐿푛 can be seen as “things born by time 푛”. 3. Each proposition is built up uniquely from (1), (2) and (3). For example, ((푝1 ⟹ 푝2) ⟹ (푝1 ⟹ 푝3)) came from (푝1 ⟹ 푝2) and (푝1 ⟹ 푝3). Note that we often omit outer brackets or use different brackets for clarity. We can now define for example, ¬푝 (reads “not 푝”) as an abbreviation for 푝 ⟹ ⊥, 푝 ∨ 푞 (reads “푝 or 푞”) for (¬푝) ⟹ 푞, 푝 ∧ 푞 (reads “푝 and 푞”) for ¬(푝 ⟹ (¬푞)). 1.1 Semantic Entailment Definition (Valuation). A valuation is a function 푣 ∶ 퐿 → {0, 1} such that 1. 푣(⊥) = 0, 0 if 푣(푝) = 1, 푣(푞) = 0 2. 푣(푝 ⟹ 푞) = { for all 푝, 푞 ∈ 퐿. 1 otherwise Remark. On {0, 1}, we could define a constant ⊥ by ⊥ = 0 and an operation ⟹ by 0 if 푎 = 1, 푏 = 0 (푎 ⟹ 푏) = { 1 otherwise Then a valuation is a function 퐿 → {0, 1} that preserves the structure (⊥ and ⟹ ), i.e. it is a homomorphism. 2 1 Propositional Logic Proposition 1.1. 1. If 푣 and 푣′ are valuations with 푣(푝) = 푣′(푝) for all 푝 ∈ 푃, then 푣 = 푣′. 2. For any 푤 ∶ 푃 → {0, 1}, there exists a valuation 푣 with 푣(푝) = 푤(푝) for all 푝 ∈ 푃. In other words, a valuation is determined by its values on 푃 and any values will do. Proof. ′ ′ ′ 1. We have for all 푝 ∈ 퐿1, 푣(푝) = 푣 (푝). But if 푣(푝) = 푣 (푝) and 푣(푞) = 푣 (푞) ′ ′ then 푣(푝 ⟹ 푞) = 푣 (푝 ⟹ 푞) so 푣 = 푣 on 퐿2. Continue inductively, we ′ have 푣 = 푣 on 퐿푛 for all 푛. 2. Set 푣(푝) = 푤(푝) for all 푝 ∈ 푃 and 푣(⊥) = 0. This defines 푣 on 퐿1. Having 0 if 푣(푝) = 1, 푣(푞) = 0 defined 푣 on 퐿2, use 푣(푝 ⟹ 푞) = { to define 푣 1 otherwise on 퐿푛+1. Example. In a valuation given by 푣(푝1) = 1 푣(푝2) = 1 푣(푝푛) = 0 for all 푛 ≥ 3 we have 푣((푝⏟⏟⏟⏟⏟1 ⟹ 푝2) ⟹ 푝⏟3) = 0. 1 0 Definition (Tautology). 푝 is a tautology, written ⊨ 푝 if 푣(푝) = 1 for all valuations 푣. Example. 1. 푝 ⟹ (푞 ⟹ 푝). “A true statement is implied by anything”. To show this we could write donw a truth table 푣(푝) 푣(푞) 푣(푞 ⟹ 푝) 푣(푝 ⟹ (푞 ⟹ 푝)) 1 1 1 1 1 0 1 1 0 1 0 1 0 0 1 1 2. (¬¬푝) ⟹ 푝, i.e. ((푝 ⟹ ⊥) ⟹ ⊥) ⟹ 푝. “Law of excluded middle”. 3 1 Propositional Logic 3. (푝 ⟹ (푞 ⟹ 푟)) ⟹ ((푝 ⟹ 푞) ⟹ (푝 ⟹ 푟)). This is an example where writing down a truth table is not so desirable. Instead, this is not a tautology only if we have 푣 with 푣(푝 ⟹ (푞 ⟹ 푟)) = 1 푣((푝 ⟹ 푞) ⟹ (푝 ⟹ 푟)) = 0 so 푣(푝 ⟹ 푞) = 1, 푣(푝 ⟹ 푟) = 0 whence 푣(푝) = 1, 푣(푟) = 0, so also 푣(푞) = 1. But then 푣(푞 ⟹ 푟) = 0 so 푣(푝 ⟹ (푞 ⟹ 푟)) = 0. Absurd. Definition (Semantic entailment). For 푆 ⊆ 퐿, 푡 ∈ 퐿, we say 푆 entails or semantically implies 푡, written 푆 ⊨ 푡, if 푣(푠) = 1 for all 푠 ∈ 푆 then 푣(푡) = 1 for each valuation 푣. This says whenever all of 푆 is true, 푡 is true as well. Example. {푝 ⟹ 푞, 푞 ⟹ 푟} ⊨ (푝 ⟹ 푟). Indeed, suppose not. So have 푣 with 푣(푝 ⟹ 푞) = 푣(푞 ⟹ 푟) = 1, 푣(푝 ⟹ 푟) = 0. Then 푣(푝) = 1, 푣(푟) = 0, whence 푣(푞) = 0 (from 푣(푞 ⟹ 푟) = 1), so 푣(푝 ⟹ 푞) = 0. Absurd. Definition (Model). If 푣(푡) = 1, we say 푡 is true in 푣 or that 푣 is a model of 푡. For 푆 ⊆ 퐿, 푣 is a model of 푆 if 푣(푠) = 1 for all 푠 ∈ 푆. Using this terminology, 푆 ⊨ 푡 says that every model of 푆 is a model of 푡. Note. ⊨ 푡 is equivalent to ∅ ⊨ 푡. 1.2 Syntactic Implication For a notion of “proof”, we’ll need axioms and deduction rules. As axioms, we’ll take 1. 푝 ⟹ (푞 ⟹ 푝) for all 푝, 푞 ∈ 퐿. 2. (푝 ⟹ (푞 ⟹ 푟)) ⟹ ((푝 ⟹ 푞) ⟹ (푝 ⟹ 푟)) for all 푝, 푞, 푟 ∈ 퐿. 3. (¬¬푝) ⟹ 푝 for all 푝 ∈ 퐿. Note. We have already checked that these are all tautologies. Sometimes we say 3 axiom schemes to mean 3 infinite sets of axioms. As deduction rules, we’ll take just modus ponens: from 푝 and (푝 ⟹ 푞) we can deduce 푞. Definition (Proof). For 푆 ⊆ 퐿 and 푡 ∈ 퐿, a proof of 푡 from 푆 consists of a finite sequence 푡1, … , 푡푛 of propositions, with 푡푛 = 푡 such that for every 푖, the proposition 푡푖 is an axiom, or a member of 푆, or there exists 푗, 푘 < 푖 with 푡푗 = (푡푘 ⟹ 푡푖). We say 푆 is the hypotheses or premises and 푡 is the conclusion. 4 1 Propositional Logic Definition (Syntactical implication). If there is a proof of 푡 from 푆, say 푆 proves or syntactically implies 푡, written 푆 ⊢ 푡. Definition (Theorem). 푡 is a theorem if ∅ ⊢ 푡, written ⊢ 푡. Example. {푝 ⟹ 푞, 푞 ⟹ 푟} ⊢ 푝 ⟹ 푟 1. (푞 ⟹ 푟) ⟹ (푝 ⟹ (푞 ⟹ 푟)), A1 2. 푞 ⟹ 푟, hypothesis 3. 푝 ⟹ (푞 ⟹ 푟), MP 4. (푝 ⟹ (푞 ⟹ 푟)) ⟹ ((푝 ⟹ 푞) ⟹ (푝 ⟹ 푟)), A2 5. (푝 ⟹ 푞) ⟹ (푝 ⟹ 푟), MP 6. 푝 ⟹ 푞, hypothesis 7. 푝 ⟹ 푟, MP Example. ⊢ 푝 ⟹ 푝 1. 푝 ⟹ ((푝 ⟹ 푝) ⟹ 푝), A1 2. (푝 ⟹ ((푝 ⟹ 푝) ⟹ 푝)) ⟹ ((푝 ⟹ (푝 ⟹ 푝)) ⟹ (푝 ⟹ 푝)), A2 3. (푝 ⟹ (푝 ⟹ 푝)) ⟹ (푝 ⟹ 푝), MP 4. 푝 ⟹ (푝 ⟹ 푝), A1 5. 푝 ⟹ 푝, MP The following theorem allows us to prove things much more easily: Theorem 1.2 (Deduction theorem). Let 푆 ⊆ 퐿 and 푝, 푞 ∈ 퐿. Then 푆 ⊢ 푝 ⟹ 푞 if and only if 푆 ∪ {푝} ⊢ 푞. Proof. • ⟸ : Given a proof of 푝 ⟹ 푞 from 푆, append the lines 1. 푝, hypothesis 2. 푞, MP to obtain a proof of 푞 from 푆 ∪ {푝}. • ⟹ : Let 푡1, … , 푡푛 = 푞 be a proof of 푞 from 푆 ∪ {푝}. We’ll show that 푆 ⊢ 푝 ⟹ 푡푖 for all 푖. Split into cases – 푡푖 is an axiom: write down 1. 푡푖 ⟹ (푝 ⟹ 푡푖), A1 2. 푡푖, axiom 3. 푝 ⟹ 푡푖, MP 5 1 Propositional Logic – 푡푖 ∈ 푆: identical as above. – 푡푖 = 푝: write down the proof 푝 ⟹ 푝. – 푡푖 is obtained by MP: there exist 푗, 푘 < 푖 such that 푡푘 = (푡푗 ⟹ 푡푖). By induction 푆 ⊢ 푝 ⟹ 푡푗 and 푆 ⊢ 푝 ⟹ 푡푘. Now write down 1. (푝 ⟹ (푡푗 ⟹ 푡푖)) ⟹ ((푝 ⟹ 푡푗) ⟹ (푡 ⟹ 푡푖)), A1 2. 푝 ⟹ (푡푗 ⟹ 푡푖), known 3. (푝 ⟹ 푡푗) ⟹ (푝 ⟹ 푡푖), MP 4. 푝 ⟹ 푡푗, known 5. 푝 ⟹ 푡푖, MP and we can conclude 푆 ⊢ 푝 ⟹ 푡푖 for all 푖. Example. In order to show {푝 ⟹ 푞, 푞 ⟹ 푟} ⊢ 푝 ⟹ 푟, it suffices to show {푝 ⟹ 푞, 푞 ⟹ 푟, 푝} ⊢ 푟 by deduction theorem, which is easy by using MP twice. Now we have two turnstiles ⊨ and ⊢, how are they related? The aim of the rest of the chapter is to prove Theorem 1.3 (Completeness theorem). 푆 ⊨ 푡 if and only if 푆 ⊢ 푡. We break this down into two directions: • ⟹ : adequacy • ⟸ : soundness The easy part is Proposition 1.4 (Soundness). If 푆 ⊢ 푡 then 푆 ⊨ 푡. Proof. Given 푣 that models 푆 and a proof 푡1, … , 푡푛 = 푡 of 푆 ⊢ 푡, we will show that 푣(푡푖) = 1 for all 푖. If 푡푖 is an axiom then 푣(푡푖) = 1 since it is tautology. If 푡푖 is a hypothesis then 푣(푡푖) = 1 by assumption. Finally, if 푡푖 is obtained by MP, say from 푡푗 ⟹ 푡푖, since 푣(푡푗) = 1 and 푣(푡푗 ⟹ 푡푖) = 1 by induction, 푣(푡푖) = 1. Note that soundness holds whenever our axioms are tautologies. To prove adequacy, which is a bit harder, we need a few lemmas. Definition (Consistency). 푆 is inconsistent if 푆 ⊢ ⊥.