Indexed observations, native actions, and Mathlib Tape equivalence on bidirectional tapes #
Bolton Bailey's upstream BiTape stores finite data relative to the current head. Its integer
view includes blank gaps and negative displacements. The representation relation allows a native
integer-indexed tape to have any absolute head position. We also provide the canonical equivalence
BiTape.equivTape between BiTape Symbol and Mathlib's _root_.Turing.Tape (Option Symbol).
Main definitions #
Cslib.Turing.BiTape.read: observe the tape at an integer displacement.Cslib.Turing.BiTape.step: an optional write followed by a signed move.Cslib.Turing.BiTape.Represents: agreement with a native tape and its head position.Cslib.Turing.BiTape.equivTape: equivalence betweenBiTape Symboland_root_.Turing.Tape (Option Symbol).
Main results #
Cslib.Turing.BiTape.Represents.step: native actions preserve the represented tape.Cslib.Turing.BiTape.spaceUsed_step_le: each action adds at most one stored cell.Cslib.Turing.BiTape.equivTape_mk₁,equivTape_write,equivTape_move,nth_equivTape:equivTapecommutes with tape initialization, writes, head movement, and indexed reads.
References #
Ports the additions to Foundations/Data/BiTape.lean and the tape action laws from
Computability/Machines/Turing/MultiTape/FiniteTape.lean on the cslib crypto branch at
5ff69ca93402e7c947208dc56396d6d86203ccd8.
Blank finite storage represents the native initial work tape.
Related tapes present the same symbol to the machine's transition table.
Finite tape updates realize precisely the native write and movement, with no restriction on the head position or on blank gaps within the stored contents.
The tape loaded with a word stores the rest of the word to the right of its head.
Canonical equivalence between BiTape Symbol and Mathlib's
_root_.Turing.Tape (Option Symbol).
Instances For
The left side of equivTape tape is the ListBlank of the left side of tape.
The right side of equivTape tape is the ListBlank of the right side of tape.
The left side of equivTape.symm tape is the stack tape of the left side of tape.
The right side of equivTape.symm tape is the stack tape of the right side of tape.
The inverse of equivTape commutes with writing.
equivTape turns moveLeft into Mathlib's move to the left.
equivTape turns moveRight into Mathlib's move to the right.
equivTape commutes with moving the head in either direction.
The inverse of equivTape commutes with moving the head in either direction.
equivTape commutes with an optional head move, where none leaves the tape in place.