Physical halting predicate for the literal 207-state Turing machine
Definitionpalomar_zf207_physicalDefines the standard external (meta-level) single-step transition function, -step execution, and halting predicate for the literal 207-state binary Turing machine whose transition table is given by PalomarZF207History.literalRows.
A machine configuration is encoded as a triple , where is the control state, encodes the tape bits strictly to the left of the head in binary (least-significant bit nearest the head), and encodes the tape bits at and to the right of the head in binary (least-significant bit under the head). Reading the bit and looking up the transition entry in row of literalRows yields the written bit , head direction (right or left), and next state ; shifting the head updates via binary cons/uncons matching PalomarZF207History.Move. Starting from the all-blank configuration , the machine halts physically if it reaches a state after finitely many steps:
This definition makes explicit the external halting predicate physicalHalts referenced in the challenge specification for bridging ArithmeticSigma1Sound and InternalLinkedHalts to standard halting in .
import Definitions.Def_palomar_zf207_history
namespace PalomarZF207
/-- Single deterministic step of the literal 207-state Turing machine on natural-number tape codes. -/
def stepPhysical (c : Nat × Nat × Nat) : Nat × Nat × Nat :=
let (q, left, right) := c
let read := right % 2 == 1
let r := right / 2
match (if read then (PalomarZF207History.literalRows.getD q (none, none)).2
else (PalomarZF207History.literalRows.getD q (none, none)).1) with
| none => c
| some (write, direction, next) =>
let w : Nat := if write then 1 else 0
if direction then
(next, w + 2 * left, r)
else
let bit : Nat := left % 2
let l : Nat := left / 2
let middle : Nat := w + 2 * r
(next, l, bit + 2 * middle)
/-- Iterated execution of `stepPhysical` for `n` steps. -/
def iterPhysical : Nat → Nat × Nat × Nat → Nat × Nat × Nat
| 0, c => c
| n + 1, c => iterPhysical n (stepPhysical c)
/-- Standard external halting of the 207-state Turing machine from the blank tape `(0, 0, 0)`. -/
def PhysicalHalts207 : Prop :=
∃ n : Nat, (iterPhysical n (0, 0, 0)).1 ≥ 207
end PalomarZF207