Anda di halaman 1dari 5

PH340 Problem Set II Solutions

(1) [30 marks] Show that the following functions introduced in the development of the
arithmetization of syntax are primitive recursive: concat(s, t) (Open Logic, p. 78),
flatten(z) (Open Logic, p. 104), conj(x, y) = the code of the formula which is the conjunc-
tion of the formulas which are coded by x and y (i.e. conj(#(), #()) = #(( ))).

concat(s, t): Following the suggestion on Open Logic, p. 78 we first define an auxiliary
function hconcat(s, t, i) which returns the code of the sequence formed by concatenating
the first i elements of the sequence coded by t to that coded by s. Such a function may
be defined by primitive recursion as follows:
hconcat(s, t, 0) = s
hconcat(s, t, i + 1) = append(hconcat(s, t, x), (t)i )

Here append(s, a) is the function which returns returns the code of the sequence resulting
from appending the number a to the sequence coded by s and (s)i =df element(s, i) is the
function which returns the ith element of the sequence coded by s. (These are both also
defined on Open Logic p. 78.) Finally we define concat(s, t) = hconcat(s, t, len(t)) when
len(s) returns the length of the sequence coded by s (p. 77). concat(s, t) is primitive
recursive because it is the composition of primitive recursive functions.
flatten(z): Suppose z is the code of the sequence z1 , . . . , zn i.e. z = hz1 , . . . , zn i. In this
case the function flatten(z) is defined so that it returns the code of the sequence

z1 , #(,), z2 , #(,), . . . , #(,), zn

In the case that zi = #(ti ) i.e. zi is the Godel number of a term ti then flatten(z) =
h#(t1 ), #(,), #(t2 , #(,), . . . , #(,), #(tn )i = #(t1 ,t2 , . . . ,tn ). Since we have defined our
coding of finite sequences such that all numbers code finite sequence, we wish to define
flatten(z) so that it is defined for all z. Hence if z codes the empty sequence (i.e. z = 0)
then we should define flatten(z) so that it also codes the empty sequence i.e. flatten(z) =
0.
Note also that since the value of flatten(z) depends on the length of the sequence coded
by z we cannot define flatten(z) directly as hz1 , #(,), z2 , #(,), . . . , #(,), zn i but must
rather again define an auxiliary function which return hz1 , #(,), . . . , #(,), zi )i for each
i n i.e.
hflatten(z, 0) = 0
hflatten(z, i + 1) = append(append(flatten(z, i), #(,)), (z)i )

We may then define flatten(z) = hflatten(z, len(z)).


conj(x, y) The intention is that function is defined such that conj(#(), #()) = #((
)). However we give a definition which returns a value even if x and y are not the codes
of formulas. In this case, the definition can be given directly by composition as

conj(x, y) = concat(append(concat(h#(()i, x), #( )))), append(y, #()))


Note that the second application of concat(x, y) must be applied to to h#(()i (rather
than just #())) and x because both arguments to concat(x, y) are assumed to be codes
of sequences (rather than a code of a sequence and a number in the case of append(x, y)).
(2) [20 marks] Recall that x and y are twin primes just in case they are both prime and
y = x + 2 and that N extT winP rime(x) denotes the smallest y > x such that y and
y + 2 are twin primes. Also recall that the Twin Prime Conjecture states that there
are infinitely many twin primes. Show that the function N extT winP rime(x) is partial
recursive and that if the Twin Prime Conjecture is true, then N extT winP rime(x) is
total recursive.

Proof. Note that the relation T winP rime(y) =df P rime(y) P rime(y + 2) is primitive
recursive as it is the conjunction of primitive recursive relations. The function defined by
unbounded minimization as

N extT winP rime(x) = y.T winP rime(y, y + 2) x < y

is hence partial recursive. If the Twin Prime Conjecture is true, then for any x, there
exists y > x such that T winP rime(y) holds. In this case, N extT winP rime(x) will be
defined for all x N and will hence be a total recursive function.

(3) [50 marks] Recall that if t is a LA -term, then x < t(x) abbreviates x(x < t (x))
and x < t(x) abbreviates x(x < t (x)). We call x < t and x < t bounded
quantifiers. A LA -formula is called 0 if it is constructed from atomic formulas by
propositional operations (i.e. conjunction, disjunction, negation, and conditionals) and
bounded quantification where we additionally require that the term t does not contain
the variable x. For instance, the following formulas are all 0 : 0 = 0, 0 < 00 , (0 = 0 0 <
00 ), x < 10(x < x0 ). Finally, a formula is called 1 is of the form x(x) where (x)
is 0 .1

The goal of this exercise is to prove the following proposition, known as the 1 -completeness
of Q:

(?) If is a true 1 -sentence (i.e. N |= ), then Q ` .

NB: The following solution sketches are similar to (and based on) the detailed proof of the
1 -completeness of the system which is called Q in Computability and Logic (pp. 208-
210). (Note, however, that this is system is not the same as the theory called Q in Open
Logic. The relationship between the two is explained on pp. 216-217 in Computability
and Logic.)

a) Prove the following sequence of lemmas:

i) For all n, m N, if n = m, then Q ` n = m and if n 6= m, then Q ` n 6= m.


1
These notions are also defined in section 16.1 of Computability and Logic, wherein 0 formulas are
called rudimentary and 1 formulas are called -rudimentary.
Proof. Note that if n = m, then n = m are the same numeral 00 . . .0 (n-times). So
in this case, Q ` n = m by citing an identity axiom for first-order logic. If n 6= m,
then suppose that (without loss of generality) that n < m. In this case we may
reason in Q as follows: i) suppose for a contradiction n = m; ii) if n = 0, then
this statement is of the form 0 = 00 . . .0 (m-times), in which case a contradiction is
reached by instantiating x in axiom Q2 (i.e. x(0 6= x0 ) to m 1; iii) supposing
that n > 0, instantiate x and y in axiom Q1 (i.e. xy(x0 = y 0 x = y) to
n 1 and m 1 and use modus ponens to derive n 1 = m 1; iv) continue
this process to derive n 2 = m 2, n 3 = m 3, . . .until the value of the
first argument (i.e. n) has been reduced to 0; v) at this point a contradiction is
reached by instantiating m in Q2 to m n.

ii) For all n, m N, if n < m, then Q ` n < m and if m n, then Q ` (n < m).

Proof. By axiom Q8, Q ` n < m z(z 0 + n) = m. If we suppose that that


n < m, then there is a natural number p > 0 such that n + p = m. We can show
that Q ` n+p = m in the manner of the example on p. 209 in Computability and
Logic i.e. by using axiom Q5 to repeatedly move the instances of the symbol
0 0 0
which comprise the numeral p to the outside of the expression (n + p i) ...
(i times) until this expression is reduced to 0 and then citing axiom Q4. Since
0
p > 0, p is of the form p 1 and it thus follows that we can derive righthand side
of the relevant instance of Q8. n < m then follows by applying modus ponens.
Now suppose that m n. Then we can show that if we assume that n < m, it
follows by Q8 that n + z 0 = m and hence also (by repeated application of Q5 and
0
Q4) that n + z = m. But by reasoning in the same manner as part i), we can
0
now reach a contradiction by deriving n m = 0.

iii) Suppose that t ClT ermLA and that tN = n. Then Q ` t = n.

Proof. This is shown inductively on the structure of t. Note that if t = 0, then


N
0 = 0 and Q ` 0 = 0 by one of the identity axioms. Suppose t = t01 . Then the
statement t = n is equivalent to t01 = n where n 1. In this case, t1 = n 1
follows by the induction hypothesis and thus t01 = n follows by Q1. The case for
t = t1 + tn is exemplified by the case of 2 + 3 = 5 exhibited on p. 209. The case
for t = t1 t2 is analogous using axioms Q6 and Q7.

