primitive recursion - department of mathematicsorion.math.iastate.edu/jdhsmith/math/jgknf4cf.pdf ·...

Post on 25-Apr-2018

255 Views

Category:

Documents

2 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Primitive recursion

DefinitionGiven a binary function β(m, n) and any a ∈ N define the functionϕ(n) as follows;

ϕ(0) := a and ϕ(n + 1) := β(n, ϕ(n)).

I Note how the successor function σ0(n) = n + 1 is builtdirectly into the definition of primitive recursion.

I The class PR is built up from σ0 the constant functions andthe projections πi (a1, ..., ai , ..., an) = ai by substitution andprimitive recursion.

DMACC John M. Gillespie 1

Primitive recursion

DefinitionGiven a binary function β(m, n) and any a ∈ N define the functionϕ(n) as follows;

ϕ(0) := a and ϕ(n + 1) := β(n, ϕ(n)).

I Note how the successor function σ0(n) = n + 1 is builtdirectly into the definition of primitive recursion.

I The class PR is built up from σ0 the constant functions andthe projections πi (a1, ..., ai , ..., an) = ai by substitution andprimitive recursion.

DMACC John M. Gillespie 2

Primitive recursion

DefinitionGiven a binary function β(m, n) and any a ∈ N define the functionϕ(n) as follows;

ϕ(0) := a and ϕ(n + 1) := β(n, ϕ(n)).

I Note how the successor function σ0(n) = n + 1 is builtdirectly into the definition of primitive recursion.

I The class PR is built up from σ0 the constant functions andthe projections πi (a1, ..., ai , ..., an) = ai by

substitution andprimitive recursion.

DMACC John M. Gillespie 3

Primitive recursion

DefinitionGiven a binary function β(m, n) and any a ∈ N define the functionϕ(n) as follows;

ϕ(0) := a and ϕ(n + 1) := β(n, ϕ(n)).

I Note how the successor function σ0(n) = n + 1 is builtdirectly into the definition of primitive recursion.

I The class PR is built up from σ0 the constant functions andthe projections πi (a1, ..., ai , ..., an) = ai by substitution

andprimitive recursion.

DMACC John M. Gillespie 4

Primitive recursion

DefinitionGiven a binary function β(m, n) and any a ∈ N define the functionϕ(n) as follows;

ϕ(0) := a and ϕ(n + 1) := β(n, ϕ(n)).

I Note how the successor function σ0(n) = n + 1 is builtdirectly into the definition of primitive recursion.

I The class PR is built up from σ0 the constant functions andthe projections πi (a1, ..., ai , ..., an) = ai by substitution andprimitive recursion.

DMACC John M. Gillespie 5

Two surprisingly useful functions

We define by primitive recursion sg and s̄g.

I sg(0) = 0 with sg(n + 1) = 1.

I s̄g(0) = 1 with s̄g(n + 1) = 0.

I Exponent notation is used e.g. 11sg = 1 and 2s̄g = 0.

DMACC John M. Gillespie 6

Two surprisingly useful functions

We define by primitive recursion sg and s̄g.

I sg(0) = 0 with sg(n + 1) = 1.

I s̄g(0) = 1 with s̄g(n + 1) = 0.

I Exponent notation is used e.g. 11sg = 1 and 2s̄g = 0.

DMACC John M. Gillespie 7

Examples

Well known primitive recursive functions. Takes some work!

1. The n-th prime pn

2. The exponent expl(n) of the l-th prime in the primefactorization of n ∈ N.

3. The residue res(a,n) of a modulo n.

4. Restricted subtraction a ·− b.

DMACC John M. Gillespie 8

Examples

Well known primitive recursive functions. Takes some work!

1. The n-th prime pn

2. The exponent expl(n) of the l-th prime in the primefactorization of n ∈ N.

3. The residue res(a,n) of a modulo n.

4. Restricted subtraction a ·− b.

DMACC John M. Gillespie 9

Examples

Well known primitive recursive functions. Takes some work!

1. The n-th prime pn

2. The exponent expl(n) of the l-th prime in the primefactorization of n ∈ N.

3. The residue res(a,n) of a modulo n.

4. Restricted subtraction a ·− b.

DMACC John M. Gillespie 10

Examples

Well known primitive recursive functions. Takes some work!

1. The n-th prime pn

2. The exponent expl(n) of the l-th prime in the primefactorization of n ∈ N.

3. The residue res(a,n) of a modulo n.

4. Restricted subtraction a ·− b.

DMACC John M. Gillespie 11

Examples

I If we let

S(n) =n∑

i=1

s̄g(res(n, i))

then S(n) yields the number of divisors of n.

I If we let

π(n) =n∑

i=2

s̄g(S(n) ·− 2)

then π(n) yields the number of primes among 2, ..., n.

Then the nth prime is the least j such that π(j) = n + 1.

DMACC John M. Gillespie 12

Examples

I If we let

S(n) =n∑

i=1

s̄g(res(n, i))

then S(n) yields the number of divisors of n.

I If we let

π(n) =n∑

i=2

s̄g(S(n) ·− 2)

then π(n) yields the number of primes among 2, ..., n.

Then the nth prime is the least j such that π(j) = n + 1.

DMACC John M. Gillespie 13

Examples

I If we let

S(n) =n∑

i=1

s̄g(res(n, i))

then S(n) yields the number of divisors of n.

I If we let

π(n) =n∑

i=2

s̄g(S(n) ·− 2)

then π(n) yields the number of primes among 2, ..., n.

Then the nth prime is the least j such that π(j) = n + 1.

DMACC John M. Gillespie 14

Examples

I If we let

S(n) =n∑

i=1

s̄g(res(n, i))

then S(n) yields the number of divisors of n.

I If we let

π(n) =n∑

i=2

s̄g(S(n) ·− 2)

then π(n) yields the number of primes among 2, ..., n.

Then the nth prime is the least j such that π(j) = n + 1.

DMACC John M. Gillespie 15

Examples

I If we let

S(n) =n∑

i=1

s̄g(res(n, i))

then S(n) yields the number of divisors of n.

I If we let

π(n) =n∑

i=2

s̄g(S(n) ·− 2)

then π(n) yields the number of primes among 2, ..., n.

Then the nth prime is the least j such that π(j) = n + 1.

DMACC John M. Gillespie 16

Bounded search

Suppose a function τ(a1, ..., ar , n) is given which satisfies thefollowing formula.

(∀a1 . . . ∀ar∃n)(τ(~a, n) = 0)

Then the smallest n for which τ(a1, ..., ar , n) = 0 is given by theexpression below.

B∑i=0

i∏j=0

τ(~a, j)sg

= τ(~a, 0)sg + τ(~a, 0)sgτ(~a, 1)sg + τ(~a, 0)sgτ(~a, 1)sgτ(~a, 2)sg + . . .

+ τ(~a, 0)sgτ(~a, 1)sg . . . τ(~a,B)sg

DMACC John M. Gillespie 17

Bounded search

Suppose a function τ(a1, ..., ar , n) is given which satisfies thefollowing formula.

(∀a1 . . . ∀ar∃n)(τ(~a, n) = 0)

Then the smallest n for which τ(a1, ..., ar , n) = 0 is given by theexpression below.

B∑i=0

i∏j=0

τ(~a, j)sg

= τ(~a, 0)sg + τ(~a, 0)sgτ(~a, 1)sg + τ(~a, 0)sgτ(~a, 1)sgτ(~a, 2)sg + . . .

+ τ(~a, 0)sgτ(~a, 1)sg . . . τ(~a,B)sg

DMACC John M. Gillespie 18

Bounded search

Suppose a function τ(a1, ..., ar , n) is given which satisfies thefollowing formula.

(∀a1 . . . ∀ar∃n)(τ(~a, n) = 0)

Then the smallest n for which τ(a1, ..., ar , n) = 0 is given by theexpression below.

B∑i=0

i∏j=0

τ(~a, j)sg

= τ(~a, 0)sg + τ(~a, 0)sgτ(~a, 1)sg + τ(~a, 0)sgτ(~a, 1)sgτ(~a, 2)sg + . . .

+ τ(~a, 0)sgτ(~a, 1)sg . . . τ(~a,B)sg

DMACC John M. Gillespie 19

Bounded search

The following notation is fairly standard.

µj [τ(~a, j) = 0] =B∑i=0

i∏j=0

τ(~a, j)sg

I The bound B is specific to the function τ .

I For example the nth prime pn satisfies pn < 22n .

I This provides the bound B = 22n .

DMACC John M. Gillespie 20

Bounded search

The following notation is fairly standard.

µj [τ(~a, j) = 0] =B∑i=0

i∏j=0

τ(~a, j)sg

I The bound B is specific to the function τ .

I For example the nth prime pn satisfies pn < 22n .

I This provides the bound B = 22n .

DMACC John M. Gillespie 21

