Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
aa:intro:computability_theory [2016/07/21 23:30]
malex
aa:intro:computability_theory [2016/08/01 16:36] (current)
malex [1.4.6. Proposition]
Line 232: Line 232:
 This observation prompted the aforementioned conjecture. It is strongly believed to hold (as evidence suggests), but it cannot be formally proved. This observation prompted the aforementioned conjecture. It is strongly believed to hold (as evidence suggests), but it cannot be formally proved.
  
-===== - Decidability ​{[(DE AICI IN JOS DE VERIFICAT!)]}=====+===== - Decidability =====
 [Matei: The fact that the totality problem is undecidable means that we cannot write a program that can find any infi nite loop in any program. The fact that the equivalence problem is undecidable means that the code optimization phase of a compiler may improve a program, but can never guarantee finding the optimally eficient version of the program. There may be potentially improved versions of the program that it cannot even be sure are equivalent.] [Matei: The fact that the totality problem is undecidable means that we cannot write a program that can find any infi nite loop in any program. The fact that the equivalence problem is undecidable means that the code optimization phase of a compiler may improve a program, but can never guarantee finding the optimally eficient version of the program. There may be potentially improved versions of the program that it cannot even be sure are equivalent.]
  
-The existence of the Universal Turing Machine $math[(U)] inevitably leads to interesting questions. Assume $math[M] is a Turing Machine and $math[w] is a word. We use the following convention: $math[enc(M)\_w] in order to represent the input of the $math[U]. Thus, $math[U] expects the encoding of a TM, followed by the special ​_____ symbol, and $math[M]'​s input $math[w]. $math[(\star)] Does $math[U] halt for all inputs? If the answer is positive, then $math[U] can be used to tell whether any machine halts, for a given input.+The existence of the Universal Turing Machine $math[(U)] inevitably leads to interesting questions. Assume $math[M] is a Turing Machine and $math[w] is a word. We use the following convention: $math[enc(M)\_w] in order to represent the input of the $math[U]. Thus, $math[U] expects the encoding of a $math[TM], followed by the special symbol ​$math[\_], and $math[M]'​s input $math[w]. $math[(\star)] Does $math[U] halt for all inputs? If the answer is positive, then $math[U] can be used to tell whether any machine halts, for a given input.
  
 We already have some reasons to believe we cannot answer positively to $math[(\star)],​ if we examine the proof of Proposition 1.3.2. Actually $math[(\star)] is a decision problem, one that is quite interesting and useful. We already have some reasons to believe we cannot answer positively to $math[(\star)],​ if we examine the proof of Proposition 1.3.2. Actually $math[(\star)] is a decision problem, one that is quite interesting and useful.
Line 252: Line 252:
 //Proof:// It is sucient to show that $math[Hom(\mathbb{N},​ \{0, 1\})] is uncountably infi nite. We build a proof by contraposition. We assume $math[Hom(\mathbb{N},​ \{0, 1\})] is countably infi nite. Hence, each natural number $math[n \in \mathbb{N}] corresponds to a function $math[f_n \in Hom(\mathbb{N},​ \{0, 1\})]. We build a matrix as follows: Columns describe functions $math[f_n : n \in \mathbb{N}]. Rows describe inputs $math[k \in \mathbb{N}]. Each matrix content $math[m_{i,​j}] is the value of $math[f_j(i)] (hence, the expected output for input $math[i], from function $math[f_j]). //Proof:// It is sucient to show that $math[Hom(\mathbb{N},​ \{0, 1\})] is uncountably infi nite. We build a proof by contraposition. We assume $math[Hom(\mathbb{N},​ \{0, 1\})] is countably infi nite. Hence, each natural number $math[n \in \mathbb{N}] corresponds to a function $math[f_n \in Hom(\mathbb{N},​ \{0, 1\})]. We build a matrix as follows: Columns describe functions $math[f_n : n \in \mathbb{N}]. Rows describe inputs $math[k \in \mathbb{N}]. Each matrix content $math[m_{i,​j}] is the value of $math[f_j(i)] (hence, the expected output for input $math[i], from function $math[f_j]).
  