iv) For all atomic formulas, , : a) Q ` ( ) if and only if Q ` and Q ` ;


b) Q ` ( ) if and only if Q ` or Q ` ; c) Q ` ( ) if and only if
Q ` or Q ` ; d) Q ` ( ) if and only if Q ` and Q ` ; e)
Q ` iff Q 6` .

Proof. First note that an atomic sentence of LA is either of the form t1 = t2


or t2 < t2 where t1 , t2 ClT ermLA . Suppose t1 = t2 and that tN 1 = n and
tN
2 = m. Then by part iii), Q ` t1 = n and Q ` t2 = m. It thus follows that if
n = m, then since Q ` t1 = n and Q ` t2 = n, Q ` t1 = t2 by the transitivity
of identity. On the other hand, if n 6= m, then by part i), Q ` n 6= m. Thus
again by the transitivity of identity, Q ` t1 6= t2 . Thus Q correctly decides all
statements of the form t1 = t2 i.e. if N |= t1 = t2 , then Q ` t1 = t2 and if
N 6|= t1 = t2 , then Q ` t1 6= t2 .
Via similar a argument using parts ii) and iii), Q also correctly decides all state-
ments of the form t1 < t2 i.e. if N |= t1 < t2 , then Q ` t1 < t2 and if
N 6|= t1 < t2 , then Q ` (t1 < t2 ).
The proofs of the a) - e) are now all follow from simple proof theoretic observation
together with the correct decidability of statements of the form t1 = t2 and t1 < t2
in Q.
For part a) suppose that Q ` ( ). Then by -Elim, Q ` and Q ` .
Conversely if Q ` and Q ` then Q ` ( ) by -Intro.
For part b), suppose that Q ` ( ). It does not in general follow in this case
that Q ` or Q ` . Suppose, however, that Q 6` and Q 6` . Then since
and are atomic, it must be that that N 6|= and N 6|= . In this case, Q `
and Q ` (by correct decidability) and thus also (by propositional reasoning)
that Q ` ( ). But in this case, Q is inconsistent, contradicting that its
axioms are all true in N.
The other parts are similar.

v) For all closed terms t such that tN = m and formulas (x):


Q ` x < t(x) ((0) (1) . . . (m 1))
Q ` x < t(x) ((0) (1) . . . (m 1))

Proof. Recall that x < t(x) is an abbreviation for x(x < t (x)) and let
tN = m. Since Q ` t = m by part iii), in the first case we must hence show that

