Computability and Gödel's Theorem: Understanding the Limits of Proof and Algorithms - Prof, Study notes of Computer Science

A series of lecture notes from the university of virginia's cs150 course, fall 2005, focusing on computability and gödel's theorem. The notes cover topics such as gödel's proof, completeness and consistency of axiomatic systems, the proof-checking problem, and the halting problem. Students will learn about the concept of computability, decidable and undecidable problems, and the significance of gödel's theorem in computer science.

Typology: Study notes

Pre 2010

Uploaded on 07/29/2009

koofers-user-4jf-1
koofers-user-4jf-1 🇺🇸

9 documents

1 / 5

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
David Evans
http://www.cs.virginia.edu/evans
CS150: Computer Science
University of Virginia
Computer Science
Class 24:
Computability
Halting Problems
Hockey Team Logo
2
CS150 Fall 2005: Lecture 24: Computability
Menu
Review:
Gödel’s Theorem
Proof in Axiomatic Systems
Computability:
Are there some problems that it is
impossible to write a program to
solve?
3
CS150 Fall 2005: Lecture 24: Computability
Gödel’s Proof
G
: This statement of number theory
does not have any proof in the system
of
PM
.
If
G
were provable, then PM would be
inconsistent.
If
G
is unprovable, then PM would be
incomplete.
PM cannot be complete and consistent!
4
CS150 Fall 2005: Lecture 24: Computability
What does it mean for an axiomatic
system to be complete and consistent?
Derives all true
statements, and no false
statements starting from a
finite number of axioms
and following mechanical
inference rules.
5
CS150 Fall 2005: Lecture 24: Computability
What does it mean for an axiomatic
system to be complete and consistent?
It means the axiomatic system is
weak.
Its is so weak, it cannot express
“This statement has no proof.”
6
CS150 Fall 2005: Lecture 24: Computability
Why is an
Inconsistent
Axiomatic
System less useful than an
Incomplete
Axiomatic System?
pf3
pf4
pf5

Partial preview of the text

Download Computability and Gödel's Theorem: Understanding the Limits of Proof and Algorithms - Prof and more Study notes Computer Science in PDF only on Docsity!

David Evans http://www.cs.virginia.edu/evans

CS150: Computer Science University of Virginia Computer Science

Class 24:

Computability

Halting Problems Hockey Team Logo

CS150 Fall 2005: Lecture 24: Computability 2

Menu

  • Review:
    • Gödel’s Theorem
    • Proof in Axiomatic Systems
  • Computability: Are there some problems that it is impossible to write a program to solve?

CS150 Fall 2005: Lecture 24: Computability 3

Gödel’s Proof

G: This statement of number theory

does not have any proof in the system

of PM.

If G were provable, then PM would be inconsistent. If G is unprovable, then PM would be incomplete.

PM cannot be complete and consistent! CS150 Fall 2005: Lecture 24: Computability 4

What does it mean for an axiomatic

system to be complete and consistent?

Derives all true statements, and no false statements starting from a finite number of axioms and following mechanical inference rules.

CS150 Fall 2005: Lecture 24: Computability 5

What does it mean for an axiomatic

system to be complete and consistent?

It means the axiomatic system is weak.

Its is so weak, it cannot express “This statement has no proof.”

CS150 Fall 2005: Lecture 24: Computability 6

Why is an Inconsistent Axiomatic

System less useful than an

Incomplete Axiomatic System?

CS150 Fall 2005: Lecture 24: Computability 7

Inconsistent Axiomatic System

Derives all true statements, and some false statements starting from a finite number of axioms and following mechanical inference rules. (^) some false Once you can prove one false statement, statements everything can be proven! false ⇒ anything CS150 Fall 2005: Lecture 24: Computability 8

Proof

  • A proof of S in an axiomatic system is

a sequence of strings, T 0 , T 1 , …, Tn

where:

  • The first string is the axioms
  • For all i from 1 to n , Tn is the result of applying one of the inference rules to Tn -
  • Tn is S
  • How much work is it to check a

proof?

CS150 Fall 2005: Lecture 24: Computability 9

Proof Checking Problem

  • Input: an axiomatic system (a set of axioms and inference rules), a statement S , and a proof P containing n steps of S
  • Output: true if P is a valid proof of S false otherwise How much work is a proof-checking procedure?

We can write a proof-checking procedure that is θ ( n )

CS150 Fall 2005: Lecture 24: Computability 10

Finite-Length Proof Finding Problem

  • Input: an axiomatic system (a set of axioms and inference rules), a statement S , n (the maximum number of proof steps)
  • Output: A valid proof of S with no more then n steps if there is one. If there is no proof of S with <= n steps, unprovable. How much work?

At worst, we can try all possible proofs: r inference rules, 0 - n steps ~ rn^ possible proofs Checking each proof is θ ( n ) So, there is a procedure that is θ ( nrn ) but, it might not be the best one.

CS150 Fall 2005: Lecture 24: Computability 11

Proof Finding Problem

  • Input: an axiomatic system, a statement S
  • Output: If S is true, output a valid proof. If S is not true, output false.

How much work? It is impossible! “It might take infinite work.” Gödel’s theorem says it cannot be done. CS150 Fall 2005: Lecture 24: Computability 12

Computability

CS150 Fall 2005: Lecture 24: Computability 19

Halting Problem

Define a procedure halts? that takes a procedure and an input evaluates to #t if the procedure would terminate on that input, and to #f if would not terminate.

(define (halts? procedure input) … )

CS150 Fall 2005: Lecture 24: Computability 20

Examples

(halts? ‘(lambda (x) (+ x x)) 3) #t (halts? ‘(lambda (x) (define (f x) (f x)) (f x))

#f

CS150 Fall 2005: Lecture 24: Computability 21

Halting Examples

(halts? `(lambda (x) (define (fact n) (if (= n 1) 1 (* n (fact (- n 1))))) (fact x))

#t

(halts? `(lambda (x) (define (fact n) (if (= n 1) 1 (* n (fact (- n 1))))) (fact x))

#f CS150 Fall 2005: Lecture 24: Computability 22

Can we define halts??

  • We could try for a really long time, get something to work for simple examples, but could we solve the problem – make it work for all possible inputs?
  • Could we compute find-proof if we had halts?

CS150 Fall 2005: Lecture 24: Computability 23

find-proof (define (find-proof S axioms rules) ;; If S is provable, evaluates to a proof of S. ;; Otherwise, evaluates to #f. (if (halts? find-proof-exhaustive S axioms rules)) (find-proof-exhaustive S axioms rules) #f)) Where (find-proof-exhaustive S axioms rules) is a procedure that tries all possible proofs starting from the axioms that evaluates to a proof if it finds one, and keeps working if it doesn’t.

I cheated a little here – we only know we can’t do this for “true”.

CS150 Fall 2005: Lecture 24: Computability 24

Another Informal Proof

(define (contradict-halts x) (if (halts? contradict-halts null) (loop-forever) #t))

If contradict-halts halts, the if test is true and it evaluates to (loop-forever) - it doesn’t halt!

If contradict-halts doesn’t halt, the if test if false, and it evaluates to #t. It halts!

CS150 Fall 2005: Lecture 24: Computability 25

Reducing Undecidable Problems

  • If solving a problem P would allow us to solve the halting problem, then P is undecidable – there is no solution to P , since we have proved there is no solution to the halting problem!
  • There are lots of important problems like this - Friday: why virus scanners will never work perfectly CS150 Fall 2005: Lecture 24: Computability 26

Charge

  • Now (if you can)
    • Marc Levoy, Newcomb South Meeting Room “Digital Michelangelo”