Bounded search

The following notation is fairly standard.

µj [τ(~a, j) = 0] =B∑i=0

i∏j=0

τ(~a, j)sg

I The bound B is specific to the function τ .

I For example the nth prime pn satisfies pn < 22n .

I This provides the bound B = 22n .

DMACC John M. Gillespie 22

Bounded search

The following notation is fairly standard.

µj [τ(~a, j) = 0] =B∑i=0

i∏j=0

τ(~a, j)sg

I The bound B is specific to the function τ .

I For example the nth prime pn satisfies pn < 22n .

I This provides the bound B = 22n .

DMACC John M. Gillespie 23

The length of n ∈ N

Consider the problem of finding the index l of the largest primedividing n ∈ N and suppose n > 1.

I Take the sign of the sum

sg(expl(n) + exp2(n) + . . .+ expn(n)).

I What we seek is the smallest j such that

sg(expj+1(n) + expj+2(n) + . . .+ expn(n)) = 0.

DMACC John M. Gillespie 24

The length of n ∈ N

Consider the problem of finding the index l of the largest primedividing n ∈ N and suppose n > 1.

I Take the sign of the sum

sg(expl(n) + exp2(n) + . . .+ expn(n)).

I What we seek is the smallest j such that

sg(expj+1(n) + expj+2(n) + . . .+ expn(n)) = 0.

DMACC John M. Gillespie 25

The length of n ∈ N

Consider the problem of finding the index l of the largest primedividing n ∈ N and suppose n > 1.

I Take the sign of the sum

sg(expl(n) + exp2(n) + . . .+ expn(n)).

I What we seek is the smallest j such that

sg(expj+1(n) + expj+2(n) + . . .+ expn(n)) = 0.

DMACC John M. Gillespie 26

The length of n ∈ N

The following primitive recursive function yields the index of thelargest prime divisor of the natural number n.

long(n) =n∑

k=0

k∏j=0

sg

n∑l=j+1

expl(n)

I The bound n is sufficient since n < pn.

I This yields the smallest j such that expl(n) = 0 if l > j .

DMACC John M. Gillespie 27

The length of n ∈ N

The following primitive recursive function yields the index of thelargest prime divisor of the natural number n.

long(n) =n∑

k=0

k∏j=0

sg

n∑l=j+1

expl(n)

I The bound n is sufficient since n < pn.

I This yields the smallest j such that expl(n) = 0 if l > j .

DMACC John M. Gillespie 28

The length of n ∈ N

The following primitive recursive function yields the index of thelargest prime divisor of the natural number n.

long(n) =n∑

k=0

k∏j=0

sg

n∑l=j+1

expl(n)

I The bound n is sufficient since n < pn.

I This yields the smallest j such that expl(n) = 0 if l > j .

DMACC John M. Gillespie 29

Other forms of recursion

Course-of-values recursion

DefinitionGiven a binary function β and any a ∈ N define ϕ as follows;

ϕ(0) = a and ϕ(n + 1) = β(n∏

i=0

pϕ(i)i , n).

We can prove that such a definition yields a primitive recursivefunction.

DMACC John M. Gillespie 30

Course-of-values recursion

Definition of ϕ

ϕ(0) = a and ϕ(n + 1) = β(n∏

i=0

pϕ(i)i , n)

Define a function ψ(n) =∏n

i=0 pϕ(n)i . Then ψ(0) = 2a and

ψ(n + 1) = ψ(n) · pϕ(n+1)n+1

= ψ(n) · pβ(ψ(n),n)n+1

Thus ψ is primitive recursive and ϕ(n) = expn ψ(n) hence ϕ is alsoprimitive recursive.

DMACC John M. Gillespie 31

Course-of-values recursion

Definition of ϕ

ϕ(0) = a and ϕ(n + 1) = β(n∏

i=0

pϕ(i)i , n)

Define a function ψ(n) =∏n

i=0 pϕ(n)i . Then ψ(0) = 2a and

ψ(n + 1) = ψ(n) · pϕ(n+1)n+1

= ψ(n) · pβ(ψ(n),n)n+1

Thus ψ is primitive recursive and ϕ(n) = expn ψ(n) hence ϕ is alsoprimitive recursive.

DMACC John M. Gillespie 32

Course-of-values recursion

Definition of ϕ

ϕ(0) = a and ϕ(n + 1) = β(n∏

i=0

pϕ(i)i , n)

Define a function ψ(n) =∏n

i=0 pϕ(n)i . Then ψ(0) = 2a and

ψ(n + 1) = ψ(n) · pϕ(n+1)n+1

= ψ(n) · pβ(ψ(n),n)n+1

Thus ψ is primitive recursive and ϕ(n) = expn ψ(n) hence ϕ is alsoprimitive recursive.

DMACC John M. Gillespie 33

Course-of-values recursion

Definition of ϕ

ϕ(0) = a and ϕ(n + 1) = β(n∏

i=0

pϕ(i)i , n)

Define a function ψ(n) =∏n

i=0 pϕ(n)i . Then ψ(0) = 2a and

ψ(n + 1) = ψ(n) · pϕ(n+1)n+1

= ψ(n) · pβ(ψ(n),n)n+1

Thus ψ is primitive recursive and ϕ(n) = expn ψ(n) hence ϕ is alsoprimitive recursive.

DMACC John M. Gillespie 34

Another form of recursion

Simultaneous recursion

DefinitionGiven a, b ∈ N and binary functions β1 and β2 define σ1 and σ2;σ1(0) = a, σ2(0) = b with

σ1(n + 1) = β1(σ1(n), σ2(n))

σ2(n + 1) = β2(σ1(n), σ2(n)).

We can prove that such a definition yields primitive recursivefunctins σ1 and σ2.

DMACC John M. Gillespie 35

Another form of recursion

Simultaneous recursion

DefinitionGiven a, b ∈ N and binary functions β1 and β2 define σ1 and σ2;σ1(0) = a, σ2(0) = b with

σ1(n + 1) = β1(σ1(n), σ2(n))

σ2(n + 1) = β2(σ1(n), σ2(n)).

We can prove that such a definition yields primitive recursivefunctins σ1 and σ2.

DMACC John M. Gillespie 36

Simultaneous recursion

σ1(0) = a and σ2(0) = b

σ1(n + 1) = β1(σ1(n), σ2(n))

σ2(n + 1) = β2(σ1(n), σ2(n)).

Define a function ψ(n) = pσ1(n)1 ·pσ2(n)

2 . So then ψ(0) = pa1 ·pb2 and

ψ(n + 1) = pσ1(n+1)1 · pσ2(n+1)

2

