\[\newcommand{\lra}{\leftrightarrow}
\newcommand{\tx}[1]{\text{#1}}
\newcommand{\line}[2]{\ & #1 \quad & \rm{(#2)}\\}
\newcommand{\linet}[2]{\ & #1 \quad & \rm{#2}\\}
\newcommand{\fa}{\forall}
\newcommand{\ex}{\exists}
\newcommand{\A}{\mathcal{A}}
\newcommand{\B}{\mathcal{B}}
\newcommand{\C}{\mathcal{C}}
\newcommand{\D}{\mathcal{D}}
\newcommand{\E}{\mathcal{E}}
\newcommand{\G}{\mathcal{G}}
\newcommand{\H}{\mathcal{H}}
\newcommand{\I}{\mathcal{I}}
\newcommand{\J}{\mathcal{J}}
\newcommand{\mK}{\mathfrak{K}}
\newcommand{\mN}{\mathfrak{N}}
\newcommand{\mM}{\mathfrak{M}}
\newcommand{\mA}{\mathfrak{A}}
\newcommand{\mB}{\mathfrak{B}}
\newcommand{\mC}{\mathfrak{C}}
\newcommand{\mD}{\mathfrak{D}}
\newcommand{\mL}{\mathfrak{L}}
\newcommand{\mR}{\mathfrak{R}}
\newcommand{\Ax}{{\bf Ax}}
\newcommand{\ax}{\Lambda}
\newcommand{\bl}{\begin{aligned}}
\newcommand{\el}{\end{aligned}}
\newcommand{\T}{\mathscr{T}}
\newcommand{\t}{ {\bf t} }
\newcommand{\f}{ {\bf f} }
\newcommand{\L}[1]{L(#1)}
\newcommand{\eq}{\equiv}
\newcommand{\inp}{\leftarrow}
\newcommand{\la}[1]{\langle #1\rangle}
\newcommand{\ov}[1]{\overline{#1}}
\newcommand{\wff}{{\bf Wff}}
\newcommand{\so}{{\scr O}}
\newcommand{\vd}{\vdash_{L(N)}}
\newcommand{\ifff}{\ {\rm iff}\ }
\newcommand{\thm}{\mathbf{Thm}}
\newcommand{\mod}{\mathrm{Mod}\ }
\newcommand{\momg}{{\mM_\omega}}
\newcommand{\m}{\mM}
\newcommand{\st}{{\mathrm{st}}}
\]
Thm(Rice). 对于 \(\frak P\) 的非平凡子集 \(\cal F\) , 集合 \(\mathbb A:=\{x\in\N:\{x\}\in\cal F\}\) 不是递归的.
we prove the theorem through the unsolvability of halting problem
注意到 \(\cal F\) 的补集也是非平凡的, 因此我们总是可以假定空函数 \(\empty\in\cal F\) , 如果不然我们可以讨论 \(\ov{\cal F}\) 的情形, 之后我们另取一部分递归函数 \(g\notin\cal F\) .
Lem 1. 函数 \(U:=\lambda ix.\{i\}(x)\) 是部分递归函数.
显然 \(U=\lambda ix.((\mu z)T^{(1)}(i,x,z))_0\) , 而 \(T^{(1)}\) 是原始递归谓词, 根据 \(\frak P\) 的定义可得 \(U\in\frak P\) .
Col 2. 函数 \(f:=\lambda xy.U(y,y)\cdot 0+g(x)\) 是部分递归函数.
之后我们关注构造出来的 \(f\) 的性质, 对于任意的输入 \(x,y\in\N\) , 如果 \(y\in K\) 则 \(f(x,y)=g(x)\) , 否则 \(f(x,y)\uparrow\) . 由于 \(f\in\frak P\) 故存在 \(i_0\in\Phi\) 使得 \(\{i_0\}=f\) , 于是由 I.8.52 对于任意的 \(x,y\in\N\) 均有
\[U(x,y)=\{i_0\}(x,y)=\{\sigma(i_0,y)\}(x)
\]
于是对于 \(y\in\N\) , 假定 \(y\in K\) , 则对于任意输入 \(x\in \N\) 均有 \(\{\sigma(i_0,y)\}(x)=g(x)\) 从而 \(\{\sigma(i_0,y)\}=g\) ; 而另一方面假定 \(y\notin K\) , 则对于任意输入 \(x\in\N\) 有 \(\{\sigma(i_0,y)\}(x)\uparrow\) , 从而 \(\{\sigma(i_0,y)\}=\empty\) .
接下来我们通过反证法来证明莱斯定理, 为导出矛盾, 假定 \(\mathbb A\) 是递归集, 那么它的特征函数 \(\chi_{\mathbb A}\) 是递归函数, 于是考虑构造递归函数
\[\varphi:=\lambda y.\chi_{\mathbb A}(\sigma(i_0,y))
\]
则对于任意 \(n\in\N\) , 如果 \(n\in K\) 则 \(\{\sigma(i_0,n)\}=g\notin\cal F\) 从而 \(\varphi(x)=1\) ; 另一方面如果 \(n\notin K\) 则 \(\{\sigma(i_0,n)\}=\empty\in\cal F\) 从而 \(\varphi(x)=0\) , 故递归函数 \(\varphi\) 是 \(\ov K\) 的特征函数, 故 \(K\) 也是递归集, 这与我们的结论矛盾了.