← Student tools · Problem 15 · Lecture 8 · Round 1 (30 pts)

The recursion theorem · fixed-point form

For every computable t, there is a TM R such that L(R) = L(t(⟨R⟩)). Programs reason about themselves.

CLO-2R1·30 ptsL8
🔊 Listen
Theorem (Sipser 6.8)

Let t : Σ* → Σ* be a computable total function (a "program transformation"). Then there exists a TM R such that L(R) = L(t(⟨R⟩)). R is a fixed point of t at the level of recognised languages — the transformation t does not change what R recognises.

This is the cleaner, more powerful statement of the recursion theorem. Sipser's classic Theorem 6.3 (every TM can obtain its own description) is a special case. Quines (Problem 13) are another special case: t outputs a program-that-prints-its-argument, and the fixed point is a program-that-prints-itself.

Reading "fixed point" carefully

"L(R) = L(t(⟨R⟩))" does not say R and t(⟨R⟩) are the same TM — they might have very different code. It says they recognise the same language. R is a semantic fixed point of t, not a syntactic one.

🔊 Listen
Recursion theorem proof skeleton · how to find R given t Step 1 · Build helper q q : Σ* → Σ* takes ⟨P⟩ and outputs ⟨P'⟩, where P' on input x runs P(⟨P'⟩, x). P' "knows" its own code. q exists by the s-m-n theorem. Step 2 · Apply q to t Compute ⟨t∘q⟩, the TM that on input ⟨P⟩ computes t(q(⟨P⟩)). Plug ⟨t∘q⟩ into q itself. R := q(⟨t∘q⟩) Step 3 · Verify the fix On input x, R runs (t∘q)(⟨R⟩, x) = t(q(⟨R⟩))(x) = t(⟨R⟩)(x) So R and t(⟨R⟩) compute the same function. ✓ The key move: q gives any program access to its own code, then we apply that to t.

The two non-obvious moves: q is the constructive engine — it converts an arbitrary program description ⟨P⟩ into a self-aware version ⟨P'⟩ that has its own code as data. The s-m-n theorem (or just direct construction) guarantees q is computable. The second move is plugging ⟨t∘q⟩ back into q to get R. That self-application is the closing of the loop.

🔊 Listen

Let t : Σ* → Σ* take ⟨M⟩ and return the description of the TM obtained by swapping qaccept and qreject in M. Clearly L(t(⟨M⟩)) = Σ* \ L(M) for halting M.

The recursion theorem gives R with L(R) = L(t(⟨R⟩)) = Σ* \ L(R). So L(R) is its own complement — possible only if L(R) is undefined on some inputs (R loops). The fixed point exists, and exploring why it must loop is a nice consequence: no halting TM can be its own complement under accept/reject swap.

🔊 Listen
A fixed-point construction · q maps any ⟨P⟩ to ⟨P'⟩ Auto-plays
🔊 Listen
🔊 Listen
🔊 Listen

Sipser: §6.1, Theorem 6.8 (fixed-point form) and Theorem 6.9 (corollaries). Lecture notes: Module 3 slide 5 has the T = A·B construction. Companion problems: P13 (quine, special case), P14 (Rice via recursion theorem), P16 (self-aware TM).