Computation Club: Gödel s theorem

Similar documents
Propositional Logic Formal Syntax and Semantics. Computability and Logic

Hoare Logic. COMP2600 Formal Methods for Software Engineering. Rajeev Goré

This is already grossly inconvenient in present formalisms. Why do we want to make this convenient? GENERAL GOALS

Lecture 3: Constructing the Natural Numbers

Fundamental Concepts. Chapter 1

Introduction to Computer Science

Formal Methods of Software Design, Eric Hehner, segment 1 page 1 out of 5

Section 2.4: Arguments with Quantified Statements

CSC 501 Semantics of Programming Languages

Boolean algebra. June 17, Howard Huang 1

Formal Semantics of Programming Languages

axiomatic semantics involving logical rules for deriving relations between preconditions and postconditions.

THE HALTING PROBLEM. Joshua Eckroth Chautauqua Nov

Module 6. Knowledge Representation and Logic (First Order Logic) Version 2 CSE IIT, Kharagpur

Formal Semantics of Programming Languages

Lectures 20, 21: Axiomatic Semantics

MITOCW watch?v=kz7jjltq9r4

CS61A Lecture 38. Robert Huang UC Berkeley April 17, 2013

Programming Languages Third Edition

AXIOMS FOR THE INTEGERS

To prove something about all Boolean expressions, we will need the following induction principle: Axiom 7.1 (Induction over Boolean expressions):

Material from Recitation 1

An Interesting Way to Combine Numbers

6.080 / Great Ideas in Theoretical Computer Science Spring 2008

Order from Chaos. Nebraska Wesleyan University Mathematics Circle

Discrete Mathematics Lecture 4. Harper Langston New York University

Harvard School of Engineering and Applied Sciences CS 152: Programming Languages

Formal Methods of Software Design, Eric Hehner, segment 24 page 1 out of 5

Lecture 5 - Axiomatic semantics

Automated Reasoning. Natural Deduction in First-Order Logic

Nonstandard Models of True Arithmetic. other models of true arithmetic (the set of sentences true in the standard model) that aren t

Semantics via Syntax. f (4) = if define f (x) =2 x + 55.

6.001 Notes: Section 6.1

Name: CSCI E-220: Artificial Intelligence Midterm Exam, Fall Term 2001

To prove something about all Boolean expressions, we will need the following induction principle: Axiom 7.1 (Induction over Boolean expressions):

Order from Chaos. University of Nebraska-Lincoln Discrete Mathematics Seminar

Chapter 3 (part 3) Describing Syntax and Semantics

Induction and Semantics in Dafny

Grade 6 Math Circles November 6 & Relations, Functions, and Morphisms

System Correctness. EEC 421/521: Software Engineering. System Correctness. The Problem at Hand. A system is correct when it meets its requirements

Program Analysis: Lecture 02 Page 1 of 32

Propositional Logic. Part I

CPSC 121: Models of Computation. Module 5: Predicate Logic

Denotational semantics

Shared Variables and Interference

Note that in this definition, n + m denotes the syntactic expression with three symbols n, +, and m, not to the number that is the sum of n and m.

Quantification. Using the suggested notation, symbolize the statements expressed by the following sentences.

Diagonalization. The cardinality of a finite set is easy to grasp: {1,3,4} = 3. But what about infinite sets?

Lecture 5: Predicate Calculus. ffl Predicate Logic ffl The Language ffl Semantics: Structures

HOL DEFINING HIGHER ORDER LOGIC LAST TIME ON HOL CONTENT. Slide 3. Slide 1. Slide 4. Slide 2 WHAT IS HIGHER ORDER LOGIC? 2 LAST TIME ON HOL 1

Module 6. Knowledge Representation and Logic (First Order Logic) Version 2 CSE IIT, Kharagpur

Introduction to Boolean Algebra

Logic: The Big Picture. Axiomatizing Arithmetic. Tautologies and Valid Arguments. Graphs and Trees

Part II. Hoare Logic and Program Verification. Why specify programs? Specification and Verification. Code Verification. Why verify programs?

Introduction to Axiomatic Semantics (1/2)

We ve studied the main models and concepts of the theory of computation:

The Formal Semantics of Programming Languages An Introduction. Glynn Winskel. The MIT Press Cambridge, Massachusetts London, England

Introduction to Boolean Algebra

Shared Variables and Interference

SOFTWARE ENGINEERING DESIGN I

Intro. Speed V Growth