= pβ1(σ1(n),σ2(n))1 · pβ2(σ1(n),σ2(n)

2

= pβ1(exp1 ψ(n),exp2 ψ(n))1 · pβ2(exp1 ψ(n),exp2 ψ(n))

2

Hence ψ is primitive recursive ⇒ σ1 and σ2 are primitive recursive.

DMACC John M. Gillespie 37

Simultaneous recursion

σ1(0) = a and σ2(0) = b

σ1(n + 1) = β1(σ1(n), σ2(n))

σ2(n + 1) = β2(σ1(n), σ2(n)).

Define a function ψ(n) = pσ1(n)1 ·pσ2(n)

2 . So then ψ(0) = pa1 ·pb2 and

ψ(n + 1) = pσ1(n+1)1 · pσ2(n+1)

2

= pβ1(σ1(n),σ2(n))1 · pβ2(σ1(n),σ2(n)

2

= pβ1(exp1 ψ(n),exp2 ψ(n))1 · pβ2(exp1 ψ(n),exp2 ψ(n))

2

Hence ψ is primitive recursive ⇒ σ1 and σ2 are primitive recursive.

DMACC John M. Gillespie 38

Simultaneous recursion

σ1(0) = a and σ2(0) = b

σ1(n + 1) = β1(σ1(n), σ2(n))

σ2(n + 1) = β2(σ1(n), σ2(n)).

Define a function ψ(n) = pσ1(n)1 ·pσ2(n)

2 . So then ψ(0) = pa1 ·pb2 and

ψ(n + 1) = pσ1(n+1)1 · pσ2(n+1)

2

= pβ1(σ1(n),σ2(n))1 · pβ2(σ1(n),σ2(n)

2

= pβ1(exp1 ψ(n),exp2 ψ(n))1 · pβ2(exp1 ψ(n),exp2 ψ(n))

2

Hence ψ is primitive recursive ⇒ σ1 and σ2 are primitive recursive.

DMACC John M. Gillespie 39

Simultaneous recursion

σ1(0) = a and σ2(0) = b

σ1(n + 1) = β1(σ1(n), σ2(n))

σ2(n + 1) = β2(σ1(n), σ2(n)).

Define a function ψ(n) = pσ1(n)1 ·pσ2(n)

2 . So then ψ(0) = pa1 ·pb2 and

ψ(n + 1) = pσ1(n+1)1 · pσ2(n+1)

2

= pβ1(σ1(n),σ2(n))1 · pβ2(σ1(n),σ2(n)

2

= pβ1(exp1 ψ(n),exp2 ψ(n))1 · pβ2(exp1 ψ(n),exp2 ψ(n))

2

Hence ψ is primitive recursive ⇒ σ1 and σ2 are primitive recursive.

DMACC John M. Gillespie 40

Nested recursion

Example

Given known functions α, β and γ define ϕ(0, a) = α(a) with

ϕ(n + 1, a) = β(n, ϕ(n, γ(n, a, ϕ(n, a)))).

I This function is indeed primitive recursive.

I But in such a definition if you have induction on multiplevariables then your function may no longer be PR.

DMACC John M. Gillespie 41

Nested recursion

Example

Given known functions α, β and γ define ϕ(0, a) = α(a) with

ϕ(n + 1, a) = β(n, ϕ(n, γ(n, a, ϕ(n, a)))).

I This function is indeed primitive recursive.

I But in such a definition if you have induction on multiplevariables then your function may no longer be PR.

DMACC John M. Gillespie 42

Nested recursion

Example

Given known functions α, β and γ define ϕ(0, a) = α(a) with

ϕ(n + 1, a) = β(n, ϕ(n, γ(n, a, ϕ(n, a)))).

I This function is indeed primitive recursive.

I But in such a definition if you have induction on multiplevariables then your function may no longer be PR.

DMACC John M. Gillespie 43

General recursive functions

General recursive functions are defined in terms of a system ofequations.

I The class of general recursive functions coincides with theclass of all computable functions.

I Hence functions of the λ-calculus, Turing computablefunctions, and so on are all general recursive functions.

I Given a defining system of equations you may not be able totell if you have a working definition.

I In general the problem is undecidable.

DMACC John M. Gillespie 44

General recursive functions

General recursive functions are defined in terms of a system ofequations.

I The class of general recursive functions coincides with theclass of all computable functions.

I Hence functions of the λ-calculus, Turing computablefunctions, and so on are all general recursive functions.

I Given a defining system of equations you may not be able totell if you have a working definition.

I In general the problem is undecidable.

DMACC John M. Gillespie 45

General recursive functions

General recursive functions are defined in terms of a system ofequations.

I The class of general recursive functions coincides with theclass of all computable functions.

I Hence functions of the λ-calculus, Turing computablefunctions, and so on are all general recursive functions.

I Given a defining system of equations you may not be able totell if you have a working definition.

I In general the problem is undecidable.

DMACC John M. Gillespie 46

General recursive functions

General recursive functions are defined in terms of a system ofequations.

I The class of general recursive functions coincides with theclass of all computable functions.

I Hence functions of the λ-calculus, Turing computablefunctions, and so on are all general recursive functions.

I Given a defining system of equations you may not be able totell if you have a working definition.

I In general the problem is undecidable.

DMACC John M. Gillespie 47

General recursive functions

General recursive functions are defined in terms of a system ofequations.

I The class of general recursive functions coincides with theclass of all computable functions.

I Hence functions of the λ-calculus, Turing computablefunctions, and so on are all general recursive functions.

I Given a defining system of equations you may not be able totell if you have a working definition.

I In general the problem is undecidable.

DMACC John M. Gillespie 48

General recursive functions

Given a defining system of equations there are two numbers whichare noteworthy.

The index of the function being defined σs and the number Aof axioms.

Example

1. σ1(0, x2) = x2

2. σ1(σ0(x1), x2) = σ0(σ1(x1, x2))

3. σ2(0, x2) = 0

4. σ2(σ0(x1), x2) = σ1(σ2(x1, x2), x2)

5. σ3(x1) = σ2(x1, x1)

I For this example s = 3, A = 5 and σ3 is the square function.

DMACC John M. Gillespie 49

General recursive functions

Given a defining system of equations there are two numbers whichare noteworthy.

The index of the function being defined σs and the number Aof axioms.

Example

1. σ1(0, x2) = x2

2. σ1(σ0(x1), x2) = σ0(σ1(x1, x2))

3. σ2(0, x2) = 0

4. σ2(σ0(x1), x2) = σ1(σ2(x1, x2), x2)

5. σ3(x1) = σ2(x1, x1)

I For this example s = 3, A = 5 and σ3 is the square function.

DMACC John M. Gillespie 50

General recursive functions

Given a defining system of equations there are two numbers whichare noteworthy.

The index of the function being defined σs and the number Aof axioms.

Example

1. σ1(0, x2) = x2

2. σ1(σ0(x1), x2) = σ0(σ1(x1, x2))

3. σ2(0, x2) = 0

4. σ2(σ0(x1), x2) = σ1(σ2(x1, x2), x2)

5. σ3(x1) = σ2(x1, x1)

I For this example s = 3, A = 5 and σ3 is the square function.

DMACC John M. Gillespie 51

General recursive functions

Given a defining system of equations there are two numbers whichare noteworthy.

The index of the function being defined σs and the number Aof axioms.

Example

1. σ1(0, x2) = x2

2. σ1(σ0(x1), x2) = σ0(σ1(x1, x2))

3. σ2(0, x2) = 0

4. σ2(σ0(x1), x2) = σ1(σ2(x1, x2), x2)

5. σ3(x1) = σ2(x1, x1)

I For this example s = 3, A = 5 and σ3 is the square function.

DMACC John M. Gillespie 52

General recursive functions

Example

1. σ1(0) = 0

2. σ1(σ0(x1)) = x1

3. σ2(0, x2) = x2

4. σ2(σ0(x1), x2) = σ0(σ2(x1, x2))

5. σ3(0) = 1

6. σ3(σ0(x1)) = σ2(ϕ(x1), ϕ(σ1(x1)))

I For this example s = 3, A = 6. Can you identify the functionσ3?

DMACC John M. Gillespie 53

General recursive functions

Example

1. σ1(0) = 0

2. σ1(σ0(x1)) = x1

3. σ2(0, x2) = x2

4. σ2(σ0(x1), x2) = σ0(σ2(x1, x2))

5. σ3(0) = 1

6. σ3(σ0(x1)) = σ2(ϕ(x1), ϕ(σ1(x1)))

I For this example s = 3, A = 6. Can you identify the functionσ3?

DMACC John M. Gillespie 54

General recursive functions

Example

1. σ1(0) = 0

2. σ1(σ0(x1)) = x1

3. σ2(x1, 0) = x1

4. σ2(x1, σ0(x2)) = σ1(σ2(x1, x2))

I For this example s = 2 and A = 4.

I σ2(x1, x2) = x1 ·− x2.

DMACC John M. Gillespie 55

General recursive functions

Example

1. σ1(0) = 0

2. σ1(σ0(x1)) = x1

3. σ2(x1, 0) = x1

4. σ2(x1, σ0(x2)) = σ1(σ2(x1, x2))

I For this example s = 2 and A = 4.

I σ2(x1, x2) = x1 ·− x2.

DMACC John M. Gillespie 56

Computations as deductions

Axioms

{σ1(0, x2) = x2 (1)σ1(σ0(x1), x2) = σ0(σ1(x1, x2)) (2)

Deductions

n(1, 2) σ1(0, σ0(x2)) = σ0(x2) (3)z(3, 2) σ1(0, σ0(0)) = σ0(0) (4)n(2, 2) σ1(σ0(x1), σ0(x2)) = σ0(σ1(x1, σ0(x2))) (5)z(5, i) σ1(σ0(0), σ0(0)) = σ0(σ1(0, σ0(0))) (6)sub(4, 6, 15) σ1(σ0(0), σ0(0)) = σ0(σ0(0)) (7)

This illustrates the three admissable steps in any computation;n, z and sub.

DMACC John M. Gillespie 57

Computations as deductions

Axioms

{σ1(0, x2) = x2 (1)σ1(σ0(x1), x2) = σ0(σ1(x1, x2)) (2)

Deductions

n(1, 2) σ1(0, σ0(x2)) = σ0(x2) (3)

z(3, 2) σ1(0, σ0(0)) = σ0(0) (4)n(2, 2) σ1(σ0(x1), σ0(x2)) = σ0(σ1(x1, σ0(x2))) (5)z(5, i) σ1(σ0(0), σ0(0)) = σ0(σ1(0, σ0(0))) (6)sub(4, 6, 15) σ1(σ0(0), σ0(0)) = σ0(σ0(0)) (7)

This illustrates the three admissable steps in any computation;n, z and sub.

DMACC John M. Gillespie 58

Computations as deductions

Axioms

{σ1(0, x2) = x2 (1)σ1(σ0(x1), x2) = σ0(σ1(x1, x2)) (2)

Deductions

n(1, 2) σ1(0, σ0(x2)) = σ0(x2) (3)z(3, 2) σ1(0, σ0(0)) = σ0(0) (4)

n(2, 2) σ1(σ0(x1), σ0(x2)) = σ0(σ1(x1, σ0(x2))) (5)z(5, i) σ1(σ0(0), σ0(0)) = σ0(σ1(0, σ0(0))) (6)sub(4, 6, 15) σ1(σ0(0), σ0(0)) = σ0(σ0(0)) (7)

This illustrates the three admissable steps in any computation;n, z and sub.

DMACC John M. Gillespie 59

Computations as deductions

Axioms

{σ1(0, x2) = x2 (1)σ1(σ0(x1), x2) = σ0(σ1(x1, x2)) (2)

Deductions

n(1, 2) σ1(0, σ0(x2)) = σ0(x2) (3)z(3, 2) σ1(0, σ0(0)) = σ0(0) (4)n(2, 2) σ1(σ0(x1), σ0(x2)) = σ0(σ1(x1, σ0(x2))) (5)

z(5, i) σ1(σ0(0), σ0(0)) = σ0(σ1(0, σ0(0))) (6)sub(4, 6, 15) σ1(σ0(0), σ0(0)) = σ0(σ0(0)) (7)

This illustrates the three admissable steps in any computation;n, z and sub.

DMACC John M. Gillespie 60

Computations as deductions

Axioms

{σ1(0, x2) = x2 (1)σ1(σ0(x1), x2) = σ0(σ1(x1, x2)) (2)

Deductions

n(1, 2) σ1(0, σ0(x2)) = σ0(x2) (3)z(3, 2) σ1(0, σ0(0)) = σ0(0) (4)n(2, 2) σ1(σ0(x1), σ0(x2)) = σ0(σ1(x1, σ0(x2))) (5)z(5, i) σ1(σ0(0), σ0(0)) = σ0(σ1(0, σ0(0))) (6)

sub(4, 6, 15) σ1(σ0(0), σ0(0)) = σ0(σ0(0)) (7)

This illustrates the three admissable steps in any computation;n, z and sub.

DMACC John M. Gillespie 61

Computations as deductions

Axioms

{σ1(0, x2) = x2 (1)σ1(σ0(x1), x2) = σ0(σ1(x1, x2)) (2)

Deductions

n(1, 2) σ1(0, σ0(x2)) = σ0(x2) (3)z(3, 2) σ1(0, σ0(0)) = σ0(0) (4)n(2, 2) σ1(σ0(x1), σ0(x2)) = σ0(σ1(x1, σ0(x2))) (5)z(5, i) σ1(σ0(0), σ0(0)) = σ0(σ1(0, σ0(0))) (6)sub(4, 6, 15) σ1(σ0(0), σ0(0)) = σ0(σ0(0)) (7)

This illustrates the three admissable steps in any computation;n, z and sub.

DMACC John M. Gillespie 62

Computations as deductions

Axioms

{σ1(0, x2) = x2 (1)σ1(σ0(x1), x2) = σ0(σ1(x1, x2)) (2)

Deductions

n(1, 2) σ1(0, σ0(x2)) = σ0(x2) (3)z(3, 2) σ1(0, σ0(0)) = σ0(0) (4)n(2, 2) σ1(σ0(x1), σ0(x2)) = σ0(σ1(x1, σ0(x2))) (5)z(5, i) σ1(σ0(0), σ0(0)) = σ0(σ1(0, σ0(0))) (6)sub(4, 6, 15) σ1(σ0(0), σ0(0)) = σ0(σ0(0)) (7)

This illustrates the three admissable steps in any computation;n, z and sub.

DMACC John M. Gillespie 63

The admissable steps

I z(i , j) denotes plugging zero into the j variable of equation i .

I n(i , j) denotes non-zero evaluation; We are plugging σ0(xj)into equation i in the variable j .

I sub(i , j , k) denotes substitution of RHS of equation i intoequation j at the kth position.

DMACC John M. Gillespie 64

The admissable steps

I z(i , j) denotes plugging zero into the j variable of equation i .

I n(i , j) denotes non-zero evaluation; We are plugging σ0(xj)into equation i in the variable j .

I sub(i , j , k) denotes substitution of RHS of equation i intoequation j at the kth position.

DMACC John M. Gillespie 65

The admissable steps

I z(i , j) denotes plugging zero into the j variable of equation i .

I n(i , j) denotes non-zero evaluation; We are plugging σ0(xj)into equation i in the variable j .

I sub(i , j , k) denotes substitution of RHS of equation i intoequation j at the kth position.

DMACC John M. Gillespie 66

Computations as deductions

Axioms

σ1(0, x2) = x2 (1)σ1(σ0(x1), x2) = σ0(σ1(x1, x2)) (2)σ2(0, x2) = 0 (3)σ2(σ0(x1), x2) = σ1(σ2(x1, x2), x2) (4)

n(1, 2) σ1(0, σ0(x2)) = σ0(x2) (5)z(5, 2) σ1(0, σ0(0)) = σ0(0) (6)n(4, 2) σ2(σ0(x1), σ0(x2)) = σ1(σ2(x1, σ0(x2)), σ0(x2)) (7)z(7, i) σ2(σ0(0), σ0(0)) = σ1(σ2(0, σ0(0)), σ0(0)) (8)n(3, 2) σ2(0, σ0(x2)) = 0 (9)z(9, 2) σ2(0, σ0(0)) = 0 (10)sub(10, 8) σ2(σ0(0), σ0(0))) = σ1(0, σ0(0)) (11)sub(6, 11) σ2(σ0(0), σ0(0))) = σ0(0) (12)

DMACC John M. Gillespie 67

Computations as deductions

Axioms

σ1(0, x2) = x2 (1)σ1(σ0(x1), x2) = σ0(σ1(x1, x2)) (2)σ2(0, x2) = 0 (3)σ2(σ0(x1), x2) = σ1(σ2(x1, x2), x2) (4)

n(1, 2) σ1(0, σ0(x2)) = σ0(x2) (5)

z(5, 2) σ1(0, σ0(0)) = σ0(0) (6)n(4, 2) σ2(σ0(x1), σ0(x2)) = σ1(σ2(x1, σ0(x2)), σ0(x2)) (7)z(7, i) σ2(σ0(0), σ0(0)) = σ1(σ2(0, σ0(0)), σ0(0)) (8)n(3, 2) σ2(0, σ0(x2)) = 0 (9)z(9, 2) σ2(0, σ0(0)) = 0 (10)sub(10, 8) σ2(σ0(0), σ0(0))) = σ1(0, σ0(0)) (11)sub(6, 11) σ2(σ0(0), σ0(0))) = σ0(0) (12)

DMACC John M. Gillespie 68

Computations as deductions

Axioms

σ1(0, x2) = x2 (1)σ1(σ0(x1), x2) = σ0(σ1(x1, x2)) (2)σ2(0, x2) = 0 (3)σ2(σ0(x1), x2) = σ1(σ2(x1, x2), x2) (4)

n(1, 2) σ1(0, σ0(x2)) = σ0(x2) (5)z(5, 2) σ1(0, σ0(0)) = σ0(0) (6)

n(4, 2) σ2(σ0(x1), σ0(x2)) = σ1(σ2(x1, σ0(x2)), σ0(x2)) (7)z(7, i) σ2(σ0(0), σ0(0)) = σ1(σ2(0, σ0(0)), σ0(0)) (8)n(3, 2) σ2(0, σ0(x2)) = 0 (9)z(9, 2) σ2(0, σ0(0)) = 0 (10)sub(10, 8) σ2(σ0(0), σ0(0))) = σ1(0, σ0(0)) (11)sub(6, 11) σ2(σ0(0), σ0(0))) = σ0(0) (12)

DMACC John M. Gillespie 69

Computations as deductions

Axioms

σ1(0, x2) = x2 (1)σ1(σ0(x1), x2) = σ0(σ1(x1, x2)) (2)σ2(0, x2) = 0 (3)σ2(σ0(x1), x2) = σ1(σ2(x1, x2), x2) (4)

n(1, 2) σ1(0, σ0(x2)) = σ0(x2) (5)z(5, 2) σ1(0, σ0(0)) = σ0(0) (6)n(4, 2) σ2(σ0(x1), σ0(x2)) = σ1(σ2(x1, σ0(x2)), σ0(x2)) (7)

z(7, i) σ2(σ0(0), σ0(0)) = σ1(σ2(0, σ0(0)), σ0(0)) (8)n(3, 2) σ2(0, σ0(x2)) = 0 (9)z(9, 2) σ2(0, σ0(0)) = 0 (10)sub(10, 8) σ2(σ0(0), σ0(0))) = σ1(0, σ0(0)) (11)sub(6, 11) σ2(σ0(0), σ0(0))) = σ0(0) (12)

DMACC John M. Gillespie 70

Computations as deductions

Axioms

σ1(0, x2) = x2 (1)σ1(σ0(x1), x2) = σ0(σ1(x1, x2)) (2)σ2(0, x2) = 0 (3)σ2(σ0(x1), x2) = σ1(σ2(x1, x2), x2) (4)

n(1, 2) σ1(0, σ0(x2)) = σ0(x2) (5)z(5, 2) σ1(0, σ0(0)) = σ0(0) (6)n(4, 2) σ2(σ0(x1), σ0(x2)) = σ1(σ2(x1, σ0(x2)), σ0(x2)) (7)z(7, i) σ2(σ0(0), σ0(0)) = σ1(σ2(0, σ0(0)), σ0(0)) (8)

n(3, 2) σ2(0, σ0(x2)) = 0 (9)z(9, 2) σ2(0, σ0(0)) = 0 (10)sub(10, 8) σ2(σ0(0), σ0(0))) = σ1(0, σ0(0)) (11)sub(6, 11) σ2(σ0(0), σ0(0))) = σ0(0) (12)

DMACC John M. Gillespie 71

Computations as deductions

Axioms

σ1(0, x2) = x2 (1)σ1(σ0(x1), x2) = σ0(σ1(x1, x2)) (2)σ2(0, x2) = 0 (3)σ2(σ0(x1), x2) = σ1(σ2(x1, x2), x2) (4)

n(1, 2) σ1(0, σ0(x2)) = σ0(x2) (5)z(5, 2) σ1(0, σ0(0)) = σ0(0) (6)n(4, 2) σ2(σ0(x1), σ0(x2)) = σ1(σ2(x1, σ0(x2)), σ0(x2)) (7)z(7, i) σ2(σ0(0), σ0(0)) = σ1(σ2(0, σ0(0)), σ0(0)) (8)n(3, 2) σ2(0, σ0(x2)) = 0 (9)

z(9, 2) σ2(0, σ0(0)) = 0 (10)sub(10, 8) σ2(σ0(0), σ0(0))) = σ1(0, σ0(0)) (11)sub(6, 11) σ2(σ0(0), σ0(0))) = σ0(0) (12)

