238) Let E N Be a Decidable Set
Total Page:16
File Type:pdf, Size:1020Kb
Foundations of Computer Science Logic, models, and computations Course INF412 of l’Ecole Polytechnique Olivier Bournez [email protected] Version of July 19, 2021 Logic, Models of computation, Complexity 3 Contents 1 Introduction 13 1 Mathematical concepts . 14 1.1 Sets, Functions . 14 1.2 Alphabets, Words, Languages . 15 1.3 Change of alphabet . 17 1.4 Graphs ....................................... 18 2 The diagonalisation method . 19 2 Recurrence and induction 21 1 Motivation . 21 2 Reasoning by recurrence over N ............................ 21 3 Inductive definitions . 23 3.1 General principle of an inductive definition ................. 23 3.2 Formalisation: First fix point theorem . 24 3.3 Various notations of an inductive definition . 24 4 Applications . 26 4.1 A few examples . 26 4.2 Labeled binary trees . 26 4.3 Arithmetic expressions . 28 4.4 Terms........................................ 28 5 Proofs by induction . 29 6 Derivations......................................... 31 6.1 Explicit expression of the elements: Second fix point theorem . 31 6.2 Derivation trees . 32 7 Functions defined inductively . 33 8 Bibliographic notes . 35 3 Propositional calculus 37 1 Syntax............................................ 37 2 Semantic . 39 3 Tautologies, equivalent formulas . 40 4 Some elementary facts . 40 5 Replacement of a formula by some equivalent formula . 42 5.1 A simple remark . 42 5.2 Substitutions . 42 5.3 Compositionality . 42 6 Complete systems of connectors . 43 5 Contents 7 Functional completeness . 43 8 Normalforms ....................................... 44 8.1 Conjunctive and disjunctive normal forms . 44 8.2 Transformation methods . 46 9 Compactness theorem . 47 9.1 Satisfaction of a set of formulas . 47 10 Exercises .......................................... 49 11 Bibliographic notes . 50 4 Proofs 51 1 Introduction . 51 2 Proofs à la Frege and Hilbert . 52 3 Demonstrations by natural deduction . 55 3.1 Rules from natural deduction . 55 3.2 Validity and completeness . 56 4 Proofs by resolution . 57 5 Proofs by tableau method . 58 5.1 Principle . 58 5.2 Description of the method . 61 5.3 Termination of the method . 62 5.4 Validity . 63 5.5 Completeness . 64 5.6 One consequence of compactness theorem . 65 6 Bibliographic notes . 65 5 Predicate calculus 67 1 Syntax............................................ 67 1.1 Terms........................................ 69 1.2 Atomic formulas . 69 1.3 Formulas . 70 2 First properties and definitions . 71 2.1 Decomposition / Uniqueness reading . 71 2.2 Free variables . 72 3 Semantic . 74 3.1 Interpretation of terms . 74 3.2 Interpretation of atomic formulas . 75 3.3 Interpretation of formulas . 76 3.4 Substitutions . 77 4 Equivalence, Normal forms . 78 4.1 Equivalent formulas . 78 4.2 Prenex normal form . 80 4.3 Skolem form . 82 5 Bibliographic notes . 84 6 Contents 6 Models. Completeness. 85 1 Examples of theories . 85 1.1 Graphs ....................................... 85 1.2 Simple remarks . 86 1.3 Equality . 87 1.4 Small digression . 88 1.5 Groups . 89 1.6 Fields . 89 1.7 Robinson Arithmetic . 90 1.8 Peano arithmetic . 92 2 Completeness . 93 2.1 Consequences . 93 2.2 Demonstration . 93 2.3 Statement of completeness theorem . 93 2.4 Meaning of the theorem . 94 2.5 Other formulation of the theorem . 94 3 Proof of completeness theorem . 94 3.1 A deduction system . 94 3.2 Finiteness theorem . 95 3.3 Some technical results . 96 3.4 Validity of the deduction system . 97 3.5 Completeness of the deduction system . 97 4 Compactness . 100 5 Other consequences . 100 6 Bibliographic notes . 100 7 Turing machines 103 1 Turingmachines ..................................... 104 1.1 Ingredients . 104 1.2 Description . 105 1.3 Programming with Turing machines . 109 1.4 Some programming techniques . 112 1.5 Applications . 114 1.6 Variants of the notion of Turing machine . 114 1.7 Locality of the notion of computation . 118 2 Bibliographic notes . 118 8 A few other models of computation 121 1 RAM............................................. 121 1.1 RAMmodel .................................... 121 1.2 Simulation of a RISC machine by a Turing machine . 122 1.3 Simulation of a RAM by a Turing machine . 124 2 Rudimentary models . 124 2.1 Machines with k 2 stacks . 124 ¸ 7 Contents 2.2 Counter machines . 125 3 Church-Turing thesis . ..