Documentation

CslibFrontier.Computability.Machines.Turing.MultiTape.Complexity.InSpace.FramePrefix

Native extraction of an encoded framed header #

A layout equality encIn x = frame (encOut (f x)) ++ suffix x identifies the first framed field of an input. ComputableInTimeAndSpace.framedPrefix realizes that field projection using the existing zero-work-tape frame transducer. Its time bound is twice the complete input length plus three, and its workspace is zero. The suffix can be arbitrarily long.

ComputableInSpace.framedPrefix supplies the corresponding compositional space certificate, charging only the extracted header's encoding. This additional charge accounts for retaining the output in a later computation; it is not a charge for the suffix. These certificates concern inputs in the supplied encoding's image, not arbitrary malformed framed words.

This original shared certificate supports runtime parameter and controller-header extraction; it does not initialize or execute a complete query machine.

theorem Turing.MultiTapeTM.ComputableInTimeAndSpace.framedPrefix {α : Type u_1} {β : Type u_2} (f : α → β) (encIn : α ↪ List Bool) (encOut : β ↪ List Bool) (suffix : α → List Bool) (layout : ∀ (x : α), encIn x = frame (encOut (f x)) ++ suffix x) :
ComputableInTimeAndSpace f encIn encOut (fun (x : α) => 2 * (encIn x).length + 3) fun (x : α) => 0

Extract the first framed encoded field with the existing native frame reader, without work tapes. The layout premise leaves the remainder of the input unrestricted.

theorem Turing.MultiTapeTM.ComputableInSpace.framedPrefix {α : Type u_1} {β : Type u_2} (f : α → β) (encIn : α ↪ List Bool) (encOut : β ↪ List Bool) (suffix : α → List Bool) (layout : ∀ (x : α), encIn x = MultiTapeTM.frame (encOut (f x)) ++ suffix x) :
ComputableInSpace f encIn encOut fun (x : α) => (encOut (f x)).length

Extract a framed encoded field with a native space budget that charges its output alone, independently of the length of the untouched suffix.

theorem Turing.MultiTapeTM.ComputableInSpace.frameLength {α : Type u_1} {β : Type u_2} {f : α → β} {encIn : α ↪ List Bool} {encHeader : β ↪ List Bool} {budget : α → ℕ} (h : ComputableInSpace f encIn encHeader budget) :
ComputableInSpace (fun (x : α) => (MultiTapeTM.frame (encHeader (f x))).length) encIn encNat budget

Compute the length of the framed header in the same space budget as its extraction. For a framed prefix, this gives the binary offset of the original payload.