DMACC John M. Gillespie 72

Computations as deductions

Axioms

σ1(0, x2) = x2 (1)σ1(σ0(x1), x2) = σ0(σ1(x1, x2)) (2)σ2(0, x2) = 0 (3)σ2(σ0(x1), x2) = σ1(σ2(x1, x2), x2) (4)

n(1, 2) σ1(0, σ0(x2)) = σ0(x2) (5)z(5, 2) σ1(0, σ0(0)) = σ0(0) (6)n(4, 2) σ2(σ0(x1), σ0(x2)) = σ1(σ2(x1, σ0(x2)), σ0(x2)) (7)z(7, i) σ2(σ0(0), σ0(0)) = σ1(σ2(0, σ0(0)), σ0(0)) (8)n(3, 2) σ2(0, σ0(x2)) = 0 (9)z(9, 2) σ2(0, σ0(0)) = 0 (10)

sub(10, 8) σ2(σ0(0), σ0(0))) = σ1(0, σ0(0)) (11)sub(6, 11) σ2(σ0(0), σ0(0))) = σ0(0) (12)

DMACC John M. Gillespie 73

Computations as deductions

Axioms

σ1(0, x2) = x2 (1)σ1(σ0(x1), x2) = σ0(σ1(x1, x2)) (2)σ2(0, x2) = 0 (3)σ2(σ0(x1), x2) = σ1(σ2(x1, x2), x2) (4)

