Documentation

Complexitylib.Models.TuringMachine.UTM.Internal.StepGlue

Glue facts: phase outputs vs the interpreted step #

Small bridges used when matching the body's phase outputs against TMDesc.toTM.step:

A well-formed tape reads exactly at cell 0.

theorem Complexity.TM.UTMBody.simRead_flag_eq {sim utm : Tape} (h : VShift sim utm) (hwf : sim.StartInvariant) :
simRead (decide (sim.head = 0)) utm.read = sim.read

The simulated read, reconstructed from the honest flag and the live shadow read, is exactly the simulated tape's read.

theorem Complexity.TM.UTMBody.parseEntry_q'_lt {w : } {seg : List Γw} {e : DescEntry} (hp : parseEntry w seg = some e) :
e.act.q' < 2 ^ w

Every entry produced by parseEntry has an in-range target, so the interpreter's min-clamp is the identity on it.

Writing back the read symbol (the interpreter's default action) and moving is just the move, on a well-formed tape.

theorem Complexity.TM.UTMBody.valueSlice_take (seg : List Γw) (w : ) :
List.take w (List.take (w + 10) (List.drop (w + 6) seg)) = List.take w (List.drop (w + 6) seg)

The value slice copied to scratch, restricted to its first w cells, is the segment's new-state field.

theorem Complexity.TM.UTMBody.scratch_cellBit_eq_segBit {t : Tape} {seg : List Γw} {w k : } (hk : k < 10) (hlen : 2 * w + 16 seg.length) (h : t.HoldsExact (List.take (w + 10) (List.drop (w + 6) seg))) :
cellBit (t.cells (1 + w + k)) = segBit seg (2 * w + 6 + k)

Scratch cells holding the value slice decode, at the action offsets, to the segment's action bits.