-
Notifications
You must be signed in to change notification settings - Fork 1
/
exercises.tex
1502 lines (1318 loc) · 81.3 KB
/
exercises.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
% John Peloquin
% Exercises from Computability: An introduction to recursive function theory
\documentclass[letterpaper]{article}
\usepackage{amsmath,amssymb,amsthm,fourier,enumitem,xifthen}
\newcommand{\exercise}[2][]{\noindent\textbf{Exercise~{#2}}\ifthenelse{\isempty{#1}}{\textbf{.}}{ ({#1})\textbf{.}}}
\newcommand{\A}{\mathcal{A}}
\newcommand{\B}{\mathcal{B}}
\newcommand{\C}{\mathcal{C}}
\newcommand{\D}{\mathcal{D}}
\newcommand{\E}{\mathcal{E}}
\newcommand{\F}{\mathcal{F}}
\newcommand{\T}{\mathcal{T}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\PRR}{\mathcal{PR}}
\newcommand{\MUR}{\mathcal{R}_0}
\newcommand{\PAR}{\mathcal{R}}
\renewcommand{\P}{\mathcal{P}}
\newcommand{\union}{\cup}
\newcommand{\sect}{\cap}
\newcommand{\dom}{\mathrm{Dom}}
\newcommand{\ran}{\mathrm{Ran}}
\newcommand{\tminus}{\mathop{\overset{.}{-}}}
\newcommand{\si}{\mathrm{si}}
\newcommand{\sic}{\overline{\si}}
\newcommand{\qt}{\mathrm{qt}}
\renewcommand{\rm}{\mathrm{rm}}
\renewcommand{\div}{\mathrm{div}}
\newcommand{\lcm}{\mathrm{LCM}}
\newcommand{\hcf}{\mathrm{HCF}}
\newcommand{\sub}{\mathrm{Sub}}
\newcommand{\mr}{\mathrel{\le_{\mathrm{m}}}}
\newcommand{\mR}{\mathrel{<_{\mathrm{m}}}}
\newcommand{\me}{\mathrel{\equiv_{\mathrm{m}}}}
\newcommand{\tr}{\mathrel{\le_{\mathrm{T}}}}
\newcommand{\tR}{\mathrel{<_{\mathrm{T}}}}
\newcommand{\te}{\mathrel{\equiv_{\mathrm{T}}}}
\newcommand{\fsubseteq}{\mathrel{\subseteq_{\mathrm{F}}}}
\newcommand{\floor}[1]{\left\lfloor{#1}\right\rfloor}
\newcommand{\card}[1]{|{#1}|}
\newcommand{\func}[2]{f_{#1}^{(#2)}}
\newcommand{\funcr}[3]{f_{{#1},{#2}}^{(#3)}}
\newcommand{\dg}[1]{\mathbf{{#1}}}
\newcommand{\code}[1]{\widetilde{{#1}}}
\newcommand{\bigunion}{\bigcup}
\newcommand{\biglor}{\bigvee}
\newcommand{\lub}{\cup}
\newcommand{\smn}{$s$-$m$-$n$}
\theoremstyle{plain}
\newtheorem*{lem}{Lemma}
\newtheorem*{thm}{Theorem}
\theoremstyle{definition}
\newtheorem*{defn}{Definition}
\theoremstyle{remark}
\newtheorem*{rmk}{Remark}
\title{Exercises from \emph{Computability}}
\author{John Peloquin}
\date{}
\begin{document}
\maketitle
\section*{Chapter~1}
\subsection*{Exercises~3.3}
\exercise{1}
We show that the functions below are computable by exhibiting procedures which compute them.
\begin{enumerate}
\item[(a)]
\begin{tabular}{p{150px}l}
$f(x)=\begin{cases}0&\text{if }x=0\\1&\text{if }x\ne0\end{cases}$&
\begin{tabular}{rl}
1.&J(1,2,4)\\
2.&Z(1)\\
3.&S(1)
\end{tabular}
\end{tabular}
\item[(b)]
\begin{tabular}{p{150px}l}
$f(x)=5$&
\begin{tabular}{rl}
1.&Z(1)\\
2.&S(1)\\
$\vdots$&$\vdots$\\
6.&S(1)
\end{tabular}
\end{tabular}
\item[(c)]
\begin{tabular}{p{150px}l}
$f(x,y)=\begin{cases}0&\text{if }x=y\\1&\text{if }x\ne y\end{cases}$&
Same procedure as in~(a).
\end{tabular}
\item[(d)]
\begin{tabular}{p{150px}l}
$f(x,y)=\begin{cases}0&\text{if }x\le y\\1&\text{if }x>y\end{cases}$&
\begin{tabular}{rl}
1.&J(1,3,5)\\
2.&J(2,3,7)\\
3.&S(3)\\
4.&J(1,1,1)\\
5.&Z(1)\\
6.&J(1,1,9)\\
7.&Z(1)\\
8.&S(1)
\end{tabular}
\end{tabular}
The idea in this procedure is to run a counter (in~$R_3$) which is repeatedly checked against first~$x$ and then~$y$. If $x$~is hit first, we know $x\le y$. If $y$~is hit first, we know $y<x$.
\item[(e)]
\begin{tabular}{p{200px}l}
$f(x)=\begin{cases}\tfrac{1}{3}x&\text{if }x\text{ is a multiple of~3}\\\text{undefined}&\text{otherwise}\end{cases}$&
See Example~3.3(c).
\end{tabular}
\item[(f)] $f(x)=\floor{2x/3}$
We merely sketch a procedure: first load~$2x$ into a register. Run a counter~$k$ in one register and $3(k+1)$ in another register, stopping at the least~$k$ such that $3(k+1)>2x$. Then $k$~is the desired value.
\end{enumerate}
\exercise{2}
Let $P$~be the program in Example~2.1. We claim
$$\func{P}{2}=
\begin{cases}
x-y&\text{if }x\ge y\\
\text{undefined}&\text{otherwise}
\end{cases}$$
\begin{proof}
We note that $P$~repeatedly checks whether $r_1=r_2$, and if not increments~$r_2$ as well as the counter~$r_3$. If and when $r_1=r_2$, $P$~halts and returns the value~$r_3$.
Clearly then if $x<y$, $P$~does not halt. If $x\ge y$, then $P$~returns the value~$k$ satisfying $y+k=x$; in other words, $P$~returns $x-y$ as desired.
\end{proof}
\exercise{3}
Let $P$~be a program with no jump instructions. Then there exists $m\in\N$ such that either
$$\func{P}{1}(x)=m\qquad\text{or}\qquad\func{P}{1}(x)=m+x$$
for all $x\in\N$.
\begin{proof}
We prove a more general claim. Let $\funcr{P}{R_k}{1}(x)$~denote the final contents of the register~$R_k$ under the computation~$P(x)$ (or be undefined if $P(x)$~does not halt). We claim that for each $k\ge1$, there exists $m_k\in\N$ such that either $\funcr{P}{R_k}{1}(x)=m_k$ or $\funcr{P}{R_k}{1}(x)=m_k+x$. The result then follows since $\func{P}{1}(x)=\funcr{P}{R_1}{1}(x)$.
We prove the claim by induction on the length~$n$ of~$P$. If $n=0$, then trivially $\funcr{P}{R_1}{1}(x)=x$ and $\funcr{P}{R_k}{1}(x)=0$ for all $k>1$, so the claim holds. Now suppose $n>0$ and the claim holds for all programs of length $n-1$ with no jump instructions. Let $P^*$~be the program consisting of the first $n-1$ instructions of~$P$. Then by assumption the claim holds for~$P^*$, and hence the contents of register~$R_k$ after the first $n-1$ instructions in the computation~$P(x)$ is given by $\funcr{P^*}{R_k}{1}(x)$, which is $m_k$ or $m_k+x$ for some $m_k\in\N$.
Now consider instruction~$I_n$ in~$P$ by cases:
\begin{enumerate}[itemsep=0pt]
\item[(i)] If $I_n$~is Z(q), then $\funcr{P}{R_q}{1}(x)=0$.
\item[(ii)] If $I_n$~is S(q), then $\funcr{P}{R_q}{1}(x)=\funcr{P^*}{R_q}{1}(x)+1$, giving either $m_q+1$ or $(m_q+1)+x$.
\item[(iii)] If $I_n$~is T(p,q), then $\funcr{P}{R_q}{1}(x)=\funcr{P^*}{R_p}{1}(x)$, giving either $m_p$ or $m_p+x$.
\end{enumerate}
\noindent In all cases, $\funcr{P}{R_k}{1}(x)=\funcr{P^*}{R_k}{1}(x)$ for all $k\ne q$. Therefore $\funcr{P}{R_k}{1}(x)$~is of the desired form for all $k\ge1$, so the claim holds for~$P$ as desired.
\end{proof}
\exercise{4}
For each transfer instruction T($m$,$n$), with $m,n\ge 1$, there exists a program~$P_{m,n}$ having the same effect on the register machine configuration and using no transfer instructions.
\begin{proof}
For $m=n$, let $P_{m,n}$~be the empty program. For $m\ne n$, let $P_{m,n}$~be given by:
\begin{center}
\begin{tabular}{rl}
1.&Z($n$)\\
2.&J($m$,$n$,5)\\
3.&S($n$)\\
4.&J(1,1,2)
\end{tabular}
\end{center}
\end{proof}
\section*{Chapter~2}
\subsection*{Exercises~3.4}
\exercise{1}
For every $m\in\N$, the functions $\mathbf{m}(x)=m$ and~$mx$, are computable.
\begin{proof}
We proceed by induction on~$m$.
For the first class of functions, we know that $\mathbf{0}$~is computable by Lemma~1.1(a). Suppose that $\mathbf{m}$~is computable. Then $\mathbf{m+1}$ is obtained by composition of $\mathbf{m}$~and the successor function, and hence is computable by Lemma~1.1(b) and Theorem~3.1.
For the second class of functions, $0x=\mathbf{0}$ is computable. Now suppose $mx$~is computable. Since
$$(m+1)x=mx+x$$
is simply the composite of~$mx$ and the identity map~$x$ with the addition function, it is also computable by Theorem~3.1.
\end{proof}
\exercise{3}
Let $g(x)$~be total computable. Define a binary predicate~$M(x,y)$ by
$$M(x,y)\equiv g(x)=y$$
Then $M(x,y)$~is decidable.
\begin{proof}
We must show that the characteristic function
$$\varphi_M(x,y)=
\begin{cases}
1&\text{if }M(x,y)\\
0&\text{otherwise}
\end{cases}=
\begin{cases}
1&\text{if }g(x)=y\\
0&\text{otherwise}
\end{cases}$$
is computable. Let $G$~be a procedure in standard form computing~$g$ and let $k$~be the number of instructions in~$G$ and $r=\rho(G)+1$. Define a procedure~$P$ as follows:
\begin{center}
\begin{tabular}{rl}
1.&T(2,$r$)\\
2.&Z(2)\\
3.&$G$\\
$3+k$.&J(1,$r$,$6+k$)\\
$4+k$.&Z(1)\\
$5+k$.&J(1,1,$8+k$)\\
$6+k$.&Z(1)\\
$7+k$.&S(1)
\end{tabular}
\end{center}
Since $G$~is total, $P$~always halts, and $P$~computes~$\varphi_M$ as desired.
\end{proof}
\subsection*{Exercises~4.16}
\exercise{1}
We prove that the following functions are computable:
\begin{enumerate}[itemsep=0pt]
\item[(a)] Any polynomial function $a_0+a_1x+\cdots+a_nx^n$, where $a_0,\ldots,a_n\in\N$.
\begin{proof}Note any~$x^k$ is just the composite of the constant function~$\mathbf{k}$ with the exponential function~$x^y$, and hence is computable. Therefore any term~$a_kx^k$ is computable since it is the composite of functions $\mathbf{a_k}$~and~$x^k$ with the product function~$xy$. Finally, a polynomial is just obtained from iterated composition of these terms with the sum function~$x+y$.
\end{proof}
\item[(b)] $\floor{\sqrt{x}}$\quad\emph{Proof:} $\floor{\sqrt{x}}=\mu z<x+2\,(x<z^2)\tminus 1$.
\item[(c)] $\lcm(x,y)$\quad\emph{Proof:} $\lcm(x,y)=\mu z<xy(z>0\text{ and }x|z\text{ and }y|z)$.
\item[(d)] $\hcf(x,y)$\quad\emph{Proof:} $\hcf(x,y)=\qt(\lcm(x,y),xy)$ (assumed $x,y>0$).
\item[(e)] $f(x)=\text{number of prime divisors of }x$\quad\emph{Proof:} $f(x)=\sum_{z\le x}\Pr(\div(z,x)\cdot z)$.
\item[(f)] $\varphi(x)$\quad\emph{Proof:} $\varphi(x)=\sum_{1\le z<x}\sic(\hcf(z,x)\tminus 1)$.
\end{enumerate}
\exercise{2}
Let $\pi(x,y)=2^x(2y+1)-1$. Then $\pi$~is a computable bijection from~$\N^2$ to~$\N$, and the functions $\pi_1$, $\pi_2$ such that $\pi(\pi_1(n),\pi_2(n))=n$ for all~$n$ are computable.
\begin{proof}
Clearly $\pi$~is a computable function.
To see $\pi$~is injective, suppose $\pi(v,w)=\pi(x,y)$ for $v,w,x,y\in\N$. Then we have $2^v(2w+1)=2^x(2y+1)$. If $v=0$ or $x=0$, then we must have both $v=0$ and $x=0$ lest one side of the equation be odd and the other even. It then also follows that $w=y$. If $v\ne0$ and $x\ne0$, note that $2^v|2^x(2y+1)$, but since $2^v$~is even and $2y+1$ is odd, we must have $2^v|2^x$. Similarly $2^x|2^v$. Therefore $2^v=2^x$, so $x=v$, and it then also follows that $w=y$. In either case, $(v,w)=(x,y)$, establishing injectivity of~$\pi$.
To see $\pi$~is surjective, let $n\in\N$ be arbitrary and let $2^x$~be the highest power of~$2$ dividing~$n+1$ (note this is defined since $n+1\ne0$). Then the quotient of $n+1$ by~$2^x$ must be odd of the form $2y+1$, so $n=2^x(2y+1)-1=\pi(x,y)$.
Note $\pi_1(n)=\mu z\le n+1(2^z>n+1)\tminus 1$ is clearly computable, from which it follows that $\pi_2(n)=\qt(2,\qt(2^{\pi_1(n)},n+1)\tminus 1)$ is also computable.
\end{proof}
\exercise{5}
Recall any $x\in\N$ can be expressed uniquely in the form $x=\sum_{i=0}^\infty\alpha_i2^i$ where $\alpha_i\in\{0,1\}$ for all~$i$ (this is the \emph{binary expansion} of~$x$). Hence if $x>0$ there are unique expressions for~$x$ of the forms
\begin{align*}
x&=2^{b_1}+2^{b_2}+\cdots+2^{b_l}&&(l\ge1,\ 0\le b_1<b_2<\cdots<b_l)&&\text{ and}\\
x&=2^{a_1}+2^{a_1+a_2+1}+\cdots+2^{a_1+\cdots+a_k+k-1}&&&&
\end{align*}
\noindent For these expressions, define $\alpha(i,x)=\alpha_i$ and
$$l(x)=\begin{cases}
l&\text{if }x>0\\
0&\text{otherwise}
\end{cases}
\qquad
b(i,x)=\begin{cases}
b_i&\text{if }x>0,1\le i\le l\\
0&\text{otherwise}
\end{cases}
\qquad
a(i,x)=\begin{cases}
a_i&\text{if }x>0,1\le i\le l\\
0&\text{otherwise}
\end{cases}$$
Then $\alpha,l,b,a$ are all computable.
\begin{proof}
We exhibit each:
\begin{enumerate}[itemsep=0pt]
\item[(i)] To calculate~$\alpha_i$, we can right shift and then mod the binary expansion of~$x$ in order to isolate the $i$-th~bit, so $\alpha(i,x)=\rm(2,\qt(2^i,x))$, which is computable.
\item[(ii)] Note $l$~is the number of~$1$'s in the binary expansion of~$x$, so $l(x)=\sum_{i\le x}\alpha(i,x)$, which is also computable.
\item[(iii)] Note $b_i$~is the digit index of the $i$-th~$1$ in the binary expansion of~$x$ (if such a~$1$ exists), so we can calculate it by sequentially searching digits until we have accumulated $i$~$1$'s. Specifically,
$$b(i,x)=\begin{cases}
\mu z\le x\bigl(\,\sum_{j\le z}\alpha(j,x)=i\,\bigl)&\text{if }x>0\text{ and }1\le i\le l(x)\\
0&\text{ otherwise}
\end{cases}$$
Therefore $b(i,x)$~is computable.
\item[(iv)] Note $a_i$~measures the number of~$0$'s between the $(i-1)$-th and $i$-th~$1$'s in the binary expansion of~$x$ (where the $0$-th~$1$ fictionally occurs just prior to the start of the binary expansion). Therefore, for $x>0$ and $1\le i\le l(x)$, we obtain a recursive definition for $a(i,x)$ of the form
\begin{align*}
a(1,x)&=b(1,x)\\
a(i+1,x)&=b(i+1,x)\tminus b(i,x)\tminus 1
\end{align*}
By cases, we set $a(i,x)=0$ otherwise. It follows that $a(i,x)$~is computable.
\end{enumerate}
\end{proof}
\noindent This exercise demonstrates that the third expression for~$x$ above can be regarded as a coding for the sequence $(a_1,\ldots,a_l)$, and each~$a_i$ can be effectively calculated from~$x$. The coding uses a binary expansion like a delimited string, with $0$'s~acting as tally marks for the values in the sequence and $1$'s~acting as delimiters.
As an example, consider the following coding:
$$(1,2,3)\mapsto 100010010=1\underbrace{000}_31\underbrace{00}_21\underbrace{0}_1$$
\subsection*{Exercises~5.4}
\exercise{1}
Let $f(x)$ be a total injective computable function. Then the inverse function~$f^{-1}(y)$ is computable.
\begin{proof}
Note $f^{-1}(y)=\mu z(f(z)=y)$.
\end{proof}
\section*{Chapter~3}
\subsection*{Exercises~4.6}
\exercise{1}
The unary function computed by the Turing machine in Example~4.2 is $f(x)=\floor{\tfrac{x+1}{2}}$. \emph{Proof:} The machine starts with $x+1$ $1$'s on the tape, and then zeros out every other one, leaving~$\floor{\tfrac{x+1}{2}}$ remaining.
\subsection*{Exercises~5.4}
\exercise{1}
Let $\Sigma=\{a,b\}$. We examine the ways in which the production
$$(\pi)\ S_1bS_2aaS_3b\to S_3abS_1$$
applies to the string $\sigma=babaabbaab$.
The following are exhaustive possibilities:
\begin{enumerate}[itemsep=0pt]
\item[(1)] If the first~$b$ in~$\pi$ matches the first~$b$ in~$\sigma$, then $S_1=\Lambda$.
\begin{enumerate}[itemsep=0pt]
\item[(a)] If the~$aa$ in~$\pi$ matches the first~$aa$ in~$\sigma$, then $S_2=ab$ and $S_3=bbaa$. In this case the string generated is $bbaaab$.
\item[(b)] If the~$aa$ in~$\pi$ matches the second~$aa$ in~$\sigma$, then $S_2=abaabb$ and $S_3=\Lambda$. In this case the string generated is~$ab$.
\end{enumerate}
\item[(2)] If the first~$b$ in~$\pi$ matches the second~$b$ in~$\sigma$, then $S_1=ba$.
\begin{enumerate}[itemsep=0pt]
\item[(a)] If the~$aa$ in~$\pi$ matches the first~$aa$ in~$\sigma$, then $S_2=\Lambda$ and $S_3=bbaa$. In this case the string generated is $bbaaabba$.
\item[(b)] If the~$aa$ in~$\pi$ matches the second~$aa$ in~$\sigma$, then $S_2=aabb$ and $S_3=\Lambda$. In this case the string generated is $abba$.
\end{enumerate}
\item[(3)] If the first~$b$ in~$\pi$ matches the third~$b$ in~$\sigma$, then $S_1=babaa$, $S_2=b$, and $S_3=\Lambda$. The string generated is $abbabaa$.
\item[(4)] If the first~$b$ in~$\pi$ matches the fourth~$b$ in~$\sigma$, then $S_1=babaab$ and $S_2=S_3=\Lambda$. The string generated is $abbabaab$.
\end{enumerate}
\subsection*{Exercises~7.2}
\exercise{1}
Suppose $f(x)$~and~$g(x)$ are effectively computable. Then
$$h(x)=\begin{cases}
x&\text{if }x\in\dom(f)\sect\dom(g)\\
\text{undefined}&\text{otherwise}
\end{cases}$$
is URM-computable.
\begin{proof}
Since $f$~and~$g$ are computable, their values can be computed by algorithms. Consider the following algorithm to compute~$h(x)$: `Run an algorithm to compute~$f(x)$. If it halts, then run an algorithm to compute~$g(x)$. If it also halts, then return~$x$.' This algorithm computes~$h(x)$, for it halts (and returns~$x$) iff the algorithms for computing $f(x)$~and~$g(x)$ both halt, which occurs iff $x\in\dom(f)\sect\dom(g)$. By Church's Thesis then, it follows that $h$~is URM-computable.
\end{proof}
\section*{Chapter~4}
\subsection*{Exercises~1.6}
\exercise{1}
\begin{enumerate}[itemsep=0pt]
\item[(c)] Let $P$~be the program T(3,4), S(3), Z(1). Then
\begin{align*}
\beta(\mathrm{T(3,4)})&=4\pi(3-1,4-1)+2&\beta(\mathrm{S(3)})&=4(3-1)+1&\beta(\mathrm{Z(1)})&=4(1-1)\\
&=4[\,2^2(2\cdot 3+1)-1]+2&&=9&&=0\\
&=4\cdot 27+2&&&&\\
&=110&&&&
\end{align*}
Therefore $\gamma(P)=\tau(110,9,0)=2^{110}+2^{120}+2^{121}$.
\item[(d)] Let $P=P_{100}$. Note $100=1100100_2=2^2+2^5+2^6$, so $a_1=2$, $a_2=2$, and $a_3=0$. Now $2=4\cdot 0+2$, hence $\beta^{-1}(2)=\mathrm{T(1,1)}$. Similarly $\beta^{-1}(0)=\mathrm{Z(1)}$. Therefore $P$~is the program T(1,1), T(1,1), Z(1).
\end{enumerate}
\subsection*{Exercises~2.3}
\exercise{1}
Let $f$~be computable. Then $f$~has infinitely many indices.
\begin{proof}
Write $f=\phi_k^{(n)}$, so $P_k$~computes~$f$. Set $r=\rho(P_k)+1$. Then for any fixed~$m$, the program
\begin{center}
\begin{tabular}{cl}
$P_k$&\\
Z(r)&\\
$\vdots$&\quad $m$~times\\
Z(r)&
\end{tabular}
\end{center}
also computes~$f$. Denote this program by~$P_k^m$, so $\gamma(P_k^m)$~is also an index of~$f$. By the injectivity of~$\gamma$, the set $\Gamma=\{\,\gamma(P_k^m)\mid m\in\N\,\}$ gives infinitely many indices of~$f$.
\end{proof}
\subsection*{Exercises~3.2}
\exercise{3}
Let $f:\N\to\N$ be partial and $m\in\N$. There exists a non-computable function~$g$ such that $g(x)\simeq f(x)$ for $x\le m$.
\begin{proof}
Define $g$~as follows:
$$g(x)\simeq\begin{cases}
f(x)&\text{if }x\le m\\
\phi_{x-(m+1)}(x)+1&\text{if }x>m\text{ and }\phi_{x-(m+1)}(x)\text{ is defined}\\
0&\text{if }x>m\text{ and }\phi_{x-(m+1)}(x)\text{ is undefined}
\end{cases}$$
By construction, $g(x)\simeq f(x)$ for $x\le m$ and $g$~is non-computable since for any~$\phi_k$,
$$g(k+m+1)\not\simeq\phi_k(k+m+1)$$
\end{proof}
\noindent Note that the above proof works by shifting the diagonal used in the diagonalization argument right by a finite number of places. A corollary of this exercise is that for any computable function~$\phi_k$, there exist non-computable functions agreeing with~$\phi_k$ for up to any finite number of values.
\bigskip
\exercise{4}
\begin{enumerate}[itemsep=0pt]
\item[(a)] The set of all functions from~$\N$ to~$\N$ is uncountable.
\begin{proof}
The set is clearly infinite since, for example, there are infinitely many constant functions. The set is seen to be uncountably infinite using a standard diagonalization argument.
\end{proof}
\item[(b)] The set of all total non-computable functions from~$\N$ to~$\N$ is uncountable.
\begin{proof}
Let $\T$~be the set of all total functions from~$\N$ to~$\N$. Then it is immediate by diagonalization that $\T$~is uncountable. For each $\alpha\in\T$ define a function $f_{\alpha}:\N\to\N$ as follows:
$$f_{\alpha}(n)=\begin{cases}
\phi_n(n)+\alpha(n)+1&\text{if }\phi_n(n)\text{ is defined}\\
\alpha(n)&\text{ otherwise}
\end{cases}$$
It is immediate that each $f_{\alpha}$~is total and non-computable. And clearly if $\alpha\ne\beta$, then $f_{\alpha}\ne f_{\beta}$. Therefore $\{\,f_{\alpha}\mid\alpha\in\T\,\}$ is uncountable, establishing the result.
\end{proof}
\end{enumerate}
\subsection*{Exercises~4.4}
\exercise{1}
There is a total computable function~$k$ such that $k(n)$~is an index of the function~$\floor{\sqrt[n]{x}}$.
\begin{proof}
Note $f(x,y)=\floor{\sqrt[x]{y}}=\mu z(z^x>y)\tminus 1$ is computable. The result thus follows from the simple \smn\ theorem.
\end{proof}
\exercise{3}
For fixed $n\ge1$, there is a total computable function~$s$ such that
$$W_{s(x)}^{(n)}=\{\,(y_1,\ldots,y_n)\mid y_1+\cdots+y_n=x\,\}$$
\begin{proof}
Fix $n\ge1$ and define
$$f(x,y_1,\ldots,y_n)=\begin{cases}
1&\text{if }x=y_1+\cdots+y_n\\
\text{undefined}&\text{otherwise}
\end{cases}$$
Clearly $f$~is computable, so $f=\phi_k^{(n)}$ for some index~$k$. By the \smn\ theorem, there exists a total computable function $s(x)=s_n^1(k,x)$ such that for all~$x$,
$$\phi_{s(x)}^{(n)}(y_1,\ldots,y_n)=f(x,y_1,\ldots,y_n)$$
Therefore by construction of~$f$, $W_{s(x)}^{(n)}$~is as desired.
\end{proof}
\exercise{4}
The functions~$s^m_n$ in in the \smn\ theorem are primitive recursive.
\begin{proof}
We merely sketch: since the encoding and decoding functions used by each~$s^m_n$ are all primitive recursive, each~$s^m_n$ itself is also primitive recursive.
\end{proof}
\exercise[\smn\ theorem]{5} For each~$m$ there is a total computable $(m+1)$-ary function~$s^m$ such that for all $e,n,\vec{x}$,
$$\phi_{s^m(e,\vec{x})}^{(n)}(\vec{y})\simeq\phi_e^{(m+n)}(\vec{x},\vec{y})$$
\begin{proof}
In the proof of Theorem~4.3, $n$~is used only to count how many registers should be right shifted initially. But since $P_e$~uses only registers $R_1,\ldots,R_{\rho(e)}$, it works equally well to shift $\rho(e)$~registers. Now $\rho(e)$~can be effectively computed from~$e$ by syntactically examining the finitely many instructions of~$P_e$. Therefore $n$~is not needed in the proof, and by constructing a similar proof but using~$\rho(e)$ instead of~$n$, one obtains a total computable function~$s^m$ as desired.
\end{proof}
\section*{Chapter~5}
\subsection*{Exercises~1.5}
\exercise{1}
\begin{enumerate}
\item[(i)] There exists a decidable predicate $Q(x,y,z)$ such that $y\in E_x$ iff $\exists z\,Q(x,y,z)$ and if $y\in E_x$ then $\phi_x((z)_1)=y$.
\begin{proof}
Note $y\in E_x$ iff there exists some~$s$ such that $\phi_x(s)=y$, that is, iff the computation~$P_x(s)$ halts with output~$y$ after a finite number~$t$ of steps. Thus under the effective coding $z=2^s3^t$ we define
$$Q(x,y,z)\equiv S_1(x,s,y,t)=S_1(x,(z)_1,y,(z)_2)$$
Now $Q$~is decidable by Corollary~1.3(a) and substitution, and the remaining properties follow easily.
\end{proof}
\item[(ii)] There exists a computable function $g(x,y)$ such that $y\in E_x$ iff $g(x,y)$ is defined, and if $y\in E_x$ then $g(x,y)\in W_x$ and $\phi_x(g(x,y))=y$.
\begin{proof}
Define $g(x,y)\simeq\bigl(\mu z\,Q(x,y,z)\bigr)_1$.
\end{proof}
\end{enumerate}
\exercise{2}
Suppose $f$~and~$g$ are unary computable functions. Then the function~$h$ defined by
$$h(x)=\begin{cases}
1&\text{if }x\in\dom(f)\union\dom(g)\\
\text{undefined}&\text{otherwise}
\end{cases}$$
is computable.
\begin{proof}
Write $f=\phi_m$, $g=\phi_n$. Then $h(x)=\mathbf{1}(\mu t(H_1(m,x,t)\text{ or }H_1(n,x,t)))$.
\end{proof}
\noindent Note this exercise illustrates the theoretical possibility of effective \emph{multitasking} or \emph{multithreading}. Since any finite initial segment of a computation can be effectively simulated, a program can run through steps of multiple computations, giving the effect of `running multiple programs simultaneously' (see Example 3.7.1.2).
\subsection*{Exercises~3.2}
\begin{rmk}
In these exercises we apply the \smn\ theorem and universal functions to prove effectiveness of operations on computable functions and predicates.
\end{rmk}
\exercise{1}
There is a total computable function~$k(e)$ such that for all~$e$, if $\phi_e$~is the characteristic function of a decidable predicate~$M(x)$, then $\phi_{k(e)}$~is the characteristic function for its negation `not~$M(x)$'.
\begin{proof}
Define $f(e,x)=1-\phi_e(x)=1\tminus\psi_U(e,x)$. Then $f$~is computable, and for fixed~$e$ if $\phi_e(x)$~characterizes~$M(x)$, then $f(e,x)$ characterizes its negation. By the \smn\ theorem, there exists a total computable function~$k(e)$ such that $\phi_{k(e)}(x)\simeq f(e,x)$, establishing the result.
\end{proof}
\exercise{2}
There exists a total computable function~$k(e)$ such that $E_{k(e)}=W_e$.
\begin{proof}
Define $f(e,x)=x\cdot\mathbf{1}(\phi_e(x))=x\cdot\mathbf{1}(\psi_U(e,x))$. Then $f$~is computable, so by the \smn\ theorem there exists a total computable function~$k(e)$ such that for all~$e$ $\phi_{k(e)}(x)\simeq f(e,x)$. By construction $x\in E_{k(e)}$ iff $x\in W_e$, so $E_{k(e)}=W_e$ as desired.
\end{proof}
\exercise{3}
There exists a total computable function $s(x,y)$ such that, for all $x$~and~$y$, $E_{s(x,y)}=E_x\union E_y$.
\begin{proof}
For a pair $x$~and~$y$, we must construct a single computable function the range of which consists of all elements from the ranges of $\phi_x$~and~$\phi_y$. Thus we partition our domain and define the computable function
$$f(x,y,z)\simeq\begin{cases}
\phi_x\bigl(\frac{z}{2}\bigr)&\text{if }z\text{ is even}\\
\phi_y\bigl(\frac{z-1}{2}\bigr)&\text{if }z\text{ is odd}\end{cases}$$
By the \smn\ theorem, there exists a total computable function $s(x,y)$ such that for all $x$~and~$y$, $\phi_{s(x,y)}(z)\simeq f(x,y,z)$. Clearly $E_{s(x,y)}=E_x\union E_y$.
\end{proof}
\exercise[Effectiveness of substitution and minimalization]{5}
\begin{enumerate}[itemsep=0pt]
\item[(a)] Fix $m,n\ge1$. There is a total computable function $s(e,e_1,\ldots,e_m)$ such that
$$\phi_{s(e,e_1,\ldots,e_m)}^{(n)}=\sub(\phi_e^{(m)}\,;\,\phi_{e_1}^{(n)},\ldots,\phi_{e_m}^{(n)})$$
\begin{proof}
Define the computable function
$$f(e,e_1,\ldots,e_m,\vec{x})\simeq\phi_e^{(m)}\bigl(\phi_{e_1}^{(n)}(\vec{x}),\ldots,\phi_{e_m}^{(n)}(\vec{x})\bigr)$$
Now apply the \smn\ theorem to obtain~$s$.
\end{proof}
\item[(b)] Fix $n\ge1$. There is a total computable function~$k(e)$ such that for all~$e$
$$\phi_{k(e)}^{(n)}(\vec{x})\simeq\mu y\,\bigl(\phi_e^{(n+1)}(\vec{x},y)=0\bigr)$$
\begin{proof}
Define
$$f(e,\vec{x})\simeq\mu y\,\bigl(\phi_e^{(n+1)}(\vec{x},y)=0\bigr)$$
and apply the \smn\ theorem.
\end{proof}
\end{enumerate}
\section*{Chapter~6}
\subsection*{Exercises~1.8}
\exercise{1}
The following predicates are undecidable:
\begin{enumerate}[itemsep=0pt]
\item[(a)] `$x\in E_x$'
\begin{proof}
If `$x\in E_x$' is decidable, then the function
$$f(x)=\begin{cases}
x&\text{if }x\not\in E_x\\
\text{undefined}&\text{if }x\in E_x
\end{cases}$$
is computable, say $f=\phi_m$. But then for all~$x$, $x\in E_m$ iff $x\not\in E_x$, so in particular $m\in E_m$ iff $m\not\in E_m$---a contradiction.
\end{proof}
\item[(b)] `$W_x=W_y$'
\begin{proof}
Fix~$k$ with $\phi_k=\mathbf{0}$. Then $W_x=W_k$ iff $\phi_x$~is total, which is undecidable, hence `$W_x=W_y$' is undecidable.
\end{proof}
\item[(c)] `$\phi_x(x)=0$'
\begin{proof}
Let $c(x)$~be the characteristic function of the predicate. Then for all~$x$, $c(x)=0$ iff $\phi_x(x)\ne 0$, hence $c\ne\phi_x$. Since $c$~differs from all unary computable functions, $c$~is not computable.
\end{proof}
\item[(d)] `$\phi_x(y)=0$'.\quad\emph{Proof:} `$\phi_x(x)=0$' reduces to this problem.
\item[(e)] `$x\in E_y$'.\quad\emph{Proof:} `$x\in E_x$' reduces to this problem.
\item[(f)] `$\phi_x$~is total and constant'
\begin{proof}
Apply Rice's Theorem, or note that `$\phi_x=\mathbf{0}$' reduces to this problem since $\phi_x=\mathbf{0}$ iff $\phi_x$~is total and constant and $\phi_x(0)=0$.
\end{proof}
\item[(g)] `$W_x=\emptyset$'.\quad\emph{Proof:} Apply Rice's Theorem with $\B=\{\,f\in\C_1\mid\dom f=\emptyset\,\}$.
\item[(h)] `$E_x$~is infinite'.\quad\emph{Proof:} Apply Rice's Theorem with $\B=\{\,f\in\C_1\mid\ran f\text{ is infinite}\,\}$.
\item[(i)] `$\phi_x=g$'.\quad\emph{Proof:} Apply Rice's Theorem with $\B=\{g\}$.
\end{enumerate}
\exercise{2} There does not exist a total computable function $f(x,y)$ such that for all $x,y$, if $P_x(y)$ halts, it does so in at most $f(x,y)$ steps.
\begin{proof}
Suppose such a function $f(x,y)$ exists. Construct a program~$P$ which, on input~$x$, runs for at least $f(x,x)+1$ steps and halts. Let $n=\gamma(P)$. Then $\phi_n$~is total, and the computation $\phi_n(n)$~runs for at least $f(n,n)+1>f(n,n)$ steps---contradicting the definition of~$f$.
Alternately, define the predicate $H(x,y)\equiv H_1(x,y,f(x,y))$, which is decidable if $f(x,y)$ is computable. Note $H(x,y)$ holds iff $P_x(y)$ halts, so the halting problem reduces to~$H$.
\end{proof}
\subsection*{Exercises~6.14}
\exercise{1}
The following predicates are partially decidable:
\begin{enumerate}[itemsep=0pt]
\item[(a)] `$E_x^{(n)}\ne\emptyset$' ($n$~fixed)
\begin{proof}
The predicate `$y\in E_x^{(n)}$' is partially decidable (Example~6.7.1), hence $M(x)\equiv\exists y(y\in E_x^{(n)})$ is partially decidable by Corollary~6.6, and $E_x^{(n)}\ne\emptyset$ iff $M(x)$~holds.
\end{proof}
\item[(b)] `$\phi_x(y)$~is a perfect square'
\begin{proof}
Note $M(z)\equiv\text{`}z\text{ is a perfect square'}$ is decidable, and therefore partially decidable, so its partial characteristic function~$c_M$ is computable. Hence the partial characteristic function $c(x,y)$ of the desired predicate is computed by
$$c(x,y)\simeq c_M(\phi_x(y))\simeq c_M(\psi_U(x,y))$$
\end{proof}
\item[(c)] `$n$~is a Fermat number'
\begin{proof}
By definition, $n$~is a Fermat number iff $\exists x\exists y\exists z(x^n+y^n=z^n)$, which is partially decidable by Corollary~6.6.
\end{proof}
\item[(d)] `There exists a run of exactly~$x$ consecutive~$7$'s in the decimal expansion of~$\pi$'
\begin{proof}
For fixed~$n$ it is decidable whether there exists such a run within the first~$n$ digits of the decimal expansion of~$\pi$. Denote this predicate $M(x,n)$. Then the desired predicate is given by $\exists n\,M(x,n)$, which is partially decidable by Theorem~6.4.
\end{proof}
\end{enumerate}
\exercise{2}
Let $G=\langle S\mid R\rangle$ be a finitely presented group. Then the word problem for~$G$ is partially decidable.
\begin{proof}
For a word $w\in G$, if $w=1$, then by definition of a group presentation this is a consequence of the relations in~$R$ and the group axioms, that is, the relation $w=1$ is derivable from~$R$ in~$G$. Derivability from~$R$ in~$G$ is partially decidable just like provability in the predicate calculus (Example~6.7.2). Therefore, the word problem is partially decidable.
\end{proof}
\exercise{4}
Suppose $M(\vec{x})$~and~$N(\vec{x})$ are partially decidable. Then the predicates $M(\vec{x})\land N(\vec{x})$ and $M(\vec{x})\lor N(\vec{x})$ are partially decidable, but $\lnot M(\vec{x})$ is not necessarily partially decidable.
\begin{proof}
If $\phi_j^{(n)}$~and~$\phi_k^{(n)}$ are partial characteristic functions for $M$~and~$N$, respectively, then it follows that
$$c_{M\land N}(\vec{x})\simeq\mathbf{1}(\phi_j^{(n)}(\vec{x}),\phi_k^{(n)}(\vec{x}))\simeq\mathbf{1}(\psi_U^{(n)}(j,\vec{x}),\psi_U^{(n)}(k,\vec{x}))$$
is a computable partial characteristic function for $M\land N$, and similarly
$$c_{M\lor N}(\vec{x})\simeq\mathbf{1}(\mu t[H_n(j,\vec{x},t)\lor H_n(k,\vec{x},t)])$$
is a computable partial characteristic function for $M\lor N$.
To see that $\lnot M(\vec{x})$ is not necessarily partially decidable, let $M(x)\equiv x\in W_x$. Then $M(x)$~is partially decidable, but $\lnot M(x)$ is not partially decidable (see Examples~6.2).
\end{proof}
\noindent Note the partial decision procedure for $M\lor N$ uses multithreading (see the comment after Exercise~5.1.5.2).
\bigskip
\exercise{5}
Suppose $M(\vec{x},y)$ is partially decidable. Then
\begin{enumerate}[itemsep=0pt]
\item[(a)] `$\exists y<z\,M(\vec{x},y)$' is partially decidable.
\begin{proof}
Let $\phi_e^{(n+1)}$ denote the partial characteristic function for~$M$. Then the partial characteristic function for this predicate is computed by
$$f(\vec{x},z)\simeq\mathbf{1}(\mu t[\exists y<z H_{n+1}(e,\vec{x},y,t)])$$
\end{proof}
\noindent Note this partial decision procedure multithreads computation of the values $\phi_e^{(n+1)}(0),\ldots,\phi_e^{(n+1)}(z-1)$.
\item[(b)] `$\forall y<z\,M(\vec{x},y)$' is partially decidable.
\begin{proof}
The partial characteristic function is computed by
$$f(\vec{x},z)\simeq\prod_{y<z}\phi_e^{(n+1)}(\vec{x},y)$$
\end{proof}
\item[(c)] `$\forall y\,M(\vec{x},y)$' is not necessarily partially decidable.
\begin{proof}
Set $M(x,y,t)\equiv\lnot H_1(x,y,t)$. Then $M$~is decidable but
$$\forall t\,M(x,y,t)\iff P_x(y)\text{ diverges}$$
which is not partially decidable (Corollary~6.12).
\end{proof}
\end{enumerate}
\goodbreak
\exercise{7}
\begin{enumerate}[itemsep=0pt]
\item[(a)] There does not exist a partially decidable predicate~$M(x)$ and total computable function~$k(x)$ such that $x\in W_x$ iff not~$M(k(x))$.
\begin{proof}
For such a predicate, $M(k(x))$~holds iff $x\not\in W_x$, which is not partially decidable (Example~6.2.4).
\end{proof}
\item[(b)] `$\phi_x$~is not total' is not partially decidable.
\begin{proof}
By the \smn\ theorem, there exists a total computable function~$k(x)$ such that for all~$x$,
$$\phi_{k(x)}(y)=\begin{cases}
1&\text{if }x\in W_x\\
\text{undefined}&\text{otherwise}
\end{cases}$$
Thus $\phi_{k(x)}$~is not total iff $x\not\in W_x$, so it follows from part~(a) that `$\phi_x$~is not total' is not partially decidable.
\end{proof}
\item[(c)] `$\phi_x$~is total' is not partially decidable.
\begin{proof}
By the \smn\ theorem, there exists a total computable function~$k(x)$ such that for all~$x$,
$$\phi_{k(x)}(y)=\begin{cases}
1&\text{if }\lnot H_1(x,x,y)\\
\text{undefined}&\text{otherwise}
\end{cases}$$
Thus $\phi_{k(x)}$~is total iff $x\not\in W_x$, so `$\phi_x$~is total' is not partially decidable by~(a).
\end{proof}
\noindent This proof illustrates an important technique: if $M(x)$~is partially decidable and $\lnot M(x)$~is not, then even though there is no partial decision procedure for~$\lnot M(x)$, we can characterize the failure to halt of a decision procedure for~$M(x)$ in terms of other properties of computable functions, and thereby establish a lack of partial decidability for such properties. This technique is facilitated by the effectiveness of simulation and the \smn\ theorem, and is also used in the proof of the Rice-Shapiro Theorem (Theorem 7.2.16).
\end{enumerate}
\exercise{9}
Suppose $M(x_1,\ldots,x_n)$ is partially decidable and $g_1,\ldots,g_n$ are $m$-ary computable functions. Then the predicate
$$N(\vec{y})\equiv M(g_1(\vec{y}),\ldots,g_n(\vec{y}))$$
is partially decidable.
\begin{proof}
If $c_M$~is the partial characteristic function of~$M$, then the partial characteristic function of~$N$ is computed by $c_N(\vec{y})\simeq c_M(g_1(\vec{y}),\ldots,g_n(\vec{y}))$.
\end{proof}
\section*{Chapter~7}
\subsection*{Exercises~1.4}
\exercise{2}
\begin{enumerate}[itemsep=0pt]
\item[(a)] Let $B\subseteq\N$ be recursive and $n>1$. Define the predicate
$$M(x_1,\ldots,x_n)\equiv \prod_{i=1}^n p_i^{x_i}\in B$$
Then $M$~is decidable.
\begin{proof}
The characteristic function is given by $c_M(x_1,\ldots,x_n)=c_B(\prod p_i^{x_i})$, which is computable.
\end{proof}
\item[(b)] For $n>1$, call $A\subseteq\N^n$ \emph{recursive} iff the predicate `$\vec{x}\in A$' is decidable. Then $A$~is recursive iff the set $B=\{\,\prod p_i^{x_i}\mid(x_1,\ldots,x_n)\in A\,\}$ is recursive.
\begin{proof}
This follows from~(a) since $c_A(\vec{x})=c_M(\vec{x})$.
\end{proof}
\end{enumerate}
\noindent This exercise shows that we experience no loss of generality in restricting attention to recursive subsets of~$\N$, since recursive subsets of more general sets can be fully characterized in~$\N$ using effective codings.
\subsection*{Exercises~2.18}
\exercise{1}
For $a,e\in\N$, the set ${}^aW_e=\{\,x\mid\phi_e(x)=a\,\}$ is r.e., and ${}^aW_1,{}^aW_2,\ldots$ is an enumeration of all r.e. sets.
\begin{proof}
The set ${}^aW_e$~is r.e. since `$\phi_e(x)\simeq a$' is partially decidable (Theorem~6.6.13).
Now if $A$~is r.e., $A=W_k$ for some~$k$. Define $f(x)=\mathbf{a}(\phi_k(x))$. Then $f$~is computable, so $f=\phi_m$ for some~$m$, and
$$x\in A\iff x\in W_k\iff x\in W_m\iff\phi_m(x)=a\iff x\in{}^aW_m$$
Hence $A={}^aW_m$. Since $A$~was arbitrary, this establishes the enumeration.
\end{proof}
\exercise{2}
The set $\B=\{\,x\mid\phi_x\text{ is not injective}\,\}$ is r.e.
\begin{proof}
The predicate $M(x,y,z)\equiv\phi_x(y)=\phi_x(z)$ is partially decidable, and
$$x\in\B\iff\exists y\exists z\bigl(\,y\ne z\land M(x,y,z)\,\bigr)$$
\end{proof}
\exercise{3}
There exist total computable functions $k$~and~$l$ such that for all~$x$,
$$W_x=E_{k(x)}\quad\text{and}\quad E_x=W_{l(x)}$$
\begin{proof}
We already know $k$~exists by Exercise~5.3.2.2. Define
$$f(x,y)\simeq\mu z[\,S_1(x,(z)_1,y,(z)_2)\,]_1$$
By the \smn\ theorem, there exists a total computable function~$l(x)$ such that for all $x$~and~$y$, $\phi_{l(x)}(y)=f(x,y)$. Then $y\in E_x$ iff $y\in W_{l(x)}$, hence $E_x=W_{l(x)}$.
\end{proof}
\exercise{4}
If $A$~is r.e., then $\bigunion_{x\in A}W_x$ and $\bigunion_{x\in A}E_x$ are r.e.
\begin{proof}
By definition,
\begin{align*}
y\in\bigunion_{x\in A}W_x&\iff \exists x(x\in A\land y\in W_x)\\
y\in\bigunion_{x\in A}E_x&\iff \exists x(x\in A\land y\in E_x)
\end{align*}
and the predicates on the right are partially decidable.
\end{proof}
\exercise{5}
Let $f$~be a unary computable function and $A\subseteq\dom f$. Then $A$~is r.e. iff $g=f|_A$ is computable.
\begin{proof}
If $g$~is computable, then $A=\dom g$ is r.e. by Theorem~2.3. If $A$~is r.e. and $c_A$~is the partial characteristic function of~$A$, then $g(x)=f(x\cdot c_A(x))$ is computable.
\end{proof}
\exercise{6}
Let $f$~be a unary function and set $A=\{\,2^x3^{f(x)}\mid x\in\dom f\,\}$. Then $f$~is computable iff $A$~is r.e.
\begin{proof}
If $f$~is computable, $\dom f$~is r.e. and hence is empty or enumerated by a total unary computable function~$g$. If empty, $A=\emptyset$ is r.e. If not, define $h(x)=2^{g(x)}3^{f(g(x))}$. Then $h$~is computable and $A=\ran\,h$, so $A$~is r.e.
Conversely, if $B$~is r.e., then `$2^x3^y\in B$' is partially decidable, and $f(x)\simeq y$ iff $2^x3^y\in B$, hence $f$~is computable by Theorem~6.6.13.
\end{proof}
\exercise{7}
Let $A$~be infinite and r.e. Then $A$~can be enumerated without repetitions by a total computable function.
\begin{proof}
Let $f$~be a total unary computable function with $A=\ran f$. Define
\begin{align*}
g(0)&=f(0)\\
g(n)&=f(\mu t[f(t)\not\in\{f(0),\ldots,f(n-1)\}])\qquad(n>0)
\end{align*}
Then $g$~is well-defined, total, and computable, and by construction enumerates~$A$ without repetitions.
\end{proof}
\exercise{8}
We consider sets:
\begin{center}
\begin{tabular}{|l|c|c|c|}
\hline
$A$&$A$\quad r.e.&$\overline{A}$\quad r.e.&$A$\quad recursive\\
\hline
$\{x\mid x\in E_x\}$&Y&N&N\\
$\{x\mid x\text{ a perfect square}\,\}$&Y&Y&Y\\
$\{x\mid\phi_x\text{ injective}\,\}$&N&Y&N\\
$\{x\mid\exists\ge x\text{ 7's in }\pi\,\}$&Y&N&N\\
$\{x\mid P_m(x)\uparrow\,\}$&N&Y&N\\
\hline
\end{tabular}
\end{center}
\exercise{10}
Let $A$~be recursive, $B$~r.e., and $f$~a total unary computable function. Then $f^{-1}(A)$ is recursive, and $f(A)$, $f(B)$, and $f^{-1}(B)$ are r.e. but not necessarily recursive. If $f$~is bijective on~$\N$, then $f(A)$~is recursive.
\begin{proof}
$f^{-1}(B)$~is r.e. since $x\in f^{-1}(B)\iff f(x)\in B$, which is partially decidable since $B$~is r.e. Similarly, $y\in f(B)\iff\exists x(x\in B\land f(x)\simeq y)$, which is also partially decidable, so $f(B)$~is r.e.
It follows that $f(A)$~and~$f^{-1}(A)$ are r.e. since $A$~is r.e., and $\overline{f^{-1}(A)}=f^{-1}(\overline{A})$ is r.e., so $f^{-1}(A)$~is recursive.
Note $f^{-1}(B)$ and $f(B)$ are not necessarily recursive; for example, take $B=K$ and $f$~the identity map. Also $f(A)$~is not necessarily recursive; for example, take $A=\N$ and $f=\phi_k$ where $\phi_k$~is total, injective, and $K=E_k$ (cf. Exercise~7).
These examples show that we do not gain additional information if we assume $f$~is injective. However, if $f$~is bijective on~$\N$, then $y\in f(A)\iff f^{-1}(y)\in A$, which is decidable by Exercise~2.5.4.1, so $f(A)$~is recursive.
\end{proof}
\exercise[Rice-Shapiro]{11}
The Rice-Shapiro Theorem implies Rice's Theorem.
\begin{proof}
Let $\B\subseteq\C_1$ with $\B\ne\emptyset,\C_1$. We must prove that $\B$~is not recursive using the Rice-Shapiro Theorem.
Fix $f\in\B$ and $g\in\overline{\B}$. Note $\emptyset\subseteq f,g$. If $\B$~is recursive, then $\B$~and~$\overline{\B}$ are both r.e., so by the Rice-Shapiro Theorem, $\emptyset\not\in\B$ since $g\not\in\B$ and $\emptyset\not\in\overline{\B}$ since $f\not\in\overline{\B}$. But this is a contradiction since $\emptyset\in\C_1=\B\union\overline{\B}$. Therefore $\B$~is not recursive.
\end{proof}
\exercise{13}
\begin{enumerate}[itemsep=0pt]
\item[(a)] Define sets $K_0=\{\,x\mid\phi_x(x)=0\,\}$ and $K_1=\{\,x\mid\phi_x(x)=1\,\}$. Then $K_0$~and~$K_1$ are recursively inseperable.
\begin{proof}
Trivially $K_0$~and~$K_1$ are r.e. and $K_0\sect K_1=\emptyset$. If $C$~is recursive and $K_0\subseteq C$ and $K_1\subseteq\overline{C}$, note that the characteristic function of~$C$ differs from~$\phi_x$ at~$x$ for all~$x$---a contradiction.
\end{proof}
\item[(b)] Let $A$~and~$B$ be disjoint. Then $A$~and~$B$ are recursively inseparable iff whenever $A\subseteq W_a$ and $B\subseteq W_b$ with $W_a\sect W_b=\emptyset$, then there exists $x\not\in W_a\union W_b$.
\begin{proof}
If for all~$x$, $x\in W_a\union W_b$, then $W_a,W_b$ partition~$\N$, so $W_b=\overline{W_a}$ and $W_a,W_b$ are recursive. But then $A$~and~$B$ are not recursively inseparable.
Conversely, if $A$~and~$B$ are recursively inseparable, choose $C$~recursive with $A\subseteq C$ and $B\subseteq\overline{C}$. Since $C$~and~$\overline{C}$ are r.e., there exist $a,b\in\N$ with $C=W_a$ and $\overline{C}=W_b$, and hence for all~$x$, $x\in W_a\union W_b$.
\end{proof}
\end{enumerate}
\noindent Note intuitively that $A$~and~$B$ are recursively inseparable iff there does not exist a general effective procedure by which to \emph{rule out}, for an arbitrary~$x$, one or the other of the alternatives $x\in A$ or $x\in B$.
\subsection*{Exercises~3.13}
\exercise{1}
The following sets are productive:
\begin{enumerate}[itemsep=0pt]
\item[(a)] $\{\,x\mid W_x\text{ is finite}\,\}$
\item[(b)] $\{\,x\mid\phi_x\text{ is not surjective}\,\}$
\item[(c)] $\{\,x\mid\phi_x\text{ is injective}\,\}$
\item[(d)] $\{\,x\mid\phi_x\text{ is not a polynomial}\,\}$
\end{enumerate}
\begin{proof}
By Theorem~3.4. For (a)--(d), the empty function is in the set; for (a), (b), and~(d), the identity function is not in the set; and for~(c), the zero function is not in the set.
\end{proof}
\exercise{2}
The following sets are creative:
\begin{enumerate}[itemsep=0pt]
\item[(a)] $\{\,x\mid x\in E_x\,\}$
\item[(b)] $\{\,x\mid E_x^{(n)}\ne\emptyset\,\}$
\item[(c)] $\{\,x\mid\phi_x\text{ is not injective}\,\}$
\item[(d)] $\{\,x\mid\phi_x(x)\in B\,\}$ where $B$~is a nonempty r.e. set
\item[(e)] $\{\,x\mid\phi_x(x)=f(x)\,\}$ where $f$~is a total computable function
\end{enumerate}
\begin{proof}
By Theorem~3.8.
For (a)~and~(b), we know the sets are r.e., and we know the sets are not recursive hence nontrivial and proper.
For~(c), we know the set is r.e. (Exercise~2.18.2), and the zero function is in but the identity function is not.
For~(d), we know the set is r.e. since `$\phi_x(x)\in B$' is partially decidable. Fix $b\in B$. Then the function~$\mathbf{b}$ is in the set, but the empty function is not.
For~(e), we know the set is r.e. since `$\phi_x(x)=f(x)$' is partially decidable, and $f$~is in the set but the empty function is not.
\end{proof}
\exercise{3}
Let $A$~and~$B$ be sets and suppose $B$~is r.e. and $A\sect B$~is productive. Then $A$~is productive.
\begin{proof}
First we claim there exists a total computable function~$k$ such that for all~$x$, $W_{k(x)}=W_x\sect B$. Indeed, since $B$~is r.e., by the \smn\ theorem there exists~$k$ with
$$\phi_{k(x)}(y)=\begin{cases}
\phi_x(y)&\text{if }y\in B\\
\text{undefined}&\text{otherwise}
\end{cases}$$
Then $W_{k(x)}=W_x\sect B$ as desired.
Now let $f$~be a productive function for~$A\sect B$. We claim $g=f\circ k$ is productive for~$A$. Indeed, $g$~is total computable, and given $W_x\subseteq A$, $W_{k(x)}\subseteq A\sect B$, so
$$g(x)=f(k(x))\in A\sect B-W_{k(x)}=A\sect B-W_x\sect B\subseteq A-W_x$$
Thus $A$~is productive.
\end{proof}
\exercise{4}
Let $A$~and~$C$ be disjoint sets and suppose $A$~is r.e. and $C$~is creative. Then $A\union C$~is creative.
\begin{proof}
Since $A$~and~$C$ are r.e., $A\union C$ is r.e.
We claim that $\overline{A\union C}=\overline{A}\sect\overline{C}$ is productive. Fix a total computable function~$k$ such that for all~$x$, $W_{k(x)}=W_x\union A$ (cf.~Exercise~3), and let $f$~be a productive function for~$\overline{C}$. We claim that $g=f\circ k$ is productive for $\overline{A}\sect\overline{C}$. Indeed, $g$~is total computable, and given $W_x\subseteq\overline{A}\sect\overline{C}$, $W_{k(x)}\subseteq\overline{C}$, so
$$g(x)=f(k(x))\in\overline{C}-W_{k(x)}=\overline{C}-W_x\union A\subseteq\overline{A}\sect\overline{C}-W_x$$
Thus $\overline{A}\sect\overline{C}$ is productive, and so $A\union C$ is creative.
\end{proof}
\noindent This exercise shows that adjoining additional r.e. elements to a creative set preserves creativity, while the previous exercise shows that adjoining additional non-r.e. elements to a productive set preserves productivity.
\bigskip
\exercise{7}
Let $\B\subseteq\C_1$, and suppose there exists $g\in\B$ such that for all finite $\theta\subseteq g$, $\theta\not\in\B$. Then $\B$~is productive.
\begin{proof}
By the \smn\ theorem, there exists~$k$ such that for all~$x$,
$$\phi_{k(x)}(y)=\begin{cases}
g(y)&\text{if }\lnot H_1(x,x,y)\\
\text{undefined}&\text{otherwise}
\end{cases}$$
If $x\in\overline{K}$, then $\phi_{k(x)}=g\in\B$, and if $x\not\in\overline{K}$, then $\phi_{k(x)}\subseteq g$ is finite, hence $\phi_{k(x)}\not\in\B$. By Theorem~3.2, $\B$~is productive.
\end{proof}
\exercise{8}
The following sets are productive:
\begin{enumerate}[itemsep=0pt]
\item[(a)] $\{\,x\mid\phi_x\text{ is total}\,\}$
\item[(b)] $\{\,x\mid\phi_x\text{ is a polynomial}\,\}$
\end{enumerate}
\begin{proof}
Note the identity function is in both sets, but no finite function is in either set, so the sets are productive by Exercise~7.
\end{proof}
\exercise{9}
\begin{enumerate}[itemsep=0pt]
\item[(a)] The sets $K_0=\{\,x\mid\phi_x(x)=0\,\}$ and $K_1=\{\,x\mid\phi_x(x)=1\,\}$ are effectively recursively inseparable.
\begin{proof}
By the \smn\ theorem, there exists a total computable function $k(a,b)$ such that for all $a,b$ with $W_a\sect W_b=\emptyset$,
$$\phi_{k(a,b)}(x)=\begin{cases}
1&\text{if }x\in W_a\\
0&\text{if }x\in W_b\\
\text{undefined}&\text{otherwise}
\end{cases}$$
Now suppose $K_0\subseteq W_a$ and $K_1\subseteq W_b$ with $W_a\sect W_b=\emptyset$. Set $n=k(a,b)$. Then if $n\in W_a\union W_b$, $\phi_n(n)=0$ iff $\phi_n(n)=1$---a contradiction. Hence $n\not\in W_a\union W_b$.
\end{proof}
\item[(b)] Suppose $A$~and~$B$ are r.e. sets which are effectively recursively inseparable. Then $A$~and~$B$ are creative.
\begin{proof}
We must prove that $\overline{A}$~and~$\overline{B}$ are productive.
To see $\overline{A}$~is productive, fix~$k$ such that for all~$x$, $W_{k(x)}=W_x\union B$ (cf.~Exercise~3) and let $f$~be a witness function for $A$~and~$B$. Define $g(x)=f(a,k(x))$, where $A=W_a$. Then given $W_x\subseteq\overline{A}$, $g(x)\not\in A\union W_{k(x)}=A\union B\union W_x$, so $g(x)\in\overline{A}-W_x$. So $g$~is a productive function or~$\overline{A}$.
To see $\overline{B}$~is productive, proceed similarly.
\end{proof}
\end{enumerate}
\subsection*{Exercises~4.4}
\exercise{2}
Let $f$~be an injective total computable function such that $\ran f$~is not recursive. Then the set
$$A=\bigl\{\,x\mid\exists y>x\bigl(\,f(y)<f(x)\,\bigr)\,\bigr\}$$
is simple.
\begin{proof}
Note $A$~is r.e. since membership is partially decidable.
If $\overline{A}$~is finite, then there exists some~$x_0$ such that for all $x\ge x_0$, $x\in A$. But then we can recursively define
$$x_{n+1}=\mu x>x_n[f(x_{n+1})<f(x_n)]$$
Now $f(x_0)>f(x_1)>\cdots$ is infinitely descending---a contradiction. Thus $\overline{A}$~is infinite.
To see that $\overline{A}$~contains no infinite r.e. subset, suppose towards a contradiction that $B\subseteq\overline{A}$ is infinite r.e. Then we can decide whether $y\in\ran f$ as follows: search for $b\in B$ with $f(b)>y$ (such a~$b$ much exist since $B$~is infinite and $f$~is injective). Then we know for all $c>b$, $y<f(b)<f(c)$. Now check whether any of $f(0),\ldots,f(b-1)$ equal~$y$. If so, $y\in\ran f$; if not, then by the previous remark, $y\not\in\ran f$. Since $\ran f$~is not decidable, this is a contradiction.
\end{proof}
\section*{Chapter~9}
\subsection*{Exercises~1.7}
\exercise{1}
\begin{enumerate}[itemsep=0pt]
\item[(a)] $K\mr\{\,x\mid\phi_x(x)=0\,\}$
\begin{proof}
By the \smn\ theorem, there exists a total computable function~$s$ such that for all~$x$,
$$\phi_{s(x)}(y)=\begin{cases}
0&\text{if }x\in W_x\\
\text{undefined}&\text{otherwise}
\end{cases}$$
Clearly $x\in W_x$ iff $\phi_{s(x)}(s(x))=0$.
\end{proof}
\item[(b)] $K\mr\{\,x\mid x\in E_x\,\}$
\begin{proof}
By the \smn\ theorem, there exists a total computable function~$t$ such that for all~$x$,
$$\phi_{t(x)}(y)=\begin{cases}
y&\text{if }x\in W_x\\
\text{undefined}&\text{otherwise}
\end{cases}$$
Then $x\in W_x$ iff $t(x)\in E_{t(x)}$.
\end{proof}
\end{enumerate}
\exercise{3}
\begin{enumerate}[itemsep=0pt]
\item[(a)] $\{\,x\mid \phi_x=\mathbf{0}\,\}\mr\{\,x\mid\phi_x\text{ is total and constant}\,\}$
\begin{proof}
By the \smn\ theorem, there exists a total computable function~$k$ such that for all~$x$,
$$\phi_{k(x)}(y)=y\sum_{z=0}^y\phi_x(z)$$
If $\phi_x=\mathbf{0}$, then $\phi_{k(x)}=\mathbf{0}$, so $\phi_{k(x)}$~is total and constant. If $\phi_x\ne\mathbf{0}$, then either $\phi_x$~is total or it is not. If $\phi_x$~is not total, then neither is~$\phi_{k(x)}$ (in fact, if $\phi_x(y)$~is undefined, then $\phi_{k(x)}(z)$~is undefined for all $z\ge y$). If $\phi_x$~is total, choose~$y$ such that $\phi_x(y)>0$. Then
$$\phi_{k(x)}(y+1)=(y+1)\sum_{z=0}^{y+1}\phi_x(z)\ge(y+1)\sum_{z=0}^y\phi_x(z)\ge\phi_{k(x)}(y)+\phi_x(y)>\phi_{k(x)}(y)$$
Hence $\phi_{k(x)}$~is not constant.
\end{proof}
\item[(b)] $\{\,x\mid\phi_x\text{ is total}\,\}\mr\{\,x\mid W_x\text{ is infinite}\,\}$
\begin{proof}
Using the same function~$k$ from part~(a).
\end{proof}
\end{enumerate}
\exercise{5}
Suppose $A$~and~$B$ are r.e., $A\union B=\N$ and $A\sect B\ne\emptyset$. Then $A\mr A\sect B$.
\begin{proof}
Write $A=W_a$, $B=W_b$, and define $\tau(x)=\mu t[H_1(a,x,t)\lor H_1(b,x,t)]$. Then $\tau$~is total and computable, and hence so is
$$\pi(x)=\begin{cases}
0&\text{if }H_1(a,x,\tau(x))\\
1&\text{otherwise}
\end{cases}$$
Note $\pi^{-1}(0)\subseteq A$ and $\pi^{-1}(1)\subseteq B$. Now fix $w\in A\sect B$ and define total computable
$$f(x)=(1-\pi(x))w+\pi(x)x$$
If $x\in A$, either $\pi(x)=0$ and $f(x)=w\in A\sect B$, or else $\pi(x)=1$ so $x\in B$ and hence $f(x)=x\in A\sect B$. If $x\not\in A$, then $x\in B$ and $\pi(x)=1$, so $f(x)=x\not\in A\sect B$. Therefore $x\in A$ iff $f(x)\in A\sect B$, so $f:A\mr A\sect B$.
\end{proof}
\subsection*{Exercises~2.9}
\exercise{1}
The following sets are m-equivalent to~$K$:
\begin{enumerate}[itemsep=0pt]
\item[(a)] $\{\,x\mid x\in E_x\,\}$
\item[(b)] $\{\,x\mid\phi_x(x)=0\,\}$
\end{enumerate}
\begin{proof}
These sets are m-reducible to~$K$ since they are r.e. (Theorem~1.6), and $K$~is m-reducible to each of them by Exercise~1.7.1.
\end{proof}
\exercise{3}
It is not true in general that if $A\me\overline{A}$, then $A$~is recursive.
\begin{proof}
Let $\dg{a}=\dg{0}_m'\union\dg{0}_m'^*>\dg{0}$. Then $\dg{a}=\dg{a}^*$ by Exercise~5(d). Hence for $A\in\dg{a}$, $A$~is not recursive but $A\me\overline{A}$.
\end{proof}
\exercise{4}
The following sets are all m-equivalent:
\begin{enumerate}[itemsep=0pt]
\item[(a)] $A=\{\,x\mid\phi_x=\mathbf{0}\,\}$
\item[(b)] $B=\{\,x\mid\phi_x\text{ is total and constant}\,\}$
\item[(c)] $C=\{\,x\mid W_x\text{ is infinite}\,\}$
\end{enumerate}
\begin{proof}
We know $A\mr B$ by Exercise 1.7.3(a). To see $B\mr C$, note by the \smn\ theorem there exists a total computable function~$s$ such that for all~$x$, $\phi_{s(x)}$~is defined recursively as follows:
\begin{align*}
\phi_{s(x)}(0)&=\phi_x(0)\\
\phi_{s(x)}(y+1)&=\begin{cases}
\phi_x(y+1)&\text{if }\phi_{s(x)}(y)\text{ is defined and }\phi_x(y+1)=\phi_{s(x)}(y)\\
\text{undefined}&\text{otherwise}
\end{cases}
\end{align*}
If $\phi_x$~is total and constant, then $\phi_{s(x)}=\phi_x$ so $W_{s(x)}=\N$ is infinite. If $\phi_x$~is not total, then there exists~$y$ such that $\phi_x(y)$~is undefined; by construction then, $\phi_{s(x)}(z)$~is undefined for all $z\ge y$, so $W_{s(x)}$~is finite. If $\phi_x$~is total but not constant, then there exists a least $y>0$ such that $\phi_x(y)\ne\phi_x(0)$; by construction again, $\phi_{s(x)}(z)$~is undefined for all $z\ge y$, so $W_{s(x)}$~is finite. Thus $s:B\mr C$.
Finally, to see $C\mr A$, note by the \smn\ theorem there exists a total computable function~$u$ such that for all~$x$,
$$\phi_{u(x)}(y)=\mathbf{0}\bigl(\,\mu t\bigl[\biglor_{i=0}^t H_1(x,y+i,t)\bigr]\,\bigr)$$
If $W_x$~is infinite, then for any~$y$ there exists $z\ge y$ such that $\phi_x(z)$~is defined, that is, for any~$y$ there exists~$i$ and $t\ge i$ such that the computation $P_x(y+i)$ halts within~$t$ steps, so $\phi_{u(x)}(y)=0$. Since $y$~was arbitrary, $\phi_{u(x)}=\mathbf{0}$. Conversely, if $W_x$~is finite, there exists some~$y$ such that for all $z\ge y$, the computation~$P_x(z)$ never halts, so $\phi_{u(x)}(y)$~is undefined and $\phi_{u(x)}\ne\mathbf{0}$. Therefore we have $u:C\mr A$.
Since $A\mr B\mr C\mr A$, $A\me B\me C$ by Theorem~1.3.
\end{proof}
\exercise{5}
Let $\dg{a},\dg{b}$ be m-degrees.
\begin{enumerate}