n(1, 2) σ1(0, σ0(x2)) = σ0(x2) (5)z(5, 2) σ1(0, σ0(0)) = σ0(0) (6)n(4, 2) σ2(σ0(x1), σ0(x2)) = σ1(σ2(x1, σ0(x2)), σ0(x2)) (7)z(7, i) σ2(σ0(0), σ0(0)) = σ1(σ2(0, σ0(0)), σ0(0)) (8)n(3, 2) σ2(0, σ0(x2)) = 0 (9)z(9, 2) σ2(0, σ0(0)) = 0 (10)sub(10, 8) σ2(σ0(0), σ0(0))) = σ1(0, σ0(0)) (11)

sub(6, 11) σ2(σ0(0), σ0(0))) = σ0(0) (12)

DMACC John M. Gillespie 74

Computations as deductions

Axioms

σ1(0, x2) = x2 (1)σ1(σ0(x1), x2) = σ0(σ1(x1, x2)) (2)σ2(0, x2) = 0 (3)σ2(σ0(x1), x2) = σ1(σ2(x1, x2), x2) (4)

n(1, 2) σ1(0, σ0(x2)) = σ0(x2) (5)z(5, 2) σ1(0, σ0(0)) = σ0(0) (6)n(4, 2) σ2(σ0(x1), σ0(x2)) = σ1(σ2(x1, σ0(x2)), σ0(x2)) (7)z(7, i) σ2(σ0(0), σ0(0)) = σ1(σ2(0, σ0(0)), σ0(0)) (8)n(3, 2) σ2(0, σ0(x2)) = 0 (9)z(9, 2) σ2(0, σ0(0)) = 0 (10)sub(10, 8) σ2(σ0(0), σ0(0))) = σ1(0, σ0(0)) (11)sub(6, 11) σ2(σ0(0), σ0(0))) = σ0(0) (12)

DMACC John M. Gillespie 75

Key component of the Kleene normal form

The Kleene operator

Given a function τ(a1, ..., ar , n) in which for every ~a there exists ann such that τ(~a, n) = 0 we can define a new function ϕ(~a).

ϕ(a1, ..., ar ) = µj [τ(a1, ..., ar ) = 0]

This is the unbounded search.

limB→∞

B∑i=0

i∏j=0

τ(~a, j)sg

We will use this Kleene operator later to search throughcomputations.

DMACC John M. Gillespie 76

Key component of the Kleene normal form

The Kleene operator

Given a function τ(a1, ..., ar , n) in which for every ~a there exists ann such that τ(~a, n) = 0 we can define a new function ϕ(~a).

ϕ(a1, ..., ar ) = µj [τ(a1, ..., ar ) = 0]

This is the unbounded search.

limB→∞

B∑i=0

i∏j=0

τ(~a, j)sg

We will use this Kleene operator later to search throughcomputations.

DMACC John M. Gillespie 77

Key component of the Kleene normal form

The Kleene operator

Given a function τ(a1, ..., ar , n) in which for every ~a there exists ann such that τ(~a, n) = 0 we can define a new function ϕ(~a).

ϕ(a1, ..., ar ) = µj [τ(a1, ..., ar ) = 0]

This is the unbounded search.

limB→∞

B∑i=0

i∏j=0

τ(~a, j)sg

We will use this Kleene operator later to search throughcomputations.

DMACC John M. Gillespie 78

Key component of the Kleene normal form

The Kleene operator

Given a function τ(a1, ..., ar , n) in which for every ~a there exists ann such that τ(~a, n) = 0 we can define a new function ϕ(~a).

ϕ(a1, ..., ar ) = µj [τ(a1, ..., ar ) = 0]

This is the unbounded search.

limB→∞

B∑i=0

i∏j=0

τ(~a, j)sg

We will use this Kleene operator later to search throughcomputations.

DMACC John M. Gillespie 79

The Kleene operator as a general recursive function

Suppose a function τ(a1, ..., ar , n) is already given. We define anew function σ.

I σ(j , a1, ..., ar , 0) = j

I σ(j , a1, ..., ar , n + 1) = σ(j + 1, a1, ..., ar , τ(a1, ..., ar , j + 1))

Then µj [τ(a1, ..., ar , j) = 0] = σ(0, a1, ..., ar , τ(a1, ..., ar , 0)).

DMACC John M. Gillespie 80

The Kleene operator as a general recursive function

Suppose a function τ(a1, ..., ar , n) is already given. We define anew function σ.

I σ(j , a1, ..., ar , 0) = j

I σ(j , a1, ..., ar , n + 1) = σ(j + 1, a1, ..., ar , τ(a1, ..., ar , j + 1))

Then µj [τ(a1, ..., ar , j) = 0] = σ(0, a1, ..., ar , τ(a1, ..., ar , 0)).

DMACC John M. Gillespie 81

Kleene’s theorem states that any general recursive functionϕ can be put in the form

ϕ = ψ(µ[τ ])

where µ is the Kleene operator and ψ and τ are primitiverecursive.

I This is the normal form we wish to prove exists.

I This proves the Kleene operator cannot be primitive recursive.

I This also proves that if we augment the class PR with theKleene operator this yields the class of all computablefunctions.

DMACC John M. Gillespie 82

Kleene’s theorem states that any general recursive functionϕ can be put in the form

ϕ = ψ(µ[τ ])

where µ is the Kleene operator and ψ and τ are primitiverecursive.

I This is the normal form we wish to prove exists.

