Turing machines can be effectively enumerated (e.g., by lexicographic order of their descriptions), yielding a universal Turing machine. An index set is a set of indices W ⊆ ℕ where W = {i : the i-th machine has property P}. Rice's theorem asserts that all non-trivial index sets are non-recursive, formalizing the intuition that enumerating machines with a semantic property is fundamentally undecidable.
You know from the formal definition of Turing machines that each machine can be described by a finite string — an encoding of its states, alphabet, and transition function. Since these descriptions are finite strings over a finite alphabet, they can be sorted lexicographically and listed in order: M₀, M₁, M₂, …. This is the standard enumeration of Turing machines. The index i of machine Mᵢ is called its Gödel number or index, borrowing the idea from Gödel's arithmetization of logic. Cantor's pairing techniques (from your prerequisite) let you encode tuples as single numbers, making the whole machinery constructive and explicit.
This enumeration enables the universal Turing machine U: given an encoding ⟨i, w⟩, U simulates Mᵢ on input w. The universal machine is the theoretical foundation of stored-program computers — code and data are both strings, and the CPU is the universal simulator. Every modern computer is, in essence, a physical instantiation of this construction.
An index set is a set W ⊆ ℕ defined by a property of the *function computed* by the machine, not by the machine's syntax or description. Formally, W is an index set if: whenever Mᵢ and Mⱼ compute the same function (i.e., the same input-output behavior), either both indices are in W or neither is. Example: W = {i : Mᵢ halts on every input} is an index set because whether the machine "halts on every input" is a property of the computed function, not of the internal wiring. Contrast this with a non-index-set property like "the machine has exactly 5 states" — that's about the description, not the function.
Rice's theorem delivers a striking verdict: every non-trivial index set is undecidable. "Non-trivial" means W is neither empty (no machine qualifies) nor all of ℕ (every machine qualifies). The proof reduces the Halting Problem to any non-trivial index set: if you could decide W, you could decide halting. The theorem is a sweeping generalization — it says you cannot write a general program that reliably tests *any* semantic property of arbitrary programs: whether they halt, whether they accept a particular input, whether they ever produce output, whether they compute a specific function. This is the formal grounding for why static analysis of programs is fundamentally limited and why there is no general-purpose bug-detector that works for all programs.
No topics depend on this one yet.