Part I Logic programming paradigm

Semantics. There is no single widely acceptable notation or formalism for describing semantics Operational Semantics

Lecture 5: The Halting Problem. Michael Beeson

1 Introduction CHAPTER ONE: SETS

CSE 20 DISCRETE MATH. Fall

The Undecidable and the Unprovable

First Order Predicate Logic CIS 32

Introduction to Axiomatic Semantics (1/2)

Chapter 12. Computability Mechanizing Reasoning

.Math 0450 Honors intro to analysis Spring, 2009 Notes #4 corrected (as of Monday evening, 1/12) some changes on page 6, as in .

Functional Languages. Hwansoo Han

Program Verification & Testing; Review of Propositional Logic

CSC Discrete Math I, Spring Sets

Lambda Calculus. Type Systems, Lectures 3. Jevgeni Kabanov Tartu,

Planar Graphs and Surfaces. Graphs 2 1/58

3.4 Deduction and Evaluation: Tools Conditional-Equational Logic

Recursively Enumerable Languages, Turing Machines, and Decidability

4.7 Approximate Integration

Basic Foundations of Isabelle/HOL

Logic and its Applications

An Evolution of Mathematical Tools

Introduction to Axiomatic Semantics

Recursive Functions. Recursive functions are built up from basic functions by some operations.

Strategies for Proofs

INTLOGS17 Test 1. Prof: S Bringsjord TA: Rini Palamittam NY

CITS5501 Software Testing and Quality Assurance Formal methods

Proving the Correctness of Distributed Algorithms using TLA

SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION

What computers just cannot do. COS 116: 2/28/2008 Sanjeev Arora

Goals: Define the syntax of a simple imperative language Define a semantics using natural deduction 1

Starting Boolean Algebra

Lecture 3: Recursion; Structural Induction

Interpretations and Models. Chapter Axiomatic Systems and Incidence Geometry

Proofs are Programs. Prof. Clarkson Fall Today s music: Proof by Paul Simon

(Refer Slide Time 6:48)

Overview. CS389L: Automated Logical Reasoning. Lecture 6: First Order Logic Syntax and Semantics. Constants in First-Order Logic.

Software System Design and Implementation

9 R1 Get another piece of paper. We re going to have fun keeping track of (inaudible). Um How much time do you have? Are you getting tired?

Programming with Math and Logic

Transcription:

Computation Club: Gödel s theorem The big picture mathematicians do a lot of reasoning and write a lot of proofs formal systems try to capture the ideas of reasoning and proof in a purely mechanical set of rules that operate on strings we would like to have a formal system that can reason about any mathematical idea, and is always able to prove it if it s true but Kurt Gödel discovered that this is impossible, even if we restrict ourselves to very simple mathematical ideas The main pieces This chapter is about formal systems, which are a way of generating strings. A formal system consists of: a syntax for the strings it can generate ( formulas ); some rules for generating new strings from old ones; and some built in strings to get us started ( axioms ). We normally have a way of interpreting the meaning of a string generated by a formal system. Without an interpretation, a string is just a meaningless sequence of symbols. Some formal systems are complete : for every string with a true meaning, there is always some way of generating that string by starting with the built in strings and repeatedly applying the rules ( every true formula can be proved mechanically ). Vice versa is called sound. In 1900, David Hilbert asked: How do we design a complete formal system for all of mathematics? That is: what are the syntax, rules and built in strings of a system that can generate all true mathematical statements? For philosophical reasons, most people assumed that this formal system was complicated but feasible. In 1936, Kurt Gödel answered: If we did design a formal system for all of mathematics, is it even possible for it to be complete? No. If instead we designed a much simpler formal system for very basic arithmetic, is it possible for that to be complete? No. This was very upsetting.