I This proves the Kleene operator cannot be primitive recursive.

I This also proves that if we augment the class PR with theKleene operator this yields the class of all computablefunctions.

DMACC John M. Gillespie 83

Kleene’s theorem states that any general recursive functionϕ can be put in the form

ϕ = ψ(µ[τ ])

where µ is the Kleene operator and ψ and τ are primitiverecursive.

I This is the normal form we wish to prove exists.

I This proves the Kleene operator cannot be primitive recursive.

I This also proves that if we augment the class PR with theKleene operator this yields the class of all computablefunctions.

DMACC John M. Gillespie 84

Kleene’s theorem states that any general recursive functionϕ can be put in the form

ϕ = ψ(µ[τ ])

where µ is the Kleene operator and ψ and τ are primitiverecursive.

I This is the normal form we wish to prove exists.

I This proves the Kleene operator cannot be primitive recursive.

I This also proves that if we augment the class PR with theKleene operator this yields the class of all computablefunctions.

DMACC John M. Gillespie 85

Arithmetization of computations

We begin with the basic Godel numbering of symbols.

Individual symbol Godel numberσn 2n + 2, n = 0, 1, ...0 1= 3( 5) 7, 9xn 2n + 9, n = 1, 2, ...

By Godel numbering the symbols used in computations we canemploy standard arithmetic to sort through sets of computations.Furthermore we can hone in on those computations which areactually correct.

DMACC John M. Gillespie 86

Arithmetization of computations

We begin with the basic Godel numbering of symbols.

Individual symbol Godel numberσn 2n + 2, n = 0, 1, ...0 1= 3( 5) 7, 9xn 2n + 9, n = 1, 2, ...

By Godel numbering the symbols used in computations we canemploy standard arithmetic to sort through sets of computations.

Furthermore we can hone in on those computations which areactually correct.

DMACC John M. Gillespie 87

Arithmetization of computations

We begin with the basic Godel numbering of symbols.

Individual symbol Godel numberσn 2n + 2, n = 0, 1, ...0 1= 3( 5) 7, 9xn 2n + 9, n = 1, 2, ...

By Godel numbering the symbols used in computations we canemploy standard arithmetic to sort through sets of computations.Furthermore we can hone in on those computations which areactually correct.

DMACC John M. Gillespie 88

More on Godel numbers

Some examples of symbol sequences and their Godel numbers.

Example

1. σ0(0) has Godel number p21p

52p

13p

74

2. σ0(σ0(0)) has Godel number p21p

52p

23p

54p

15p

76p

77

3. σ2(x1) = x1 has Godel number p41p

52p

113 p7

4p35p

116

4. σ0(xi ) has Godel number p21p

52p

2i+93 p7

4

DMACC John M. Gillespie 89

More on Godel numbers

Some examples of symbol sequences and their Godel numbers.

Example

1. σ0(0) has Godel number p21p

52p

13p

74

2. σ0(σ0(0)) has Godel number p21p

52p

23p

54p

15p

76p

77

3. σ2(x1) = x1 has Godel number p41p

52p

113 p7

4p35p

116

4. σ0(xi ) has Godel number p21p

52p

2i+93 p7

4

DMACC John M. Gillespie 90

More on Godel numbers

Some examples of symbol sequences and their Godel numbers.

Example

1. σ0(0) has Godel number p21p

52p

13p

74

2. σ0(σ0(0)) has Godel number p21p

52p

23p

54p

15p

76p

77

3. σ2(x1) = x1 has Godel number p41p

52p

113 p7

4p35p

116

4. σ0(xi ) has Godel number p21p

52p

2i+93 p7

4

DMACC John M. Gillespie 91

More on Godel numbers

Some examples of symbol sequences and their Godel numbers.

Example

1. σ0(0) has Godel number p21p

52p

13p

74

2. σ0(σ0(0)) has Godel number p21p

52p

23p

54p

15p

76p

77

3. σ2(x1) = x1 has Godel number p41p

52p

113 p7

4p35p

116

4. σ0(xi ) has Godel number p21p

52p

2i+93 p7

4

DMACC John M. Gillespie 92

Godel numbering a computation

This is the first example computation.

Axioms

