Documentation

LeanPool.BeyondBethe.Complexitylib.Models.TuringMachine.Combinators

TM Combinators #

This file provides TM constructions for composing machines, used to prove closure properties of complexity classes.

Main definitions #

Design #

The union machine has three phases:

  1. Phase 1: Simulate tm₁, redirecting its output to work tape n₁ (a "fake output" tape). The real output tape stays pristine.
  2. Transition: Rewind the fake output to cell 1 and check the result. If Γ.one (tm₁ accepted), write Γ.one to the real output and halt. Otherwise rewind the input tape and reset Phase-2 tapes to cell 0.
  3. Phase 2: Simulate tm₂ using work tapes n₁+1..n₁+n₂ and the real output tape.

Work tape layout (0-indexed) #

State space #

Q₁ ⊕ UnionPhase ⊕ Q₂ where UnionPhase encodes the four transition states between Phase 1 and Phase 2.