1. Fix an alphabet Σ with m > 1 elements. Show that the following functions are in Cobham’s class
Σ (cf. 5.1.1.7 ):
(i) λ x.x
(ii) λ x .0
(iii) The left successors: λ x.d ∗ x , for all d
Σ
(iv) λ x.x R , where x R is the number whose m -adic notation is the reverse of that of x .
2. Fix an alphabet Σ with m > 1 elements. Show that Cobham’s class
Σ is closed under bounded left recursion on notation , that is, under the schema below, where the h , ( gd ) d
Σ, and B are in
Σ .
f (0,
n ) = h (
n )
f ( d ∗ x ,
n )= gd ( x ,
n , f ( x ,
n )), for all d
Σ
| f ( x ,
n )| ≤ | B ( x ,
n )|
Hint . (iv) of the preceding exercise helps.
3. Fix an alphabet Σ with m > 1 elements. Show that the following functions are in Cobham’s class
Σ :
(i) init = λ x.y , if x = y ∗ d , for some d
Σ. We define init (0) = 0.
(ii) last = λ x.d , if x = y ∗ d , for some d
Σ. We define last (0) = 0.
(iii) first = λ x.d , if x = d ∗ y , for some d
Σ. We define first (0) = 0.
(iv) tail = λ x.y , if x = d ∗ y , for some d
Σ. We define tail (0) = 0.
(v) λ xyz. if x = 0 then y else z .
(vi) λ x .1 ∸ x .
(vii) λ x.x ∸ 1.
(viii) ones = λ x .if x = 0 then 0 else the numerical value of
(ix) sub = λ xy .if | x | ≤ | y | then 0 else the numerical value of
(x) λ xy.x ∗ y (that is, the numerical value of the string x ∗ y ).
4. For any Σ we define
∗ to be the class of relations { f (
) = 0: f
}.
Now, fix an alphabet Σ with m > 1 elements. We define
5.3.0.52 Definition. We define the predicates xBy (“ x begins y ”), xEy (“ x ends y ”) and xPy (“ x is part of y ”) by (∃ z ) y = x ∗ z , (∃ z ) y = z ∗ x , (∃ z , w ) y = w∗x∗z respectively.
If R is a relation, then the notations (∃ y ) Bz R ,(∃ y ) Ez R , (∃ y ) Pz R , mean, respectively, (∃ y )( yBz ∧ R ), (∃ y )( yEz ∧ R ), (∃ y )( yPz ∧ R ). They are read in the obvious way, e.g., “there is a y that begins z such that R holds”. The quantifiers (∀ y ) Bz R , (∀ y )(∀ y ) Pz R are defined similarly.
With these concepts in mind, prove
(i)
∗ is closed under Boolean operations.
(ii)
∗ is closed under (∃ y ) Bz R .
(iii)
∗ is closed under (∃ y ) Ez R .
(iv)
∗ is closed under (∀ y ) Bz R .
(v)
∗ is closed under (∀ y ) Ez R .
Hint . We do not know yet whether either of the relations xBy or x = y are in
∗ . For (ii) you should offer a proof by direct bounded recursion on notation to define a function f
such that f ( z ,
) = 0 ≡ (∃ y ) Bz R ( y ,
). Your assumption will be that a function r
exists such that r ( y ,
) = 0 ≡ R ( y,
).
5. Fix an alphabet Σ with m > 1 elements. Show that the following relations are in
∗ .
(i) λ x.x = d , for all d
Σ.
(ii) λ x.tally d ( x ), for all d
Σ, where tally d ( x ) is true iff x =
, for n > 0.
(iii) λ xy .| x | ≤ | y |.
(iv) λ xy.x = y .
Hint . This is true iff x and y have the same length, and every prefix of x is also a prefix of y .
(v) λ xy.xBy , λ xy.xEy .
(vi) λ xyz.z = x ∗ y .
(vii) λ xy.xPy .
6. Fix an alphabet Σ with m > 1 elements. Show that
∗ . is closed under (∃ y ) Pz R and (∀ y ) Pz R .
7. 5.3.0.53 Definition. Let Q be a relation. We define the notation (max y ) Bz Q ( y ,
) and (max y ) Ez Q ( y ,
) by
if the max does not exist
and
if the max does not exist
Prove that if Q is in
∗ , then λ z
.(max y ) Bz Q ( y ,
) and λ z
.(max y ) Ez Q ( y ,
) are in
.
8. Fix an alphabet Σ with m > 1 elements. Let the expression maxtal d ( x ) denote the maximum length tally of d -symbols that is a substring of x . We let maxtal d (0) = 0.
Prove that λ xy.y = maxtal d ( x ) is in
∗ .
9. Fix an alphabet Σ with m > 1 elements.
Prove that the function λ x.maxtal d ( x ) is in
.
10. Fix an alphabet Σ with m > 1 elements.
Define a pairing function J ( x,y ) as
J ( x,y )
x ∗ 2 ∗ 1 ∗ maxtal 1 ( x ∗ 2 ∗ y ) ∗ 2 ∗ y
Prove that we have projections K and L in
. For all x and y , these satisfy K ( J ( x,y )) = x and L ( J ( x,y )) = y .
11. Use 5.3.9 to devise, for any fixed n > 1, a coding/decoding scheme
…
( n ) and
in
. Cf. 2.1.4.9 and 2.1.4.10 . Conclude that
is closed under simultaneous bounded (left and right) recursion on notation.
12. Devise, in (string-processing) URM pseudo code, an algorithm that will construct a CNF for any given formula
in poly-time with respect to |
|. Your algorithm will do the preprocessing and will then track the steps of the induction proof.
13. 3 SAT is the set of all satisfiable Boolean formulae written in CNF with clauses that each have length equal to 3 literals. Show that 3 SAT is
-complete by showing it in
and also showing that CSAT ≤ p 3 SAT .
Hint . Explore the last case of the I.S. of the induction presented in 5.1.3.2 , and see how it can be employed to transform any clause of n > 3 literals, l 1 ∨ l 2 ∨ … ∨ l n , in CNF with clause-length equal to 3, without affecting satsfiability.
14. Complete the proof in 5.2.0.6 .
15. Prove 5.2.0.11 .
16. Prove 5.2.0.13 .
17. Carry out the suggested induction proof in 5.2.0.18 .
18. Prove that the relations λ xy.x ≤ y , λ xy.x < y and λ xy.x = y are in
2 ,∗ and hence in
.
19. Prove that λ xy.x = y and λ xy.x ≠ y are in
.
20. Prove the case (3) of 5.2.0.30 .
21. Prove that all of g 0 , g 1 ,…, g n are in
n +1 , for n ≥ 0.
22. Prove that every loop program in L n with input variables
, has run time O (
(
)) for some k that depends on the program.
Hint . There is a trivial “trick” to measure the run time of a loop program, using a new variable. Then refer to 5.2.0.13 and note 5.2.0.18 .
23. Prove that the Kleene predicate T ( n ) (for any n ) is in
, and that the decoding function d is also in
3 .
Hint . Systematically scan the proof that T ( n )
∗ and d
given in 2.3.0.7 and modify it to obtain this sharper result.
In fact ,
24. Prove that T ( n )
and d
0 .
25. The restricted bounded summation of a function f is defined [Grzegorczyk (1953)] to be
Prove that
0 is closed under restricted bounded summation.
26. [Grzegorczyk (1953)] Prove that every c.e. set can be enumerated by an
0 -function.
27. [L. Kálmar (1943)] The class of elementary functions ,
, was defined by Kálmar as the closure of {λ xy.x + y , λ xy.x ∸ y } under substitution, bounded summation and bounded product ( 2.1.2.30 ).
Prove that
=
3 .
Hint . The ⊆ direction is practically trivial. For ⊇ you need a few tools:
-
contains λ xy.xy (use sum) and λ xy.x y (use product). -
contains λ xy.x (1 ∸ y ). -
∗ is closed under Boolean operations. -
is closed under (
y ) < z . Use the observation that (∀ i ) < z f ( i ,
) ≠ 0 iff Π i < z f ( i
) ≠ 0. Using Σ < z you can now compute the smallest y that makes f ( y ,
) zero. -
∗ is closed under bounded quantification (use product for the existential quantifier). -
is closed under definition by cases. - Simulate primitive recursion (bounded!) using the techniques from 2.11.1 .
28. Prove that
is not in
.
29. Prove that λ xy.x + y , λ xy.x ∸ y and λ xy.xy are in Cobham’s
.
Hint . Use the digit-by-digit “school method”.
30. Prove that an alternative definition of
is this: the closure of {λ xy.x + y, λ xy.x ∸ y , λ xy.x y } under substitution and bounded summation.
31. Prove that f
iff f is programmable on some URM that runs within time t
.
32. Prove that
∗ ⊂
∗.
138 In the standard URM the instructions x ← x + 1 and x ← a are primary. The instructions x ← y and goto L are derived .
139 If L were a numeric variable, then, of course, one could test for the condition L ≠ 0 (non-emptiness) since the number 0 corresponds to the string ∊. On the other hand, a “string stack”—like the described here “counter”—will not know when it is empty. We can get around this by initializing the stacks with a special “bottom” symbol. For example, $. Emptiness then is equivalent with $ being the top symbol.
140 A term that I borrowed from circuit design where two transistors are connected in push-pull mode if, in operation, and at any given instance in time, when one’s current goes down by a certain amount, the other’s increases by the same amount, and vice versa.
141 It turns out that deterministic (1-stack) PDA are strictly less powerful than the (1-stack) PDA.
142 Again, no circularity here!
143 A stack “underflow” is the state where a stack is empty and yet we attempt to pop.
144 The reader no doubt has noted that most proofs are nondeterministic!
145 Cf. also Papadimitriou (1994), where it is shown that a TM can simulate in polynomial time even an “augmented” URM that can access an unbounded number of registers via indirect addressing. Such a URM is called a random access machine in the literature, a RAM.
146 The symbol * denotes concatenation.
147 As far as I know, Cobham never published the complete proof.
148 “Sets” is the habitual term used for sets of numbers. “Languages” is preferred for sets of strings over some alphabet. The two concepts, as we know, are equivalent, and the nomenclature only reflects (momentarily) a point of view, not a difference of any import.
149 For n i \= 0, p ( n i ) means p.
150 qk cannot occupy location p ( n ).
151 qk cannot occupy a location to the left of 0.
152 Since logarithms of different bases are equal within a constant multiplier, there is no point to indicate the base.
153 On the other hand, if they are written in unary ( k written as a string of k 1-symbols), then each variable needs space O ( p ( n )) to be written down.
154 Dennis Ritchie.
155 For a given X the instruction “Loop X ” may appear several times. Each occurrence is associated with a new “ B ”.
156 To see this think of X as the output variable!
157 Of course, this denotes, for some C and D , the expression t h (
) + C Σ i < x t g ( i ,
, f ( i ,
)) + D .