{q1 := p4

1p52p

13p

94p

135 p7

6p37p

138

. . .

Deductions

q3 := p4

1p52 . . . p

1313p

714

...q7 := p4

1p52 . . . p

719p

720

The entire computation is encoded in the Godel numberpq1

1 pq22 . . . pq7

7 .

DMACC John M. Gillespie 93

Basic strategy

I Every computation is assigned a Godel number pe11 pe2

2 . . . pell .

I Each exponent ei is the Godel number of an equation.

I The first A equations e1,...,eA are the axioms.

I The rest eA+1,...,el are expected to be deductions fromprevious equations.

I We require functions which can detect such deductions.

DMACC John M. Gillespie 94

Basic strategy

I Every computation is assigned a Godel number pe11 pe2

2 . . . pell .

I Each exponent ei is the Godel number of an equation.

I The first A equations e1,...,eA are the axioms.

I The rest eA+1,...,el are expected to be deductions fromprevious equations.

I We require functions which can detect such deductions.

DMACC John M. Gillespie 95

Basic strategy

I Every computation is assigned a Godel number pe11 pe2

2 . . . pell .

I Each exponent ei is the Godel number of an equation.

I The first A equations e1,...,eA are the axioms.

I The rest eA+1,...,el are expected to be deductions fromprevious equations.

I We require functions which can detect such deductions.

DMACC John M. Gillespie 96

Basic strategy

I Every computation is assigned a Godel number pe11 pe2

2 . . . pell .

I Each exponent ei is the Godel number of an equation.

I The first A equations e1,...,eA are the axioms.

I The rest eA+1,...,el are expected to be deductions fromprevious equations.

I We require functions which can detect such deductions.

DMACC John M. Gillespie 97

Basic strategy

I Every computation is assigned a Godel number pe11 pe2

2 . . . pell .

I Each exponent ei is the Godel number of an equation.

I The first A equations e1,...,eA are the axioms.

I The rest eA+1,...,el are expected to be deductions fromprevious equations.

I We require functions which can detect such deductions.

DMACC John M. Gillespie 98

Basic strategy

I Every computation is assigned a Godel number pe11 pe2

2 . . . pell .

I Each exponent ei is the Godel number of an equation.

I The first A equations e1,...,eA are the axioms.

I The rest eA+1,...,el are expected to be deductions fromprevious equations.

I We require functions which can detect such deductions.

DMACC John M. Gillespie 99

Basic strategy

I We will construct a primitive recursive function τ1 such thatτ1(ω, i) = 0 if and only if ei = z(j , k) for j < i in thecomputation ω.

I

(∃j∃k)[ (j < i) ∧ (k < ω) ∧ (ei = z(j , k)) ]

I We will construct similar primitive recursive functions τ2 andτ3 for the other deduction steps n and sub.

I Then τ1(ω, i)τ2(ω, i)τ3(ω, i) will equal zero if and only if theith equation of ω is some proper deduction.

DMACC John M. Gillespie 100

Basic strategy

I We will construct a primitive recursive function τ1 such thatτ1(ω, i) = 0 if and only if ei = z(j , k) for j < i in thecomputation ω.

I

(∃j∃k)[ (j < i) ∧ (k < ω) ∧ (ei = z(j , k)) ]

I We will construct similar primitive recursive functions τ2 andτ3 for the other deduction steps n and sub.

I Then τ1(ω, i)τ2(ω, i)τ3(ω, i) will equal zero if and only if theith equation of ω is some proper deduction.

DMACC John M. Gillespie 101

Basic strategy

I We will construct a primitive recursive function τ1 such thatτ1(ω, i) = 0 if and only if ei = z(j , k) for j < i in thecomputation ω.

I

(∃j∃k)[ (j < i) ∧ (k < ω) ∧ (ei = z(j , k)) ]

I We will construct similar primitive recursive functions τ2 andτ3 for the other deduction steps n and sub.

I Then τ1(ω, i)τ2(ω, i)τ3(ω, i) will equal zero if and only if theith equation of ω is some proper deduction.

DMACC John M. Gillespie 102

Basic strategy

I We will construct a primitive recursive function τ1 such thatτ1(ω, i) = 0 if and only if ei = z(j , k) for j < i in thecomputation ω.

I

(∃j∃k)[ (j < i) ∧ (k < ω) ∧ (ei = z(j , k)) ]

I We will construct similar primitive recursive functions τ2 andτ3 for the other deduction steps n and sub.

I Then τ1(ω, i)τ2(ω, i)τ3(ω, i) will equal zero if and only if theith equation of ω is some proper deduction.

DMACC John M. Gillespie 103

Admissable deduction step z

Substituting zero for the variable xi in the equation e altarsthe Godel number as follows.

z(e, i) =

long(e)∏j=1

pj

1 if expj(e) = 2i + 9expj(e) else

This function is primitive recursive.

DMACC John M. Gillespie 104

Admissable deduction step z

Substituting zero for the variable xi in the equation e altarsthe Godel number as follows.

z(e, i) =

long(e)∏j=1

pj

1 if expj(e) = 2i + 9expj(e) else

This function is primitive recursive.

DMACC John M. Gillespie 105

Admissable deduction step z

Substituting zero for the variable xi in the equation e altarsthe Godel number as follows.

z(e, i) =

long(e)∏j=1

pj

1 if expj(e) = 2i + 9expj(e) else

This function is primitive recursive.

DMACC John M. Gillespie 106

Admissable deduction step n

Substituting a non-zero value σ0(xi) in the variable xi ofequation e altars the Godel number as follows.

n(e, i) =

long(e)⊗j=1

{q if expj(e) = 2i + 9

pexpj(e)1 else

}

This function is primitive recursive. What is q?

DMACC John M. Gillespie 107

Admissable deduction step n

Substituting a non-zero value σ0(xi) in the variable xi ofequation e altars the Godel number as follows.

n(e, i) =

long(e)⊗j=1

{q if expj(e) = 2i + 9

pexpj(e)1 else

}

This function is primitive recursive. What is q?

DMACC John M. Gillespie 108

Admissable deduction step n

Substituting a non-zero value σ0(xi) in the variable xi ofequation e altars the Godel number as follows.

n(e, i) =

long(e)⊗j=1

{q if expj(e) = 2i + 9

pexpj(e)1 else

}

This function is primitive recursive.

What is q?

DMACC John M. Gillespie 109

Admissable deduction step n

Substituting a non-zero value σ0(xi) in the variable xi ofequation e altars the Godel number as follows.

n(e, i) =

long(e)⊗j=1

{q if expj(e) = 2i + 9

pexpj(e)1 else

}

This function is primitive recursive. What is q?

DMACC John M. Gillespie 110

Useful formulas

If m is the Godel number of an equation then eq(m) locates theequality sign.

eq(m) = µj[j ≤ long(m) ∧ expj(m) = 3]

Bounded search =⇒ PR.

eq(m) = 1 +

long(m)∑i=1

i∏j=1

sg(sg(expj(m) ·− 3) + sg(3 ·− expj(m))

)

DMACC John M. Gillespie 111

Useful formulas

If m is the Godel number of an equation then eq(m) locates theequality sign.

eq(m) = µj[j ≤ long(m) ∧ expj(m) = 3]

Bounded search =⇒ PR.

eq(m) = 1 +

long(m)∑i=1

i∏j=1

sg(sg(expj(m) ·− 3) + sg(3 ·− expj(m))

)

DMACC John M. Gillespie 112

Useful formulas

If m is the Godel number of an equation then β(m) denotes theGodel number of the left-hand side of the equation.

β(m) =

eq(m) ·−1∏j=1

pexpj (m)

j

DMACC John M. Gillespie 113

Useful formulas

Then the right-hand side of equation m which we denote by γ(m)is the following.

γ(m) =

long(m) ·−eq(m)∏j=1

pexpj+eq(m)(m)

j

DMACC John M. Gillespie 114

Does a given equation contain some term?

Here we are testing for a copy of β(m) in the expression nbeginning at location j + 1. Denote this predicate β(m, n, j).

long(β(m))∑i=1

sg( expi+j(n) ·− expi β(m) ) + sg( expi β(m) ·− expi+j(n) )

I Hence β(m, n, j) = 0 iff expi (β(m)) = expi+j(n) for every1 ≤ i ≤ long(β(m)).

I So β(m, n, j) = 0 iff the expression for n contains theexpression for β(m) precisely after the jth symbol.

I Note that β(m, n, j) 6= 0 if long(n)− j < long(β(m)).

DMACC John M. Gillespie 115

Does a given equation contain some term?

Here we are testing for a copy of β(m) in the expression nbeginning at location j + 1. Denote this predicate β(m, n, j).

long(β(m))∑i=1

sg( expi+j(n) ·− expi β(m) ) + sg( expi β(m) ·− expi+j(n) )

I Hence β(m, n, j) = 0 iff expi (β(m)) = expi+j(n) for every1 ≤ i ≤ long(β(m)).

I So β(m, n, j) = 0 iff the expression for n contains theexpression for β(m) precisely after the jth symbol.

I Note that β(m, n, j) 6= 0 if long(n)− j < long(β(m)).

DMACC John M. Gillespie 116

Does a given equation contain some term?

Here we are testing for a copy of β(m) in the expression nbeginning at location j + 1. Denote this predicate β(m, n, j).

long(β(m))∑i=1

sg( expi+j(n) ·− expi β(m) ) + sg( expi β(m) ·− expi+j(n) )

I Hence β(m, n, j) = 0 iff expi (β(m)) = expi+j(n) for every1 ≤ i ≤ long(β(m)).

I So β(m, n, j) = 0 iff the expression for n contains theexpression for β(m) precisely after the jth symbol.

I Note that β(m, n, j) 6= 0 if long(n)− j < long(β(m)).

DMACC John M. Gillespie 117

Does a given equation contain some term?

Here we are testing for a copy of β(m) in the expression nbeginning at location j + 1. Denote this predicate β(m, n, j).

long(β(m))∑i=1

sg( expi+j(n) ·− expi β(m) ) + sg( expi β(m) ·− expi+j(n) )

I Hence β(m, n, j) = 0 iff expi (β(m)) = expi+j(n) for every1 ≤ i ≤ long(β(m)).

I So β(m, n, j) = 0 iff the expression for n contains theexpression for β(m) precisely after the jth symbol.

I Note that β(m, n, j) 6= 0 if long(n)− j < long(β(m)).

DMACC John M. Gillespie 118

The binary function eq(m, n)

We will use eq also to denote the binary function given below.

eq(m, n) = sg(m ·− n) + sg(n ·−m)

Hence eq(m, n) = 0 if and only if m = n. Then

long(β(m))∑i=1

sg( expi+j(n) ·− expi β(m) ) + sg( expi β(m) ·− expi+j(n) )

simplifies to

β(m, n, j) =

long(β(m))∑i=1

eq(expi+j(n), expi β(m)).

DMACC John M. Gillespie 119

The binary function eq(m, n)

We will use eq also to denote the binary function given below.

eq(m, n) = sg(m ·− n) + sg(n ·−m)

Hence eq(m, n) = 0 if and only if m = n.

Then

long(β(m))∑i=1

sg( expi+j(n) ·− expi β(m) ) + sg( expi β(m) ·− expi+j(n) )

simplifies to

β(m, n, j) =

long(β(m))∑i=1

eq(expi+j(n), expi β(m)).

DMACC John M. Gillespie 120

The binary function eq(m, n)

We will use eq also to denote the binary function given below.

eq(m, n) = sg(m ·− n) + sg(n ·−m)

Hence eq(m, n) = 0 if and only if m = n. Then

long(β(m))∑i=1

sg( expi+j(n) ·− expi β(m) ) + sg( expi β(m) ·− expi+j(n) )

simplifies to

β(m, n, j) =

long(β(m))∑i=1

eq(expi+j(n), expi β(m)).

DMACC John M. Gillespie 121

The binary function eq(m, n)

We will use eq also to denote the binary function given below.

eq(m, n) = sg(m ·− n) + sg(n ·−m)

Hence eq(m, n) = 0 if and only if m = n. Then

long(β(m))∑i=1

sg( expi+j(n) ·− expi β(m) ) + sg( expi β(m) ·− expi+j(n) )

simplifies to

β(m, n, j) =

long(β(m))∑i=1

eq(expi+j(n), expi β(m)).

DMACC John M. Gillespie 122

Admissable deduction step sub

Substituting γ(m) for β(m) in equation n altars it’s Godelnumber as follows.

If β(m, n, j) = 0 then

sub(m, n, j) =

j∏i=1

pexpi (n)i ∗ γ(m) ∗

long(n) ·−(j+longβ(m))∏i=1

pexpj+longβ(m)+i(n)

i

otherwise sub(m, n, j) = n.

This is a primitive recursive function.

DMACC John M. Gillespie 123

Admissable deduction step sub

Substituting γ(m) for β(m) in equation n altars it’s Godelnumber as follows.

If β(m, n, j) = 0 then

sub(m, n, j) =

j∏i=1

pexpi (n)i ∗ γ(m) ∗

long(n) ·−(j+longβ(m))∏i=1

pexpj+longβ(m)+i(n)

i

otherwise sub(m, n, j) = n.

This is a primitive recursive function.

DMACC John M. Gillespie 124

Valid deduction

The natural number ω is the Godel number of a valid deduction iffor every i ≤ long(ω) one of the following is true;

I expi (ω) is the Godel number of one of the defining equations.

I There exists j < i and some k such thatexpi (ω) = z(expj(ω), k).

I There exists j < i and some k such thatexpi (ω) = n(expj(ω), k)).

