Indexed observations and Mathlib ListBlank equivalence for finite stack tapes #
These additions give Bolton Bailey's upstream StackTape an indexed view that reads blank
outside its stored list, together with the canonical equivalence with Mathlib's quotient
one-sided tape _root_.Turing.ListBlank (Option Symbol).
Main definitions #
Cslib.Turing.StackTape.read: observe the tape at a natural-number displacement.Cslib.Turing.StackTape.ofList: fold a list of optional symbols onto an empty stack tape.Cslib.Turing.StackTape.equivListBlank: equivalence betweenStackTape Symboland_root_.Turing.ListBlank (Option Symbol).
Main results #
Cslib.Turing.StackTape.read_eq_getElem?: agreement with padded list lookup.Cslib.Turing.StackTape.read_mapSome: loading a word preserves its indexed symbols.Cslib.Turing.StackTape.equivListBlank_cons,head_equivListBlank,tail_equivListBlank,nth_equivListBlank:equivListBlankcommutes with stack-tape operations and indexed reads.
References #
Ports the additions to Foundations/Data/StackTape.lean on the cslib crypto branch at
5ff69ca93402e7c947208dc56396d6d86203ccd8, retaining the upstream tape representation.
Prepending retains blank cells only when there is stored data beyond them.
A list of blanks gives the empty stack tape.
The stored list of ofList l gives the same ListBlank as l.
Canonical equivalence between StackTape Symbol and Mathlib's
_root_.Turing.ListBlank (Option Symbol).
Instances For
equivListBlank sends the empty stack tape to the blank ListBlank.
The inverse of equivListBlank sends the blank ListBlank to the empty stack tape.
The inverse of equivListBlank sends the ListBlank of a list l to ofList l.
equivListBlank sends ofList l to the ListBlank of l.
equivListBlank turns stack-tape cons into ListBlank.cons.
The inverse of equivListBlank turns ListBlank.cons into stack-tape cons.
equivListBlank preserves the head.
The inverse of equivListBlank preserves the head.
equivListBlank commutes with taking the tail.
The inverse of equivListBlank commutes with taking the tail.
equivListBlank sends mapSome l to the ListBlank of l.map some.
Reading the ListBlank at n is reading the tape at n.
Reading the stack tape equivListBlank.symm lb at n is reading lb at n.