Below is a thorough and logically structured proof that Post's Correspondence Problem (PCP) is undecidable. This proof follows the standard approach by reducing the Halting Problem for Turing machines to PCP. If PCP were decidable, then the Halting Problem would also be decidable, which is known to be impossible. I'll proceed step by step, ensuring clarity and completeness.
Proof that Post's Correspondence Problem (PCP) is Undecidable
Overview
We will show that PCP is undecidable by demonstrating a many-one reduction from the Halting Problem, which is known to be undecidable. Specifically, we construct a polynomial-time computable function that maps any instance of the Halting Problem to an instance of PCP such that the Halting Problem instance is a "yes" instance if and only if the corresponding PCP instance has a solution. Since the Halting Problem is undecidable, PCP must also be undecidable.
Structure of the Proof
- Formalize the Halting Problem and PCP.
- Describe the reduction: a polynomial-time mapping from Halting Problem instances to PCP instances.
- Prove the correctness of the reduction (i.e., the equivalence).
- Conclude with the undecidability of PCP.
1. Formal Definitions
The Halting Problem (HP)
- Input: A Turing machine (M) (described by its encoding, e.g., as a string) and a string (w) (the input for (M)).
- Output: "YES" if (M) halts on input (w); "NO" otherwise.
The Halting Problem is undecidable: there is no algorithm that can solve it for all possible inputs (M) and (w).
Post's Correspondence Problem (PCP)
- Input: Two lists of non-empty strings (A = (u_1, u_2, \dots, u_k)) and (B = (v_1, v_2, \dots, v_k)) over a common alphabet (\Gamma).
- Output: "YES" if there exists a non-empty sequence of indices (i_1, i_2, \dots, i_m) (with (m \geq 1)) such that the concatenation (u_{i_1} u_{i_2} \cdots u_{i_m} = v_{i_1} v_{i_2} \cdots v_{i_m}); "NO" otherwise.
We say the PCP instance has a solution or match if the output is "YES".
2. The Reduction: Mapping HP Instances to PCP Instances
We define a polynomial-time computable function (R) that takes as input a Turing machine (M) and a string (w), and outputs a PCP instance ((A, B)). The key idea is to encode the computation of (M) on (w) into the strings of the PCP instance. A solution to the PCP instance will exist if and only if (M) halts on (w).
2.1. Assumptions about the Turing Machine (M)
To simplify the construction, assume (M) is a single-tape deterministic Turing machine with:
- A finite set of states (Q = {q_0, q_1, \dots, q_n}), where (q_0) is the initial state and (q_f) is a halting state (if it exists).
- A tape alphabet (\Gamma = {\gamma_1, \gamma_2, \dots, \gamma_m}), including a blank symbol (\sqcup).
- A transition function (\delta: Q \times \Gamma \to Q \times \Gamma \times {L, R}), where (L) means "move left" and (R) means "move right".
The input string (w) is over (\Gamma).
2.2. Encoding Configurations
A configuration of (M) on input (w) is a string that fully describes the current state of the machine, including:
- The current tape contents.
- The current head position.
- The current state.
We encode configurations as strings over an alphabet that includes symbols for states, tape symbols, and delimiters. Specifically:
- Use a special symbol to separate the tape contents from the state (e.g., a delimiter (|)).
- For example, a configuration might look like: (\text{tape contents} , | , \text{state} , \text{head position indicator}).
To make the PCP strings match only for valid computations, we use a technique where the strings in (A) and (B) represent "before" and "after" transitions, but with a twist: the overall match is only possible if the machine reaches a halting state.
2.3. Construction of the PCP Instance
Given (M) and (w), we construct two lists (A = (u_1, u_2, \dots, u_k)) and (B = (v_1, v_2, \dots, v_k)) as follows:
-
Alphabet for PCP: Let the alphabet (\Gamma') include:
- All symbols from (\Gamma) (tape alphabet of (M)).
- Symbols for states in (Q).
- Delimiters, e.g., (|) for configuration separation and ( # ) for other purposes.
-
Dominoes for Transitions: For each possible transition in (M), create a pair of strings that encode the "before" and "after" configurations.
- Suppose (\delta(q, \gamma) = (q', \gamma', D)), where (D \in {L, R}).
- Create a domino ((u_i, v_i)) that represents this transition. For example:
- (u_i): Encodes the "incoming" configuration string, e.g., a string like (\text{...} q \gamma \text{...}).
- (v_i): Encodes the "outgoing" configuration string, e.g., a string like (\text{...} q' \gamma' \text{...}) with the head moved according to (D).
More precisely, for each transition, we add strings that:
- Start with a fixed prefix (e.g., to ensure the sequence builds a full computation).
- Include the current configuration on one side and the next on the other.
-
Initial Domino: Add a domino for the initial configuration of (M) on (w). For example:
- (u_1): A string representing the initial tape (with (w) on it, head at position 0, and state (q_0)), e.g., (w , | , q_0 , \text{head}).
- (v_1): A string that matches (u_1) only if we can start the computation.
-
Halting Domino: Add a special domino that can only be appended if the machine halts:
- Suppose (q_f) is the halting state. Add a domino ((u_k, v_k)) where:
- (u_k): Encodes a string that includes (q_f), e.g., (\text{...} q_f \text{...} #).
- (v_k): A string that exactly matches (u_k) only if the halting state is reached.
The full lists (A) and (B) are constructed as:
- One domino for the initial configuration.
- One domino for each transition of (M).
- One final domino for the halting state.
This results in (k = O(|\delta| + 1)), where (|\delta|) is the size of the transition function (linear in the description of (M)).
2.4. Polynomial-Time Computability
- Parsing (M) and (w) takes time polynomial in (|M| + |w|).
- Generating the strings for each domino involves iterating over the transitions (at most (|Q| \times |\Gamma|) of them) and constructing strings of length proportional to the tape size, which is bounded by the description of (M).
- Thus, the entire construction runs in polynomial time in the size of the input ((|M| + |w|)).
3. Correctness of the Reduction
We now prove that the reduction is correct: (M) halts on (w) if and only if the PCP instance ((A, B)) has a solution.
-
(→) If (M) halts on (w), then ((A, B)) has a solution.
Suppose (M) halts on (w) after (t) steps. This means there is a sequence of configurations: (C_0, C_1, \dots, C_t), where:
- (C_0) is the initial configuration.
- (C_t) is a halting configuration (i.e., the state is (q_f)).
- Each (C_i) transitions to (C_{i+1}) via a valid transition in (\delta).
Using the dominoes:
- Start with the initial domino.
- For each transition from (C_i) to (C_{i+1}), select the corresponding domino.
- End with the halting domino.
Concatenating the strings from (A) will produce a string that exactly matches the concatenation from (B), because the dominoes are designed to encode the exact computation sequence. Thus, ((A, B)) has a solution.
-
(←) If ((A, B)) has a solution, then (M) halts on (w).
Suppose there is a sequence of indices (i_1, i_2, \dots, i_m) such that (u_{i_1} \cdots u_{i_m} = v_{i_1} \cdots v_{i_m}).
- The strings in (A) and (B) are constructed such that any matching sequence must correspond to a valid sequence of configurations of (M).
- The initial domino forces the sequence to start from the initial configuration.
- Each subsequent domino corresponds to a legal transition.
- The only way to complete the match is to reach the halting domino, which requires the final configuration to be a halting one.
Therefore, the matching sequence simulates a computation of (M) on (w) that halts.
This establishes that (M) halts on (w) if and only if ((A, B)) has a solution.
4. Conclusion: Undecidability of PCP
- We have shown a polynomial-time reduction from the Halting Problem to PCP: for any instance ((M, w)) of the Halting Problem, we can compute a PCP instance ((A, B)) such that ((M, w)) is a "yes" instance if and only if ((A, B)) has a solution.
- The Halting Problem is undecidable, meaning there is no algorithm that can decide, for all (M) and (w), whether (M) halts on (w).
- If PCP were decidable (i.e., if there existed an algorithm to solve PCP for all instances), we could use it to solve the Halting Problem: simply apply the reduction to get a PCP instance and then solve that instance.
- This is a contradiction, as no such algorithm exists.
Therefore, PCP is undecidable.
This completes the proof. 🎉