-{{ :​aa:​intro:​aafigura2.4.2.jpg?​nolink&​300 |}}+$math[\begin{array}{ll} \mbox{ } & f_0 & f_1 & f_2 & \ldots & f_n & \ldots \\ 0 & 1 & 1 & 0 & \ldots & 0 & \ldots \\ 1 & 0 & 1 & 1 & \ldots & 0 & \ldots \\ 2 & 1 & 0 & 1 & \ldots & 1 & \ldots \\ \ldots & \ldots & \ldots & \ldots & \ldots & \ldots & \ldots \\ n & 1 & 1 & 0 & \ldots & 1 & \ldots \\ \ldots & \ldots & \ldots & \ldots & \ldots & \ldots & \ldots \end{array} \\ \mbox{Figure 1.4.2}]
  
 Figure 1.4.2: An example of the matrix of the proof of Proposition 1.4.2. The value $math[m_{i,​j}] have been fi lled out purely for the illustration. Figure 1.4.2: An example of the matrix of the proof of Proposition 1.4.2. The value $math[m_{i,​j}] have been fi lled out purely for the illustration.
Line 269: Line 269:
  
 $def[Decision,​ acceptance] $def[Decision,​ acceptance]
-Let $math[M] be a Turing Machine and $math[f \in Hom(\mathbb{N},​ \{0, 1\})].We say that: +//Let $math[M] be a Turing Machine and $math[f \in Hom(\mathbb{N},​ \{0, 1\})].We say that:// 
-  * $math[M] **decides** $math[f], iff for all $math[n \in \mathbb{N}]:​ $math[M(w) = 1] whenever $math[f(n^w) = 1] and $math[M(w) = 0] whenever $math[f(n^w) = 0]. +  * //$math[M] **decides** $math[f], iff for all $math[n \in \mathbb{N}]:​ $math[M(w) = 1] whenever $math[f(n^w) = 1] and $math[M(w) = 0] whenever $math[f(n^w) = 0].// 
-  * $math[M] **accepts** $math[f] iff for all $math[n \in \mathbb{N}]:​ $math[M(w) = 1] iff $math[f(n^w) = 1], and $math[M(w) = \perp] iff $math[f(n)=0].+  * //$math[M] **accepts** $math[f] iff for all $math[n \in \mathbb{N}]:​ $math[M(w) = 1] iff $math[f(n^w) = 1], and $math[M(w) = \perp] iff $math[f(n)=0].//
 $end $end
  
-Note that, in contrast with acceptance, decision is, intuitively,​ a stronger means of computing a function (i.e. solving a problem). In the latter case, the TM at hand can provide both a //yes// and a //no// answer to any problem instance, while in the former, the TM can only provide an answer of //yes//. If the answer to the problem instance at hand is //no//, the TM will not halt.+Note that, in contrast with acceptance, decision is, intuitively,​ a stronger means of computing a function (i.e. solving a problem). In the latter case, the $math[TMat hand can provide both a //yes// and a //no// answer to any problem instance, while in the former, the $math[TMcan only provide an answer of //yes//. If the answer to the problem instance at hand is //no//, the $math[TMwill not halt.
  
 Based on the two types of problem solving, we can classify problems (functions) as follows: Based on the two types of problem solving, we can classify problems (functions) as follows:
Line 281: Line 281:
 //Let $math[f \in Hom(\mathbb{N},​ \{0, 1\})] be a decision problem.// //Let $math[f \in Hom(\mathbb{N},​ \{0, 1\})] be a decision problem.//
  