Q ` x(x < m (x)) ((0) (1) . . . (n 1))

This can be accomplished by first showing that for all m N

Q ` x(x < m x = 0 x = 1 . . . x = m)

(as on p. 209) and then reasoning in first-order logic. The second case is similar.

b) Using i) - v) show that by induction on that if 0 , if N |= , then Q ` .

Proof. Let 0 . We proceed by induction on to demonstrate both that if N |= ,


then Q ` and if N |= , then Q ` . If is atomic, then this is a consequence
by the first part of the proof of part iv). If is a propositional combination of and
, then this is a consequence of the second part of the proof of part iv). For instance,
suppose that N |= . Then N |= or N |= . But then by the induction
hypothesis Q ` or Q ` . Hence Q ` . Conversely, suppose that N 6|= .
Then N 6|= and N 6|= . But then by the induction hypothesis, Q ` and Q ` .
Hence Q ` ( ). Finally suppose that x < t(x), N |= x < t(x) and
that tN = m It hence follows that for all n < m, N |= (n) and thus (by the induction
hypothesis) that Q ` (n). But then Q ` (0) (1) . . . (m 1). Hence by
the first part of part v), Q ` x < t(x). Conversely, suppose that N 6|= x < t(x)
and that tN = m. Then N 6|= (n) for some n < m and (by the induction hypothesis)
Q ` (n). But then Q ` ((1) . . . (m 1)). But then Q ` x < t(x) by
the first part of part v). The case where x < t(x) is similar.

c) Using part c), prove (?).

Proof. Suppose that x(x) where (x) is 0 and that N |= x(x). But then
for some n N, N |= (n). Since (n) is true a true 0 -sentence, it follows from part
b) that Q ` (n). But then Q ` x(x) as well by -Intro.