Lecture 19

Today:

    1. Godel.

    2. Dynamic programming.

For next time:

    1. Start Homework 10.

    2. Read Sipser and answer the reading questions below.

The three worlds

syntax, PM: A FAS that maps onto arithmetic

semantics,

arithmetic: statements about non-negative integers, addition and multiplication

meta-math: statements about PM, arithmetic, or meta-math

Decoding Godel numbers

Here's what my solution looks like:

def decode_num(self, c):

"""Converts a number to a character, variable or sequence."""

try:

return self.symbols[c]

except IndexError:

d = self.prime_obj.factor(c)

if len(d) == 1:

return self.decode_variable(d)

else:

nums = [exp for base, exp in sorted(d.iteritems())]

return self.decode_nums(nums)

d is a map from prime numbers to their exponents; if the length of d is 1, it must be a variable:

def decode_variable(self, d, name={1:'x', 2:'p', 3:'P'}):

"""Converts a prime factorization to a variable name.

d is a map from a single element to an exponent of 1, 2 or 3

"""

for base, exp in d.iteritems():

n = self.prime_obj.which_prime(base)

return '%s%d ' % (name[exp], n-5)

Otherwise it must be a sequence, so we extract the sequence and decode it.

def decode_nums(self, nums):

"""Converts a list of numbers to a list of characters."""

s = [self.decode_num(num) for num in nums]

return s

In programming classes, you spend a lot of time trying to wrap your head around recursion.

This is why.

Arithmetization of meta-math

Godel numbering is relatively easy to get your head around, but arithmetization of meta-math is another story.

Nagel and Newman given an example:

1) If the string x is a prefix of the string y, then the first n prime factors of x are the same as the first n prime factors of y.

So you can test the meta-mathematical relationship is_prefix by purely arithmetic tests on the common factors of GN(x) and GN(y)

Hofstadter presents a simpler version that can be made more concrete:

2) If the string x begins with the symbol ~, then the first exponent in its prime factorization is GN('~'), which is 1.

So you could test the meta-mathematical relationship tilde_prefix by testing whether the GN(x) is divisible by 2 but not divisible by 4.

The surprising thing is that any meta-mathematical statement that can be expressed as a string in PM can also be expressed as an arithmetic statement on Godel numbers.

Why? Because the strings in PM are pure syntax; all operations are just string manipulations.

And any string manipulation that you could imagine implementing in Python has a computable arithmetic effect on GN(x).

Dem and Sub

dem(x, z) is an arithmetic expression that denotes a statement about the number x and z that is either a true or false statement in arithmetic

Dem(x, z) is a string of symbols that can be constructed by syntactic manipulation of the strings x and z, where x and y have to be numerals (e.g. 'sssss0')

The key is that

1) the string Dem(x, z) expresses a metamathematical statement (under the interpretation of its symbols)

2) if dem(GN(x), GN(z)) is a true statement of arithmetic, then Interp(Dem(x, z)) is a true statement of metamathematics!

Similarly:

sub(x, y, z) is an arithmetic function of numbers x, y, and z that yields a number

Sub(x, y, z) is a string of symbols that can be constructed by replacing instances of the symbol whose Godel number is y with the numeral z wherever it appears in the formula represented by the number represented by the numeral x

The key is that

1) sub(GN(x), GN(y), GN((z)) is the Godel number of the string Sub(x, y, z)

Question 9

How do you get from formula (1) to formula (G)?

By replacing instances of decode(17) with the string representation of n everywhere it appears in the string that maps to n.

How do you evaluate the expression sub(n, 17, n)?

By replacing instances of decode(17) with the string representation of n everywhere it appears in the string that maps to n.

.

Question 10

Therefore G = Sub(n, 13, n) and GN(G) = sub(GN(n), GN(13), GN(n))

One clarification: in the string Sub(n, 17, n), the first n is decoded into an expression and the second n is treated as a numeral.

Question 11

What does G mean as a meta-mathematical statement?

It means that G cannot be derived in PM.

And then the hilarity ensues.

First incompleteness theorem

Der(x) = (Ey) Dem(x,y) = 'x is derivable in PM'

Draw the tree with three branches:

1) ~Der(G)

2) Der(G) and Der(~G)

3) Der(G) and ~Der(~G)

What does each branch mean?

Which branches are possible under what assumptions?

Second incompleteness theorem

What does A mean as a meta-mathematical statement? It means that PM is consistent.

And it turns out that the formula A->G is derivable in PM (no magic involved, just plain old string manipulation).

That means that if A is derivable, then G is derivable.

So what does that mean for the consistency and/or completeness of PM?

We have already seen that if Der(G), PM is inconsistent.

Therefore

1) if A is derivable, PM is inconsistent

2) if PM is consistent, A (which says that PM is consistent) is not derivable!

This is the second incompleteness theorem.

Implications

1) Bad news for math?

Not really. This result is about math, but doesn't say anything mathematicians have a personal investment in.

2) Bad news for positivism?

Well, yes, but it is not clear that a solution to Hilbert's problem would have done what they wanted, anyway.

3) Bad news for the state of human knowledge?

The incompleteness theorems are like mining for lead and finding gold.

a) if we found a complete, consistent FAS that maps onto arithmetic by brute force, it wouldn't do a thing for the state of human knowledge

b) Godel's proof provides a startlingly novel proof technique, the seemingly impossible ability to use math to answer meta-mathematical questions, and an opportunity to marvel at the power of the human brain (and not just the one that came up with it).

4) Bad news for modernism?

Well, yes, but mostly because it's been so badly abused.

See Franzen, Godel's Theorem, an incomplete guide to its use and abuse

5) Bad news for artificial intelligence?

Only if you thought an AI would be consistent, despite the obvious observation that natural intelligence (NI) is not.

An AI may be a FAS, but it will not be a FAS that maps onto arithmetic.

In my opinion, it will use a multivalent logic, many of which are immune to the principle of explosion and vicious circle principle.

For example, Vezerides and Kehagias present a fuzzy logic in which the truth value of "This sentence is false" is 0.5. http://cogprints.org/3171/

If an AI is anything like an NI, it will be blissfully inconsistent.

Reading questions

Sipser, pages 256-270.

1) What is Sipser's explanation for the decision to draw a bright line between polynomial time algorithms and non-polynomial time algs?

2) Why does Sipser say that a brute force search for the factors of n is exponential time? Isn't it linear in n?

3) Why is unary an "unreasonable" encoding?

4) What is dynamic programming?

5) If we have not been able to find a polynomial time algorithm for a problem, what can we conclude about the intrinsic difficulty of the problem?

6) Why is NP considered a class of problems rather than just a bunch of problems that don't have polynomial time algorithms yet?

7) What is polynomial verifiability? What is a certificate?

8) What does NP stand for?

9) What proof technique is used to prove Theorem 7.20?

10) In general how do you prove that a problem is in NP?

11) P = NP?