TCS: Advanced Computability

Advanced Computability

Programs That Know Their Own Descriptions

A program description is finite data. Given a string ss, an algorithm can generate the description of a program that ignores its input and prints ss. Constructing this printer requires no execution of the program encoded by ss

Self-reference becomes possible when a program combines stored data with a procedure that turns that data into code. A self-printing program, or quine, reconstructs its full description from these two parts

Kleene’s recursion theorem generalizes this idea: a program can use its own description as an argument to an arbitrary computation

Let TT compute a partial function t(e,w)t(e,w). There exists a program RR such that

R(w)≃t(⟨R⟩,w)R(w)\simeq t(\langle R\rangle,w)

The construction of RR is effective from TT. Equality here includes matching divergence

A Compiler-Based Proof

Let φe\varphi_e denote the partial function computed by program ee. A total computable specialization function s(e,a)s(e,a) produces a program that fixes the first argument of a two-argument program

φs(e,a)(w)≃φe(a,w)\varphi_{s(e,a)}(w)\simeq\varphi_e(a,w)

Construct a two-argument program PP whose behavior is

P(z,w)≃t(s(z,z),w)P(z,w)\simeq t(s(z,z),w)

Let pp be the code of PP, and define r=s(p,p)r=s(p,p). Then

φr(w)≃φp(p,w)≃t(s(p,p),w)=t(r,w)\varphi_r(w) \simeq\varphi_p(p,w) \simeq t(s(p,p),w) =t(r,w)

Thus the program with code rr has the required behavior. The specialization operation generates code syntactically, so there is no circular request to finish executing a program before constructing it

Choosing t(e,w)=et(e,w)=e gives a self-printing program immediately

Applications of the Recursion Theorem

An Undecidability Proof

Suppose HH decides whether a program accepts an input. By the recursion theorem, construct DD that obtains its own code, asks HH whether DD accepts the current input, and returns the opposite answer

D(w)=1−H(⟨D⟩,w)D(w)=1-H(\langle D\rangle,w)

Either answer contradicts the specification of HH. The recursion theorem packages the self-reference that otherwise appears as an explicit diagonal input

Minimal Programs

Fix a machine encoding. A program MM is minimal if no shorter program computes the same partial function

The set

MIN⁡={⟨M⟩:M is minimal}\operatorname{MIN}=\{\langle M\rangle:M\text{ is minimal}\}

is not Turing-recognizable

Assume an enumerator lists exactly the minimal programs. Construct CC that knows the length of its own description, waits for an enumerated program DD longer than itself, and then simulates DD on the current input

There are infinitely many partial computable functions, hence minimal descriptions of unbounded length. The waiting stage therefore finishes. But CC computes exactly the same partial function as the longer program DD, contradicting the minimality of DD

The same reasoning rules out every infinite recognizable subset of minimal programs

Rogers’ Fixed-Point Theorem

For every total computable transformation ff of program descriptions, there is a program RR such that

φ⟨R⟩≃φf(⟨R⟩)\varphi_{\langle R\rangle} \simeq\varphi_{f(\langle R\rangle)}

To obtain RR, use the recursion theorem with a computation that transforms its own code by ff and simulates the resulting program. The fixed point is behavioral: the two descriptions need not be identical strings

Syntax, Semantics and Proof

A first-order language specifies variables, logical connectives, quantifiers, and symbols for constants, functions and relations. A structure assigns those nonlogical symbols meanings over a nonempty domain

For example, a sentence about addition can be interpreted in the natural numbers or in another structure. A sentence can be true in one structure without being valid in every structure

T⊢φandT⊨φT\vdash\varphi\qquad\text{and}\qquadT\models\varphi

The first asserts the existence of a formal derivation from TT. The second asserts truth in every model of TT

A proof calculus is sound when derivability implies semantic consequence, and complete when semantic consequence implies derivability

Gödel’s Completeness Theorem

For classical first-order logic,

T⊢φ⟺T⊨φT\vdash\varphi\quad\Longleftrightarrow\quad T\models\varphi

This completeness concerns all structures satisfying the axioms. A separate question asks whether a fixed effective theory proves every sentence true in the intended structure N\mathbb N

Formal proofs are finite strings. For an effectively axiomatized theory, proofs can be effectively enumerated; for a decidable axiom set, a candidate derivation can be checked directly. A computably enumerable axiom set can instead be handled by recording finite witnesses to the enumeration of each axiom used

Gödel’s First Incompleteness Theorem

An effectively axiomatized, consistent theory capable of expressing sufficient arithmetic is incomplete: there is a sentence φ\varphi for which neither T⊢φT\vdash\varphi nor T⊢¬φT\vdash\neg\varphi

Here consistent means that the theory does not prove a sentence and its negation. The computability argument below uses a theory strong enough to represent program execution and reason about finite computation traces

A Machine That Opposes Proofs

Using the recursion theorem, define a machine DD with access to its own description. It enumerates TT-proofs and searches for either of two sentences about itself

  1. If it finds a proof that DD halts, it enters an explicit infinite loop
  2. If it finds a proof that DD never halts, it halts

Assume TT is consistent. If TT proved that DD never halts, no proof of the opposite sentence could appear. The search would eventually find the nonhalting proof and halt. That finite execution supplies a formal proof of halting, contradicting consistency

If TT proved that DD halts, the search would instead reach the explicit loop. A finite trace establishes that DD has entered a state from which it can never halt, giving a proof of nonhalting and the same contradiction

Therefore neither sentence is provable. Externally, DD runs forever because neither triggering proof exists. Its nonhalting statement is a true arithmetic sentence unprovable in TT

Adding this sentence as an axiom gives another effective theory to which the construction can be applied again

Gödel’s Second Incompleteness Theorem

Write Con⁡(T)\operatorname{Con}(T) for the usual arithmetic sentence asserting that no TT-proof of a contradiction exists

For the standard sufficiently strong, effectively axiomatized theories of arithmetic, consistency implies

T⊬Con⁡(T)T\nvdash\operatorname{Con}(T)

The first argument used consistency to conclude that its self-referential machine never halts. When the reasoning and the usual provability conditions are formalized inside the theory, they connect its consistency statement to an unprovable sentence

If TT could prove its own consistency, it could complete that internal argument and prove the sentence already shown to be unprovable. The full theorem requires the standard arithmetization of proofs; finite proof checking alone is not its entire proof

The completeness and incompleteness theorems fit together: a sentence true in N\mathbb N but unprovable from TT must fail in some other model of TT


© 2024 本网站由 renxiaodaifu 使用 Stellar主题 创建
总访问 次 | 本页访问 次
共发表 103 篇 Blog(s) · 总计 254.1k 字