Languages determined by the first input cell #
Non-trivial languages whose membership can be decided by reading just the
first cell after ▷ on the input tape. We build a single 3-state TM
decideFirstCellTM parameterized by a predicate yesOn : Γ → Bool, prove
it runs in exactly 2 steps, and specialize it to several concrete
languages.
Main definitions #
firstCell— the first input cell after▷(aΓsymbol).TM.decideFirstCellTM yesOn— the 3-state parametric TM.
Concrete languages #
Language.singletonEmpty—{[]}(empty string only).Language.firstBitOne— strings beginning with1.Language.firstBitZero— strings beginning with0.Language.nonempty— nonempty strings.
Main results #
decideFirstCellTM_reachesIn— the TM halts in 2 steps with the correct output.singletonEmpty_in_DTIME,firstBitOne_in_DTIME,firstBitZero_in_DTIME,nonempty_in_DTIME— all decidable inDTIME(fun _ => 2).singletonEmpty_mem_P,firstBitOne_mem_P,firstBitZero_mem_P,nonempty_mem_P— all inP(and hence in every larger class).nonempty_eq_compl_singletonEmpty— the nonempty language is the complement of{[]}, giving a second derivation of its P-membership.firstBitZero_union_firstBitOne_eq_nonempty— explicit Boolean identity used to presentnonemptyas a union.
The first cell after ▷ on the initial input tape, as a Γ symbol.
This is the cell the machine reads on its second step.
Equations
Instances For
Control states of decideFirstCellTM.
- advance : FirstCellPhase
- decide : FirstCellPhase
- done : FirstCellPhase
Instances For
Equations
- One or more equations did not get rendered due to their size.
Parametric 3-state TM: advance past ▷ on input and output, then read
input cell 1 and write 1 if yesOn iHead, else 0. Always halts in
exactly 2 steps.
Equations
- One or more equations did not get rendered due to their size.
Instances For
decideFirstCellTM yesOn halts in exactly 2 steps on every input, with
output cell 1 set to Γ.one if yesOn (firstCell x) is true and
Γ.zero otherwise.
Generic bridge from decideFirstCellTM_reachesIn to DecidesInTime.
Whenever a language L is characterized by x ∈ L ↔ yesOn (firstCell x),
the 0-work-tape version of decideFirstCellTM yesOn decides L in 2 steps.
The language {[]}: the only accepted string is the empty one.
Instances For
{[]} ∈ DTIME(2): decided in 2 steps by decideFirstCellTM (· = Γ.blank).
firstBitOne ∈ DTIME(2).
firstBitZero ∈ DTIME(2).
nonempty ∈ DTIME(2).
nonempty is the complement of {[]}.
nonempty is the union of "first bit 0" and "first bit 1".
Alternative proof: nonempty ∈ P via P_compl applied to {[]} ∈ P.
Alternative proof: nonempty ∈ P via P_union.