# 克林递归定理

**克林递归定理**是可计算性理论中的一个不动点结果：对于部分可计算函数的任意可接受编号 \( (\varphi_e)_{e \in \mathbb{N}} \) 以及任意全可计算函数 \( f \colon \mathbb{N} \to \mathbb{N} \)，存在一个下标 \( e \)，使得作为部分函数有 \( \varphi_e = \varphi_{f(e)} \)。<sup>[1](https://plato.stanford.edu/archives/spr2026/entries/recursive-functions/)</sup><sup> • </sup><sup>[2](https://math.berkeley.edu/~marks/notes/computability_notes_v1.pdf)</sup> 通俗地说，每一个可计算的程序变换都存在一个程序，该变换在功能上不改变它：这个程序的行为，与将变换施加于它之后所产生的程序的行为完全相同。<sup>[3](https://mind-forge.org/lesson/fl-26-recursion-theorem)</sup> 该定理出现在克林1938年发表于《符号逻辑杂志》的论文《论序数的记号》中。<sup>[1](https://plato.stanford.edu/archives/spr2026/entries/recursive-functions/)</sup>

| 关键事实 | 详情 |
|---|---|
| 陈述 | 对每个全可计算 \( f \colon \mathbb{N} \to \mathbb{N} \)，存在 \( n \) 使得 \( \varphi_n(y) \simeq \varphi_{f(n)}(y) \)<sup>[1](https://plato.stanford.edu/archives/spr2026/entries/recursive-functions/)</sup> |
| 出处 | 斯蒂芬·科尔·克林，《论序数的记号》，《符号逻辑杂志》3(4)：150–155（1938）<sup>[1](https://plato.stanford.edu/archives/spr2026/entries/recursive-functions/)</sup> |
| 证明要素 | s-m-n 定理提供一个全可计算函数 \( b(x) = s^2_1(e,x) \)；不动点为 \( n = b(k) \)，其中 \( k \) 是 \( f \circ b \) 的一个下标<sup>[1](https://plato.stanford.edu/archives/spr2026/entries/recursive-functions/)</sup> |
| 它不给出什么 | 不必存在外延不动点 \( f(n) = n \)；\( f(x) = x+1 \) 就没有<sup>[1](https://plato.stanford.edu/archives/spr2026/entries/recursive-functions/)</sup> |
| 典型应用 | 存在 \( e \) 使得 \( \varphi_e \) 为常函数 \( e \)，即一个输出自身源代码的程序（奎恩程序）<sup>[2](https://math.berkeley.edu/~marks/notes/computability_notes_v1.pdf)</sup> |
| 适用范围 | 对每个可接受编号都成立，更一般地对每个预完全编号（叶尔绍夫）成立<sup>[4](https://www.math.ru.nl/~terwijn/publications/pca-comp.pdf)</sup> |
| 构造性形式 | 一个可计算函数 \( r \) 将任意任务程序 \( p \) 映射为一个自指程序 \( r(p) \)，后者创建自身的一个副本并在该副本上运行 \( p \)<sup>[5](https://www.researchgate.net/publication/225579883_Characterizing_Programming_Systems_Allowing_Program_Self-reference)</sup> |

## 陈述与解读

该定理通常以罗杰斯的不动点形式陈述：给定全可计算 \( f \)，某个 \( e \) 满足 \( \varphi_e = \varphi_{f(e)} \)。<sup>[1](https://plato.stanford.edu/archives/spr2026/entries/recursive-functions/)</sup> “不动点定理”这一名称也被使用。<sup>[1](https://plato.stanford.edu/archives/spr2026/entries/recursive-functions/)</sup> 该不动点仅在下述弱意义上是外延的：两个下标计算同一个部分函数；定理并不保证存在数 \( n \) 使 \( f(n) = n \)，而对于 \( f(x) = x+1 \) 这样的数并不存在。<sup>[1](https://plato.stanford.edu/archives/spr2026/entries/recursive-functions/)</sup> 将 \( f \) 视为程序变换器，定理说的是：对每个可计算变换，都存在一个程序，其计算的函数与它经变换后所得映像所计算的函数相同。<sup>[1](https://plato.stanford.edu/archives/spr2026/entries/recursive-functions/)</sup>

一个带参数的版本——即克林本人所证明的形式——断言：对任意部分可计算 \( g \)，存在 \( e \) 使得对所有 \( x \) 有 \( [[e]](x) = g(e, x) \)：一个行为如同将自身下标硬编码于其中的程序。<sup>[6](https://courses.fit.cvut.cz/MI-VYC/enderton-computability-theory.pdf)</sup> 用编程术语说，该定理断言任何编程语言都允许在执行计算时引用自身文本的反射式程序。<sup>[7](https://www.cs.unm.edu/news/2005/06/self-reference-in-computer-science.html)</sup>

## 证明

标准证明很短，使用 s-m-n 定理，后者提供一个全可计算的特化映射 \( s^m_n \)，将一个双参数程序的下标和固定数据转换为剩余单参数程序的下标。定义一个部分可计算的对角函数

\[ g(x,y) = \begin{cases} \varphi_{\varphi_x(x)}(y) & \text{若 } \varphi_x(x) \downarrow \\ \uparrow & \text{否则.} \end{cases} \]

由 s-m-n 定理，对某个下标 \( e \) 有 \( g(x,y) \simeq \varphi_{s^2_1(e,x)}(y) \)；令 \( b(x) = s^2_1(e,x) \)，便得到一个全可计算函数，且只要 \( \varphi_x(x) \) 有定义就有 \( \varphi_{b(x)}(y) \simeq \varphi_{\varphi_x(x)}(y) \)。<sup>[1](https://plato.stanford.edu/archives/spr2026/entries/recursive-functions/)</sup> 设 \( k \) 是复合 \( f \circ b \) 的下标，于是 \( \varphi_k(x) \simeq f(b(x)) \)，并令 \( n = b(k) \)。由于 \( b \) 和 \( f \) 都是全函数，\( \varphi_k(k) \) 有定义，而恒等式链

\[ \varphi_n(y) \simeq \varphi_{b(k)}(y) \simeq \varphi_{\varphi_k(k)}(y) \simeq \varphi_{f(b(k))}(y) \simeq \varphi_{f(n)}(y) \]

给出不动点。<sup>[1](https://plato.stanford.edu/archives/spr2026/entries/recursive-functions/)</sup> 罗伯特·索尔曾评论说，这个证明“很短但很神秘”，最好将其视为一个失败的对角论证：对角构造产生的函数矩阵中的一行，被变换 \( f \) 映射回自身，而不是被映射得偏离每一行。<sup>[1](https://plato.stanford.edu/archives/spr2026/entries/recursive-functions/)</sup>

该证明是构造性的：克林1938年的论证本质上构造了一个自复制程序，而同一个可计算程序对任意给定的 \( f \) 都能找到不动点。<sup>[8](https://arxiv.org/abs/1309.5128)</sup> 这种一致性给出了带参数的版本。<sup>[2](https://math.berkeley.edu/~marks/notes/computability_notes_v1.pdf)</sup>

## 历史背景

尽管该定理冠以克林之名，它的存在与证明却归功于库尔特·哥德尔1931年关于不完备现象的工作；其背后的对角技术与用于构造哥德尔句的对角引理相平行。<sup>[9](https://www.oreilly.com/library/view/theory-of-computation/9781118014783/sec2_9.html)</sup> 克林在1938年那篇关于序数记号的论文中发表了它，该论文更以引入可计算序数的记号系统 \( \mathcal{O} \) 而闻名。<sup>[1](https://plato.stanford.edu/archives/spr2026/entries/recursive-functions/)</sup> 术语发生过变化：克林将带参数的形式称为第一递归定理，而“第二递归定理”一词来自罗杰斯，现在多用于指那个简单的无参数版本。<sup>[10](https://www.math.ru.nl/~terwijn/publications/surveyrecthm.pdf)</sup> 另一个结果——现代意义上的克林第一递归定理——涉及递归算子的不动点，需要更高阶的框架。<sup>[11](https://arxiv.org/abs/1602.06220)</sup>

## 应用

**自复制程序。** 取 \( f \) 将 \( e \) 映射为取值为 \( e \) 的常函数的一个下标，定理便给出一个下标 \( e \)，使得对所有 \( n \) 有 \( \varphi_e(n) = e \)：一个打印自身源代码的程序。<sup>[2](https://math.berkeley.edu/~marks/notes/computability_notes_v1.pdf)</sup> 这类程序称为奎恩程序，其思想可追溯到约翰·冯·诺伊曼20世纪40年代关于自复制自动机的工作。<sup>[2](https://math.berkeley.edu/~marks/notes/computability_notes_v1.pdf)</sup> 同样的自指也是计算机病毒在图灵完备机器上可能存在的形式化依据，因为程序无需任何输入输出访问就能获得自身的代码。<sup>[12](https://doi.org/10.1088/2632-072X%2Fae1e50)</sup>

**不可判定性。** 该定理给出不可判定性结果的简洁证明。若停机集 \( K' = \{ n : \varphi_n(0)\downarrow \} \) 可计算，递归定理便会提供一个程序 \( \varphi_e \)，它在输入0时检查 \( e \in K' \) 是否成立，若不成立则停机，否则循环；于是 \( \varphi_e(0) \downarrow \) 当且仅当 \( \varphi_e(0) \uparrow \)，矛盾。<sup>[2](https://math.berkeley.edu/~marks/notes/computability_notes_v1.pdf)</sup> 赖斯定理也可由第二递归定理证明。<sup>[12](https://doi.org/10.1088/2632-072X%2Fae1e50)</sup>

**下标集与极小程序。** 若没有更小的下标计算同一函数，则称一个下标是极小的。递归定理表明不存在无限的极小下标可计算集：给定这样一个集合，一个可计算函数 \( f \) 将每个 \( e \) 映射为计算该集合中大于 \( e \) 的最小成员的下标，而不动点 \( e \) 将等于某个更大的成员 \( n \)，与 \( n \) 的极小性矛盾。<sup>[2](https://math.berkeley.edu/~marks/notes/computability_notes_v1.pdf)</sup>

**递归论本身。** 克林将该定理用于有效有基递归，包括每个构造性序数在其系统 \( \mathcal{O} \) 中都获得一个记号这一结果。<sup>[13](https://www.math.ucla.edu/~ynm/lectures/2009csl.pdf)</sup> 迈希尔1955年关于每个创造集都是递归可枚举完全集的定理，是第二递归定理的一个应用，莫斯霍瓦基斯认为它是克林之外的人首次印刷发表的重要应用。<sup>[14](https://dl.icdst.org/pdfs/files/4e145563028f4fc78b5047db52287168.pdf)</sup> 该定理还统一了可计算性理论、数理逻辑和计算机科学中一系列有效对角论证。<sup>[1](https://plato.stanford.edu/archives/spr2026/entries/recursive-functions/)</sup>

## 推广

该定理并不依附于某一种程序枚举。哈特利·罗杰斯通过通用机条件和 s-m-n 条件刻画了部分可计算函数的可接受编号，而递归定理对其中任何一种都成立。<sup>[15](https://www.cs.cornell.edu/courses/cs6110/2015sp/Lectures/lecture16_6110_updated.pdf)</sup> 尤里·叶尔绍夫在其编号理论中作了进一步推广：递归定理对每个预完全编号都成立，所谓预完全编号，是指每个部分可计算函数都能模该编号的等价关系被完全化的编号。<sup>[4](https://www.math.ru.nl/~terwijn/publications/pca-comp.pdf)</sup> 标准编号由 s-m-n 定理是预完全的，而由于每个可接受编号都等价于标准编号，可接受编号都是预完全的；相比之下，弗里德伯格的1-1编号则不是。<sup>[4](https://www.math.ru.nl/~terwijn/publications/pca-comp.pdf)</sup> 巴伦德雷赫特和特尔韦恩将框架推广到部分组合代数，其中 Feferman 关于组合子 \( g \) 的不动点定理 \( g(fg) \simeq fg \) 推广了递归定理。<sup>[10](https://www.math.ru.nl/~terwijn/publications/surveyrecthm.pdf)</sup>

自指程序的存在与其有效构造之间存在区别。在构造性形式中，一个可计算函数 \( r \) 将任意任务程序 \( p \) 映射为一个程序 \( r(p) \)，后者创建自身的一个副本，并在该自副本及其输入上运行 \( p \)；在非构造性形式中，这类程序存在，但一般不能从 \( p \) 出发用算法找到。<sup>[5](https://www.researchgate.net/publication/225579883_Characterizing_Programming_Systems_Allowing_Program_Self-reference)</sup> 凯斯和莫埃利乌斯表明，非构造性形式成立的有效编程系统不能被任何递归指称控制结构族所刻画，同时他们也确立了其中总是存在一种隐藏的构造性。<sup>[5](https://www.researchgate.net/publication/225579883_Characterizing_Programming_Systems_Allowing_Program_Self-reference)</sup>

一个编号中可获得的不动点的质量也可以被度量。关于该定理有效性问题的研究，考察了在从有限学习到行为正确学习的各种收敛准则下寻找见证的复杂性，并发现寻找递归定理见证的复杂性与归纳推理学习的最优性是彼此独立的。<sup>[16](https://www.sciencedirect.com/science/article/pii/S0304397518302743)</sup>

## References

1. [Recursive Functions, Stanford Encyclopedia of Philosophy (Spring 2026 edition), Section 3.4, The Recursion Theorem](https://plato.stanford.edu/archives/spr2026/entries/recursive-functions/)
2. [Computability notes, Chapter 6: The recursion theorem, acceptable numberings (University of California, Berkeley)](https://math.berkeley.edu/~marks/notes/computability_notes_v1.pdf)
3. [The Recursion Theorem, Formal Languages lesson, MindForge](https://mind-forge.org/lesson/fl-26-recursion-theorem)
4. [Computability in partial combinatory algebras and generalized numberings (Barendregt & Terwijn)](https://www.math.ru.nl/~terwijn/publications/pca-comp.pdf)
5. [John Case and Samuel E. Moelius III, Characterizing Programming Systems Allowing Program Self-Reference (CiE 2007)](https://www.researchgate.net/publication/225579883_Characterizing_Programming_Systems_Allowing_Program_Self-reference)
6. [Herbert Enderton, Computability Theory (course text, Czech Technical University)](https://courses.fit.cvut.cz/MI-VYC/enderton-computability-theory.pdf)
7. [Self-Reference in Computer Science, Department of Computer Science, University of New Mexico (2005)](https://www.cs.unm.edu/news/2005/06/self-reference-in-computer-science.html)
8. [Neil D. Jones, A Swiss Pocket Knife for Computability, EPTCS 129 (2013), arXiv:1309.5128](https://arxiv.org/abs/1309.5128)
9. [Theory of Computation, Section 2.9, The Recursion Theorem (Wiley)](https://www.oreilly.com/library/view/theory-of-computation/9781118014783/sec2_9.html)
10. [S. A. Terwijn, survey of the recursion theorem and partial combinatory algebra](https://www.math.ru.nl/~terwijn/publications/surveyrecthm.pdf)
11. [Kleene's Two Kinds of Recursion, arXiv:1602.06220](https://arxiv.org/abs/1602.06220)
12. [What computer science has to say about the simulation hypothesis, IOPscience (2025)](https://doi.org/10.1088/2632-072X%2Fae1e50)
13. [Yiannis N. Moschovakis, Kleene's Amazing Second Recursion Theorem, Bulletin of Symbolic Logic 16 (2010), pp. 189–239 (lecture slides)](https://www.math.ucla.edu/~ynm/lectures/2009csl.pdf)
14. [dl.icdst.org](https://dl.icdst.org/pdfs/files/4e145563028f4fc78b5047db52287168.pdf)
15. [Advanced Programming Languages, Cornell CS6110, Lecture 16: Kleene's recursion theorem and Rogers' acceptable indexings](https://www.cs.cornell.edu/courses/cs6110/2015sp/Lectures/lecture16_6110_updated.pdf)
16. [Effectivity questions for Kleene's recursion theorem, Theoretical Computer Science 733 (2018), pp. 55–70](https://www.sciencedirect.com/science/article/pii/S0304397518302743)

---
*Initially written Sep 17, 2026 · Reviewed: Oct 15, 2026 · Edited: Oct 15, 2026; Nov 11, 2026 · Last review: Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 逻辑与离散数学 › Formal logic and foundations › Computability theory › Recursion theorem and self-reference

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/kleenes-recursion-theorem

English original: https://www.edgepedia.org/kleenes-recursion-theorem
