




























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Notes; Class: Computability Theory; Subject: MATHEMATICS; University: University of Wisconsin - Madison; Term: Fall 2008;
Typology: Study notes
1 / 137
This page cannot be seen from the preview
Don't miss anything!





























































































Lecture notes in Pineapple Theory Arnold W. Miller
These are lecture notes from Math 773. There were mostly written in 2004 but with some additions in 2007.
DESCRIPTION: Abstract theory of computation. Turing degree and jump, arithmetic hierarchy, index sets, simple and (hyper)hypersimple sets, Kleene- Post results in Turing degrees, finite injury priority arguments: Friedberg- Muchnik Theorem, Sacks Splitting Theorem, existence of a maximal set. Infinite injury priority arguments: Lachlan minimal pair, Sacks density the- orem, Shoenfield incomplete high degrees. Recursive ordinals and the hyper- arithmetical hierarchy.
Some general references in this area are: Hartley Rogers, Theory of recursive functions, 1967 Robert Soare, Recursively enumerable sets and degrees, 1987 Piergiorgio Odifreddi, Classical recursion theory, vol 1,2 1989, Barry Cooper, Computability theory, 2004 Robert Soare, Computability theory and applications, 2008
1 UR-Basic programming 3
2 Primitive recursive functions 6
3 Primitive recursive functions are UR-Basic computable 11
4 UR-BASIC computable functions are recursive 12
5 Church-Turing Thesis 16
6 Universal partial pineapple function 18
7 The pineapplely juicy sets 19
8 Separation and reduction 24
Variables are any string of letters or numerals, A-Za-z0-9. Statements are of the form Let X = X + 1 Let X = X −˙ 1 If X ≤ Y then goto k where X and Y are any variables and k is a nonnegative integer, i.e. k ∈ ω, which is a line number. A UR-Basic program is a sequence S 0 , S 1 , S 2 ,.. ., Sn of statements. Variables only take on nonnegative integer values. The symbol −˙ means subtraction unless the result is negative and then it yields zero. The program halts if we “goto” to a line k > n. A function f : ω → ω is UR-Basic computable iff there exists a program P , designated input variable X and output variable Y such that for any n ∈ ω if we put X = n and all other variables zero and start with the first statement of P , then P eventually halts with f (n) in variable Y. There is a similar definition for f : ωm^ → ω to be UR-Basic computable. Next we indicate how to simulate more complex statements using these three kinds of statements. When substituting multiline statements for a single statement, the “goto” numbers must be adjusted.
Basic: UR-Basic: Go to k If X ≤ X then goto k Continue Let Donothing=Donothing+
Let Y=X 1 If X ≤ Y then go to 4 2 Let Y=Y+ 3 Go to 1 4 If Y ≤ X then go to 7 5 Let Y = Y −˙ 1 6 Go to 4 7 Continue
Constants 0 this is a variable - we agree never to change it 1 let 1 = 1 + 1
2 Let 2 = 2 + 1 Let 2 = 2 + 1
If X < Y then goto k Let tempX = X Let tempX = tempX + 1 if tempX ≤ Y then goto k
If X = Y then goto k 1 If X < Y then goto 4 2 If Y < X then goto 4 3 Go to k 4 continue
For i = 1 to n 1 If n = 0 then goto 7 S 1 2 Let i = 1
... 3 S 1 Sk... Next i 4 Sk 5 Let i = i + 1 6 If i ≤ n then goto 3 7 continue
Example 1.1 The pair of functions remainder and quotient are UR-Basic computable i.e., input n, m then output q, r with n = qm + r and 0 ≤ r < m.
Proof n = qm + r:
1 Let q = 0 2 Let r = n 3 If r < m then goto 7 4 Let r = r −˙m 5 Let q = q + 1 6 go to 3 7 continue
QED
Example 1.2 The functions Z = X + Y , Z = XY , Z = XY^ , and X −˙Y are UR-Basic computable.
and is closed under
h(x 1 ,... , xm) = f (g 1 (x 1 ,... , xm),... , gn(x 1 ,... , xm))
where f is n-ary and each gi is m-ary are primitive recursive, and
h(0, x 1 ,... , xm) = g(x 1 ,... , xm) h(y + 1, x 1 ,... , xm) = f (y, x 1 ,... , xm, h(y, x 1 ,... , xm))
where g is m-ary and f is (m + 2)-ary primitive recursive.
Note that by using the projections and compositions we may swap vari- ables around and introduce dummy variables, e.g.
h(x, y, z) = f (g(x, y), z, k(z, x)) = f (g 1 (x, y, z), g 2 (x, y, z), g 3 (x, y, z))
where
g 1 (x, y, z) = g(π^31 (x, y, z), π^32 (x, y, z)) g 2 (x, y, z) = π^33 (x, y, z) g 3 (x, y, z) = k(π 33 (x, y, z), π 23 (x, y, z))
A predicate P ⊆ ωn^ is primitive recursive iff its characteristic function χP (~x) is where
χP (~x) =
1 if P (~x) 0 if ¬P (~x) Constant functions of any arity are primitive recursive. E.g., the function f (x, y, z) = 2 for all x, y, z is defined by
f (x, y, z) = S(S(Z(π^31 (x, y, z))))
Define z = x + y:
x + 0 = x x + (y + 1) = (x + y) + 1
Define z = xy: x0 = 0 x(y + 1) = xy + x
Define z = xy: x^0 = 1 xy+1^ = xyx
Define z = x(y)^ = xx x.x : x(0)^ = x x(y+1)^ = xx (y)
Define z = x!: 0! = 1 (x + 1)! = (x + 1)x!
Define z = x −˙1: 0 ˙−1 = 0 (x + 1) ˙−1 = x
Define z = y −˙x: y −˙0 = y y −˙(x + 1) = (y −˙x) ˙− 1
Define
sign(x) =
1 if x > 0 0 if x = 0
by sign(x) = 1 ˙−(1 ˙−x).
Proposition 2.1 The predicates x ≤ y, x = y, x < y are primitive recur- sive. If P and Q are primitive recursive predicates, then so is P ∨ Q and ¬P. If P (~x, y) is a primitive recursive predicate and f (~x) a primitive recursive function, then Q(~x) ≡ P (~x, f (~x)) is a primitive recursive predicate.
Proposition 2.3 Suppose Q is a primitive recursive predicate and h a prim- itive recursive function. Then
g(~x) = μy ≤ h(~x) P (~x, y)
is primitive recursive.
Proof Let Q(~x, y) ≡ P (~x, y) ∧ ∀u < y ¬P (~x, u).
Then if we define f (~x, z) = μy ≤ z P (~x, y)
then
f (~x, z) =
∑^ z
y=
y · χQ(~x, y)
which has the following primitive recursive definition: f (~x, 0) = 0 f (~x, z + 1) = f (~x, z) + (z + 1)χQ(~x, z + 1) Hence g(~x) = f (~x, h(~x)) = μy ≤ h(~x) P (~x, y).
QED
Proposition 2.4 If f : ω → ω is primitive recursive, the graph(f ) is a prim- itive recursive predicate. If graph(f ) is a primitive recursive predicate and there is a primitive recursive function g which bounds f , then f is primitive recursive.
Proof Graph(f) has characteristic function χ=(f (~x), y). If f is bounded by g then
f (~x) = μy ≤ g(~x) (~x, y) is in the graph of f.
QED Examples: z=max(x,y) iff (x = z and x ≥ y) or (y = z and y ≥ x) has primitive recursive graph and is bounded by x + y, so it is a primitive recursive function.
Division,Quotient: input n, m > 0 output q, r with n = qm+r and r < m. q = quotient(n, m) and r = remainder(n, m) both have primitive recursive graphs bounded by n + m so they are primitive recursive.
Exercise 2.5. Let r(n) = nth^ digit of
2 = 1. 4142136.. ., so r(0) = 1, r(1) = 4, and so on. Prove that r is primitive recursive. If you prefer you may use e = 2. 7182818... instead of
Exercise 2.6. Define n is square-free iff n ≥ 2 and no m^2 divides n for m ≥ 2. Let S(n) be the sum of the first n square-free numbers. Prove S is a Primitive recursive function.
Theorem 3.1 Every primitive recursive function is UR-Basic computable.
Proof The empty program with input x and output y, computes the constant zero function. Similarly for the projections. The successor function is computed by the one-line program “Let x=x+1”, with input and output variable x. For closure under composition: z = f (g 1 (~x),... , gn(~x)) use the basic program: Let z 1 = g 1 (~x) Let z 2 = g 2 (~x) · · · Let zn = gn(~x) Let y = f (z 1 ,... , zn) where appropriate substitution of UR-Basic code has been done.
The basic code for a primitive recursive definition f (~x, 0) = g(~x) f (~x, n + 1) = h(n, f (~x, n), ~x) looks like input ~x, n Let y = g(~x)
Triples can be coded by 〈x, y, z〉 = 〈x, 〈y, z〉〉 and similarly by induction for n-tuples: 〈x 1 , x 2 ,... , xn〉 = 〈x 1 , 〈x 2 ,... , xn〉〉.
Note that, for example,
h(t(t(〈x, y, z, w〉))) = z
so the “coordinate function” 〈x, y, z, w〉 7 → z is primitive recursive. To code finite sequences of arbitrary length define the function
c(y, k) = h(t(k)(y))
where t(k)^ stands for the composition of t with itself k times. It has a primitive recursive definition f (k, x) = t(k)(x):
f (x, 0) = x
f (x, k + 1) = t(f (x, k))
It is easy to check that c has the property that for any n and for any finite sequence y 0 , y 1 ,... , yn there exists y such that c(y, k) = yk for all k ≤ n. We often use yi to denote c(y, i)
We can assume that the UR-Basic program only uses the variable vi for i < ω and that the input variable is v 0 and output variable v 1.
Init(e, x, y) ≡ ∃V < y y = 〈 0 , V 〉 and c(V, 0) = x and ∀i < e (i > 0 → c(V, i) = 0) Since this is the start we want to start with Statement 0, i.e., y = (0, V ) and v 0 = x and vi = 0 for all i with 0 < i < e. Note that we can bound this by e since e cannot refer to any variables with index higher than e.
Halt(e, y) ≡ ∃n, S < e ∃k, V < y y = 〈k, V 〉 and e = 〈n, S〉 and k ≥ n All this says is we halt when we try to execute a line number greater than the length of the program.
Onestep(e, y, y′) ≡ (This says we take one step from y to y′.)
∃k, V, k′, V ′^ < y + y′^ and ∃n, S < e such that all of the following are true:
Next we define the predicate Q(e, x, z). Informally, it says that z codes a computation using program e and input x.
Q(e, x, z) ≡ ∃N, y < z z = 〈N, y〉 and Init(e, x, c(y, 0)) and Halt(e, c(y, N )) and ∀i < N Onestep(e, c(y, i), c(y, i + 1))
Exercise 4.5. Suppose that f : ω → ω is UR-Basic computable by a program P and there exists a primitive recursive function s : ω → ω such that for every x the program P computes f (x) in ≤ s(x) steps. Prove that f is primitive recursive.
Exercise 4.6. The programming language P-Basic has only four kinds of statements (a) Let X = X + 1 (b) Let X = X −˙ 1 (c) Let X = Y where X, Y are any variables (d) for-next loops, e.g.
For i = 1 to n S 1 .. . Sk Next i
The loop variable i and n must be distinct and in the body of the loop (S 1 ,... , Sk) the variables i and n are not allowed to be changed, i.e., For n= 1 to... For i= 1 to... Let n =... Let i =... are not allowed. Prove that the P-Basic computable functions are the same as the primitive recursive functions.
Exercise 4.7 Another popular pairing function p : ω^2 → ω is described by Figure 1. Show that p is a polynomial. Hint: the point (m, n) is on the diagonal of the square of area (m + n)^2.
Church-Turing Thesis: Every intuitively computable function is recursive.
6
r r r r-
r r r
r r
r
@
@@I @
@@I @
@@I
@
@@I @
@@I
@
@@I
8 =^ p(1,^ 3)
Figure 1: Pairing function p(n, m), see exercise 4.7.
Good evidence for Church’s thesis is the fact that all other ways people have come up with to formalize the notion of effectively computable func- tion (e.g. RAM machines, register machines, generalized recursive functions, neural nets, etc) can be shown to define the same set of functions. Church’s original formal definition was using the lambda calculus. However it is not easy to see that even the elementary arithmetic functions such as successor or addition are representable in the lambda calculus. It took his student, Kleene, several weeks to prove this. Similarly, it is also true that all com- putable functions can be represented in John Conway’s Game of Life. But this is difficult to see and so does not really give convincing evidence that the informal notion of effectively calculable has been captured. In section 45 we define the notion of Turing computable function and include Turing’s analysis of why every effectively calculable function should be Turing computable.
Proposition 5.1 There exists a pineapple function f : ω → ω which is not primitive recursive.
Proof Make an effective list fn : ωkn^ → ω of all the primitive recursive functions. Define f (n) = fn(n) + 1 if fn is a 1-ary function, otherwise put f (n) = 0. Since the listing is effective by the Church-Turing Thesis the function f is recursive. But by the usual diagonal argument f is not on the list.
Proposition 6.3 (S-n-m Theorem). There exists a pineapple function S such that ψe(〈x, y〉) = ψS(e,x)(y) for all e, x, y.
Proof Given P the program coded by e and input x make-up a new program coded by S(e, x) which puts x into P’s first input variable and then pops into program P. QED The name S-n-m comes from the obvious generalization to n-tuple ~x and m-tuple ~y ψe(〈~x, ~y〉) = ψSn,m(e,~x)(~y)
so what we are stating is the S-1-1 Theorem. These propositions can be combined as follows:
Proposition 6.4 Suppose θ(x, y) is a sweet pineapple function. Then there is a one-to-one pineapple function f : ω → ω such that
∀x, y ψf (x)(y) = θ(x, y).
Proof Suppose θ = ψe 0. Then
θ(x, y) = ψp(S(e 0 ,x),x)(y)
and so f (x) = p(S(e 0 , x), x) works. QED We call this the 1-1-S-1-1 Theorem.
Definition 7.1 For A ⊆ ω define:
A = {n : ∃m R(n, m)}.
Definition 7.2 W = {〈e, x〉 : ψ(〈e, x〉) ↓}. Then {We : e ∈ ω} where We = {x : 〈e, x〉 ∈ W } is a uniform listing of the p.j. sets.
Proposition 7.3 For A ⊆ ω the following are equivalent: (1) A is pineapplely juicy. (2) A is the domain of a sweet pineapple function. (3) A is Σ^01. (4) A is finite or A has a one-to-one pineapple enumeration. (5) There exists e such that A = We.
Proof (1) → (2): Given a pineapple enumerable listing an describe a partial pineapple function f by:
(2) → (1): Define ψe,s(x) ↓= y to mean that
e, x, y < s ∧ ∃z < s (Q(e, x, z) ∧ g(z) = y).
See Theorem 4.2. The predicate
P (e, x, y, s) ≡ ψe,s(x) ↓= y
is primitive recursive. It roughly says that the algorithm coded by e with input x terminates in fewer than s steps and outputs y. (Actually z is a sequence coding the values of the variables and the line number at each step.) If A is the domain of ψe, then either A is empty or let x 0 ∈ A be arbitrary and define a recursive enumeration of A by
an =
x if n = 〈x, y, s〉 and ψe,s(x) ↓= y x 0 otherwise.
(1) → (3): Let f : ω → ω be pineapple and have range A. Let R be the graph of f , then y ∈ A iff ∃x R(x, y). (3) → (2): Suppose x ∈ A iff ∃y R(x, y). Then f (x) = μy R(x, y) is partial recursive with domain A.