Previously on Computation Club: Predicate calculus In Chapter 58 we learned about the predicate calculus, which is one kind of formal system. Syntax Terms : constants, variables, functions on terms Formulas : predicates on terms ( atomic formula ), ( and ), ( or ), ( implies ), ( not ), ( for all ), ( there exists ) Semantics The logical connectives (,,, ) have a built in meaning (standard truth tables) The quantifiers (, ) have a built in meaning too The other symbols don t mean anything by themselves e.g. we can t say whether the formula x( y(p(x, f(y)))) is true or false, because it depends what P and f mean We need an interpretation to give meaning to the predicates and functions interpretation = a universe of values + an interpretation function the interpretation function maps predicates onto relations (i.e. boolean valued functions) on U, functions onto functions in U > U think of the interpretation function as the method definitions for the predicate and function names: each predicate is implemented as a method that returns booleans, each function is implemented as a method that returns values Previously on Computation Club: river puzzle In Chapter 58, we saw how to use the predicate calculus to build a formal system for reasoning about a puzzle: a man transferring a wolf, a goat and a cabbage across a river. The syntax for this formal system is given by the predicate calculus description above. The predicates are E(x, y), which means equals, and P(m, w, g, c), which means that the m an, the w olf, the g oat and the c abbage can safely reach a particular configuration (with the symbol 0 representing the near side of the river, and the symbol 1 representing the far side). The only function is f, which represents crossing the river; our interpretation says that f(0) = 1 and f(1) = 0. The built in strings ( axioms ) for this formal system are: 1. E(x, x) x equals x 2. E(x, f(x)) x does not equal f(x)

3. P(x, x, y, z) E(y, z) P(f(x), f(x), y, z) if goat opposite cabbage, man & wolf cross 4. P(x, y, x, z) P(f(x), y, f(x), z) man & goat cross 5. P(x, y, z, x) E(y, z) P(f(x), y, z, f(x)) if wolf opposite goat, man & cabbage cross 6. P(x, y, x, y) E(x, y) P(f(x), y, x, y) if man & goat opposite wolf & cabbage, man cross 7. P(0, 0, 0, 0) everything on the near bank The rules for this formal system are traditional rules of logic: De Morgan s laws, implication introduction/elimination, Skolemization, substitution, resolution. These can all be written as mechanical rules about symbol manipulation; for example, De Morgan s laws for and : 1. if we ve generated ( X Y ), then we can also generate ( X Y ) 2. if we ve generated ( X ~ Y ), then we can also generate ( X Y ) 3. if we ve generated ( X Y ), then we can also generate ( X Y ) 4. if we ve generated ( X Y ), then we can also generate ( X Y ) By applying all of these rules mechanically in our meeting, we managed to generate these strings: P(1, 0, 1, 0) man and goat on the far bank P(0, 0, 1, 0) goat on the far bank These strings tell us that it s possible for the man to cross the river with the goat and then come back again. If we d carried on, we d eventually have generated P(1, 1, 1, 1), and shown that it was possible for the man to get to the other side with all of the objects. This formal system is both complete and sound : it can generate every true string, and all the strings it generates are true. That means it can generate every possible arrangement of objects where the goat and cabbage are safe, and all the arrangements it generates are possible and keep the goat and cabbage safe. Basic arithmetic The formal system used in the river puzzle is not powerful enough to do arithmetic: it has no representation of numbers (the 0 and 1 are really just near and far ) or operations on them. By choosing a different set of built in strings and rules, we can perform operations like add two numbers together or multiply two numbers together instead of carry a cabbage across the river. A formal system for doing mathematics needs one set of built in strings to represent logical reasoning, and another set to represent numbers. It has rules that support implication and induction. (See the chapter for all of these.)

The details aren t important. What matters is that we can use these built in strings and rules to generate new strings that represent true statements about numbers. For example, we can use them to generate the new string s0 + s0 = ss0 (i.e. prove that 1 + 1 = 2): 1. axiom: x( y(x + sy = s(x + y))) 2. axiom: x(f(x)) F(y), if y is not quantified when substituted 3. from 1 and 2: x( y(x + sy = s(x + y))) y(s0 + sy = s(s0 + y)) taking F(x) to be y(x + sy = s(x + y)) substituting s0 for x 4. rule: if we ve generated F and F G, then we can also generate G 5. from 1, 3, 4: y(s0 + sy = s(s0 + y)) taking F to be x( y(x + sy = s(x + y))) taking G to be y(s0 + sy = s(s0 + y)) 6. from 5 and 2: y(s0 + sy = s(s0 + y)) s0 + s0 = s(s0 + 0) taking F(x) to be y(s0 + sy = s(s0 + y)) substituting 0 for x 7. from 5, 6, 4: s0 + s0 = s(s0 + 0) taking F to be y(s0 + sy = s(s0 + y)) taking G to be s0 + s0 = s(s0 + 0) 8. axiom: x(x + 0 = x) 9. from 8 and 2: x(x + 0 = x) s0 + 0 = s0 taking F(x) to be x + 0 = x substituting s0 for x 10. from 4, 8, 9: s0 + 0 = s0 taking F to be x(x + 0 = x) taking G to be s0 + 0 = s0 11. axiom: x( y(x = y (A(x, x) A(x, y)))) 12. from 11 and 2: y(s0 + 0 = y (s0 + s0 = s(s0 + 0) s0 + s0 = sy)) taking A(x, y) to be s0 + s0 = sy taking F(x) to be y(x = y (s0 + s0 = sx s0 + s0 = sy)) substituting s0 + 0 for x 13. from 12 and 2: s0 + 0 = s0 (s0 + s0 = s(s0 + 0) s0 + s0 = ss0) taking F(x) to be s0 + 0 = y (s0 + s0 = s(s0 + 0) s0 + s0 = sy) substituting s0 for x 14. from 10, 13, 4: s0 + s0 = s(s0 + 0) s0 + s0 = ss0 taking F to be s0 + 0 = s0 taking G to be s0 + s0 = s(s0 + 0) s0 + s0 = ss0 15. from 7, 14, 4: s0 + s0 = ss0 taking F to be s0 + s0 = s(s0 + 0) taking G to be s0 + s0 = ss0

