Writing a prefix before a probabilistic computation #
A deterministic preparation restores the input head and blank work tapes after writing a prefix. Shared-tape sequencing then runs the probabilistic source on its original input. Both phases actually halt within the sum of their bounds; every instruction of preparation is charged.
Main results #
Turing.MultiTapePTM.eval_runClosedConfigFrom_seq_prependOutput: retain a prepared prefix.Turing.MultiTapePTM.seq_prependOutput_halted: add the two actual halting bounds.
References #
Adapted from Computability/Probabilistic/Realization/Composition.lean on the cslib crypto
branch at 5ff69ca93402e7c947208dc56396d6d86203ccd8, using the shared sequencing compiler.
An unreadable output prefix preserves the entire closed execution program.
A workspace-restoring preparation retains the prefix and the source distribution.
The prepared-prefix computation actually halts within the sum of the phase bounds.
The final output consists of the prepared prefix followed by the sampled source output.