I ∃m, n < i and j where expi (ω) = sub(expm(ω), expn(ω), j)).

DMACC John M. Gillespie 125

Valid deduction

The natural number ω is the Godel number of a valid deduction iffor every i ≤ long(ω) one of the following is true;

I expi (ω) is the Godel number of one of the defining equations.

I There exists j < i and some k such thatexpi (ω) = z(expj(ω), k).

I There exists j < i and some k such thatexpi (ω) = n(expj(ω), k)).

I ∃m, n < i and j where expi (ω) = sub(expm(ω), expn(ω), j)).

DMACC John M. Gillespie 126

Valid deduction

The natural number ω is the Godel number of a valid deduction iffor every i ≤ long(ω) one of the following is true;

I expi (ω) is the Godel number of one of the defining equations.

I There exists j < i and some k such thatexpi (ω) = z(expj(ω), k).

I There exists j < i and some k such thatexpi (ω) = n(expj(ω), k)).

I ∃m, n < i and j where expi (ω) = sub(expm(ω), expn(ω), j)).

DMACC John M. Gillespie 127

Valid deduction

The natural number ω is the Godel number of a valid deduction iffor every i ≤ long(ω) one of the following is true;

I expi (ω) is the Godel number of one of the defining equations.

I There exists j < i and some k such thatexpi (ω) = z(expj(ω), k).

I There exists j < i and some k such thatexpi (ω) = n(expj(ω), k)).

I ∃m, n < i and j where expi (ω) = sub(expm(ω), expn(ω), j)).

DMACC John M. Gillespie 128

Valid deduction

Let τ1(ω, i) denote the predicate

(∃j∃k)[ (j < i) ∧ (k ≤ ω) ∧ eq(expi ω, z(expj ω, k)) ]

I Thus τ1(ω, i) is primitive recursive and, as formulated below,equals zero iff the property holds true.

τ1(ω, i) =i ·−1∏j=1

ω∏k=1

eq( expi ω, z(expj ω, k) )

DMACC John M. Gillespie 129

Valid deduction

Let τ1(ω, i) denote the predicate

(∃j∃k)[ (j < i) ∧ (k ≤ ω) ∧ eq(expi ω, z(expj ω, k)) ]

I Thus τ1(ω, i) is primitive recursive and, as formulated below,equals zero iff the property holds true.

τ1(ω, i) =i ·−1∏j=1

ω∏k=1

eq( expi ω, z(expj ω, k) )

DMACC John M. Gillespie 130

Valid deduction

Let τ2(ω, i) denote the predicate

(∃j∃k)[ (j < i) ∧ (k ≤ ω) ∧ eq(expi ω,n(expj ω, k)) ]

I Thus τ2(ω, i) is primitive recursive and, as formulated below,equals zero iff the property holds true.

τ2(ω, i) =i ·−1∏j=1

ω∏k=1

eq( expi ω,n(expj ω, k) )

DMACC John M. Gillespie 131

Valid deduction

Let τ2(ω, i) denote the predicate

(∃j∃k)[ (j < i) ∧ (k ≤ ω) ∧ eq(expi ω,n(expj ω, k)) ]

I Thus τ2(ω, i) is primitive recursive and, as formulated below,equals zero iff the property holds true.

τ2(ω, i) =i ·−1∏j=1

ω∏k=1

eq( expi ω,n(expj ω, k) )

DMACC John M. Gillespie 132

Valid deduction

Let τ3(ω, i) denote the predicate

(∃m)(∃n)(∃j)[ (m, n < i) ∧ (j ≤ long(n)) ∧ expi ω = sub(expm ω, expn ω, j) ]

I Thus τ3(ω, i) is primitive recursive and, as formulated below,equals zero iff the property holds true.

τ3(ω, i) =i ·−1∏m=1

i ·−1∏n=1

long(n)∏j=1

eq(expi ω, sub(expm ω, expn ω, j))

DMACC John M. Gillespie 133

Valid deduction

Let τ3(ω, i) denote the predicate

(∃m)(∃n)(∃j)[ (m, n < i) ∧ (j ≤ long(n)) ∧ expi ω = sub(expm ω, expn ω, j) ]

I Thus τ3(ω, i) is primitive recursive and, as formulated below,equals zero iff the property holds true.

τ3(ω, i) =i ·−1∏m=1

i ·−1∏n=1

long(n)∏j=1

eq(expi ω, sub(expm ω, expn ω, j))

DMACC John M. Gillespie 134

Useful formula

The symbol sequence σ0(0) represents the natural number oneand in general if σn

0 (0) then σ0(σn0 (0)) represents n + 1.

The Godel numbers of these expressions have a primitiverecursive formula.

ζ(0) = p11 and ζ(n + 1) = p2

1p52 ∗ ζ(n) ∗ p7

1

DMACC John M. Gillespie 135

Useful formula

The symbol sequence σ0(0) represents the natural number oneand in general if σn

0 (0) then σ0(σn0 (0)) represents n + 1.

The Godel numbers of these expressions have a primitiverecursive formula.

ζ(0) = p11 and ζ(n + 1) = p2

1p52 ∗ ζ(n) ∗ p7

1

DMACC John M. Gillespie 136

Useful formula

The symbol sequence σ0(0) represents the natural number oneand in general if σn

0 (0) then σ0(σn0 (0)) represents n + 1.

The Godel numbers of these expressions have a primitiverecursive formula.

ζ(0) = p11 and ζ(n + 1) = p2

1p52 ∗ ζ(n) ∗ p7

1

DMACC John M. Gillespie 137

The valid deduction of ϕ(a1, ..., ar)

Let τ4(a1, ..., ar , ω) denote the predicate

(∃a)[ (a < γ(explongω(ω)) ∧ eq(explongω(ω),Φ(a)) ]

I Where Φ(a) := p2s+91 p5

2 ∗ ζ(a1) ∗ . . . ∗ ζ(ar ) ∗ p71p

32 ∗ ζ(a))

τ4(a1, ..., ar , ω) =

γ(explongω(ω))∏a=0

eq(explongω(ω),Φ(a))

DMACC John M. Gillespie 138

The valid deduction of ϕ(a1, ..., ar)

Let τ4(a1, ..., ar , ω) denote the predicate

(∃a)[ (a < γ(explongω(ω)) ∧ eq(explongω(ω),Φ(a)) ]

I Where Φ(a) := p2s+91 p5

2 ∗ ζ(a1) ∗ . . . ∗ ζ(ar ) ∗ p71p

32 ∗ ζ(a))

τ4(a1, ..., ar , ω) =

γ(explongω(ω))∏a=0

eq(explongω(ω),Φ(a))

DMACC John M. Gillespie 139

PR detection of a valid computation

Let τ(a1, ..., ar , ω) denote the following formula

long(ω)∑i=1+A

τ1(ω, i)τ2(ω, i)τ3(ω, i) + τ4(a1, ..., ar , ω)

I Thus ω is the Godel number of a valid computation of ϕ(~a) iffτ(a1, ..., ar , ω) = 0.

I The function µω[τ(a1, ..., ar , ω) = 0] denotes the unboundedsearch for a valid computation of ϕ(~a).

DMACC John M. Gillespie 140

PR detection of a valid computation

Let τ(a1, ..., ar , ω) denote the following formula

long(ω)∑i=1+A

τ1(ω, i)τ2(ω, i)τ3(ω, i) + τ4(a1, ..., ar , ω)

I Thus ω is the Godel number of a valid computation of ϕ(~a) iffτ(a1, ..., ar , ω) = 0.

I The function µω[τ(a1, ..., ar , ω) = 0] denotes the unboundedsearch for a valid computation of ϕ(~a).

DMACC John M. Gillespie 141

PR detection of a valid computation

Let τ(a1, ..., ar , ω) denote the following formula

long(ω)∑i=1+A

τ1(ω, i)τ2(ω, i)τ3(ω, i) + τ4(a1, ..., ar , ω)

I Thus ω is the Godel number of a valid computation of ϕ(~a) iffτ(a1, ..., ar , ω) = 0.

I The function µω[τ(a1, ..., ar , ω) = 0] denotes the unboundedsearch for a valid computation of ϕ(~a).

DMACC John M. Gillespie 142

Kleene normal form

Let ψ(ω) denote the function

µj [j < γ(explongω(ω)) ∧ ζ(j) = γ(explong(ω)(ω)) ]

Since j < γ(explongω(ω)) the function ψ is primitive recursive andfinally we have the normal form below.

ϕ = ψ(µω[τ(a1, ..., ar , ω) = 0])

Thus every GR function can be written as above where ψ is aPR function and τ is a PR predicate on which the Kleeneoperator acts.

DMACC John M. Gillespie 143

top related