Inner-Block Realizability #
This file shows that any TM0RealizesBlockSep Γ sep f can be lifted to
operate on an inner block of a two-separator tape, preserving the prefix.
Main definitions #
TM0RealizesInnerBlockSep Γ sep₁ sep₂ f: the machine appliesfto the inner block betweensep₂andsep₁, preserving the prefix beforesep₂.
Main result #
tm0RealizesBlockSep_toInnerOuterSep: anyTM0RealizesBlockSep Γ sep₂ fcan be lifted toTM0RealizesInnerBlockSep Γ sep₁ sep₂ fwhen the outer separator is non-default.tm0RealizesBlockSep_toInnerDefault: default-boundary version of the same prefix/suffix lift.
Strategy #
The construction composes five sub-machines (three distinct):
- Reverse (sep₁-delimited): reverses the outer block, bringing
inner.reverseto the front where the left boundary is blank. - Reverse (sep₂-delimited): un-reverses the inner block back to
inner. - Apply f (sep₂-delimited): applies
fto the inner block. - Reverse (sep₂-delimited): reverses
f(inner)back. - Reverse (sep₁-delimited): reverses the outer block, restoring prefix.
Steps 2–4 are composed into reverse ∘ f ∘ reverse via tm0RealizesBlockSep_comp,
producing a single TM0RealizesBlockSep Γ sep₂ machine. The full construction
is then a three-machine composition: reverse(sep₁) → revFRev(sep₂) → reverse(sep₁).
Inner Block Realizability Definition #
A TM0 machine that applies f to the inner block of a two-separator tape.
Given tape pfx ++ [sep₂] ++ inner ++ [sep₁] ++ suffix,
produces pfx ++ [sep₂] ++ f(inner) ++ [sep₁] ++ suffix.
The prefix pfx, both separators sep₁ and sep₂, and the suffix
are all preserved. Only the inner block between sep₂ and sep₁ is
modified.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Strong suffix version of TM0RealizesInnerBlockSep.
The machine applies f to the block between sep₂ and sep₁, preserving
the entire suffix after sep₁ without requiring it to be blank-free.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Forget that an inner-block machine is suffix-opaque.
A default-delimited version of TM0RealizesInnerBlockSep.
This is the shape needed by invariant while-loop bodies: the whole active
block is default-delimited, and an internal separator sep₂ splits the
preserved prefix from the inner block transformed by f.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Default-delimited inner-block realizability using a temporary non-default outer separator.
The extra separator tmp is not part of the input/output tape. It is the
marker used internally to turn the outer default boundary into a real
separator, run the non-default prefix/suffix lift, then restore the boundary
to default. The contract records exactly the freshness facts needed for that
construction.
Equations
- One or more equations did not get rendered due to their size.
Instances For
List Reversal Helpers #
Boundary replacement helper #
- scan : BoundaryReplaceSt
- goLeft : BoundaryReplaceSt
- rewind : BoundaryReplaceSt
- done : BoundaryReplaceSt
Instances For
Equations
- instFintypeBoundaryReplaceSt = { elems := { val := ↑BoundaryReplaceSt.enumList, nodup := BoundaryReplaceSt.enumList_nodup }, complete := instFintypeBoundaryReplaceSt._proof_1 }
Equations
- instInhabitedBoundaryReplaceSt = { default := BoundaryReplaceSt.scan }
Scan to the first occurrence of target, replace it by repl, then rewind
to the left edge of the active block.
Equations
- One or more equations did not get rendered due to their size.
- boundaryReplaceMachine target repl BoundaryReplaceSt.goLeft a = some (BoundaryReplaceSt.rewind, Turing.TM0.Stmt.move Turing.Dir.left)
- boundaryReplaceMachine target repl BoundaryReplaceSt.done a = none
Instances For
Any default-delimited block machine can be run before an arbitrary
non-default separator by temporarily replacing that separator with default,
running the machine, and restoring the separator.
Any strong default-delimited block machine can be run before an arbitrary
non-default separator by temporarily replacing that separator with default,
running the machine, and restoring the separator.
Unlike tm0RealizesBlock_toBlockSep, this preserves an entirely opaque suffix:
the wrapped machine must already be a strong TM0RealizesBlockAnySuffix
machine, and the boundary replacement machines only touch the first boundary
cell.
Composition: reverse ∘ f ∘ reverse #
If f is TM0RealizesBlockSep Γ sep, then reverse ∘ f ∘ reverse
is also TM0RealizesBlockSep Γ sep, provided f preserves the
non-defaultness and non-separator properties.
This is a reusable sub-machine composition: it takes any block-sep-realizable
function and produces a machine for the "conjugated" function
reverse ∘ f ∘ reverse.
Strong suffix version of tm0RealizesBlockSep_revFRev. This is the form
needed by prefix/suffix lifting when the preserved suffix after sep may
itself contain default.
Appending a fixed non-default, non-separator list is realizable before a separator, with no invariant on the suffix. This follows by reversing the active block, prepending the reversed fixed suffix, and reversing back.
Main Theorem: Lifting to Inner Block #
Strong suffix version of the prefix/suffix lift.
This is the construction that works uniformly for sep₁ = default and
sep₁ ≠ default: after reversing the outer block, the middle machine runs on
inner.reverse ++ sep₂ :: pfx.reverse ++ sep₁ :: suffix, so the hypothesis on
f must be TM0RealizesBlockSepAnySuffix.
Separator-delimited version of the default-boundary lift.
This is the form to use when the outer delimiter after the inner block should
be a real separator sep₁, not the tape blank. The tape shape is
pfx ++ sep₂ :: inner ++ sep₁ :: suffix.
Default-boundary inner-block lift through a temporary real separator.
Operationally this is:
- rewrite the boundary
defaultafterinnertotmp; - use
tm0RealizesBlockSep_toInner_nondefaultwith outer separatortmp; - rewrite the resulting boundary
tmpback todefault.
The freshness assumptions on tmp are carried by
TM0RealizesInnerBlockDefaultViaSep, because the temporary marker must not be
confused with data in the prefix, inner block, or transformed inner block.
Default-delimited inner-block lift with no suffix after the final blank.
The construction is the same three-machine composition:
reverse before the outer default, run reverse ∘ f ∘ reverse before the
internal separator, then reverse before the outer default again. The middle
phase is applied to a list without the trailing default; evalCfg_append_default
identifies that with the actual intermediate tape.