Mathematical Logic
Total Page:16
File Type:pdf, Size:1020Kb
Mathematical Logic Helmut Schwichtenberg Mathematisches Institut der Universit¨at M¨unchen Wintersemester 2003/2004 Contents Chapter 1. Logic 1 1. Formal Languages 2 2. Natural Deduction 4 3. Normalization 11 4. Normalization including Permutative Conversions 20 5. Notes 31 Chapter 2. Models 33 1. Structures for Classical Logic 33 2. Beth-Structures for Minimal Logic 35 3. Completeness of Minimal and Intuitionistic Logic 39 4. Completeness of Classical Logic 42 5. Uncountable Languages 44 6. Basics of Model Theory 48 7. Notes 54 Chapter 3. Computability 55 1. Register Machines 55 2. Elementary Functions 58 3. The Normal Form Theorem 64 4. Recursive Definitions 69 Chapter 4. G¨odel’s Theorems 73 1. G¨odel Numbers 73 2. Undefinability of the Notion of Truth 77 3. The Notion of Truth in Formal Theories 79 4. Undecidability and Incompleteness 81 5. Representability 83 6. Unprovability of Consistency 87 7. Notes 90 Chapter 5. Set Theory 91 1. Cumulative Type Structures 91 2. Axiomatic Set Theory 92 3. Recursion, Induction, Ordinals 96 4. Cardinals 116 5. The Axiom of Choice 120 6. Ordinal Arithmetic 126 7. Normal Functions 133 8. Notes 138 Chapter 6. Proof Theory 139 i ii CONTENTS 1. Ordinals Below ε0 139 2. Provability of Initial Cases of TI 141 3. Normalization with the Omega Rule 145 4. Unprovable Initial Cases of Transfinite Induction 149 Bibliography 157 Index 159 CHAPTER 1 Logic The main subject of Mathematical Logic is mathematical proof. In this introductory chapter we deal with the basics of formalizing such proofs. The system we pick for the representation of proofs is Gentzen’s natural deduc- tion, from [8]. Our reasons for this choice are twofold. First, as the name says this is a natural notion of formal proof, which means that the way proofs are represented corresponds very much to the way a careful mathematician writing out all details of an argument would go anyway. Second, formal proofs in natural deduction are closely related (via the so-called Curry- Howard correspondence) to terms in typed lambda calculus. This provides us not only with a compact notation for logical derivations (which other- wise tend to become somewhat unmanagable tree-like structures), but also opens up a route to applying the computational techniques which underpin lambda calculus. Apart from classical logic we will also deal with more constructive logics: minimal and intuitionistic logic. This will reveal some interesting aspects of proofs, e.g. that it is possible und useful to distinguish beween existential proofs that actually construct witnessing objects, and others that don’t. As an example, consider the following proposition. There are irrational numbers a, b such that ab is rational. This can be proved as follows, by cases. √2 Case √2 is rational. Choose a = √2 and b = √2. Then a, b are irrational and by assumption ab is rational. √2 √2 Case √2 is irrational. Choose a = √2 and b = √2. Then by assumption a, b are irrational and √2 √2 2 ab = √2 = √2 = 2 ³ ´ ³ ´ is rational. ¤ √2 As long as we have not decided whether √2 is rational, we do not know which numbers a, b we must take. Hence we have an example of an existence proof which does not provide an instance. An essential point for Mathematical Logic is to fix a formal language to be used. We take implication and the universal quantifier as basic. Then the logic rules correspond to lambda→ calculus. The additional∀ connectives , , and are defined via axiom schemes. These axiom schemes will later⊥ be∃ ∨ seen as∧ special cases of introduction and elimination rules for inductive definitions. 1 2 1. LOGIC 1. Formal Languages 1.1. Terms and Formulas. Let a countable infinite set vi i N of variables be given; they will be denoted by x,y,z. A first order{ language| ∈ } then is determined by its signature, which is to mean the following. L For every natural number n 0 a (possible empty) set of n-ary rela- • tion symbols (also called predicate≥ symbols). 0-ary relation symbols are called propositional symbols. (read “falsum”) is required as a fixed propositional symbol. The⊥ language will not, unless stated otherwise, contain = as a primitive. For every natural number n 0 a (possible empty) set of n-ary • function symbols. 0-ary function≥ symbols are called constants. We assume that all these sets of variables, relation and function symbols are disjoint. For instance the language G of group theory is determined by the sig- nature consisting of the followingL relation and function symbols: the group operation (a binary function symbol), the unit e (a constant), the inverse ◦ 1 operation − (a unary function symbol) and finally equality = (a binary relation symbol). -terms are inductively defined as follows. L Every variable is an -term. • Every constant of Lis an -term. • L L If t ,...,tn are -terms and f is an n-ary function symbol of • 1 L L with n 1, then f(t ,...,tn) is an -term. ≥ 1 L From -terms one constructs -prime formulas, also called atomic for- L L mulas of : If t ,...,tn are terms and R is an n-ary relation symbol of , L 1 L then R(t1,...,tn) is an -prime formula. -formulas are inductivelyL defined from -prime formulas by L L Every -prime formula is an -formula. • If A andL B are -formulas, thenL so are (A B) (“if A, then B”), • (A B) (“A andL B”) and (A B) (“A or B→”). If A∧ is an -formula and x is∨ a variable, then xA (“for all x, A • holds”) andL xA (“there is an x such that A”) are∀ -formulas. ∃ L Negation, classical disjunction, and the classical existential quantifier are defined by A := A , ¬ →⊥ A cl B := A B , ∨ ¬ → ¬ →⊥ clxA := x A. ∃ ¬∀ ¬ Usually we fix a language , and speak of terms and formulas instead of -terms and -formulas. WeL use L L r, s, t for terms, x,y,z for variables, c for constants, P, Q, R for relation symbols, f,g,h for function symbols, A,B,C,D for formulas. 1. FORMAL LANGUAGES 3 Definition. The depth dp(A) of a formula A is the maximum length of a branch in its construction tree. In other words, we define recursively dp(P ) = 0 for atomic P , dp(A B) = max(dp(A), dp(B)) + 1 for binary operators , dp( A) = dp(A) + 1◦ for unary operators . The size◦ or ◦length A of a formula A is the number◦ of occurrences of logical symbols and atomic| | formulas (parentheses not counted) in A: P = 1 for P atomic, A B = A + B + 1 for binary operators , A =| A| + 1 for unary operators| ◦ | . | | | | ◦ | ◦ | | | ◦ One can show easily that A + 1 2dp(A)+1. | | ≤ Notation (Saving on parentheses). In writing formulas we save on parentheses by assuming that , , bind more strongly than , , and that in turn , bind more strongly∀ ∃ ¬ than , (where A B abbreviates∧ ∨ (A B) (∧B∨ A)). Outermost parentheses→ ↔ are also usually↔ dropped. Thus→A ∧B →C is read as ((A ( B)) C). In the case of iterated implications∧ ¬ we→ sometimes use the short∧ ¬ notation→ A1 A2 ...An 1 An for A1 (A2 ... (An 1 An) ... ). → → − → → → − → To save parentheses in quantified formulas, we use a mild form of the dot notation: a dot immediately after x or x makes the scope of that quantifier as large as possible, given the parentheses∀ ∃ around. So x.A B means x(A B), not ( xA) B. ∀ → ∀ → ∀ → We also save on parentheses by writing e.g. Rxyz, Rt0t1t2 instead of R(x,y,z), R(t0,t1,t2), where R is some predicate symbol. Similarly for a unary function symbol with a (typographically) simple argument, so fx for f(x), etc. In this case no confusion will arise. But readability requires that we write in full R(fx,gy,hz), instead of Rfxgyhz. Binary function and relation symbols are usually written in infix nota- tion, e.g. x + y instead of +(x, y), and x < y instead of <(x, y). We write t = s for (t = s) and t < s for (t < s). 6 ¬ 6 ¬ 1.2. Substitution, Free and Bound Variables. Expressions , 0 which differ only in the names of bound variables will be regarded as iden-E E tical. This is sometimes expressed by saying that and 0 are α-equivalent. In other words, we are only interested in expressionsE “modulE o renaming of bound variables”. There are methods of finding unique representatives for such expressions, for example the namefree terms of de Bruijn [7]. For the human reader such representations are less convenient, so we shall stick to the use of bound variables. In the definition of “substitution of expression for variable x in ex- E0 pression ”, either one requires that no variable free in 0 becomes bound by a variable-bindingE operator in , when the free occurrencesE of x are re- placed by (also expressed by sayingE that there must be no “clashes of E0 variables”), “ 0 is free for x in ”, or the substitution operation is taken to involve a systematicE renamingE operation for the bound variables, avoiding clashes. Having stated that we are only interested in expressions modulo renaming bound variables, we can without loss of generality assume that substitution is always possible. 4 1. LOGIC Also, it is never a real restriction to assume that distinct quantifier occurrences are followed by distinct variables, and that the sets of bound and free variables of a formula are disjoint. Notation. “FV” is used for the (set of) free variables of an expression; so FV(t) is the set of variables free in the term t, FV(A) the set of variables free in formula A etc.