-
Prove (without looking up Euclid’s proof) that there are infinitely many primes. Hint . See Example 2.1.2.40 and Exercise 2.1.2.42 .
-
Modify the pairing function of Grzegorczyk (1953) ( 2.1.4.5 ) to make it onto.
-
Give a direct proof that the J in 2.1.4.6 is 1-1.
-
Give a direct proof that the J in 2.1.4.8 is 1-1.
-
Show that J given by
is an onto pairing function in
. Show that its projections are in
. Hint . View
2 is the union of all the finite groups of pairs, for i = 0, 1, 2, . . . , G i = {〈 x , y 〉 ∈
2 : x + y = i } Now enumerate
2 by listing pairs 〈 x , y 〉, first, by ascending order (with respect to i ) of their group-number i , and then, within each group G i , listing them in ascending order of the y -component. Show that the position n = 0, 1, 2, . . . of 〈 x , y 〉 in this enumeration is precisely J ( x , y ), which settles onto-ness. Of course, projections K and L exist (why?). Now observe that J ( x , y ) ≥ x and J ( x , y ) ≥ y and use this fact to show that the projections K and L are primitive recursive. -
Prove that every finite set is primitive recursive.
-
Prove that
is primitive recursive. -
Verify the claims made in Remark 2.1.4.10 .
-
Prove that λ x . x ! (factorial) is primitive recursive.
-
Without using the if-then-else function or definition by cases, prove that λ xy . max( x , y ) and λ xy . min( x , y ) are primitive recursive.
-
Prove that if we know that (1) g is primitive recursive; (2) f (
) ≤ g (
), for all
; and (3) λ z
. z = f (
) is in
* , then f is primitive recursive. -
Are the conditions (1) and (2) above necessary in order to arrive to the same conclusion from just (3)?
-
What end-values do X , Y , Z , W hold in Example 2.2.0.13 if the variables initially hold, in order, a , b , c , d ?
-
Prove by an appropriate induction that the claim regarding the end-values of X and Y in 2.2.0.15 are correct.
-
Write a loop program that computes λ x . ⌊ x / k ⌋.
-
Write a loop program that computes λ x . rem ( x , k ).
-
Redo the previous two problems to ensure that you do not nest the Loop-end instructions.
-
Prove that the function λ x .║ x ║, where ║ x ║ here denotes the number of decimal digits of x ∈
, is in
. -
Define
Prove that
is closed under (
y ) ≤ z . -
Prove that if a class of functions
is closed under (
y )≤ z and substitution , then its corresponding class of relations
* = { f (
) = 0 : f ∈
} is closed under (∃ y )≤ z . -
Is the result of the previous exercise still valid if we replace (
y )≤ z by ( μy )≤ z ? -
Refer to Subsection 2.2.2 . Prove that neither of the two relations λ xy . f x ( y ) = 0 and λ xy . f x ( y ) ≠ 0 is primitive recursive.
-
Once again, refer to Subsection 2.2.2 where we constructed the “universal” two-argument function λ yx . f y ( x ) that enumerates all one-argument primitive recursive functions. Prove
-
For all λ x . h ( x ) ∈
, there is an m such that h ( x ) < f m ( x ), for all x . -
Base on the preceding bullet a new proof of the fact that λ yx . f y ( x ) ∉
-
For all λ x . h ( x ) ∈
-
Prove that it is impossible to form
as the closure under substitution of some finite set of primitive recursive functions. -
Prove that for n ≥ 0, we have A n ( x ) < A x (2) a.e. Use this fact to show
-
For all λ x . h ( x ) ∈
, we have h ( x ) < A x (2) a.e. -
λ x . A x (2) ∉
.
-
For all λ x . h ( x ) ∈
-
Suppose that x , y , z are distinct variables. Show that (∃ y ) (∃ x ) < z Q ≡ (∃ x ) < z (∃ y ) Q .
Hint . (∃ x ) < z Q ≡ (∃ x )( x < z ⋀ Q ). But unbounded ∃ commute. -
Show that the set K 0 defined as {〈 x , y 〉 :
x ( y ) ↓} is semi-computable. -
Prove the counterpart “definition by cases” theorem of 2.1.2.37 for
and
. The assumptions are:
(1) For the
case, all the f i are in
, while for the
case they all are in
.
(2) In both cases, the R i are in
* .
The result to prove is that the defined f is in
and
, respectively. -
In 2.5.0.17 we saw that λ x .
x ( x ) + 1 cannot be extended into a recursive (total) function. Prove that the same is true for λ x .
x ( x ). -
Show that the set K 1 defined as {[ x , y ] :
x ( y ) ↓} is semi-computable. -
Show that the set K 1 defined above is not recursive.
Hint. Caution: Do not confuse [ x , y ] with 〈 x , y 〉. K 1 is { z :
( z ) 0 (( z ) 1 ) ↓}—a set of numbers, not a set of pairs. -
Show 2.5.0.20 directly from 2.5.0.3 .
-
Explain precisely why the alternative “proof” of 2.5.0.7 that was suggested in the Pause following the corollary will not work.
-
Prove that λ ixy .Φ i ( x ) = y is primitive recursive.
-
Prove that neither
nor
are in
. This justifies our remarks in 2.5.0.30 that the best we can suggest as “output” in the “otherwise” case is ↑. In general. Why “in general”?
-
This exercise attempts to contradict 35. So let x ∈ K ≡
( x ) = 0 for some
∈
(cf. 2.5.0.6 ).
But then f ( x ) ≃ if
( x ) = 0 then 0 else 42 and g ( x ) ≃ if
( x ) = 0 then 0 else x , which prove—via 2.1.2.6 —that f and g are partial recursive. Is there something wrong with this, and if so what precisely? -
Prove that a non-empty set is c.e. iff it is the range of some recursive function.
Hint. One direction is trivial. -
Is the “proof” below correct? If not, where exactly does it go wrong?
“Let y = f (
) be r.e. Then y = f (
) ≡
( y ,
) = 0 for some
∈
. Thus g = λ
.( μy )
( y ,
) is in
. But g = f , since the unbounded search finds the y that makes y = f (
) true, if f (
) ↓. Thus, f ∈
.” -
Prove that if f and g are in
, then f ( x ) = g ( x ) is c.e. -
Prove that if f and g are in
, then f ( x ) ≃ g ( x ) is not necessarily c.e.
Hint. Choose carefully specific f and g for a definitive (non c.e.) example. -
Prove Corollary 2.7.1.10 .
-
Prove that the set {〈 x , y 〉 :
x =
y } is not semi-recursive. Thus, as expected (given the result 2.5.0.22 ), the general “equivalence problem” of (URM-) computable functions is also not semi-decidable.
Hint . Fix
y to a conveniently simple function. -
Prove, via Rice’s lemmata, that the set of
-indices of each computable function f is not c.e.
Hint. You may want to consider the total and nontotal cases separately.
The invocation of Rice’s theorem is not permitted in Exercises 44-54.
-
Prove that the problem {0, 1, 5} ⊆ ran(
x ) is undecidable. -
Prove that the set { x : W x = {0}} is not c.e.
-
Prove that the set { x : W x = {0, 1, 2}} is not c.e.
-
Prove that the set { x : W x =
} is not c.e. -
Prove that the set { x : W x ∈
* } is not c.e. -
Prove that the set { x : W x = the set of all even numbers} is not c.e.
-
Prove that the set { x : W x is finite} is not c.e.
-
Prove that the set { x : W x is infinite} is not c.e.
-
Prove that the set = { x : dom(
x ) has exactly two elements} is not recursive. Is it c.e.? Why? -
Explore and prove as needed
-
the set { x : ran(
x ) has exactly five distinct elements} is not recursive. (I.e., “ x ∈ A is unsolvable”). Is it c.e.? Why? -
the set { x :
x is the characteristic function of some recursive set} is not recursive. Is it c.e.? Why? -
the set { x : ran(
x ) contains only odd numbers} is not recursive. Is it c.e.? Why?
-
the set { x : ran(
-
Prove that { x :
x ∈
} is not c.e. -
Can every infinite c.e. set be enumerated in strictly increasing order by a primitive recursive function? Why?
Hint. Bring the Ackermann function into the question.
-
Let
f = λ x .if f R ( x ) = 0 then g ( x ) else if f Q ( x ) = 0 then h ( x ) else ↑
where R , Q are c.e. (and mutually exclusive), and g , h , f R , f Q are partial recursive, where R ( x ) ≡ f R ( x ) = 0 and Q ( x ) ≡ f Q ( x ) = 0.
Is f partial recursive? Why?
Is the f ′ defined below the same as f ? Why?
Suppose you answered “no” to the last question. Supplementary : Is f ′ partial recursive? Why?
-
Prove that there is a primitive recursive τ such that for all x, we have ran(
x ) = ran(
τ ( x ) ) and, moreover, if ran(
x ) ≠
, then ran(
τ ( x ) ) is total.
Hint. Combine 2.7.3.5 with 2.7.3.3 . -
There is a primitive recursive function r such that
— { x } = W r ( x ) , for all x .
Hint . Consider
( x , y ) ≃ if y ≠ x then 0 else ↑. -
There is a primitive recursive function q such that { x } = W q ( x ) , for all x .
-
There is a primitive recursive function k such that W x ⋃ W y = W k ( x , y ) , for all x and y .
-
(Selection Theorem) For each n ≥ 1 there is a partial recursive function λ i
n . Sel ( n +1) ( i ,
n ) such that
Hint. Imitate the dovetailing from the proof of 2.7.3.2 .
-
Is there a partial recursive function λ x . f ( x ) such that for all i
W i ≠
→ f ( i ) ↓ ⋀ f ( i ) = min{ y : y ∈ W i } If you think that “yes”, then you must give a proof.
If you think that “no”, then you must give a definitive counterexample.
-
For your amusement: Write a “self-reproducing” program in your favourite programming language. This program, on every input, will just print itself— exactly ; i.e., it prints nothing else—and then halts.
-
Prove that ≤ m and ≤ 1 are transitive relations.
-
Prove the claims made in 2.10.0.14 .
-
Prove that a simple set is not recursive.
Hint. You want the set’s complement to be c.e. (Why?) Can this be? -
If f , of one variable, is recursive then there is an e such that W e = W f ( e ) .
-
If g , of two variables, is recursive then there is an 1-1 primitive recursive λ x . h ( x ) such that W h ( x ) \= W g ( h ( x ), x ) , for all x .
Hint . From W a = dom(
a and 2.9.0.30 . -
Let f be recursive. Is any of { x :
f ( x ) ( x ) ↓ } and { x :
x ( f ( x )) ↓} a complete index set?
Hint. It depends on f . -
Let a F be a computable function. Then the closure of
⋃ { F } under composition, primitive recursion and unbounded search is a subset of
(indeed equal to it).
Hint. Do induction on said closure. -
Prove the uniqueness of solution of the recurrence for F in 2.9.1.7 .
-
Settle the unproved claims in Example 2.9.1.8 .
-
Let g be recursive. Show that
has a computable h -solution
that satisfies
, for all
k . -
Answer the question in the Pause on p. 229 .
-
Complete the proof given for 2.11.1.3 .
49 That is, the largest positive integer that is a common divisor of two given integers.
50 I will stress that even if this sounds like the “completeness theorem ” of logic—that states the provability of all universally true formulae—Church’s Thesis, existing in the realm of computability, is not a completeness result. It is just an empirical belief, rather than a provable result—unlike Gödel’s completeness theorem. For example, Kalmár (1957) and Péter (1967) have argued that it is conceivable that the intuitive concept of calculability may in the future be extended so much as to transcend the power of the various mathematical models of computation that we currently know.
51 The level is “higher” the more the programming language is distanced from machine-dependent details.
52 x →
means “ x is input to M ” and
→ x indicates “ x is output from M ”.
53 For each m -tuple
,
g 1 , ..., g n
(
) =
g 1 (
), ..., g n (
)
.
54 The identity function behaves with respect to composition like the number 1 does with respect to multiplication; as a “unit”. Cf. 1.8.25 .
55 In first-year university calculus we learn that “0 0 ” is an “indeterminate form”.
56 The symbol “⌊ x ⌋” is called the floor of x. It succeeds in the literature (with the same definition) the so-called “greatest integer function, [ x ]”, i.e., the integer part of the real number x.
57 The π-function plays a central role in number theory, figuring in the so-called prime number theorem. See, for example, LeVeque (1956).
58 In his proof that there are infinitely many primes.
59 The inclusion of f ( i ,
) in
renders all of H ( x ,
) undefined if f ( i ,
) ↑. In a set setting, the latter condition simply means that f ( i ,
) is not included in the set { f (0,
), f (1,
), ..., f ( x ,
)}
60 An equation for which we seek integer solutions only is called a Diophantine equation.
61 For example, take the logarithm base-2 for both sides.
62 Recall that we write g ( x , y , . . .) for g (
x , y , . . .
); cf. p. 43.
63 The precise syntax of variables will be given shortly, but even after this fact we will continue using signs such as X , A , Z′ ,
, to stand for variables —i.e., we will continue using metanotation.
64 Using the letter Q to stand for an instruction is consistent with clause (1).
65 One calls single-element sets singletons .
66 Of course, P and Q may—but don't have to—name the same string (loop program). The same holds for v i and v j : It is allowed to have i = j .
67 We will define URM computations explicitly in Section 2.3 . In the case of loop programs we have defined semantics that will characterize the set of computed functions without the need to define mathematically the concept of “computation” explicitly.
68 More generally, we could have chosen x i 1 , ..., x i r for input. Since renaming of variables is up to us we can avoid the ugly notational acrobatics that this choice entails.
69 Fix the ordering of Σ as listed in (1) on p. 131 . Lexicographic order is the resulting alphabetic order.
70 Note that z = [( z ) 0 ,…,( z ) lh ( z )∸1 ]. Since labels are positive, the last label is lh ( z ). A similar comment holds about “(∃ i , a ) ≤ z ( z ) L = [1, L + 1, i + 1, a ]”, etc. Why i + 1? Because the variables are X 1, X 11, X 111,…
71 The effect of “ L + 1 : X 1 k ← a ” on ID u =
L + 1, …
is to change L + 1 to L + 2 (effected by the factor 2) and change the current value of X 1 k , i.e., (μ) k —stored in the ID as a factor
, a factor that we remove by dividing μ by it—to a , this being stored in v as a factor
.
72 A “compiler” translates “high level” programs written in C, Pascal, etc., into machine language so they can be “understood” by a computer, and therefore be executed on given input data.
73 A pure unadulterated formalism also employs the purely syntactic (or formal) application of logic, based on appropriately chosen nonlogical axioms. In such mode of application of logic, meaning or semantics is redundant, although well-chosen mathematical/logical argot , as in Bourbaki (1966) and Tourlakis (2003a), may create the feeling that one argues pretty much as in “everyday mathematics”. As we have noted already in the Preface, while our use of logic is mathematically rigorous and correct, we do not insist on basing our reasoning on nonlogical axioms, e.g., such as those of Peano arithmetic.
74 Here the colloquialisms “easy to compute” and “hard to compute” are aliases for “primitive recursive” and “not primitive recursive”, respectively. This is a hopelessly coarse rendering of easy/hard and a much better gauge for the runtime complexity of a problem is on which side of O (2 n ) it lies. However, our gauge will have to do for now: All I want to leave you with is that for some functions it is easier to compute the graph—to the quantifiable extent that it is in
* —than the function itself, to the extent that it fails being primitive recursive.
75 To be precise, what we are proving is “(∀ n )(∀ x ) A n ( x ) > x + 1”. Thus, as we start on an induction on n , its I.H. is “(∀ x ) A n ( x ) > x + 1” for a fixed unspecified n .
76 To be precise, the step is to prove—from the basis and I.H.—“(∀ x ) A n + 1 ( x ) > x + 1” for the n that we fixed in the I.H. It turns out that this is best handled by induction on x .
77 The function that does the majorizing.
78 A n ( x ) = A n −1 ( A n ( x − 1)).
79 A term the reader surely is familiar with, from programming and discrete math courses.
80 Assuming that modus ponens is the only rule of inference, the proof a formula A depends, in general, on that of “earlier” formulae X → A and X , which in turn depend (require) earlier formulae each, and so on and so on, until we reach formulae that are axioms.
81 This is actually a technical term due to Blum (1967). See also Tourlakis (1984), Ch. 12.
82 The parenthetical qualifier is usually omitted.
83 A terminating one; cf. remark following the proof of 2.3.0.8.
84 We have used = rather than ⋍ throughout, since all expressions used in this display are defined.
85 Here 〈 x , y 〉
K 0 .
86 Here x
K .
87 Think of a “step” as the passage from one ID to the next.
88 Condition failed: Either because we did not let the computation
i ( x ) to go on long enough, or no terminating computation exists.
89 Actually, the URM formalism postdates the formulation of Church’s Thesis but is demonstrably equivalent to all the others.
90 Could have used output 0; either is fine.
91 One is normally less pedantic and rather than explicit function calls Z ( y ) and
( y ) writes 0 and ↑ respectively.
92 Cf. p. 45 .
93 Again note the “=” used for emphasis. The more general symbol ≃ would also be correct.
94 The empty function in this context
95 If h
C , then dom( h )
C * by definition; hence T
C * .
96 This statement is dependent on how the finite set is “given”, as the reader will see shortly (cf. 2.7.4.11 – 2.7.4.14 ).
97 0! = 1 and ( n + 1)! = n ! × ( n + 1).
98 Where this set is converted to a set of numbers, as we show how in Section 2.11 .
99 That is, for every such W x , we have S ∩ W x ≠
.
100 We cannot algorithmically focus on infinite W x only, since { x : W x is infinite} is not c.e. (cf. Exercise 2.12.51 ).
101 In this volume we apply logic informally , we announced on p. 2.
102 What makes arithmetic formal is its foundation on axioms and precise rules of logic, where the form of formulae, rules of inference and proofs matters.
103 A particularly famous choice of axioms is due to Peano—the so-called peano Arithmetic, for short “PA”. It has axioms that give the behavior of every nonlogical symbol, plus the induction axiom schema :
This “schema” (or form) gives one axiom for each choice of wff
.
104 A rigorous mathematical proof of the recursiveness of the set of all formulae over the alphabet ( B ) is not difficult, but is tedious. The reader who would like to see how this is done may refer to Tourlakis (2008).
105 Why not number the symbols in ( B ) by 0 through 14 and work base 15? Because we will have trouble with strings such as ¬0 < 0. The “digit” in the most significant position is (of value) 0 and we lose information as we pass to a numerical value. I.e., both ¬0 < 0 and 0 < 0 denote the same number.
106 If one decides to verify this carefully, he will find that f is in fact even primitive recursive.
107 The arithmetical relations have a lot of tolerance for variations in their definition: Sometimes as much as all of
* . is taken as the “initial” arithmetical relations. Sometimes as little as z = x + y and z = x · y . For technical convenience we have added the graph of exponentiation rather than choosing the most minimalist approach.
108 Gödel proved all this without the need to have exponentiation as a primitive operation in arithmetic. However, adopting this operation makes things considerably easier and, as mentioned earlier ( footnote 107 on p. 229 ), it does not change the set of arithmetical relations.
109 Again recall that x y is that of 2.1.2.14 , and x y +1 | z ≡ (∃ u )( u = y + 1 ⋀ x u | z ). On the other hand, x u | z ≡ (∃ w )( w = x u ⋀ w | z ).