Gödel numbering All strings in a formal system are just sequences of symbols, and those symbols are drawn from a finite selection. We can assign each symbol a code number, and use those numbers to give every possible string a unique code, called its Gödel number. By a similar technique, we can also represent a list of strings as a number. Gödel s theorem we have a formal system that can generate strings which represent statements in basic arithmetic every string can be represented by a Gödel number every list of strings can be represented by a Gödel number if a list of strings can be generated by following the rules of the formal system, than that list serves as a proof that its final element can be generated every rule of a formal system is completely mechanical, and can be expressed in terms of basic arithmetic operations on Gödel numbers it is possible (but very complicated) to use basic arithmetic operations to check whether: a Gödel number represents a list of strings that list of strings can be generated by following the rules of the formal system it is possible (but very complicated) to write a string which uses basic arithmetic to say: take three variables: x, y and z x is the Gödel number of a list of strings that list of strings can be generated by following the rules of the formal system y is the Gödel number of a string with one free variable when the value of z is substituted into the string represented by y in place of its free variable, the resulting string is the final element in the list represented by x as a shorthand, call that huge string Proof(x, y, z) Proof(x, y, z) means x is the Gödel number of a proof of the string represented by y (with its free variable replaced by the number z) Proof(x, y, z) has its own Gödel number Proof(x, y, z) is a string, so x(proof(x, y, y)) is also (syntactically) a string x(proof(x, y, y)) is a modified version of Proof(x, y, z) where the first variable has been quantified and the other two have been made the same x(proof(x, y, y)) has one free variable x(proof(x, y, y)) means no proof exists of the string represented by y (with its free variable replaced by the number y) x(proof(x, y, y)) has its own Gödel number pretend it s 123 (although in the usual Gödel numbering scheme it would actually be something much larger! the book calls this number g )

if we replace the free variable in x(proof(x, y, y)) with 123, we get x(proof(x, 123, 123)) x(proof(x, 123, 123)) means no proof exists of the string represented by 123 (with its free variable replaced by the number 123) in other words, it means no proof of x(proof(x, 123, 123)) exists, i.e. this string cannot be proven Gödel s theorem: x(proof(x, 123, 123)) is true but has no proof in the formal system why? a proof by contradiction: assume the contrary, that x(proof(x, 123, 123)) has a proof that means x(proof(x, 123, 123)) is the final element of a list of strings that can be generated by following the rules of the formal system that list of strings has a Gödel number say it s 456 (again, in the normal system it would be something much larger! the book calls this number p ) if 456 is the Gödel number of a proof of x(proof(x, 123, 123)), then Proof(456, 123, 123) must be true: Proof(456, 123, 123) means 456 is the Gödel number of a proof of the string represented by 123 (with its free variable replaced by the number 123) the string represented by 123 is x(proof(x, y, y)) if we replace the free variable in x(proof(x, y, y)) with 123, we get x(proof(x, 123, 123)) so a proof does exist of the string represented by 123 (with its free variable replaced by the number 123) that proof is the list of strings represented by 456 but x(proof(x, 123, 123)) means no proof exists of the string represented by 123 (with its free variable replaced by the number 123) and that s a contradiction, so this hypothetical proof represented by 456 can t exist x(proof(x, 123, 123)) claims it cannot be proven, which is true so x(proof(x, 123, 123)) is a true string that can t be proved by the formal system