-  * //$math[f] is **recursive** (decidable) iff there exists a $math[TM M] which decides $math[f]. The set of recursive functions is $math[R = \{f \in Hom(\mathbb{N},​ \{0,1\}) \mid \mbox{f is recursive} \}]// +  * //$math[f] is **recursive** (decidable) iff there exists a $math[TM] $math[M] which decides $math[f]. The set of recursive functions is $math[R = \{f \in Hom(\mathbb{N},​ \{0,1\}) \mid \mbox{f is recursive} \}]// 
-  * //$math[f] is **recursively enumerable** (//​semi-decidable//​) iff there exists a $math[TM M] which accepts $math[f]. The set of recursive-enumerable function is $math[RE = \{f \in Hom(\mathbb{N},​\{0,​1\}) \mid \mbox{f is recursively-enumerable} \}]//+  * //$math[f] is **recursively enumerable** (//​semi-decidable//​) iff there exists a $math[TM] $math[M] which accepts $math[f]. The set of recursive-enumerable function is $math[RE = \{f \in Hom(\mathbb{N},​\{0,​1\}) \mid \mbox{f is recursively-enumerable} \}]//
 $end $end
  
-Now, let us turn our attention to ques +Now, let us turn our attention to question ​$math[\star],​ which we shall formulate as a problem:
-tion $math[\star],​ which we shall formulate as a problem:+
  
 $math[f_h(n^{enc(M)\_w})= \left\{ \begin{array}{ll} 1 & \mbox{iff } M(w) \mbox{halts} \\ 0 & \mbox{iff } M(w) = \perp \end{array} \right.] $math[f_h(n^{enc(M)\_w})= \left\{ \begin{array}{ll} 1 & \mbox{iff } M(w) \mbox{halts} \\ 0 & \mbox{iff } M(w) = \perp \end{array} \right.]
Line 299: Line 298:
 $math[D(enc(M)) = \left\{ \begin{array}{ll} \perp & \mbox{iff } M_h(enc(M)\_enc(M)) = 1 \\ 1 & \mbox{iff } M_h(enc(M)\_enc(M)) = 0 \end{array} \right.] $math[D(enc(M)) = \left\{ \begin{array}{ll} \perp & \mbox{iff } M_h(enc(M)\_enc(M)) = 1 \\ 1 & \mbox{iff } M_h(enc(M)\_enc(M)) = 0 \end{array} \right.]
  
-The existence of the Universal Turing Machine guarantees that $math[D] can indeed be built, since $math[D] simulates $math[M_h]. We note that $math[M_h(enc(M)\_enc(M))] decides if the $math[TM M] halts with "//​itself//"​ as input (namely $math[enc(M)]).+The existence of the Universal Turing Machine guarantees that $math[D] can indeed be built, since $math[D] simulates $math[M_h]. We note that $math[M_h(enc(M)\_enc(M))] decides if the $math[TM] $math[M] halts with "//​itself//"​ as input (namely $math[enc(M)]).
  
 Assume $math[D(enc(D)) = 1]. Hence $math[M_h(enc(D),​enc(D)) = 0], that is, machine $math[D] does not halt for input $math[enc(D)]. Hence $math[D(enc(D)) = \perp]. Contradiction. Assume $math[D(enc(D)) = 1]. Hence $math[M_h(enc(D),​enc(D)) = 0], that is, machine $math[D] does not halt for input $math[enc(D)]. Hence $math[D(enc(D)) = \perp]. Contradiction.
Line 308: Line 307:
  
 ==== Exercise ==== ==== Exercise ====
-Apply the diagonalization technique from the proof of Proposition 1.4.2, in order to prove Proposition 1.4.3.+//Apply the diagonalization technique from the proof of Proposition 1.4.2, in order to prove Proposition 1.4.3.//
  
 ==== - Proposition ==== ==== - Proposition ====
Line 320: Line 319:
 $math[R \subsetneq RE] $math[R \subsetneq RE]
  
-//Proof:// $math[R \subseteq RE] is straightforward from Definition of $math[R] and $math[RE] from Definition of $math[R] and $math[RE]. Let $math[f \in R], and $math[M_f] be the $math[TM] which decides $math[M_f]. We build the $math[TM] $math[M'] such that $math[M'(w)=1] iff $math[M_f(w)=1] and $math[M'(w)=\perp] iff $math[M_f(w)=0]. $math[M'] simulates $math[M] but enters into an infinite loop whenever $math[M_f(w)=0]. $math[M'] accepts $math[f] hence $math[f \in RE].+//Proof:// $math[R \subseteq RE] is straightforward from Definition of $math[R] and $math[RE] from Definition of $math[R] and $math[RE]. Let $math[f \in R], and $math[M_f] be the $math[TM] which decides $math[M_f]. We build the $math[TM] $math[M^\prime] such that $math[M^\prime(w)=1] iff $math[M_f(w)=1] and $math[M^\prime(w)=\perp] iff $math[M_f(w)=0]. $math[M^\prime] simulates $math[M] but enters into an infinite loop whenever $math[M_f(w)=0]. $math[M^\prime] accepts $math[f] hence $math[f \in RE].
  
 $math[R \neq RE] has already been shown by Propositions 1.4.3 and 1.4.4. $math[f_h \in RE] but $math[f_h \notin R]. $math[R \neq RE] has already been shown by Propositions 1.4.3 and 1.4.4. $math[f_h \in RE] but $math[f_h \notin R].
Line 327: Line 326:
  
 ==== 1.4.1 Remark ==== ==== 1.4.1 Remark ====
-//We note that $math[R] and $math[RE] are not the only sets of functions which are used in Computability Theory. It has been shown that there are //"​degrees"//​ of unsolvability,​ of //"​higher level"//​ than $math[R] and $math[RE]. These degrees are intuitively obtained as follows: We assume we live in a world where $math[f_h] is decidable (recursive). Now, as before, we ask which problems are recursive and which are recursively-enumerable. It turns out that, also in this ideal case, there still exist recurs +//We note that $math[R] and $math[RE] are not the only sets of functions which are used in Computability Theory. It has been shown that there are //"​degrees"//​ of unsolvability,​ of //"​higher level"//​ than $math[R] and $math[RE]. These degrees are intuitively obtained as follows: We assume we live  
-ive and recursively-enumerable problems, as well +in a world where $math[f_h] is decidable (recursive). Now, as before, we ask which problems are recursive and which are recursively-enumerable. It turns out that, also in this ideal case, there still exist recursive ​and recursively-enumerable problems, as well as some which are neither. This could be imagined as //"​undecidability level 1"//. Now, we take some problem which is in $math[RE] on level 1, and repeat the same assumption: it is decidable. Again, under this assumption, we find problems in $math[R], $math[RE] and outside the two, which form up //"​undecidability level 2"//. This process can be repeated// ad infi nitum.
-as some which are neither. This could be imagined as //"​undecidability level 1"//. Now, we take some problem which is in $math[RE] on level 1, and repeat the same assumption: it is decidable. Again, under this assumption, we find problems in $math[R], $math[RE] and outside the two, which form up //"​undecidability level 2"//. This process can be repeated// ad infi nitum.+
  
 Returning to our simpler classi cation,​ we must observe an interesting feature of recursively-enumerable functions, which is also the reason they are called this way. Returning to our simpler classi cation,​ we must observe an interesting feature of recursively-enumerable functions, which is also the reason they are called this way.
Line 336: Line 334:
 //A function $math[f \in Hom(\mathbb{N},​ \{0, 1\})] is recursively enumerable iff there exists a Turing Machine which can **enumerate/​generate** all elements in $math[A_f = \{w \in \mathbb{N} \mid f(n^w) = 1\}]. Intuitively,​ $math[A_f] is the set of inputs of $math[f] for which the answer at hand is yes.// //A function $math[f \in Hom(\mathbb{N},​ \{0, 1\})] is recursively enumerable iff there exists a Turing Machine which can **enumerate/​generate** all elements in $math[A_f = \{w \in \mathbb{N} \mid f(n^w) = 1\}]. Intuitively,​ $math[A_f] is the set of inputs of $math[f] for which the answer at hand is yes.//
  
-//Proof:// $math[\Longrightarrow] Suppose $math[f] is recursively-enumerable and $math[M] ​accpts ​$math[f]. We write $math[w_i] to refer to the //i//th word from $math[\Sigma^*]. We specify the $math[TM] generating $math[A_f] by the following pseudocode:+//Proof:// $math[\Longrightarrow] Suppose $math[f] is recursively-enumerable and $math[M] ​accepts ​$math[f]. We write $math[w_i] to refer to the //i//th word from $math[\Sigma^*]. We specify the $math[TM] generating $math[A_f] by the following pseudocode:
  
 $algorithm[$math[GEN()]] $algorithm[$math[GEN()]]
Line 373: Line 371:
 $math[\mathbf{while} \mbox{ } w \notin A_f \mbox{ } \mathbf{do}] $math[\mathbf{while} \mbox{ } w \notin A_f \mbox{ } \mathbf{do}]
  
-$math[\quad ​w=GEN();]+$math[\quad ​v=GEN();]
  
-$math[\quad A_f = A_f \cup \{ \};]+$math[\quad A_f = A_f \cup \{ \};]
  
 $math[\mathbf{end}] $math[\mathbf{end}]
Line 396: Line 394:
 The technique we use to show $math[f_{all} \notin R] is called a //​reduction//​ (from $math[f_h]). It proceeds as follows. We assume $math[f_{all} \in R]. Starting from the $math[TM \mbox{ } M_{all}] which decides $math[f_{all}] we built a $math[TM] which decides $math[f_h]. Thus, if $math[f_{all}] is decidable then $math[f_h] is decidable, which leads to contradiction. The technique we use to show $math[f_{all} \notin R] is called a //​reduction//​ (from $math[f_h]). It proceeds as follows. We assume $math[f_{all} \in R]. Starting from the $math[TM \mbox{ } M_{all}] which decides $math[f_{all}] we built a $math[TM] which decides $math[f_h]. Thus, if $math[f_{all}] is decidable then $math[f_h] is decidable, which leads to contradiction.
  
-First, for each fixed $math[TM \mbox{ } M] and fi xed input $math[w \in \Sigma^*],​ we build the $math[TM \mbox{ } \Pi_{M,​w}(\omega) = ]//"​Replace $math[\omega] by $math[w] and then simulate $math[M(w)]"//​. It is easy to see that $math[(\forall \omega \in \Sigma^* : \Pi_{M,​w}(\omega) \mbox{ halts})] iff $math[M(w)] halts. Now, we build the $math[TM \mbox{ } M_h] which decides $math[f_h]. The input of $math[M_h] is $math[enc(M)\_w]. We construct $math[\Pi_{M,​w}] and run $math[M_{all}(enc(\Pi_{M,​w}))]. By assumption $math[M_{all}] must always halt. If the output is $math[1], then $math[\Pi_{M,​w}(\omega)] halts for all inputs, hence $math[M(w)] halts. We output $math[1]. If the output is $math[0], then $math[\Pi_{M,​w}(\omega)] does not halt for all inputs, hence $math[M(w)] does not halt. We output $math[0].+First, for each fixed $math[TM \mbox{ } M] and fi xed input $math[w \in \Sigma^*],​ we build the $math[TM \mbox{ } \Pi_{M,​w}(\omega) = ]//"​Replace $math[\omega] by $math[w] and then simulate $math[M(w)]"//​. It is easy to see that $math[(\forall \omega \in \Sigma^* : \Pi_{M,​w}(\omega) \mbox{ halts})] iff $math[M(w) 
 +] halts. Now, we build the $math[TM \mbox{ } M_h] which decides $math[f_h]. The input of $math[M_h] is $math[enc(M)\_w]. We construct $math[\Pi_{M,​w}] and run $math[M_{all}(enc(\Pi_{M,​w}))]. By assumption $math[M_{all}] must always halt. If the output is $math[1], then $math[\Pi_{M,​w}(\omega)] halts for all inputs, hence $math[M(w)] halts. We output $math[1]. If the output is $math[0], then $math[\Pi_{M,​w}(\omega)] does not halt for all inputs, hence $math[M(w)] does not halt. We output $math[0].
  
 We have built a reduction from $math[f_{all}] to $math[f_h]: Using the $math[TM] which decides $math[f_{all}] we have constructed a machine which decides $math[f_h]. Since $math[f_h] is not recursive, we obtain a contradiction. We have built a reduction from $math[f_{all}] to $math[f_h]: Using the $math[TM] which decides $math[f_{all}] we have constructed a machine which decides $math[f_h]. Since $math[f_h] is not recursive, we obtain a contradiction.
Line 415: Line 414:
 $math[\Pi_{M,​w}(\omega) = \mbox{ if } \omega = 111 \mbox{ then } M(w) \mbox{ else loop }] $math[\Pi_{M,​w}(\omega) = \mbox{ if } \omega = 111 \mbox{ then } M(w) \mbox{ else loop }]
  
-We observe that (i) the transformation from $math[enc(M)\_w] to $math[enc(\Pi_{M,​w})] is decidable since it involves adding precisely three states to $math[M]: these states check the input $math[\omega],​ and if it is $math[111] - replace it with $math[w] and run $math[M]; (ii) $math[M_{111}(\Pi_{M,​w}) = 1 \mbox{ iff } M(w)halts. The reduction is complete. $math[f_{111} \notin R].+We observe that (i) the transformation from $math[enc(M)\_w] to $math[enc(\Pi_{M,​w})] is decidable since it involves adding precisely three states to $math[M]: these states check the input $math[\omega],​ and if it is $math[111] - replace it with $math[w] and run $math[M]; (ii) $math[M_{111}(\Pi_{M,​w}) = 1 \mbox{ iff } M(w) \mbox{halts}]. The reduction is complete. $math[f_{111} \notin R].
  
 **Halting on some input** **Halting on some input**
Line 435: Line 434:
 $math[f_{eq}(n^{enc(M_1)\_enc(M_2)}) = \left\{ \begin{array}{ll} 1 & \mbox{for all } w \in \Sigma^* \mbox{ : } M_1(w) \mbox{ halts iff } M_2(w) \mbox{ halts} \\ 0 & \mbox{otherwise} \end{array} \right.] $math[f_{eq}(n^{enc(M_1)\_enc(M_2)}) = \left\{ \begin{array}{ll} 1 & \mbox{for all } w \in \Sigma^* \mbox{ : } M_1(w) \mbox{ halts iff } M_2(w) \mbox{ halts} \\ 0 & \mbox{otherwise} \end{array} \right.]
  
-We reduce $math[f_{all}] to $math[f_{eq}]. Let $math[M_{triv}] be a one-state Turing Machine which halts on every input, and $math[M_{eq}] be the Turing Machine which decides $math[f_{eq}]. Then $math[M_{eq}(enc(M)\_enc(M_{triv}) = 1 \mbox{ iff } M] halts on all inputs. We have shown we can use $math +We reduce $math[f_{all}] to $math[f_{eq}]. Let $math[M_{triv}] be a one-state Turing Machine which halts on every input, and $math[M_{eq}] be the Turing Machine which decides $math[f_{eq}]. Then $math[M_{eq}(enc(M)\_enc(M_{triv})) = 1 \mbox{ iff } M] halts on all inputs. We have shown we can use $math[M_{eq}] in order to build a machine which decides $math[f_{all}]. Contradiction. $math[f_{eq} \notin R].
-[M_{eq}] in order to build a machine which decides $math[f_{all}]. Contradiction. $math[f_{eq} \notin R].+
  
 So far, we have used reductions in order to establish problem nonmembership in $math[R]. There are other properties of $math[R] and $math[RE] which can be of use for this task. First we defi ne: So far, we have used reductions in order to establish problem nonmembership in $math[R]. There are other properties of $math[R] and $math[RE] which can be of use for this task. First we defi ne:
Line 461: Line 459:
 $math[RE \cap coRE = R]. $math[RE \cap coRE = R].
  
-//Proof:// Assume $math[f \in RE \cap coRE]. Hence, there exists a Turing Machine $math[M] which ccepts ​$math[f] ​ +//Proof:// Assume $math[f \in RE \cap coRE]. Hence, there exists a Turing Machine $math[M] which accepts ​$math[f] and a Turing Machine $math[\overline{M}] which accepts $math[\overline{f}]. We build the Turing Machine:
-and a Turing Machine $math[\overline{M}] which accepts $math[\overline{f}]. We build the Turing Machine:+
  
-$math[M^*(w) = \mbox{ for } i \in \mathbb{N} \left\{ \begin{array}{ll} \mbox{ run } M(w) \mbox{ for } i \mbox{steps.}\\ \mbox{ If } M(w) = 1 \mbox{, return } 1 \mbox{. Otherwise:​}\\ \mbox{ run } \overline{M}(w) \mbox{ for } i \mbox{steps.}\\ \mbox{ If } \overline{M}(w) = 1 \mbox{, return } 0 \mbox{.} \end{array} \right.]+$math[M^*(w) = \mbox{ for } i \in \mathbb{N} \left\{ \begin{array}{ll} \mbox{ run } M(w) \mbox{ for } i \mbox{ steps.}\\ \mbox{ If } M(w) = 1 \mbox{, return } 1 \mbox{. Otherwise:​}\\ \mbox{ run } \overline{M}(w) \mbox{ for } i \mbox{ steps.}\\ \mbox{ If } \overline{M}(w) = 1 \mbox{, return } 0 \mbox{.} \end{array} \right.]
  
 Since $math[M] and $math[\overline{M}] will always halt when expected result is 1, they can be used together to decide $math[f]. Hence $math[f \in R]. Since $math[M] and $math[\overline{M}] will always halt when expected result is 1, they can be used together to decide $math[f]. Hence $math[f \in R].
Line 472: Line 469:
  
 //Proof:// The proposition follows immediately since the Turing Machine which decides $math[f] can be used to decide $math[\overline{f}],​ by simply switching it's output from $math[0] to $math[1] and $math[1] to $math[0]. The same holds for the other direction. //Proof:// The proposition follows immediately since the Turing Machine which decides $math[f] can be used to decide $math[\overline{f}],​ by simply switching it's output from $math[0] to $math[1] and $math[1] to $math[0]. The same holds for the other direction.
- +
 We conclude this chapter with a very powerful result which states that an //​category/​type//​ of problems does not belong in $math[R]. We conclude this chapter with a very powerful result which states that an //​category/​type//​ of problems does not belong in $math[R].
  
Line 478: Line 475:
 //Let $math[\mathcal{C} \subseteq RE]. Given a Turing Machine $math[M], we ask:// "The problem accepted by $math[M] is in $math[\mathcal{C}]?"​. //Answering this question is not in $math[R].// //Let $math[\mathcal{C} \subseteq RE]. Given a Turing Machine $math[M], we ask:// "The problem accepted by $math[M] is in $math[\mathcal{C}]?"​. //Answering this question is not in $math[R].//
  
-//Proof:// We consider that the trivial problem $math[f(n) = 0] is not in $math[\mathcal{C}]. Since $math[\mathcal{C}] is non-empty, suppose $math[f^* \in \mathcal{C}],​ and since $math[f^*] is recursively-enumerable,​ let $math[M] be the Turing Machine which accepts $math[f^*].+//Proof:// We consider that the trivial problem $math[f(n) = 0] is not in $math[\mathcal{C}]. Since $math[\mathcal{C}] is non-empty, suppose $math[f^* \in \mathcal{C}],​ and since $math[f^*] is recursively-enumerable,​ let $math[M^*] be the Turing Machine which accepts $math[f^*].
  
 We apply a reduction from a variant of $math[f_{111}],​ namely $math[f_x]. $math[f_x] asks if a Turing Machine halts for input $math[x]. We assume we can decide the membership $math[f \in \mathcal{C}] by some Turing Machine. Based on the latter, we construct a Turing Machine which decides $math[f_x] (i.e. solves the halting problem for a particular input). Let $math[M_x] be the Turing Machine which //accepts// $math[fx]. We apply a reduction from a variant of $math[f_{111}],​ namely $math[f_x]. $math[f_x] asks if a Turing Machine halts for input $math[x]. We assume we can decide the membership $math[f \in \mathcal{C}] by some Turing Machine. Based on the latter, we construct a Turing Machine which decides $math[f_x] (i.e. solves the halting problem for a particular input). Let $math[M_x] be the Turing Machine which //accepts// $math[fx].