- VII. Problem Index
VII. Problem Index Yuxi Fu BASICS, Shanghai Jiao Tong University - - PowerPoint PPT Presentation
VII. Problem Index Yuxi Fu BASICS, Shanghai Jiao Tong University - - PowerPoint PPT Presentation
VII. Problem Index Yuxi Fu BASICS, Shanghai Jiao Tong University Motivation By Church-Turing Thesis one may study computability theory using any of the computation models. It is much more instructive however to carry out the study in a model
Motivation
By Church-Turing Thesis one may study computability theory using any of the computation models. It is much more instructive however to carry out the study in a model independent manner. The first step is to assign index to computable function.
Computability Theory, by Y. Fu
- VII. Problem Index
1 / 44
Agenda
We shall study three fundamental theorems about indexing.
Computability Theory, by Y. Fu
- VII. Problem Index
2 / 44
Synopsis
- 1. G¨
- del Index
- 2. S-m-n Theorem
- 3. Enumeration Theorem
- 4. Recursion Theorem
Computability Theory, by Y. Fu
- VII. Problem Index
3 / 44
- 1. G¨
- del Index
Computability Theory, by Y. Fu
- VII. Problem Index
4 / 44
Basic Idea
We see a number as an index for a problem/function if it is the G¨
- del number of a programme that solves/calculates the
problem/function.
Computability Theory, by Y. Fu
- VII. Problem Index
5 / 44
Definition
Suppose a ∈ ω and n ≥ 1. φ(n)
a
= the n ary function computed by Pa = f (n)
Pn ,
W (n)
a
= the domain of φ(n)
a
= {(x1, . . . , xn) | Pa(x1, . . . , xn) ↓}, E (n)
a
= the range of φ(n)
a .
The super script (n) is omitted when n = 1.
Computability Theory, by Y. Fu
- VII. Problem Index
6 / 44
Example
Let a = 4127. Then P4127 = S(2); T(2, 1). If the program is seen to calculate a unary function, then φ4127(x) = 1, W4127 = ω, E4127 = {1}. If the program is seen to calculate an n-ary function, then φ(n)
4127(x1, . . . , xn)
= x2 + 1, W n
4127
= ωn, E n
4127
= ω+.
Computability Theory, by Y. Fu
- VII. Problem Index
7 / 44
G¨
- del Index for Computable Function
Suppose f is an n-ary computable function. A number a is an index for f if f = φ(n)
a .
Computability Theory, by Y. Fu
- VII. Problem Index
8 / 44
Padding Lemma
Padding Lemma. Every computable function has infinite indices. Moreover for each x we can effectively find an infinite recursive set Ax of indices for φx.
Proof.
Systematically add useless instructions to Px.
Computability Theory, by Y. Fu
- VII. Problem Index
9 / 44
Computable Functions are Enumerable
We may list for example all the elements of C as φ0, φ1, φ2, . . . .
Computability Theory, by Y. Fu
- VII. Problem Index
10 / 44
Diagonal Method
- Fact. There is a total unary function that is not computable.
Proof.
Suppose φ0, φ1, φ2, . . . is an enumeration of C. Define f (n) = φn(n) + 1, if φn(n) is defined, 0, if φn(n) is undefined. By Church-Turing Thesis the function f (n) is not computable.
Computability Theory, by Y. Fu
- VII. Problem Index
11 / 44
- 2. S-m-n Theorem
Computability Theory, by Y. Fu
- VII. Problem Index
12 / 44
How do different indexing systems relate?
Computability Theory, by Y. Fu
- VII. Problem Index
13 / 44
S-m-n Theorem, the Unary Case
Given a binary function f (x, y), we get a unary computable function f (a, y) by fixing a value a for x. Let e be an index for f (a, y). Then f (a, y) ≃ φe(y). S-m-n Theorem states that the index e can be computed from a.
Computability Theory, by Y. Fu
- VII. Problem Index
14 / 44
S-m-n Theorem, the Unary Case
- Fact. Suppose that f (x, y) is a computable function. There is a
primitive recursive function k(x) such that f (x, y) ≃ φk(x)(y).
Computability Theory, by Y. Fu
- VII. Problem Index
15 / 44
S-m-n Theorem, the Unary Case
Let F be a program that computes f . Consider the following T(1, 2) Z(1) S(1) . . . S(1) a times F The above program can be effectively constructed from a. Let k(a) be the G¨
- del number of the above program.
It can be effectively computed from the above program.
Computability Theory, by Y. Fu
- VII. Problem Index
16 / 44
Example
- 1. Let f (x, y) = yx. Then φk(x)(y) = yx. For each fixed n, k(n)
is an index for yn.
- 2. Let f (x, y) ≃
y, if y is a multiple of x, ↑,
- therwise.
. Then φk(n)(y) is defined if and only if y is a multiple of n.
Computability Theory, by Y. Fu
- VII. Problem Index
17 / 44
S-m-n Theorem. For m, n, there is an injective primitive recursive (m + 1)-function sm
n (x,
x) such that for all e the following holds: φm+n
e
( x, y) ≃ φn
sm
n (e,
x)(
y). S-m-n Theorem is also called Parameter Theorem.
Computability Theory, by Y. Fu
- VII. Problem Index
18 / 44
Proof of S-m-n Theorem
- Proof. Given e, x1, . . . , xm, we can effectively construct the
following program and its index T(n, m + n) . . . T(1, m + 1) Q(1, x1) . . . Q(m, xm) Pe where Q(i, x) is the program Z(i), S(i), . . . , S(i)
- x times
. The injectivity is achieved by padding enough useless instructions.
Computability Theory, by Y. Fu
- VII. Problem Index
19 / 44
- 3. Enumeration Theorem
Computability Theory, by Y. Fu
- VII. Problem Index
20 / 44
What makes it possible that every C program can be executed in a computer?
Computability Theory, by Y. Fu
- VII. Problem Index
21 / 44
General Remark
There are universal programs that embody all the programs. A program is universal if upon receiving the G¨
- del number of a
program it simulates the program indexed by the number.
Computability Theory, by Y. Fu
- VII. Problem Index
22 / 44
Intuition
Consider the function ψ(x, y) defined as follows ψ(x, y) ≃ φx(y). In an obvious sense ψ(x, ) is a universal function for the unary functions φ0, φ1, φ2, φ3, . . . .
Computability Theory, by Y. Fu
- VII. Problem Index
23 / 44
Universal Function
The universal function for n-ary computable functions is the (n + 1)-ary function ψ(n)
U
defined by ψ(n)
U (e, x1, . . . , xn) ≃ φ(n) e (x1, . . . , xn).
We write ψU for ψ(1)
U .
Question: Is ψ(n)
U
computable?
Computability Theory, by Y. Fu
- VII. Problem Index
24 / 44
Enumeration Theorem. For each n, the universal function ψ(n)
U
is computable.
Proof.
Given a number e, decode the number to get the program Pe; and then simulate the program Pe. If the simulation ever terminates, then return the number in R1. By Church-Turing Thesis, ψ(n)
U
is computable.
Computability Theory, by Y. Fu
- VII. Problem Index
25 / 44
Application: Undecidability
- Proposition. The problem ‘φx is total’ is undecidable.
Proof.
If ‘φx is total’ were decidable, then by Church’s Thesis f (x) = ψU(x, x) + 1, if φx is total, 0, if φx is not total. would be a total computable function that differs from every total computable function.
Computability Theory, by Y. Fu
- VII. Problem Index
26 / 44
Application: Effectiveness of Function Operation
- Proposition. There is a total computable function s(x, y) such
that φs(x,y) = φxφy for all x, y.
Proof.
Let f (x, y, z) ≃ φx(z)φy(z) ≃ ψU(x, z)ψU(y, z). By S-m-n Theorem there is a total function s(x, y) such that φs(x,y)(z) ≃ f (x, y, z).
Computability Theory, by Y. Fu
- VII. Problem Index
27 / 44
Application: Effectiveness of Set Operation
- Proposition. There is a total computable function s(x, y) such
that Ws(x,y) = Wx ∪ Wy.
Proof.
Let f (x, y, z) = 1, if z ∈ Wx or z ∈ Wy, undefined,
- therwise.
By S-m-n Theorem there is a total function s(x, y) such that φs(x,y)(z) ≃ f (x, y, z). Clearly Ws(x,y) = Wx ∪ Wy.
Computability Theory, by Y. Fu
- VII. Problem Index
28 / 44
Application: Effectiveness of Recursion
Consider f defined by the following recursion f (e1, e2, x, 0) ≃ φ(n)
e1 (
x) ≃ ψ(n)
U (e1,
x), and f (e1, e2, x, y + 1) ≃ φ(n+2)
e2
( x, y, f (e1, e2, x, y)) ≃ ψ(n+2)
U
(e2, x, y, f (e1, e2, x, y)). By S-m-n Theorem, there is a total computable function r(e1, e2) such that φ(n+1)
r(e1,e2)(
x, y) ≃ f (e1, e2, x, y).
Computability Theory, by Y. Fu
- VII. Problem Index
29 / 44
Application: Non-Primitive Recursive Total Function
- Theorem. There is a total computable function that is not
primitive recursive.
Proof.
- 1. The primitive recursive functions have a universal function.
- 2. Such a function cannot be primitive recursive by
diagonalisation.
Computability Theory, by Y. Fu
- VII. Problem Index
30 / 44
- 4. Recursion Theorem
Computability Theory, by Y. Fu
- VII. Problem Index
31 / 44
Recursion Theorem (Kleene, 1938). Let f be a total unary computable function. Then there is a number n such that φf (n) = φn.
Proof.
By S-m-n Theorem there is an injective primitive recursive function s(x) such that for all x φs(x)(y) ≃ φφx(x)(y), if φx(x) ↓; ↑,
- therwise.
(1) Let v be such that φv = s; f . Obviously φv is total and φv(v) ↓. It follows from (1) that φs(v) = φφv(v) = φf (s(v)). We are done by letting n be s(v).
Computability Theory, by Y. Fu
- VII. Problem Index
32 / 44
More about Recursion Theorem
- Fact. If f is partial then φf (n) = φn whenever f (n) ↓.
- Fact. The fixpoint n can be computed from an index of f by an
injective primitive recursive function.
Proof.
Let v(z) be an injective primitive recursive function such that φv(z) ≃ s; φz. Then let n(z) ≃ s(v(z)).
- Fact. There is an infinite set of fixpoints for f .
Proof.
By Padding Lemma there is an infinite set of indices v such that φv ≃ s; f .
Computability Theory, by Y. Fu
- VII. Problem Index
33 / 44
- Fact. If f is a total computable function, there is a number n such
that Wf (n) = Wn and Ef (n) = En.
Computability Theory, by Y. Fu
- VII. Problem Index
34 / 44
Self Referential Definition
- Fact. Let f (x, y) be a computable function. Then there is an
index e such that φe(y) ≃ f (e, y).
Proof.
By S-m-n Theorem there is a total computable function s(x) such that φs(x)(y) ≃ f (x, y). We are done by applying Recursion Theorem.
Computability Theory, by Y. Fu
- VII. Problem Index
35 / 44
Self Referential Definition
The previous corollary makes it meaningful to define a computable function φe(y) by a computable function f (e, y).
Computability Theory, by Y. Fu
- VII. Problem Index
36 / 44
Self Referential Definition
There is a number n such that φn(x) = xn. There is a number n such that Wn = {n}. This number is
- btained by applying the above corollary to the function
f (x, y) = 0, if x = y, ↑,
- therwise.
Computability Theory, by Y. Fu
- VII. Problem Index
37 / 44
Self Printing Program
- Fact. There is a program P such that for all x, P(x) ↓ γ(P).
Proof.
It says that there is a number n such that φn(x) = n for all x. Simply apply one of the corollaries to f (z, x) = z.
Computability Theory, by Y. Fu
- VII. Problem Index
38 / 44
Applying Recursion Theorem
- Theorem. Suppose that f is a total increasing function such that
◮ if m = n then φf (m) = φf (n), ◮ f (n) is the least index of the function φf (n).
Then f is not computable.
Proof.
Suppose f satisfies the conditions of the theorem. By the first condition f (n) > n if n is large enough. By the second condition φf (n) = φn for all large enough n. This contradicts to Recursion Theorem.
Computability Theory, by Y. Fu
- VII. Problem Index
39 / 44
Diagonalisation Implicit in Recursion Theorem
We may think of φx as providing an effective enumeration of φφx(0), φφx(1), φφx(2), . . . , φφx(i), . . . . The diagonal function φx(x) enumerates φφ0(0), φφ1(1), φφ2(2), . . .. Let f be total computable. There is some total computable s(x), due to S-m-n Theorem, and some index m for s(x) such that φφm(x)(y) ≃ φs(x)(y) ≃ φf (φx(x))(y). Both φm and f (φx(x)) enumerate the following φφm(0), φφm(1), φφm(2), . . ., φφm(i), . . ..
Computability Theory, by Y. Fu
- VII. Problem Index
40 / 44
Diagonalisation Implicit in Recursion Theorem
φφ0(0), φφ0(1), φφ0(2), . . . , φφ0(i), . . . φφ1(0), φφ1(1), φφ1(2), . . . , φφ1(i), . . . φφ2(0), φφ2(1), φφ2(2), . . . , φφ2(i), . . . . . . . . . . . . . . . φφm(0), φφm(1), φφm(2), . . ., φφm(m), . . . . . . . . . . . . . . . The diagonal intersects the m-row at φφm(m) = φf (φm(m)). It is important that φm(m) must be defined.
Computability Theory, by Y. Fu
- VII. Problem Index
41 / 44
Diagonalisation offers an intuition about Recursion Theorem. It also explains the power of Recursion Theorem.
Computability Theory, by Y. Fu
- VII. Problem Index
42 / 44
Generalized Recursion Theorem. Suppose f (x, z) is a total computable function. There is an injective primitive recursive function n(z) such that φf (n(z),z) = φn(z) for all z.
Proof.
By S-m-n Theorem there is an injective primitive recursive function s(x, z) such that φf (φx(x),z) = φs(x,z). By the same theorem there is an injective primitive recursive function m(z) such that s(x, z) = φm(z)(x). So φf (φx(x),z) = φφm(z)(x). We are done by letting x = m(z) and n(z) = φm(z)(m(z)). It is clear that n is an injective primitive recursive function.
Computability Theory, by Y. Fu
- VII. Problem Index
43 / 44
Basic recursion theory can be developed from S-m-n Theorem and Enumeration Theorem. Advanced recursion theory makes frequent use of Recursion Theorem.
Computability Theory, by Y. Fu
- VII. Problem Index
44 / 44