Imports
/-
Copyright (c) 2026 Terence Rokop. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Terence Rokop
-/
module
public import Geb.Prototypes.Computability.BitTree.Elias.MachineModel
public import Geb.Prototypes.Computability.BitTree.Elias.MachineConfig
public import Geb.Prototypes.Computability.TreeScanner.Steps
public import Mathlib.Tactic.FinCasesset_option doc.verso trueReading input at delta-decoder boundaries
Each external reading transition advances the input once and emits nothing. The results below expose its writes as updates of the two finite binary words; the countdown and cleanup proofs then compose with those boundaries directly.
Main statements
-
step_readresolves a reading transition on an arbitrary configuration. -
step_tree,step_zeros,step_sizeandstep_lengthdescribe the four kinds of header input transitions.
Implementation notes
These statements concern the Cslib execution functions and their input reader,
whose implementation uses Classical.choice.
Tags
Elias delta code, Turing machine, input, simulation
@[expose] public sectionnamespace Geb.BitTree.Elias.Machineopen Turing MultiTapeTMResolve one external reading step while leaving its work actions explicit.
theorem step_read {input : List (Fin 3)} (cfg : Cfg 4 (Fin 3) Control input)
(q : Control) (b : Bool) (hq : cfg.state = some q)
(hin : cfg.inputSymbol = some (boolEmb b))
(hr : q = stTree ∨ q = stZeros ∨ q = stSizeBit ∨ q = stLengthBit ∨
q = stPayloadBit ∨ q = stDone ∨ q = stDead) :
machine.step cfg =
{ state := (read q (boolEmb b)).q'
inputPos := moveInputPos cfg.inputPos 1
workTapes := fun i ↦
match ((read q (boolEmb b)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s
workTapePos := fun i ↦ cfg.workTapePos i +
((read q (boolEmb b)).workActions i).2 } := input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputq:Controlb:Boolhq:cfg.state = some qhin:cfg.inputSymbol = some (boolEmb b)hr:q = stTree ∨ q = stZeros ∨ q = stSizeBit ∨ q = stLengthBit ∨ q = stPayloadBit ∨ q = stDone ∨ q = stDead⊢ step cfg =
{ state := (read q (boolEmb b)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3)) ((read q (boolEmb b)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read q (boolEmb b)).workActions i).2 }
input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputq:Controlb:Boolhq:cfg.state = some qhin:cfg.inputSymbol = some (boolEmb b)hr:q = stTree ∨ q = stZeros ∨ q = stSizeBit ∨ q = stLengthBit ∨ q = stPayloadBit ∨ q = stDone ∨ q = stDead⊢ { state := (read q (boolEmb b)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3)) ((read q (boolEmb b)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read q (boolEmb b)).workActions i).2 } =
{ state := (read q (boolEmb b)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3)) ((read q (boolEmb b)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read q (boolEmb b)).workActions i).2 }
refine Cfg.ext rfl rfl ?_ rfl input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputq:Controlb:Boolhq:cfg.state = some qhin:cfg.inputSymbol = some (boolEmb b)hr:q = stTree ∨ q = stZeros ∨ q = stSizeBit ∨ q = stLengthBit ∨ q = stPayloadBit ∨ q = stDone ∨ q = stDead⊢ { state := (read q (boolEmb b)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3)) ((read q (boolEmb b)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read q (boolEmb b)).workActions i).2 }.workTapes =
{ state := (read q (boolEmb b)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3)) ((read q (boolEmb b)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read q (boolEmb b)).workActions i).2 }.workTapes
funext i z input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputq:Controlb:Boolhq:cfg.state = some qhin:cfg.inputSymbol = some (boolEmb b)hr:q = stTree ∨ q = stZeros ∨ q = stSizeBit ∨ q = stLengthBit ∨ q = stPayloadBit ∨ q = stDone ∨ q = stDeadi:Fin 4z:ℤ⊢ { state := (read q (boolEmb b)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3)) ((read q (boolEmb b)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read q (boolEmb b)).workActions i).2 }.workTapes
i z =
{ state := (read q (boolEmb b)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3)) ((read q (boolEmb b)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read q (boolEmb b)).workActions i).2 }.workTapes
i z
rcases hr with rfl | rfl | rfl | rfl | rfl | rfl | rfl inl input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputb:Boolhin:cfg.inputSymbol = some (boolEmb b)i:Fin 4z:ℤhq:cfg.state = some stTree⊢ { state := (read stTree (boolEmb b)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb b)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stTree (boolEmb b)).workActions i).2 }.workTapes
i z =
{ state := (read stTree (boolEmb b)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb b)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stTree (boolEmb b)).workActions i).2 }.workTapes
i zinr.inl input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputb:Boolhin:cfg.inputSymbol = some (boolEmb b)i:Fin 4z:ℤhq:cfg.state = some stZeros⊢ { state := (read stZeros (boolEmb b)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb b)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stZeros (boolEmb b)).workActions i).2 }.workTapes
i z =
{ state := (read stZeros (boolEmb b)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb b)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stZeros (boolEmb b)).workActions i).2 }.workTapes
i zinr.inr.inl input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputb:Boolhin:cfg.inputSymbol = some (boolEmb b)i:Fin 4z:ℤhq:cfg.state = some stSizeBit⊢ { state := (read stSizeBit (boolEmb b)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stSizeBit (boolEmb b)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stSizeBit (boolEmb b)).workActions i).2 }.workTapes
i z =
{ state := (read stSizeBit (boolEmb b)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stSizeBit (boolEmb b)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stSizeBit (boolEmb b)).workActions i).2 }.workTapes
i zinr.inr.inr.inl input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputb:Boolhin:cfg.inputSymbol = some (boolEmb b)i:Fin 4z:ℤhq:cfg.state = some stLengthBit⊢ { state := (read stLengthBit (boolEmb b)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stLengthBit (boolEmb b)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stLengthBit (boolEmb b)).workActions i).2 }.workTapes
i z =
{ state := (read stLengthBit (boolEmb b)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stLengthBit (boolEmb b)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stLengthBit (boolEmb b)).workActions i).2 }.workTapes
i zinr.inr.inr.inr.inl input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputb:Boolhin:cfg.inputSymbol = some (boolEmb b)i:Fin 4z:ℤhq:cfg.state = some stPayloadBit⊢ { state := (read stPayloadBit (boolEmb b)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stPayloadBit (boolEmb b)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stPayloadBit (boolEmb b)).workActions i).2 }.workTapes
i z =
{ state := (read stPayloadBit (boolEmb b)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stPayloadBit (boolEmb b)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stPayloadBit (boolEmb b)).workActions i).2 }.workTapes
i zinr.inr.inr.inr.inr.inl input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputb:Boolhin:cfg.inputSymbol = some (boolEmb b)i:Fin 4z:ℤhq:cfg.state = some stDone⊢ { state := (read stDone (boolEmb b)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDone (boolEmb b)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDone (boolEmb b)).workActions i).2 }.workTapes
i z =
{ state := (read stDone (boolEmb b)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDone (boolEmb b)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDone (boolEmb b)).workActions i).2 }.workTapes
i zinr.inr.inr.inr.inr.inr input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputb:Boolhin:cfg.inputSymbol = some (boolEmb b)i:Fin 4z:ℤhq:cfg.state = some stDead⊢ { state := (read stDead (boolEmb b)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDead (boolEmb b)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDead (boolEmb b)).workActions i).2 }.workTapes
i z =
{ state := (read stDead (boolEmb b)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDead (boolEmb b)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDead (boolEmb b)).workActions i).2 }.workTapes
i z <;> inl input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputb:Boolhin:cfg.inputSymbol = some (boolEmb b)i:Fin 4z:ℤhq:cfg.state = some stTree⊢ { state := (read stTree (boolEmb b)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb b)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stTree (boolEmb b)).workActions i).2 }.workTapes
i z =
{ state := (read stTree (boolEmb b)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb b)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stTree (boolEmb b)).workActions i).2 }.workTapes
i zinr.inl input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputb:Boolhin:cfg.inputSymbol = some (boolEmb b)i:Fin 4z:ℤhq:cfg.state = some stZeros⊢ { state := (read stZeros (boolEmb b)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb b)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stZeros (boolEmb b)).workActions i).2 }.workTapes
i z =
{ state := (read stZeros (boolEmb b)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb b)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stZeros (boolEmb b)).workActions i).2 }.workTapes
i zinr.inr.inl input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputb:Boolhin:cfg.inputSymbol = some (boolEmb b)i:Fin 4z:ℤhq:cfg.state = some stSizeBit⊢ { state := (read stSizeBit (boolEmb b)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stSizeBit (boolEmb b)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stSizeBit (boolEmb b)).workActions i).2 }.workTapes
i z =
{ state := (read stSizeBit (boolEmb b)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stSizeBit (boolEmb b)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stSizeBit (boolEmb b)).workActions i).2 }.workTapes
i zinr.inr.inr.inl input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputb:Boolhin:cfg.inputSymbol = some (boolEmb b)i:Fin 4z:ℤhq:cfg.state = some stLengthBit⊢ { state := (read stLengthBit (boolEmb b)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stLengthBit (boolEmb b)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stLengthBit (boolEmb b)).workActions i).2 }.workTapes
i z =
{ state := (read stLengthBit (boolEmb b)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stLengthBit (boolEmb b)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stLengthBit (boolEmb b)).workActions i).2 }.workTapes
i zinr.inr.inr.inr.inl input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputb:Boolhin:cfg.inputSymbol = some (boolEmb b)i:Fin 4z:ℤhq:cfg.state = some stPayloadBit⊢ { state := (read stPayloadBit (boolEmb b)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stPayloadBit (boolEmb b)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stPayloadBit (boolEmb b)).workActions i).2 }.workTapes
i z =
{ state := (read stPayloadBit (boolEmb b)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stPayloadBit (boolEmb b)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stPayloadBit (boolEmb b)).workActions i).2 }.workTapes
i zinr.inr.inr.inr.inr.inl input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputb:Boolhin:cfg.inputSymbol = some (boolEmb b)i:Fin 4z:ℤhq:cfg.state = some stDone⊢ { state := (read stDone (boolEmb b)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDone (boolEmb b)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDone (boolEmb b)).workActions i).2 }.workTapes
i z =
{ state := (read stDone (boolEmb b)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDone (boolEmb b)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDone (boolEmb b)).workActions i).2 }.workTapes
i zinr.inr.inr.inr.inr.inr input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputb:Boolhin:cfg.inputSymbol = some (boolEmb b)i:Fin 4z:ℤhq:cfg.state = some stDead⊢ { state := (read stDead (boolEmb b)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDead (boolEmb b)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDead (boolEmb b)).workActions i).2 }.workTapes
i z =
{ state := (read stDead (boolEmb b)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDead (boolEmb b)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDead (boolEmb b)).workActions i).2 }.workTapes
i z
cases b inr.inr.inr.inr.inr.inr.false input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputi:Fin 4z:ℤhq:cfg.state = some stDeadhin:cfg.inputSymbol = some (boolEmb false)⊢ { state := (read stDead (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDead (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDead (boolEmb false)).workActions i).2 }.workTapes
i z =
{ state := (read stDead (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDead (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDead (boolEmb false)).workActions i).2 }.workTapes
i zinr.inr.inr.inr.inr.inr.true input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputi:Fin 4z:ℤhq:cfg.state = some stDeadhin:cfg.inputSymbol = some (boolEmb true)⊢ { state := (read stDead (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDead (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDead (boolEmb true)).workActions i).2 }.workTapes
i z =
{ state := (read stDead (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDead (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDead (boolEmb true)).workActions i).2 }.workTapes
i z <;> inl.false input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputi:Fin 4z:ℤhq:cfg.state = some stTreehin:cfg.inputSymbol = some (boolEmb false)⊢ { state := (read stTree (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stTree (boolEmb false)).workActions i).2 }.workTapes
i z =
{ state := (read stTree (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stTree (boolEmb false)).workActions i).2 }.workTapes
i zinl.true input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputi:Fin 4z:ℤhq:cfg.state = some stTreehin:cfg.inputSymbol = some (boolEmb true)⊢ { state := (read stTree (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stTree (boolEmb true)).workActions i).2 }.workTapes
i z =
{ state := (read stTree (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stTree (boolEmb true)).workActions i).2 }.workTapes
i zinr.inl.false input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputi:Fin 4z:ℤhq:cfg.state = some stZeroshin:cfg.inputSymbol = some (boolEmb false)⊢ { state := (read stZeros (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stZeros (boolEmb false)).workActions i).2 }.workTapes
i z =
{ state := (read stZeros (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stZeros (boolEmb false)).workActions i).2 }.workTapes
i zinr.inl.true input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputi:Fin 4z:ℤhq:cfg.state = some stZeroshin:cfg.inputSymbol = some (boolEmb true)⊢ { state := (read stZeros (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stZeros (boolEmb true)).workActions i).2 }.workTapes
i z =
{ state := (read stZeros (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stZeros (boolEmb true)).workActions i).2 }.workTapes
i zinr.inr.inl.false input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputi:Fin 4z:ℤhq:cfg.state = some stSizeBithin:cfg.inputSymbol = some (boolEmb false)⊢ { state := (read stSizeBit (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stSizeBit (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stSizeBit (boolEmb false)).workActions i).2 }.workTapes
i z =
{ state := (read stSizeBit (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stSizeBit (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stSizeBit (boolEmb false)).workActions i).2 }.workTapes
i zinr.inr.inl.true input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputi:Fin 4z:ℤhq:cfg.state = some stSizeBithin:cfg.inputSymbol = some (boolEmb true)⊢ { state := (read stSizeBit (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stSizeBit (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stSizeBit (boolEmb true)).workActions i).2 }.workTapes
i z =
{ state := (read stSizeBit (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stSizeBit (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stSizeBit (boolEmb true)).workActions i).2 }.workTapes
i zinr.inr.inr.inl.false input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputi:Fin 4z:ℤhq:cfg.state = some stLengthBithin:cfg.inputSymbol = some (boolEmb false)⊢ { state := (read stLengthBit (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stLengthBit (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stLengthBit (boolEmb false)).workActions i).2 }.workTapes
i z =
{ state := (read stLengthBit (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stLengthBit (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stLengthBit (boolEmb false)).workActions i).2 }.workTapes
i zinr.inr.inr.inl.true input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputi:Fin 4z:ℤhq:cfg.state = some stLengthBithin:cfg.inputSymbol = some (boolEmb true)⊢ { state := (read stLengthBit (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stLengthBit (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stLengthBit (boolEmb true)).workActions i).2 }.workTapes
i z =
{ state := (read stLengthBit (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stLengthBit (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stLengthBit (boolEmb true)).workActions i).2 }.workTapes
i zinr.inr.inr.inr.inl.false input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputi:Fin 4z:ℤhq:cfg.state = some stPayloadBithin:cfg.inputSymbol = some (boolEmb false)⊢ { state := (read stPayloadBit (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stPayloadBit (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stPayloadBit (boolEmb false)).workActions i).2 }.workTapes
i z =
{ state := (read stPayloadBit (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stPayloadBit (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stPayloadBit (boolEmb false)).workActions i).2 }.workTapes
i zinr.inr.inr.inr.inl.true input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputi:Fin 4z:ℤhq:cfg.state = some stPayloadBithin:cfg.inputSymbol = some (boolEmb true)⊢ { state := (read stPayloadBit (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stPayloadBit (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stPayloadBit (boolEmb true)).workActions i).2 }.workTapes
i z =
{ state := (read stPayloadBit (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stPayloadBit (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stPayloadBit (boolEmb true)).workActions i).2 }.workTapes
i zinr.inr.inr.inr.inr.inl.false input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputi:Fin 4z:ℤhq:cfg.state = some stDonehin:cfg.inputSymbol = some (boolEmb false)⊢ { state := (read stDone (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDone (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDone (boolEmb false)).workActions i).2 }.workTapes
i z =
{ state := (read stDone (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDone (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDone (boolEmb false)).workActions i).2 }.workTapes
i zinr.inr.inr.inr.inr.inl.true input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputi:Fin 4z:ℤhq:cfg.state = some stDonehin:cfg.inputSymbol = some (boolEmb true)⊢ { state := (read stDone (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDone (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDone (boolEmb true)).workActions i).2 }.workTapes
i z =
{ state := (read stDone (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDone (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDone (boolEmb true)).workActions i).2 }.workTapes
i zinr.inr.inr.inr.inr.inr.false input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputi:Fin 4z:ℤhq:cfg.state = some stDeadhin:cfg.inputSymbol = some (boolEmb false)⊢ { state := (read stDead (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDead (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDead (boolEmb false)).workActions i).2 }.workTapes
i z =
{ state := (read stDead (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDead (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDead (boolEmb false)).workActions i).2 }.workTapes
i zinr.inr.inr.inr.inr.inr.true input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputi:Fin 4z:ℤhq:cfg.state = some stDeadhin:cfg.inputSymbol = some (boolEmb true)⊢ { state := (read stDead (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDead (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDead (boolEmb true)).workActions i).2 }.workTapes
i z =
{ state := (read stDead (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDead (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDead (boolEmb true)).workActions i).2 }.workTapes
i z fin_cases i inr.inr.inr.inr.inr.inr.true.«0» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stDeadhin:cfg.inputSymbol = some (boolEmb true)⊢ { state := (read stDead (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDead (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDead (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨0, ⋯⟩) z =
{ state := (read stDead (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDead (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDead (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨0, ⋯⟩) zinr.inr.inr.inr.inr.inr.true.«1» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stDeadhin:cfg.inputSymbol = some (boolEmb true)⊢ { state := (read stDead (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDead (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDead (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨1, ⋯⟩) z =
{ state := (read stDead (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDead (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDead (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨1, ⋯⟩) zinr.inr.inr.inr.inr.inr.true.«2» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stDeadhin:cfg.inputSymbol = some (boolEmb true)⊢ { state := (read stDead (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDead (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDead (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨2, ⋯⟩) z =
{ state := (read stDead (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDead (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDead (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨2, ⋯⟩) zinr.inr.inr.inr.inr.inr.true.«3» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stDeadhin:cfg.inputSymbol = some (boolEmb true)⊢ { state := (read stDead (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDead (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDead (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨3, ⋯⟩) z =
{ state := (read stDead (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDead (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDead (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨3, ⋯⟩) z <;> inl.false.«0» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stTreehin:cfg.inputSymbol = some (boolEmb false)⊢ { state := (read stTree (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stTree (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨0, ⋯⟩) z =
{ state := (read stTree (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stTree (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨0, ⋯⟩) zinl.false.«1» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stTreehin:cfg.inputSymbol = some (boolEmb false)⊢ { state := (read stTree (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stTree (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨1, ⋯⟩) z =
{ state := (read stTree (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stTree (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨1, ⋯⟩) zinl.false.«2» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stTreehin:cfg.inputSymbol = some (boolEmb false)⊢ { state := (read stTree (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stTree (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨2, ⋯⟩) z =
{ state := (read stTree (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stTree (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨2, ⋯⟩) zinl.false.«3» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stTreehin:cfg.inputSymbol = some (boolEmb false)⊢ { state := (read stTree (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stTree (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨3, ⋯⟩) z =
{ state := (read stTree (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stTree (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨3, ⋯⟩) zinl.true.«0» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stTreehin:cfg.inputSymbol = some (boolEmb true)⊢ { state := (read stTree (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stTree (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨0, ⋯⟩) z =
{ state := (read stTree (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stTree (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨0, ⋯⟩) zinl.true.«1» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stTreehin:cfg.inputSymbol = some (boolEmb true)⊢ { state := (read stTree (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stTree (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨1, ⋯⟩) z =
{ state := (read stTree (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stTree (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨1, ⋯⟩) zinl.true.«2» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stTreehin:cfg.inputSymbol = some (boolEmb true)⊢ { state := (read stTree (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stTree (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨2, ⋯⟩) z =
{ state := (read stTree (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stTree (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨2, ⋯⟩) zinl.true.«3» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stTreehin:cfg.inputSymbol = some (boolEmb true)⊢ { state := (read stTree (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stTree (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨3, ⋯⟩) z =
{ state := (read stTree (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stTree (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨3, ⋯⟩) zinr.inl.false.«0» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stZeroshin:cfg.inputSymbol = some (boolEmb false)⊢ { state := (read stZeros (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stZeros (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨0, ⋯⟩) z =
{ state := (read stZeros (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stZeros (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨0, ⋯⟩) zinr.inl.false.«1» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stZeroshin:cfg.inputSymbol = some (boolEmb false)⊢ { state := (read stZeros (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stZeros (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨1, ⋯⟩) z =
{ state := (read stZeros (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stZeros (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨1, ⋯⟩) zinr.inl.false.«2» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stZeroshin:cfg.inputSymbol = some (boolEmb false)⊢ { state := (read stZeros (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stZeros (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨2, ⋯⟩) z =
{ state := (read stZeros (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stZeros (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨2, ⋯⟩) zinr.inl.false.«3» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stZeroshin:cfg.inputSymbol = some (boolEmb false)⊢ { state := (read stZeros (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stZeros (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨3, ⋯⟩) z =
{ state := (read stZeros (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stZeros (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨3, ⋯⟩) zinr.inl.true.«0» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stZeroshin:cfg.inputSymbol = some (boolEmb true)⊢ { state := (read stZeros (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stZeros (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨0, ⋯⟩) z =
{ state := (read stZeros (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stZeros (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨0, ⋯⟩) zinr.inl.true.«1» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stZeroshin:cfg.inputSymbol = some (boolEmb true)⊢ { state := (read stZeros (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stZeros (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨1, ⋯⟩) z =
{ state := (read stZeros (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stZeros (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨1, ⋯⟩) zinr.inl.true.«2» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stZeroshin:cfg.inputSymbol = some (boolEmb true)⊢ { state := (read stZeros (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stZeros (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨2, ⋯⟩) z =
{ state := (read stZeros (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stZeros (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨2, ⋯⟩) zinr.inl.true.«3» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stZeroshin:cfg.inputSymbol = some (boolEmb true)⊢ { state := (read stZeros (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stZeros (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨3, ⋯⟩) z =
{ state := (read stZeros (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stZeros (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨3, ⋯⟩) zinr.inr.inl.false.«0» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stSizeBithin:cfg.inputSymbol = some (boolEmb false)⊢ { state := (read stSizeBit (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stSizeBit (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stSizeBit (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨0, ⋯⟩) z =
{ state := (read stSizeBit (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stSizeBit (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stSizeBit (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨0, ⋯⟩) zinr.inr.inl.false.«1» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stSizeBithin:cfg.inputSymbol = some (boolEmb false)⊢ { state := (read stSizeBit (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stSizeBit (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stSizeBit (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨1, ⋯⟩) z =
{ state := (read stSizeBit (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stSizeBit (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stSizeBit (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨1, ⋯⟩) zinr.inr.inl.false.«2» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stSizeBithin:cfg.inputSymbol = some (boolEmb false)⊢ { state := (read stSizeBit (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stSizeBit (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stSizeBit (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨2, ⋯⟩) z =
{ state := (read stSizeBit (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stSizeBit (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stSizeBit (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨2, ⋯⟩) zinr.inr.inl.false.«3» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stSizeBithin:cfg.inputSymbol = some (boolEmb false)⊢ { state := (read stSizeBit (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stSizeBit (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stSizeBit (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨3, ⋯⟩) z =
{ state := (read stSizeBit (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stSizeBit (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stSizeBit (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨3, ⋯⟩) zinr.inr.inl.true.«0» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stSizeBithin:cfg.inputSymbol = some (boolEmb true)⊢ { state := (read stSizeBit (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stSizeBit (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stSizeBit (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨0, ⋯⟩) z =
{ state := (read stSizeBit (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stSizeBit (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stSizeBit (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨0, ⋯⟩) zinr.inr.inl.true.«1» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stSizeBithin:cfg.inputSymbol = some (boolEmb true)⊢ { state := (read stSizeBit (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stSizeBit (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stSizeBit (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨1, ⋯⟩) z =
{ state := (read stSizeBit (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stSizeBit (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stSizeBit (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨1, ⋯⟩) zinr.inr.inl.true.«2» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stSizeBithin:cfg.inputSymbol = some (boolEmb true)⊢ { state := (read stSizeBit (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stSizeBit (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stSizeBit (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨2, ⋯⟩) z =
{ state := (read stSizeBit (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stSizeBit (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stSizeBit (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨2, ⋯⟩) zinr.inr.inl.true.«3» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stSizeBithin:cfg.inputSymbol = some (boolEmb true)⊢ { state := (read stSizeBit (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stSizeBit (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stSizeBit (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨3, ⋯⟩) z =
{ state := (read stSizeBit (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stSizeBit (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stSizeBit (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨3, ⋯⟩) zinr.inr.inr.inl.false.«0» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stLengthBithin:cfg.inputSymbol = some (boolEmb false)⊢ { state := (read stLengthBit (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stLengthBit (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stLengthBit (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨0, ⋯⟩) z =
{ state := (read stLengthBit (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stLengthBit (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stLengthBit (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨0, ⋯⟩) zinr.inr.inr.inl.false.«1» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stLengthBithin:cfg.inputSymbol = some (boolEmb false)⊢ { state := (read stLengthBit (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stLengthBit (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stLengthBit (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨1, ⋯⟩) z =
{ state := (read stLengthBit (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stLengthBit (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stLengthBit (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨1, ⋯⟩) zinr.inr.inr.inl.false.«2» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stLengthBithin:cfg.inputSymbol = some (boolEmb false)⊢ { state := (read stLengthBit (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stLengthBit (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stLengthBit (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨2, ⋯⟩) z =
{ state := (read stLengthBit (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stLengthBit (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stLengthBit (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨2, ⋯⟩) zinr.inr.inr.inl.false.«3» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stLengthBithin:cfg.inputSymbol = some (boolEmb false)⊢ { state := (read stLengthBit (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stLengthBit (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stLengthBit (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨3, ⋯⟩) z =
{ state := (read stLengthBit (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stLengthBit (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stLengthBit (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨3, ⋯⟩) zinr.inr.inr.inl.true.«0» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stLengthBithin:cfg.inputSymbol = some (boolEmb true)⊢ { state := (read stLengthBit (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stLengthBit (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stLengthBit (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨0, ⋯⟩) z =
{ state := (read stLengthBit (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stLengthBit (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stLengthBit (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨0, ⋯⟩) zinr.inr.inr.inl.true.«1» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stLengthBithin:cfg.inputSymbol = some (boolEmb true)⊢ { state := (read stLengthBit (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stLengthBit (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stLengthBit (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨1, ⋯⟩) z =
{ state := (read stLengthBit (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stLengthBit (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stLengthBit (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨1, ⋯⟩) zinr.inr.inr.inl.true.«2» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stLengthBithin:cfg.inputSymbol = some (boolEmb true)⊢ { state := (read stLengthBit (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stLengthBit (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stLengthBit (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨2, ⋯⟩) z =
{ state := (read stLengthBit (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stLengthBit (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stLengthBit (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨2, ⋯⟩) zinr.inr.inr.inl.true.«3» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stLengthBithin:cfg.inputSymbol = some (boolEmb true)⊢ { state := (read stLengthBit (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stLengthBit (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stLengthBit (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨3, ⋯⟩) z =
{ state := (read stLengthBit (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stLengthBit (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stLengthBit (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨3, ⋯⟩) zinr.inr.inr.inr.inl.false.«0» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stPayloadBithin:cfg.inputSymbol = some (boolEmb false)⊢ { state := (read stPayloadBit (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stPayloadBit (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stPayloadBit (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨0, ⋯⟩) z =
{ state := (read stPayloadBit (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stPayloadBit (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stPayloadBit (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨0, ⋯⟩) zinr.inr.inr.inr.inl.false.«1» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stPayloadBithin:cfg.inputSymbol = some (boolEmb false)⊢ { state := (read stPayloadBit (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stPayloadBit (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stPayloadBit (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨1, ⋯⟩) z =
{ state := (read stPayloadBit (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stPayloadBit (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stPayloadBit (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨1, ⋯⟩) zinr.inr.inr.inr.inl.false.«2» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stPayloadBithin:cfg.inputSymbol = some (boolEmb false)⊢ { state := (read stPayloadBit (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stPayloadBit (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stPayloadBit (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨2, ⋯⟩) z =
{ state := (read stPayloadBit (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stPayloadBit (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stPayloadBit (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨2, ⋯⟩) zinr.inr.inr.inr.inl.false.«3» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stPayloadBithin:cfg.inputSymbol = some (boolEmb false)⊢ { state := (read stPayloadBit (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stPayloadBit (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stPayloadBit (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨3, ⋯⟩) z =
{ state := (read stPayloadBit (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stPayloadBit (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stPayloadBit (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨3, ⋯⟩) zinr.inr.inr.inr.inl.true.«0» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stPayloadBithin:cfg.inputSymbol = some (boolEmb true)⊢ { state := (read stPayloadBit (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stPayloadBit (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stPayloadBit (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨0, ⋯⟩) z =
{ state := (read stPayloadBit (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stPayloadBit (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stPayloadBit (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨0, ⋯⟩) zinr.inr.inr.inr.inl.true.«1» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stPayloadBithin:cfg.inputSymbol = some (boolEmb true)⊢ { state := (read stPayloadBit (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stPayloadBit (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stPayloadBit (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨1, ⋯⟩) z =
{ state := (read stPayloadBit (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stPayloadBit (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stPayloadBit (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨1, ⋯⟩) zinr.inr.inr.inr.inl.true.«2» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stPayloadBithin:cfg.inputSymbol = some (boolEmb true)⊢ { state := (read stPayloadBit (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stPayloadBit (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stPayloadBit (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨2, ⋯⟩) z =
{ state := (read stPayloadBit (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stPayloadBit (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stPayloadBit (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨2, ⋯⟩) zinr.inr.inr.inr.inl.true.«3» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stPayloadBithin:cfg.inputSymbol = some (boolEmb true)⊢ { state := (read stPayloadBit (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stPayloadBit (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stPayloadBit (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨3, ⋯⟩) z =
{ state := (read stPayloadBit (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stPayloadBit (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stPayloadBit (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨3, ⋯⟩) zinr.inr.inr.inr.inr.inl.false.«0» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stDonehin:cfg.inputSymbol = some (boolEmb false)⊢ { state := (read stDone (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDone (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDone (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨0, ⋯⟩) z =
{ state := (read stDone (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDone (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDone (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨0, ⋯⟩) zinr.inr.inr.inr.inr.inl.false.«1» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stDonehin:cfg.inputSymbol = some (boolEmb false)⊢ { state := (read stDone (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDone (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDone (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨1, ⋯⟩) z =
{ state := (read stDone (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDone (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDone (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨1, ⋯⟩) zinr.inr.inr.inr.inr.inl.false.«2» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stDonehin:cfg.inputSymbol = some (boolEmb false)⊢ { state := (read stDone (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDone (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDone (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨2, ⋯⟩) z =
{ state := (read stDone (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDone (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDone (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨2, ⋯⟩) zinr.inr.inr.inr.inr.inl.false.«3» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stDonehin:cfg.inputSymbol = some (boolEmb false)⊢ { state := (read stDone (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDone (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDone (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨3, ⋯⟩) z =
{ state := (read stDone (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDone (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDone (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨3, ⋯⟩) zinr.inr.inr.inr.inr.inl.true.«0» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stDonehin:cfg.inputSymbol = some (boolEmb true)⊢ { state := (read stDone (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDone (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDone (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨0, ⋯⟩) z =
{ state := (read stDone (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDone (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDone (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨0, ⋯⟩) zinr.inr.inr.inr.inr.inl.true.«1» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stDonehin:cfg.inputSymbol = some (boolEmb true)⊢ { state := (read stDone (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDone (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDone (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨1, ⋯⟩) z =
{ state := (read stDone (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDone (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDone (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨1, ⋯⟩) zinr.inr.inr.inr.inr.inl.true.«2» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stDonehin:cfg.inputSymbol = some (boolEmb true)⊢ { state := (read stDone (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDone (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDone (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨2, ⋯⟩) z =
{ state := (read stDone (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDone (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDone (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨2, ⋯⟩) zinr.inr.inr.inr.inr.inl.true.«3» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stDonehin:cfg.inputSymbol = some (boolEmb true)⊢ { state := (read stDone (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDone (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDone (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨3, ⋯⟩) z =
{ state := (read stDone (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDone (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDone (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨3, ⋯⟩) zinr.inr.inr.inr.inr.inr.false.«0» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stDeadhin:cfg.inputSymbol = some (boolEmb false)⊢ { state := (read stDead (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDead (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDead (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨0, ⋯⟩) z =
{ state := (read stDead (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDead (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDead (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨0, ⋯⟩) zinr.inr.inr.inr.inr.inr.false.«1» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stDeadhin:cfg.inputSymbol = some (boolEmb false)⊢ { state := (read stDead (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDead (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDead (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨1, ⋯⟩) z =
{ state := (read stDead (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDead (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDead (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨1, ⋯⟩) zinr.inr.inr.inr.inr.inr.false.«2» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stDeadhin:cfg.inputSymbol = some (boolEmb false)⊢ { state := (read stDead (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDead (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDead (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨2, ⋯⟩) z =
{ state := (read stDead (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDead (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDead (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨2, ⋯⟩) zinr.inr.inr.inr.inr.inr.false.«3» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stDeadhin:cfg.inputSymbol = some (boolEmb false)⊢ { state := (read stDead (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDead (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDead (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨3, ⋯⟩) z =
{ state := (read stDead (boolEmb false)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDead (boolEmb false)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDead (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨3, ⋯⟩) zinr.inr.inr.inr.inr.inr.true.«0» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stDeadhin:cfg.inputSymbol = some (boolEmb true)⊢ { state := (read stDead (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDead (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDead (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨0, ⋯⟩) z =
{ state := (read stDead (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDead (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDead (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨0, ⋯⟩) zinr.inr.inr.inr.inr.inr.true.«1» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stDeadhin:cfg.inputSymbol = some (boolEmb true)⊢ { state := (read stDead (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDead (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDead (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨1, ⋯⟩) z =
{ state := (read stDead (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDead (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDead (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨1, ⋯⟩) zinr.inr.inr.inr.inr.inr.true.«2» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stDeadhin:cfg.inputSymbol = some (boolEmb true)⊢ { state := (read stDead (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDead (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDead (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨2, ⋯⟩) z =
{ state := (read stDead (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDead (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDead (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨2, ⋯⟩) zinr.inr.inr.inr.inr.inr.true.«3» input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputz:ℤhq:cfg.state = some stDeadhin:cfg.inputSymbol = some (boolEmb true)⊢ { state := (read stDead (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDead (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDead (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨3, ⋯⟩) z =
{ state := (read stDead (boolEmb true)).q', inputPos := moveInputPos cfg.inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stDead (boolEmb true)).workActions i).1 with
| none => cfg.workTapes i
| some s => Function.update (cfg.workTapes i) (cfg.workTapePos i) s,
workTapePos := fun i ↦ cfg.workTapePos i + ↑((read stDead (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨3, ⋯⟩) z rfl All goals completed! 🐙Reading an external bit emits nothing.
theorem outputSymbol_read {input : List (Fin 3)} (cfg : Cfg 4 (Fin 3) Control input)
(q : Control) (b : Bool) (hq : cfg.state = some q)
(hin : cfg.inputSymbol = some (boolEmb b))
(hr : q = stTree ∨ q = stZeros ∨ q = stSizeBit ∨ q = stLengthBit ∨
q = stPayloadBit ∨ q = stDone ∨ q = stDead) :
machine.outputSymbol cfg = none := by input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputq:Controlb:Boolhq:cfg.state = some qhin:cfg.inputSymbol = some (boolEmb b)hr:q = stTree ∨ q = stZeros ∨ q = stSizeBit ∨ q = stLengthBit ∨ q = stPayloadBit ∨ q = stDone ∨ q = stDead⊢ outputSymbol cfg = none
unfold outputSymbol input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputq:Controlb:Boolhq:cfg.state = some qhin:cfg.inputSymbol = some (boolEmb b)hr:q = stTree ∨ q = stZeros ∨ q = stSizeBit ∨ q = stLengthBit ∨ q = stPayloadBit ∨ q = stDone ∨ q = stDead⊢ (match cfg.state with
| none => none
| some q => (machine.tr q cfg.inputSymbol cfg.workTapeSymbols).outS) =
none
rw [hq input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputq:Controlb:Boolhq:cfg.state = some qhin:cfg.inputSymbol = some (boolEmb b)hr:q = stTree ∨ q = stZeros ∨ q = stSizeBit ∨ q = stLengthBit ∨ q = stPayloadBit ∨ q = stDone ∨ q = stDead⊢ (match some q with
| none => none
| some q => (machine.tr q cfg.inputSymbol cfg.workTapeSymbols).outS) =
none] input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputq:Controlb:Boolhq:cfg.state = some qhin:cfg.inputSymbol = some (boolEmb b)hr:q = stTree ∨ q = stZeros ∨ q = stSizeBit ∨ q = stLengthBit ∨ q = stPayloadBit ∨ q = stDone ∨ q = stDead⊢ (match some q with
| none => none
| some q => (machine.tr q cfg.inputSymbol cfg.workTapeSymbols).outS) =
none
change (machine.tr q cfg.inputSymbol cfg.workTapeSymbols).outS = none input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputq:Controlb:Boolhq:cfg.state = some qhin:cfg.inputSymbol = some (boolEmb b)hr:q = stTree ∨ q = stZeros ∨ q = stSizeBit ∨ q = stLengthBit ∨ q = stPayloadBit ∨ q = stDone ∨ q = stDead⊢ (machine.tr q cfg.inputSymbol cfg.workTapeSymbols).outS = none
rw [hin, input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputq:Controlb:Boolhq:cfg.state = some qhin:cfg.inputSymbol = some (boolEmb b)hr:q = stTree ∨ q = stZeros ∨ q = stSizeBit ∨ q = stLengthBit ∨ q = stPayloadBit ∨ q = stDone ∨ q = stDead⊢ (machine.tr q (some (boolEmb b)) cfg.workTapeSymbols).outS = none tr_read q _ _ hr, input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputq:Controlb:Boolhq:cfg.state = some qhin:cfg.inputSymbol = some (boolEmb b)hr:q = stTree ∨ q = stZeros ∨ q = stSizeBit ∨ q = stLengthBit ∨ q = stPayloadBit ∨ q = stDone ∨ q = stDead⊢ (read q (boolEmb b)).outS = none read_outS input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputq:Controlb:Boolhq:cfg.state = some qhin:cfg.inputSymbol = some (boolEmb b)hr:q = stTree ∨ q = stZeros ∨ q = stSizeBit ∨ q = stLengthBit ∨ q = stPayloadBit ∨ q = stDone ∨ q = stDead⊢ none = none] All goals completed! 🐙A fork increases pending trees; a leaf initializes its implicit leading length bit.
theorem step_tree (input : List (Fin 3)) (pos : Fin (input.length + 2))
(pending zeros : ℕ) (bs cs : List Bool) (b : Bool)
(hin : (scanCfg input pos stTree pending zeros bs cs).inputSymbol = some (boolEmb b)) :
machine.step (scanCfg input pos stTree pending zeros bs cs) =
if b then scanCfg input (moveInputPos pos 1) stTree (pending + 1) zeros bs cs
else scanCfg input (moveInputPos pos 1) stZeros pending zeros bs (true :: cs) := by input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stTree pending zeros bs cs).inputSymbol = some (boolEmb b)⊢ step (scanCfg input pos stTree pending zeros bs cs) =
if b = true then scanCfg input (moveInputPos pos 1) stTree (pending + 1) zeros bs cs
else scanCfg input (moveInputPos pos 1) stZeros pending zeros bs (true :: cs)
rw [step_read _ stTree b rfl hin (Or.inl rfl) input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stTree pending zeros bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stTree (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stTree pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3)) ((read stTree (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stTree pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stTree pending zeros bs cs).workTapes i)
((scanCfg input pos stTree pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stTree pending zeros bs cs).workTapePos i + ↑((read stTree (boolEmb b)).workActions i).2 } =
if b = true then scanCfg input (moveInputPos pos 1) stTree (pending + 1) zeros bs cs
else scanCfg input (moveInputPos pos 1) stZeros pending zeros bs (true :: cs)] input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stTree pending zeros bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stTree (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stTree pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3)) ((read stTree (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stTree pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stTree pending zeros bs cs).workTapes i)
((scanCfg input pos stTree pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stTree pending zeros bs cs).workTapePos i + ↑((read stTree (boolEmb b)).workActions i).2 } =
if b = true then scanCfg input (moveInputPos pos 1) stTree (pending + 1) zeros bs cs
else scanCfg input (moveInputPos pos 1) stZeros pending zeros bs (true :: cs)
cases b false input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stTree pending zeros bs cs).inputSymbol = some (boolEmb false)⊢ { state := (read stTree (boolEmb false)).q',
inputPos := moveInputPos (scanCfg input pos stTree pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb false)).workActions i).1 with
| none => (scanCfg input pos stTree pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stTree pending zeros bs cs).workTapes i)
((scanCfg input pos stTree pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stTree pending zeros bs cs).workTapePos i +
↑((read stTree (boolEmb false)).workActions i).2 } =
if false = true then scanCfg input (moveInputPos pos 1) stTree (pending + 1) zeros bs cs
else scanCfg input (moveInputPos pos 1) stZeros pending zeros bs (true :: cs)true input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stTree pending zeros bs cs).inputSymbol = some (boolEmb true)⊢ { state := (read stTree (boolEmb true)).q',
inputPos := moveInputPos (scanCfg input pos stTree pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3)) ((read stTree (boolEmb true)).workActions i).1 with
| none => (scanCfg input pos stTree pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stTree pending zeros bs cs).workTapes i)
((scanCfg input pos stTree pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stTree pending zeros bs cs).workTapePos i + ↑((read stTree (boolEmb true)).workActions i).2 } =
if true = true then scanCfg input (moveInputPos pos 1) stTree (pending + 1) zeros bs cs
else scanCfg input (moveInputPos pos 1) stZeros pending zeros bs (true :: cs) <;> false input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stTree pending zeros bs cs).inputSymbol = some (boolEmb false)⊢ { state := (read stTree (boolEmb false)).q',
inputPos := moveInputPos (scanCfg input pos stTree pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb false)).workActions i).1 with
| none => (scanCfg input pos stTree pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stTree pending zeros bs cs).workTapes i)
((scanCfg input pos stTree pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stTree pending zeros bs cs).workTapePos i +
↑((read stTree (boolEmb false)).workActions i).2 } =
if false = true then scanCfg input (moveInputPos pos 1) stTree (pending + 1) zeros bs cs
else scanCfg input (moveInputPos pos 1) stZeros pending zeros bs (true :: cs)true input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stTree pending zeros bs cs).inputSymbol = some (boolEmb true)⊢ { state := (read stTree (boolEmb true)).q',
inputPos := moveInputPos (scanCfg input pos stTree pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3)) ((read stTree (boolEmb true)).workActions i).1 with
| none => (scanCfg input pos stTree pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stTree pending zeros bs cs).workTapes i)
((scanCfg input pos stTree pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stTree pending zeros bs cs).workTapePos i + ↑((read stTree (boolEmb true)).workActions i).2 } =
if true = true then scanCfg input (moveInputPos pos 1) stTree (pending + 1) zeros bs cs
else scanCfg input (moveInputPos pos 1) stZeros pending zeros bs (true :: cs) refine Cfg.ext rfl rfl ?_ ?_ true.refine_1 input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stTree pending zeros bs cs).inputSymbol = some (boolEmb true)⊢ { state := (read stTree (boolEmb true)).q',
inputPos := moveInputPos (scanCfg input pos stTree pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb true)).workActions i).1 with
| none => (scanCfg input pos stTree pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stTree pending zeros bs cs).workTapes i)
((scanCfg input pos stTree pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stTree pending zeros bs cs).workTapePos i +
↑((read stTree (boolEmb true)).workActions i).2 }.workTapes =
(if true = true then scanCfg input (moveInputPos pos 1) stTree (pending + 1) zeros bs cs
else scanCfg input (moveInputPos pos 1) stZeros pending zeros bs (true :: cs)).workTapestrue.refine_2 input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stTree pending zeros bs cs).inputSymbol = some (boolEmb true)⊢ { state := (read stTree (boolEmb true)).q',
inputPos := moveInputPos (scanCfg input pos stTree pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb true)).workActions i).1 with
| none => (scanCfg input pos stTree pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stTree pending zeros bs cs).workTapes i)
((scanCfg input pos stTree pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stTree pending zeros bs cs).workTapePos i +
↑((read stTree (boolEmb true)).workActions i).2 }.workTapePos =
(if true = true then scanCfg input (moveInputPos pos 1) stTree (pending + 1) zeros bs cs
else scanCfg input (moveInputPos pos 1) stZeros pending zeros bs (true :: cs)).workTapePos
· false.refine_1 input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stTree pending zeros bs cs).inputSymbol = some (boolEmb false)⊢ { state := (read stTree (boolEmb false)).q',
inputPos := moveInputPos (scanCfg input pos stTree pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb false)).workActions i).1 with
| none => (scanCfg input pos stTree pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stTree pending zeros bs cs).workTapes i)
((scanCfg input pos stTree pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stTree pending zeros bs cs).workTapePos i +
↑((read stTree (boolEmb false)).workActions i).2 }.workTapes =
(if false = true then scanCfg input (moveInputPos pos 1) stTree (pending + 1) zeros bs cs
else scanCfg input (moveInputPos pos 1) stZeros pending zeros bs (true :: cs)).workTapes funext i false.refine_1 input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stTree pending zeros bs cs).inputSymbol = some (boolEmb false)i:Fin 4⊢ { state := (read stTree (boolEmb false)).q',
inputPos := moveInputPos (scanCfg input pos stTree pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb false)).workActions i).1 with
| none => (scanCfg input pos stTree pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stTree pending zeros bs cs).workTapes i)
((scanCfg input pos stTree pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stTree pending zeros bs cs).workTapePos i +
↑((read stTree (boolEmb false)).workActions i).2 }.workTapes
i =
(if false = true then scanCfg input (moveInputPos pos 1) stTree (pending + 1) zeros bs cs
else scanCfg input (moveInputPos pos 1) stZeros pending zeros bs (true :: cs)).workTapes
i
fin_cases i false.refine_1.«0» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stTree pending zeros bs cs).inputSymbol = some (boolEmb false)⊢ { state := (read stTree (boolEmb false)).q',
inputPos := moveInputPos (scanCfg input pos stTree pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb false)).workActions i).1 with
| none => (scanCfg input pos stTree pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stTree pending zeros bs cs).workTapes i)
((scanCfg input pos stTree pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stTree pending zeros bs cs).workTapePos i +
↑((read stTree (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨0, ⋯⟩) =
(if false = true then scanCfg input (moveInputPos pos 1) stTree (pending + 1) zeros bs cs
else scanCfg input (moveInputPos pos 1) stZeros pending zeros bs (true :: cs)).workTapes
((fun i ↦ i) ⟨0, ⋯⟩)false.refine_1.«1» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stTree pending zeros bs cs).inputSymbol = some (boolEmb false)⊢ { state := (read stTree (boolEmb false)).q',
inputPos := moveInputPos (scanCfg input pos stTree pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb false)).workActions i).1 with
| none => (scanCfg input pos stTree pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stTree pending zeros bs cs).workTapes i)
((scanCfg input pos stTree pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stTree pending zeros bs cs).workTapePos i +
↑((read stTree (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨1, ⋯⟩) =
(if false = true then scanCfg input (moveInputPos pos 1) stTree (pending + 1) zeros bs cs
else scanCfg input (moveInputPos pos 1) stZeros pending zeros bs (true :: cs)).workTapes
((fun i ↦ i) ⟨1, ⋯⟩)false.refine_1.«2» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stTree pending zeros bs cs).inputSymbol = some (boolEmb false)⊢ { state := (read stTree (boolEmb false)).q',
inputPos := moveInputPos (scanCfg input pos stTree pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb false)).workActions i).1 with
| none => (scanCfg input pos stTree pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stTree pending zeros bs cs).workTapes i)
((scanCfg input pos stTree pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stTree pending zeros bs cs).workTapePos i +
↑((read stTree (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨2, ⋯⟩) =
(if false = true then scanCfg input (moveInputPos pos 1) stTree (pending + 1) zeros bs cs
else scanCfg input (moveInputPos pos 1) stZeros pending zeros bs (true :: cs)).workTapes
((fun i ↦ i) ⟨2, ⋯⟩)false.refine_1.«3» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stTree pending zeros bs cs).inputSymbol = some (boolEmb false)⊢ { state := (read stTree (boolEmb false)).q',
inputPos := moveInputPos (scanCfg input pos stTree pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb false)).workActions i).1 with
| none => (scanCfg input pos stTree pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stTree pending zeros bs cs).workTapes i)
((scanCfg input pos stTree pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stTree pending zeros bs cs).workTapePos i +
↑((read stTree (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨3, ⋯⟩) =
(if false = true then scanCfg input (moveInputPos pos 1) stTree (pending + 1) zeros bs cs
else scanCfg input (moveInputPos pos 1) stZeros pending zeros bs (true :: cs)).workTapes
((fun i ↦ i) ⟨3, ⋯⟩) <;> false.refine_1.«0» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stTree pending zeros bs cs).inputSymbol = some (boolEmb false)⊢ { state := (read stTree (boolEmb false)).q',
inputPos := moveInputPos (scanCfg input pos stTree pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb false)).workActions i).1 with
| none => (scanCfg input pos stTree pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stTree pending zeros bs cs).workTapes i)
((scanCfg input pos stTree pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stTree pending zeros bs cs).workTapePos i +
↑((read stTree (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨0, ⋯⟩) =
(if false = true then scanCfg input (moveInputPos pos 1) stTree (pending + 1) zeros bs cs
else scanCfg input (moveInputPos pos 1) stZeros pending zeros bs (true :: cs)).workTapes
((fun i ↦ i) ⟨0, ⋯⟩)false.refine_1.«1» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stTree pending zeros bs cs).inputSymbol = some (boolEmb false)⊢ { state := (read stTree (boolEmb false)).q',
inputPos := moveInputPos (scanCfg input pos stTree pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb false)).workActions i).1 with
| none => (scanCfg input pos stTree pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stTree pending zeros bs cs).workTapes i)
((scanCfg input pos stTree pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stTree pending zeros bs cs).workTapePos i +
↑((read stTree (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨1, ⋯⟩) =
(if false = true then scanCfg input (moveInputPos pos 1) stTree (pending + 1) zeros bs cs
else scanCfg input (moveInputPos pos 1) stZeros pending zeros bs (true :: cs)).workTapes
((fun i ↦ i) ⟨1, ⋯⟩)false.refine_1.«2» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stTree pending zeros bs cs).inputSymbol = some (boolEmb false)⊢ { state := (read stTree (boolEmb false)).q',
inputPos := moveInputPos (scanCfg input pos stTree pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb false)).workActions i).1 with
| none => (scanCfg input pos stTree pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stTree pending zeros bs cs).workTapes i)
((scanCfg input pos stTree pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stTree pending zeros bs cs).workTapePos i +
↑((read stTree (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨2, ⋯⟩) =
(if false = true then scanCfg input (moveInputPos pos 1) stTree (pending + 1) zeros bs cs
else scanCfg input (moveInputPos pos 1) stZeros pending zeros bs (true :: cs)).workTapes
((fun i ↦ i) ⟨2, ⋯⟩)false.refine_1.«3» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stTree pending zeros bs cs).inputSymbol = some (boolEmb false)⊢ { state := (read stTree (boolEmb false)).q',
inputPos := moveInputPos (scanCfg input pos stTree pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb false)).workActions i).1 with
| none => (scanCfg input pos stTree pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stTree pending zeros bs cs).workTapes i)
((scanCfg input pos stTree pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stTree pending zeros bs cs).workTapePos i +
↑((read stTree (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨3, ⋯⟩) =
(if false = true then scanCfg input (moveInputPos pos 1) stTree (pending + 1) zeros bs cs
else scanCfg input (moveInputPos pos 1) stZeros pending zeros bs (true :: cs)).workTapes
((fun i ↦ i) ⟨3, ⋯⟩) first | rfl false.refine_1.«3» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stTree pending zeros bs cs).inputSymbol = some (boolEmb false)⊢ { state := (read stTree (boolEmb false)).q',
inputPos := moveInputPos (scanCfg input pos stTree pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb false)).workActions i).1 with
| none => (scanCfg input pos stTree pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stTree pending zeros bs cs).workTapes i)
((scanCfg input pos stTree pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stTree pending zeros bs cs).workTapePos i +
↑((read stTree (boolEmb false)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨3, ⋯⟩) =
(if false = true then scanCfg input (moveInputPos pos 1) stTree (pending + 1) zeros bs cs
else scanCfg input (moveInputPos pos 1) stZeros pending zeros bs (true :: cs)).workTapes
((fun i ↦ i) ⟨3, ⋯⟩) | exact wordTape_cons cs true All goals completed! 🐙
· false.refine_2 input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stTree pending zeros bs cs).inputSymbol = some (boolEmb false)⊢ { state := (read stTree (boolEmb false)).q',
inputPos := moveInputPos (scanCfg input pos stTree pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb false)).workActions i).1 with
| none => (scanCfg input pos stTree pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stTree pending zeros bs cs).workTapes i)
((scanCfg input pos stTree pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stTree pending zeros bs cs).workTapePos i +
↑((read stTree (boolEmb false)).workActions i).2 }.workTapePos =
(if false = true then scanCfg input (moveInputPos pos 1) stTree (pending + 1) zeros bs cs
else scanCfg input (moveInputPos pos 1) stZeros pending zeros bs (true :: cs)).workTapePos funext i false.refine_2 input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stTree pending zeros bs cs).inputSymbol = some (boolEmb false)i:Fin 4⊢ { state := (read stTree (boolEmb false)).q',
inputPos := moveInputPos (scanCfg input pos stTree pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb false)).workActions i).1 with
| none => (scanCfg input pos stTree pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stTree pending zeros bs cs).workTapes i)
((scanCfg input pos stTree pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stTree pending zeros bs cs).workTapePos i +
↑((read stTree (boolEmb false)).workActions i).2 }.workTapePos
i =
(if false = true then scanCfg input (moveInputPos pos 1) stTree (pending + 1) zeros bs cs
else scanCfg input (moveInputPos pos 1) stZeros pending zeros bs (true :: cs)).workTapePos
i
fin_cases i false.refine_2.«0» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stTree pending zeros bs cs).inputSymbol = some (boolEmb false)⊢ { state := (read stTree (boolEmb false)).q',
inputPos := moveInputPos (scanCfg input pos stTree pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb false)).workActions i).1 with
| none => (scanCfg input pos stTree pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stTree pending zeros bs cs).workTapes i)
((scanCfg input pos stTree pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stTree pending zeros bs cs).workTapePos i +
↑((read stTree (boolEmb false)).workActions i).2 }.workTapePos
((fun i ↦ i) ⟨0, ⋯⟩) =
(if false = true then scanCfg input (moveInputPos pos 1) stTree (pending + 1) zeros bs cs
else scanCfg input (moveInputPos pos 1) stZeros pending zeros bs (true :: cs)).workTapePos
((fun i ↦ i) ⟨0, ⋯⟩)false.refine_2.«1» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stTree pending zeros bs cs).inputSymbol = some (boolEmb false)⊢ { state := (read stTree (boolEmb false)).q',
inputPos := moveInputPos (scanCfg input pos stTree pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb false)).workActions i).1 with
| none => (scanCfg input pos stTree pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stTree pending zeros bs cs).workTapes i)
((scanCfg input pos stTree pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stTree pending zeros bs cs).workTapePos i +
↑((read stTree (boolEmb false)).workActions i).2 }.workTapePos
((fun i ↦ i) ⟨1, ⋯⟩) =
(if false = true then scanCfg input (moveInputPos pos 1) stTree (pending + 1) zeros bs cs
else scanCfg input (moveInputPos pos 1) stZeros pending zeros bs (true :: cs)).workTapePos
((fun i ↦ i) ⟨1, ⋯⟩)false.refine_2.«2» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stTree pending zeros bs cs).inputSymbol = some (boolEmb false)⊢ { state := (read stTree (boolEmb false)).q',
inputPos := moveInputPos (scanCfg input pos stTree pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb false)).workActions i).1 with
| none => (scanCfg input pos stTree pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stTree pending zeros bs cs).workTapes i)
((scanCfg input pos stTree pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stTree pending zeros bs cs).workTapePos i +
↑((read stTree (boolEmb false)).workActions i).2 }.workTapePos
((fun i ↦ i) ⟨2, ⋯⟩) =
(if false = true then scanCfg input (moveInputPos pos 1) stTree (pending + 1) zeros bs cs
else scanCfg input (moveInputPos pos 1) stZeros pending zeros bs (true :: cs)).workTapePos
((fun i ↦ i) ⟨2, ⋯⟩)false.refine_2.«3» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stTree pending zeros bs cs).inputSymbol = some (boolEmb false)⊢ { state := (read stTree (boolEmb false)).q',
inputPos := moveInputPos (scanCfg input pos stTree pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb false)).workActions i).1 with
| none => (scanCfg input pos stTree pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stTree pending zeros bs cs).workTapes i)
((scanCfg input pos stTree pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stTree pending zeros bs cs).workTapePos i +
↑((read stTree (boolEmb false)).workActions i).2 }.workTapePos
((fun i ↦ i) ⟨3, ⋯⟩) =
(if false = true then scanCfg input (moveInputPos pos 1) stTree (pending + 1) zeros bs cs
else scanCfg input (moveInputPos pos 1) stZeros pending zeros bs (true :: cs)).workTapePos
((fun i ↦ i) ⟨3, ⋯⟩) <;> false.refine_2.«0» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stTree pending zeros bs cs).inputSymbol = some (boolEmb false)⊢ { state := (read stTree (boolEmb false)).q',
inputPos := moveInputPos (scanCfg input pos stTree pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb false)).workActions i).1 with
| none => (scanCfg input pos stTree pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stTree pending zeros bs cs).workTapes i)
((scanCfg input pos stTree pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stTree pending zeros bs cs).workTapePos i +
↑((read stTree (boolEmb false)).workActions i).2 }.workTapePos
((fun i ↦ i) ⟨0, ⋯⟩) =
(if false = true then scanCfg input (moveInputPos pos 1) stTree (pending + 1) zeros bs cs
else scanCfg input (moveInputPos pos 1) stZeros pending zeros bs (true :: cs)).workTapePos
((fun i ↦ i) ⟨0, ⋯⟩)false.refine_2.«1» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stTree pending zeros bs cs).inputSymbol = some (boolEmb false)⊢ { state := (read stTree (boolEmb false)).q',
inputPos := moveInputPos (scanCfg input pos stTree pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb false)).workActions i).1 with
| none => (scanCfg input pos stTree pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stTree pending zeros bs cs).workTapes i)
((scanCfg input pos stTree pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stTree pending zeros bs cs).workTapePos i +
↑((read stTree (boolEmb false)).workActions i).2 }.workTapePos
((fun i ↦ i) ⟨1, ⋯⟩) =
(if false = true then scanCfg input (moveInputPos pos 1) stTree (pending + 1) zeros bs cs
else scanCfg input (moveInputPos pos 1) stZeros pending zeros bs (true :: cs)).workTapePos
((fun i ↦ i) ⟨1, ⋯⟩)false.refine_2.«2» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stTree pending zeros bs cs).inputSymbol = some (boolEmb false)⊢ { state := (read stTree (boolEmb false)).q',
inputPos := moveInputPos (scanCfg input pos stTree pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb false)).workActions i).1 with
| none => (scanCfg input pos stTree pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stTree pending zeros bs cs).workTapes i)
((scanCfg input pos stTree pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stTree pending zeros bs cs).workTapePos i +
↑((read stTree (boolEmb false)).workActions i).2 }.workTapePos
((fun i ↦ i) ⟨2, ⋯⟩) =
(if false = true then scanCfg input (moveInputPos pos 1) stTree (pending + 1) zeros bs cs
else scanCfg input (moveInputPos pos 1) stZeros pending zeros bs (true :: cs)).workTapePos
((fun i ↦ i) ⟨2, ⋯⟩)false.refine_2.«3» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stTree pending zeros bs cs).inputSymbol = some (boolEmb false)⊢ { state := (read stTree (boolEmb false)).q',
inputPos := moveInputPos (scanCfg input pos stTree pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb false)).workActions i).1 with
| none => (scanCfg input pos stTree pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stTree pending zeros bs cs).workTapes i)
((scanCfg input pos stTree pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stTree pending zeros bs cs).workTapePos i +
↑((read stTree (boolEmb false)).workActions i).2 }.workTapePos
((fun i ↦ i) ⟨3, ⋯⟩) =
(if false = true then scanCfg input (moveInputPos pos 1) stTree (pending + 1) zeros bs cs
else scanCfg input (moveInputPos pos 1) stZeros pending zeros bs (true :: cs)).workTapePos
((fun i ↦ i) ⟨3, ⋯⟩) simp [read, stTree, boolEmb_apply, consume, jump, scanCfg, stZeros] All goals completed! 🐙
· true.refine_1 input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stTree pending zeros bs cs).inputSymbol = some (boolEmb true)⊢ { state := (read stTree (boolEmb true)).q',
inputPos := moveInputPos (scanCfg input pos stTree pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb true)).workActions i).1 with
| none => (scanCfg input pos stTree pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stTree pending zeros bs cs).workTapes i)
((scanCfg input pos stTree pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stTree pending zeros bs cs).workTapePos i +
↑((read stTree (boolEmb true)).workActions i).2 }.workTapes =
(if true = true then scanCfg input (moveInputPos pos 1) stTree (pending + 1) zeros bs cs
else scanCfg input (moveInputPos pos 1) stZeros pending zeros bs (true :: cs)).workTapes rfl All goals completed! 🐙
· true.refine_2 input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stTree pending zeros bs cs).inputSymbol = some (boolEmb true)⊢ { state := (read stTree (boolEmb true)).q',
inputPos := moveInputPos (scanCfg input pos stTree pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb true)).workActions i).1 with
| none => (scanCfg input pos stTree pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stTree pending zeros bs cs).workTapes i)
((scanCfg input pos stTree pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stTree pending zeros bs cs).workTapePos i +
↑((read stTree (boolEmb true)).workActions i).2 }.workTapePos =
(if true = true then scanCfg input (moveInputPos pos 1) stTree (pending + 1) zeros bs cs
else scanCfg input (moveInputPos pos 1) stZeros pending zeros bs (true :: cs)).workTapePos funext i true.refine_2 input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stTree pending zeros bs cs).inputSymbol = some (boolEmb true)i:Fin 4⊢ { state := (read stTree (boolEmb true)).q',
inputPos := moveInputPos (scanCfg input pos stTree pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb true)).workActions i).1 with
| none => (scanCfg input pos stTree pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stTree pending zeros bs cs).workTapes i)
((scanCfg input pos stTree pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stTree pending zeros bs cs).workTapePos i +
↑((read stTree (boolEmb true)).workActions i).2 }.workTapePos
i =
(if true = true then scanCfg input (moveInputPos pos 1) stTree (pending + 1) zeros bs cs
else scanCfg input (moveInputPos pos 1) stZeros pending zeros bs (true :: cs)).workTapePos
i
fin_cases i true.refine_2.«0» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stTree pending zeros bs cs).inputSymbol = some (boolEmb true)⊢ { state := (read stTree (boolEmb true)).q',
inputPos := moveInputPos (scanCfg input pos stTree pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb true)).workActions i).1 with
| none => (scanCfg input pos stTree pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stTree pending zeros bs cs).workTapes i)
((scanCfg input pos stTree pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stTree pending zeros bs cs).workTapePos i +
↑((read stTree (boolEmb true)).workActions i).2 }.workTapePos
((fun i ↦ i) ⟨0, ⋯⟩) =
(if true = true then scanCfg input (moveInputPos pos 1) stTree (pending + 1) zeros bs cs
else scanCfg input (moveInputPos pos 1) stZeros pending zeros bs (true :: cs)).workTapePos
((fun i ↦ i) ⟨0, ⋯⟩)true.refine_2.«1» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stTree pending zeros bs cs).inputSymbol = some (boolEmb true)⊢ { state := (read stTree (boolEmb true)).q',
inputPos := moveInputPos (scanCfg input pos stTree pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb true)).workActions i).1 with
| none => (scanCfg input pos stTree pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stTree pending zeros bs cs).workTapes i)
((scanCfg input pos stTree pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stTree pending zeros bs cs).workTapePos i +
↑((read stTree (boolEmb true)).workActions i).2 }.workTapePos
((fun i ↦ i) ⟨1, ⋯⟩) =
(if true = true then scanCfg input (moveInputPos pos 1) stTree (pending + 1) zeros bs cs
else scanCfg input (moveInputPos pos 1) stZeros pending zeros bs (true :: cs)).workTapePos
((fun i ↦ i) ⟨1, ⋯⟩)true.refine_2.«2» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stTree pending zeros bs cs).inputSymbol = some (boolEmb true)⊢ { state := (read stTree (boolEmb true)).q',
inputPos := moveInputPos (scanCfg input pos stTree pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb true)).workActions i).1 with
| none => (scanCfg input pos stTree pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stTree pending zeros bs cs).workTapes i)
((scanCfg input pos stTree pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stTree pending zeros bs cs).workTapePos i +
↑((read stTree (boolEmb true)).workActions i).2 }.workTapePos
((fun i ↦ i) ⟨2, ⋯⟩) =
(if true = true then scanCfg input (moveInputPos pos 1) stTree (pending + 1) zeros bs cs
else scanCfg input (moveInputPos pos 1) stZeros pending zeros bs (true :: cs)).workTapePos
((fun i ↦ i) ⟨2, ⋯⟩)true.refine_2.«3» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stTree pending zeros bs cs).inputSymbol = some (boolEmb true)⊢ { state := (read stTree (boolEmb true)).q',
inputPos := moveInputPos (scanCfg input pos stTree pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb true)).workActions i).1 with
| none => (scanCfg input pos stTree pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stTree pending zeros bs cs).workTapes i)
((scanCfg input pos stTree pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stTree pending zeros bs cs).workTapePos i +
↑((read stTree (boolEmb true)).workActions i).2 }.workTapePos
((fun i ↦ i) ⟨3, ⋯⟩) =
(if true = true then scanCfg input (moveInputPos pos 1) stTree (pending + 1) zeros bs cs
else scanCfg input (moveInputPos pos 1) stZeros pending zeros bs (true :: cs)).workTapePos
((fun i ↦ i) ⟨3, ⋯⟩) <;> true.refine_2.«0» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stTree pending zeros bs cs).inputSymbol = some (boolEmb true)⊢ { state := (read stTree (boolEmb true)).q',
inputPos := moveInputPos (scanCfg input pos stTree pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb true)).workActions i).1 with
| none => (scanCfg input pos stTree pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stTree pending zeros bs cs).workTapes i)
((scanCfg input pos stTree pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stTree pending zeros bs cs).workTapePos i +
↑((read stTree (boolEmb true)).workActions i).2 }.workTapePos
((fun i ↦ i) ⟨0, ⋯⟩) =
(if true = true then scanCfg input (moveInputPos pos 1) stTree (pending + 1) zeros bs cs
else scanCfg input (moveInputPos pos 1) stZeros pending zeros bs (true :: cs)).workTapePos
((fun i ↦ i) ⟨0, ⋯⟩)true.refine_2.«1» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stTree pending zeros bs cs).inputSymbol = some (boolEmb true)⊢ { state := (read stTree (boolEmb true)).q',
inputPos := moveInputPos (scanCfg input pos stTree pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb true)).workActions i).1 with
| none => (scanCfg input pos stTree pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stTree pending zeros bs cs).workTapes i)
((scanCfg input pos stTree pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stTree pending zeros bs cs).workTapePos i +
↑((read stTree (boolEmb true)).workActions i).2 }.workTapePos
((fun i ↦ i) ⟨1, ⋯⟩) =
(if true = true then scanCfg input (moveInputPos pos 1) stTree (pending + 1) zeros bs cs
else scanCfg input (moveInputPos pos 1) stZeros pending zeros bs (true :: cs)).workTapePos
((fun i ↦ i) ⟨1, ⋯⟩)true.refine_2.«2» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stTree pending zeros bs cs).inputSymbol = some (boolEmb true)⊢ { state := (read stTree (boolEmb true)).q',
inputPos := moveInputPos (scanCfg input pos stTree pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb true)).workActions i).1 with
| none => (scanCfg input pos stTree pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stTree pending zeros bs cs).workTapes i)
((scanCfg input pos stTree pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stTree pending zeros bs cs).workTapePos i +
↑((read stTree (boolEmb true)).workActions i).2 }.workTapePos
((fun i ↦ i) ⟨2, ⋯⟩) =
(if true = true then scanCfg input (moveInputPos pos 1) stTree (pending + 1) zeros bs cs
else scanCfg input (moveInputPos pos 1) stZeros pending zeros bs (true :: cs)).workTapePos
((fun i ↦ i) ⟨2, ⋯⟩)true.refine_2.«3» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stTree pending zeros bs cs).inputSymbol = some (boolEmb true)⊢ { state := (read stTree (boolEmb true)).q',
inputPos := moveInputPos (scanCfg input pos stTree pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stTree (boolEmb true)).workActions i).1 with
| none => (scanCfg input pos stTree pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stTree pending zeros bs cs).workTapes i)
((scanCfg input pos stTree pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stTree pending zeros bs cs).workTapePos i +
↑((read stTree (boolEmb true)).workActions i).2 }.workTapePos
((fun i ↦ i) ⟨3, ⋯⟩) =
(if true = true then scanCfg input (moveInputPos pos 1) stTree (pending + 1) zeros bs cs
else scanCfg input (moveInputPos pos 1) stZeros pending zeros bs (true :: cs)).workTapePos
((fun i ↦ i) ⟨3, ⋯⟩) simp [read, stTree, boolEmb_apply, consume, jump, scanCfg] All goals completed! 🐙Zeros increase the unary header count; its first one initializes the width field.
theorem step_zeros (input : List (Fin 3)) (pos : Fin (input.length + 2))
(pending zeros : ℕ) (bs cs : List Bool) (b : Bool)
(hin : (scanCfg input pos stZeros pending zeros bs cs).inputSymbol = some (boolEmb b)) :
machine.step (scanCfg input pos stZeros pending zeros bs cs) =
if b then scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (true :: bs) cs
else scanCfg input (moveInputPos pos 1) stZeros pending (zeros + 1) bs cs := by input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stZeros pending zeros bs cs).inputSymbol = some (boolEmb b)⊢ step (scanCfg input pos stZeros pending zeros bs cs) =
if b = true then scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (true :: bs) cs
else scanCfg input (moveInputPos pos 1) stZeros pending (zeros + 1) bs cs
rw [step_read _ stZeros b rfl hin (Or.inr (Or.inl rfl)) input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stZeros pending zeros bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stZeros (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stZeros pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3)) ((read stZeros (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stZeros pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stZeros pending zeros bs cs).workTapes i)
((scanCfg input pos stZeros pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stZeros pending zeros bs cs).workTapePos i + ↑((read stZeros (boolEmb b)).workActions i).2 } =
if b = true then scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (true :: bs) cs
else scanCfg input (moveInputPos pos 1) stZeros pending (zeros + 1) bs cs] input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stZeros pending zeros bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stZeros (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stZeros pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3)) ((read stZeros (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stZeros pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stZeros pending zeros bs cs).workTapes i)
((scanCfg input pos stZeros pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stZeros pending zeros bs cs).workTapePos i + ↑((read stZeros (boolEmb b)).workActions i).2 } =
if b = true then scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (true :: bs) cs
else scanCfg input (moveInputPos pos 1) stZeros pending (zeros + 1) bs cs
cases b false input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stZeros pending zeros bs cs).inputSymbol = some (boolEmb false)⊢ { state := (read stZeros (boolEmb false)).q',
inputPos := moveInputPos (scanCfg input pos stZeros pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb false)).workActions i).1 with
| none => (scanCfg input pos stZeros pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stZeros pending zeros bs cs).workTapes i)
((scanCfg input pos stZeros pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stZeros pending zeros bs cs).workTapePos i +
↑((read stZeros (boolEmb false)).workActions i).2 } =
if false = true then scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (true :: bs) cs
else scanCfg input (moveInputPos pos 1) stZeros pending (zeros + 1) bs cstrue input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stZeros pending zeros bs cs).inputSymbol = some (boolEmb true)⊢ { state := (read stZeros (boolEmb true)).q',
inputPos := moveInputPos (scanCfg input pos stZeros pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb true)).workActions i).1 with
| none => (scanCfg input pos stZeros pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stZeros pending zeros bs cs).workTapes i)
((scanCfg input pos stZeros pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stZeros pending zeros bs cs).workTapePos i +
↑((read stZeros (boolEmb true)).workActions i).2 } =
if true = true then scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (true :: bs) cs
else scanCfg input (moveInputPos pos 1) stZeros pending (zeros + 1) bs cs <;> false input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stZeros pending zeros bs cs).inputSymbol = some (boolEmb false)⊢ { state := (read stZeros (boolEmb false)).q',
inputPos := moveInputPos (scanCfg input pos stZeros pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb false)).workActions i).1 with
| none => (scanCfg input pos stZeros pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stZeros pending zeros bs cs).workTapes i)
((scanCfg input pos stZeros pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stZeros pending zeros bs cs).workTapePos i +
↑((read stZeros (boolEmb false)).workActions i).2 } =
if false = true then scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (true :: bs) cs
else scanCfg input (moveInputPos pos 1) stZeros pending (zeros + 1) bs cstrue input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stZeros pending zeros bs cs).inputSymbol = some (boolEmb true)⊢ { state := (read stZeros (boolEmb true)).q',
inputPos := moveInputPos (scanCfg input pos stZeros pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb true)).workActions i).1 with
| none => (scanCfg input pos stZeros pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stZeros pending zeros bs cs).workTapes i)
((scanCfg input pos stZeros pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stZeros pending zeros bs cs).workTapePos i +
↑((read stZeros (boolEmb true)).workActions i).2 } =
if true = true then scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (true :: bs) cs
else scanCfg input (moveInputPos pos 1) stZeros pending (zeros + 1) bs cs refine Cfg.ext rfl rfl ?_ ?_ true.refine_1 input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stZeros pending zeros bs cs).inputSymbol = some (boolEmb true)⊢ { state := (read stZeros (boolEmb true)).q',
inputPos := moveInputPos (scanCfg input pos stZeros pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb true)).workActions i).1 with
| none => (scanCfg input pos stZeros pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stZeros pending zeros bs cs).workTapes i)
((scanCfg input pos stZeros pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stZeros pending zeros bs cs).workTapePos i +
↑((read stZeros (boolEmb true)).workActions i).2 }.workTapes =
(if true = true then scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (true :: bs) cs
else scanCfg input (moveInputPos pos 1) stZeros pending (zeros + 1) bs cs).workTapestrue.refine_2 input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stZeros pending zeros bs cs).inputSymbol = some (boolEmb true)⊢ { state := (read stZeros (boolEmb true)).q',
inputPos := moveInputPos (scanCfg input pos stZeros pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb true)).workActions i).1 with
| none => (scanCfg input pos stZeros pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stZeros pending zeros bs cs).workTapes i)
((scanCfg input pos stZeros pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stZeros pending zeros bs cs).workTapePos i +
↑((read stZeros (boolEmb true)).workActions i).2 }.workTapePos =
(if true = true then scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (true :: bs) cs
else scanCfg input (moveInputPos pos 1) stZeros pending (zeros + 1) bs cs).workTapePos
· false.refine_1 input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stZeros pending zeros bs cs).inputSymbol = some (boolEmb false)⊢ { state := (read stZeros (boolEmb false)).q',
inputPos := moveInputPos (scanCfg input pos stZeros pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb false)).workActions i).1 with
| none => (scanCfg input pos stZeros pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stZeros pending zeros bs cs).workTapes i)
((scanCfg input pos stZeros pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stZeros pending zeros bs cs).workTapePos i +
↑((read stZeros (boolEmb false)).workActions i).2 }.workTapes =
(if false = true then scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (true :: bs) cs
else scanCfg input (moveInputPos pos 1) stZeros pending (zeros + 1) bs cs).workTapes rfl All goals completed! 🐙
· false.refine_2 input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stZeros pending zeros bs cs).inputSymbol = some (boolEmb false)⊢ { state := (read stZeros (boolEmb false)).q',
inputPos := moveInputPos (scanCfg input pos stZeros pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb false)).workActions i).1 with
| none => (scanCfg input pos stZeros pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stZeros pending zeros bs cs).workTapes i)
((scanCfg input pos stZeros pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stZeros pending zeros bs cs).workTapePos i +
↑((read stZeros (boolEmb false)).workActions i).2 }.workTapePos =
(if false = true then scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (true :: bs) cs
else scanCfg input (moveInputPos pos 1) stZeros pending (zeros + 1) bs cs).workTapePos funext i false.refine_2 input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stZeros pending zeros bs cs).inputSymbol = some (boolEmb false)i:Fin 4⊢ { state := (read stZeros (boolEmb false)).q',
inputPos := moveInputPos (scanCfg input pos stZeros pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb false)).workActions i).1 with
| none => (scanCfg input pos stZeros pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stZeros pending zeros bs cs).workTapes i)
((scanCfg input pos stZeros pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stZeros pending zeros bs cs).workTapePos i +
↑((read stZeros (boolEmb false)).workActions i).2 }.workTapePos
i =
(if false = true then scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (true :: bs) cs
else scanCfg input (moveInputPos pos 1) stZeros pending (zeros + 1) bs cs).workTapePos
i
fin_cases i false.refine_2.«0» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stZeros pending zeros bs cs).inputSymbol = some (boolEmb false)⊢ { state := (read stZeros (boolEmb false)).q',
inputPos := moveInputPos (scanCfg input pos stZeros pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb false)).workActions i).1 with
| none => (scanCfg input pos stZeros pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stZeros pending zeros bs cs).workTapes i)
((scanCfg input pos stZeros pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stZeros pending zeros bs cs).workTapePos i +
↑((read stZeros (boolEmb false)).workActions i).2 }.workTapePos
((fun i ↦ i) ⟨0, ⋯⟩) =
(if false = true then scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (true :: bs) cs
else scanCfg input (moveInputPos pos 1) stZeros pending (zeros + 1) bs cs).workTapePos
((fun i ↦ i) ⟨0, ⋯⟩)false.refine_2.«1» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stZeros pending zeros bs cs).inputSymbol = some (boolEmb false)⊢ { state := (read stZeros (boolEmb false)).q',
inputPos := moveInputPos (scanCfg input pos stZeros pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb false)).workActions i).1 with
| none => (scanCfg input pos stZeros pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stZeros pending zeros bs cs).workTapes i)
((scanCfg input pos stZeros pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stZeros pending zeros bs cs).workTapePos i +
↑((read stZeros (boolEmb false)).workActions i).2 }.workTapePos
((fun i ↦ i) ⟨1, ⋯⟩) =
(if false = true then scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (true :: bs) cs
else scanCfg input (moveInputPos pos 1) stZeros pending (zeros + 1) bs cs).workTapePos
((fun i ↦ i) ⟨1, ⋯⟩)false.refine_2.«2» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stZeros pending zeros bs cs).inputSymbol = some (boolEmb false)⊢ { state := (read stZeros (boolEmb false)).q',
inputPos := moveInputPos (scanCfg input pos stZeros pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb false)).workActions i).1 with
| none => (scanCfg input pos stZeros pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stZeros pending zeros bs cs).workTapes i)
((scanCfg input pos stZeros pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stZeros pending zeros bs cs).workTapePos i +
↑((read stZeros (boolEmb false)).workActions i).2 }.workTapePos
((fun i ↦ i) ⟨2, ⋯⟩) =
(if false = true then scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (true :: bs) cs
else scanCfg input (moveInputPos pos 1) stZeros pending (zeros + 1) bs cs).workTapePos
((fun i ↦ i) ⟨2, ⋯⟩)false.refine_2.«3» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stZeros pending zeros bs cs).inputSymbol = some (boolEmb false)⊢ { state := (read stZeros (boolEmb false)).q',
inputPos := moveInputPos (scanCfg input pos stZeros pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb false)).workActions i).1 with
| none => (scanCfg input pos stZeros pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stZeros pending zeros bs cs).workTapes i)
((scanCfg input pos stZeros pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stZeros pending zeros bs cs).workTapePos i +
↑((read stZeros (boolEmb false)).workActions i).2 }.workTapePos
((fun i ↦ i) ⟨3, ⋯⟩) =
(if false = true then scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (true :: bs) cs
else scanCfg input (moveInputPos pos 1) stZeros pending (zeros + 1) bs cs).workTapePos
((fun i ↦ i) ⟨3, ⋯⟩) <;> false.refine_2.«0» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stZeros pending zeros bs cs).inputSymbol = some (boolEmb false)⊢ { state := (read stZeros (boolEmb false)).q',
inputPos := moveInputPos (scanCfg input pos stZeros pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb false)).workActions i).1 with
| none => (scanCfg input pos stZeros pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stZeros pending zeros bs cs).workTapes i)
((scanCfg input pos stZeros pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stZeros pending zeros bs cs).workTapePos i +
↑((read stZeros (boolEmb false)).workActions i).2 }.workTapePos
((fun i ↦ i) ⟨0, ⋯⟩) =
(if false = true then scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (true :: bs) cs
else scanCfg input (moveInputPos pos 1) stZeros pending (zeros + 1) bs cs).workTapePos
((fun i ↦ i) ⟨0, ⋯⟩)false.refine_2.«1» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stZeros pending zeros bs cs).inputSymbol = some (boolEmb false)⊢ { state := (read stZeros (boolEmb false)).q',
inputPos := moveInputPos (scanCfg input pos stZeros pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb false)).workActions i).1 with
| none => (scanCfg input pos stZeros pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stZeros pending zeros bs cs).workTapes i)
((scanCfg input pos stZeros pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stZeros pending zeros bs cs).workTapePos i +
↑((read stZeros (boolEmb false)).workActions i).2 }.workTapePos
((fun i ↦ i) ⟨1, ⋯⟩) =
(if false = true then scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (true :: bs) cs
else scanCfg input (moveInputPos pos 1) stZeros pending (zeros + 1) bs cs).workTapePos
((fun i ↦ i) ⟨1, ⋯⟩)false.refine_2.«2» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stZeros pending zeros bs cs).inputSymbol = some (boolEmb false)⊢ { state := (read stZeros (boolEmb false)).q',
inputPos := moveInputPos (scanCfg input pos stZeros pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb false)).workActions i).1 with
| none => (scanCfg input pos stZeros pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stZeros pending zeros bs cs).workTapes i)
((scanCfg input pos stZeros pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stZeros pending zeros bs cs).workTapePos i +
↑((read stZeros (boolEmb false)).workActions i).2 }.workTapePos
((fun i ↦ i) ⟨2, ⋯⟩) =
(if false = true then scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (true :: bs) cs
else scanCfg input (moveInputPos pos 1) stZeros pending (zeros + 1) bs cs).workTapePos
((fun i ↦ i) ⟨2, ⋯⟩)false.refine_2.«3» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stZeros pending zeros bs cs).inputSymbol = some (boolEmb false)⊢ { state := (read stZeros (boolEmb false)).q',
inputPos := moveInputPos (scanCfg input pos stZeros pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb false)).workActions i).1 with
| none => (scanCfg input pos stZeros pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stZeros pending zeros bs cs).workTapes i)
((scanCfg input pos stZeros pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stZeros pending zeros bs cs).workTapePos i +
↑((read stZeros (boolEmb false)).workActions i).2 }.workTapePos
((fun i ↦ i) ⟨3, ⋯⟩) =
(if false = true then scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (true :: bs) cs
else scanCfg input (moveInputPos pos 1) stZeros pending (zeros + 1) bs cs).workTapePos
((fun i ↦ i) ⟨3, ⋯⟩) simp [read, stTree, stZeros, boolEmb_apply, consume, jump, scanCfg] All goals completed! 🐙
· true.refine_1 input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stZeros pending zeros bs cs).inputSymbol = some (boolEmb true)⊢ { state := (read stZeros (boolEmb true)).q',
inputPos := moveInputPos (scanCfg input pos stZeros pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb true)).workActions i).1 with
| none => (scanCfg input pos stZeros pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stZeros pending zeros bs cs).workTapes i)
((scanCfg input pos stZeros pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stZeros pending zeros bs cs).workTapePos i +
↑((read stZeros (boolEmb true)).workActions i).2 }.workTapes =
(if true = true then scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (true :: bs) cs
else scanCfg input (moveInputPos pos 1) stZeros pending (zeros + 1) bs cs).workTapes funext i true.refine_1 input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stZeros pending zeros bs cs).inputSymbol = some (boolEmb true)i:Fin 4⊢ { state := (read stZeros (boolEmb true)).q',
inputPos := moveInputPos (scanCfg input pos stZeros pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb true)).workActions i).1 with
| none => (scanCfg input pos stZeros pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stZeros pending zeros bs cs).workTapes i)
((scanCfg input pos stZeros pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stZeros pending zeros bs cs).workTapePos i +
↑((read stZeros (boolEmb true)).workActions i).2 }.workTapes
i =
(if true = true then scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (true :: bs) cs
else scanCfg input (moveInputPos pos 1) stZeros pending (zeros + 1) bs cs).workTapes
i
fin_cases i true.refine_1.«0» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stZeros pending zeros bs cs).inputSymbol = some (boolEmb true)⊢ { state := (read stZeros (boolEmb true)).q',
inputPos := moveInputPos (scanCfg input pos stZeros pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb true)).workActions i).1 with
| none => (scanCfg input pos stZeros pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stZeros pending zeros bs cs).workTapes i)
((scanCfg input pos stZeros pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stZeros pending zeros bs cs).workTapePos i +
↑((read stZeros (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨0, ⋯⟩) =
(if true = true then scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (true :: bs) cs
else scanCfg input (moveInputPos pos 1) stZeros pending (zeros + 1) bs cs).workTapes
((fun i ↦ i) ⟨0, ⋯⟩)true.refine_1.«1» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stZeros pending zeros bs cs).inputSymbol = some (boolEmb true)⊢ { state := (read stZeros (boolEmb true)).q',
inputPos := moveInputPos (scanCfg input pos stZeros pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb true)).workActions i).1 with
| none => (scanCfg input pos stZeros pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stZeros pending zeros bs cs).workTapes i)
((scanCfg input pos stZeros pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stZeros pending zeros bs cs).workTapePos i +
↑((read stZeros (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨1, ⋯⟩) =
(if true = true then scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (true :: bs) cs
else scanCfg input (moveInputPos pos 1) stZeros pending (zeros + 1) bs cs).workTapes
((fun i ↦ i) ⟨1, ⋯⟩)true.refine_1.«2» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stZeros pending zeros bs cs).inputSymbol = some (boolEmb true)⊢ { state := (read stZeros (boolEmb true)).q',
inputPos := moveInputPos (scanCfg input pos stZeros pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb true)).workActions i).1 with
| none => (scanCfg input pos stZeros pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stZeros pending zeros bs cs).workTapes i)
((scanCfg input pos stZeros pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stZeros pending zeros bs cs).workTapePos i +
↑((read stZeros (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨2, ⋯⟩) =
(if true = true then scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (true :: bs) cs
else scanCfg input (moveInputPos pos 1) stZeros pending (zeros + 1) bs cs).workTapes
((fun i ↦ i) ⟨2, ⋯⟩)true.refine_1.«3» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stZeros pending zeros bs cs).inputSymbol = some (boolEmb true)⊢ { state := (read stZeros (boolEmb true)).q',
inputPos := moveInputPos (scanCfg input pos stZeros pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb true)).workActions i).1 with
| none => (scanCfg input pos stZeros pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stZeros pending zeros bs cs).workTapes i)
((scanCfg input pos stZeros pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stZeros pending zeros bs cs).workTapePos i +
↑((read stZeros (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨3, ⋯⟩) =
(if true = true then scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (true :: bs) cs
else scanCfg input (moveInputPos pos 1) stZeros pending (zeros + 1) bs cs).workTapes
((fun i ↦ i) ⟨3, ⋯⟩) <;> true.refine_1.«0» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stZeros pending zeros bs cs).inputSymbol = some (boolEmb true)⊢ { state := (read stZeros (boolEmb true)).q',
inputPos := moveInputPos (scanCfg input pos stZeros pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb true)).workActions i).1 with
| none => (scanCfg input pos stZeros pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stZeros pending zeros bs cs).workTapes i)
((scanCfg input pos stZeros pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stZeros pending zeros bs cs).workTapePos i +
↑((read stZeros (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨0, ⋯⟩) =
(if true = true then scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (true :: bs) cs
else scanCfg input (moveInputPos pos 1) stZeros pending (zeros + 1) bs cs).workTapes
((fun i ↦ i) ⟨0, ⋯⟩)true.refine_1.«1» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stZeros pending zeros bs cs).inputSymbol = some (boolEmb true)⊢ { state := (read stZeros (boolEmb true)).q',
inputPos := moveInputPos (scanCfg input pos stZeros pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb true)).workActions i).1 with
| none => (scanCfg input pos stZeros pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stZeros pending zeros bs cs).workTapes i)
((scanCfg input pos stZeros pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stZeros pending zeros bs cs).workTapePos i +
↑((read stZeros (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨1, ⋯⟩) =
(if true = true then scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (true :: bs) cs
else scanCfg input (moveInputPos pos 1) stZeros pending (zeros + 1) bs cs).workTapes
((fun i ↦ i) ⟨1, ⋯⟩)true.refine_1.«2» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stZeros pending zeros bs cs).inputSymbol = some (boolEmb true)⊢ { state := (read stZeros (boolEmb true)).q',
inputPos := moveInputPos (scanCfg input pos stZeros pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb true)).workActions i).1 with
| none => (scanCfg input pos stZeros pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stZeros pending zeros bs cs).workTapes i)
((scanCfg input pos stZeros pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stZeros pending zeros bs cs).workTapePos i +
↑((read stZeros (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨2, ⋯⟩) =
(if true = true then scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (true :: bs) cs
else scanCfg input (moveInputPos pos 1) stZeros pending (zeros + 1) bs cs).workTapes
((fun i ↦ i) ⟨2, ⋯⟩)true.refine_1.«3» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stZeros pending zeros bs cs).inputSymbol = some (boolEmb true)⊢ { state := (read stZeros (boolEmb true)).q',
inputPos := moveInputPos (scanCfg input pos stZeros pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb true)).workActions i).1 with
| none => (scanCfg input pos stZeros pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stZeros pending zeros bs cs).workTapes i)
((scanCfg input pos stZeros pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stZeros pending zeros bs cs).workTapePos i +
↑((read stZeros (boolEmb true)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨3, ⋯⟩) =
(if true = true then scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (true :: bs) cs
else scanCfg input (moveInputPos pos 1) stZeros pending (zeros + 1) bs cs).workTapes
((fun i ↦ i) ⟨3, ⋯⟩) first | rfl All goals completed! 🐙 | exact wordTape_cons bs true All goals completed! 🐙
· true.refine_2 input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stZeros pending zeros bs cs).inputSymbol = some (boolEmb true)⊢ { state := (read stZeros (boolEmb true)).q',
inputPos := moveInputPos (scanCfg input pos stZeros pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb true)).workActions i).1 with
| none => (scanCfg input pos stZeros pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stZeros pending zeros bs cs).workTapes i)
((scanCfg input pos stZeros pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stZeros pending zeros bs cs).workTapePos i +
↑((read stZeros (boolEmb true)).workActions i).2 }.workTapePos =
(if true = true then scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (true :: bs) cs
else scanCfg input (moveInputPos pos 1) stZeros pending (zeros + 1) bs cs).workTapePos funext i true.refine_2 input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stZeros pending zeros bs cs).inputSymbol = some (boolEmb true)i:Fin 4⊢ { state := (read stZeros (boolEmb true)).q',
inputPos := moveInputPos (scanCfg input pos stZeros pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb true)).workActions i).1 with
| none => (scanCfg input pos stZeros pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stZeros pending zeros bs cs).workTapes i)
((scanCfg input pos stZeros pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stZeros pending zeros bs cs).workTapePos i +
↑((read stZeros (boolEmb true)).workActions i).2 }.workTapePos
i =
(if true = true then scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (true :: bs) cs
else scanCfg input (moveInputPos pos 1) stZeros pending (zeros + 1) bs cs).workTapePos
i
fin_cases i true.refine_2.«0» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stZeros pending zeros bs cs).inputSymbol = some (boolEmb true)⊢ { state := (read stZeros (boolEmb true)).q',
inputPos := moveInputPos (scanCfg input pos stZeros pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb true)).workActions i).1 with
| none => (scanCfg input pos stZeros pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stZeros pending zeros bs cs).workTapes i)
((scanCfg input pos stZeros pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stZeros pending zeros bs cs).workTapePos i +
↑((read stZeros (boolEmb true)).workActions i).2 }.workTapePos
((fun i ↦ i) ⟨0, ⋯⟩) =
(if true = true then scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (true :: bs) cs
else scanCfg input (moveInputPos pos 1) stZeros pending (zeros + 1) bs cs).workTapePos
((fun i ↦ i) ⟨0, ⋯⟩)true.refine_2.«1» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stZeros pending zeros bs cs).inputSymbol = some (boolEmb true)⊢ { state := (read stZeros (boolEmb true)).q',
inputPos := moveInputPos (scanCfg input pos stZeros pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb true)).workActions i).1 with
| none => (scanCfg input pos stZeros pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stZeros pending zeros bs cs).workTapes i)
((scanCfg input pos stZeros pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stZeros pending zeros bs cs).workTapePos i +
↑((read stZeros (boolEmb true)).workActions i).2 }.workTapePos
((fun i ↦ i) ⟨1, ⋯⟩) =
(if true = true then scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (true :: bs) cs
else scanCfg input (moveInputPos pos 1) stZeros pending (zeros + 1) bs cs).workTapePos
((fun i ↦ i) ⟨1, ⋯⟩)true.refine_2.«2» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stZeros pending zeros bs cs).inputSymbol = some (boolEmb true)⊢ { state := (read stZeros (boolEmb true)).q',
inputPos := moveInputPos (scanCfg input pos stZeros pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb true)).workActions i).1 with
| none => (scanCfg input pos stZeros pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stZeros pending zeros bs cs).workTapes i)
((scanCfg input pos stZeros pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stZeros pending zeros bs cs).workTapePos i +
↑((read stZeros (boolEmb true)).workActions i).2 }.workTapePos
((fun i ↦ i) ⟨2, ⋯⟩) =
(if true = true then scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (true :: bs) cs
else scanCfg input (moveInputPos pos 1) stZeros pending (zeros + 1) bs cs).workTapePos
((fun i ↦ i) ⟨2, ⋯⟩)true.refine_2.«3» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stZeros pending zeros bs cs).inputSymbol = some (boolEmb true)⊢ { state := (read stZeros (boolEmb true)).q',
inputPos := moveInputPos (scanCfg input pos stZeros pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb true)).workActions i).1 with
| none => (scanCfg input pos stZeros pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stZeros pending zeros bs cs).workTapes i)
((scanCfg input pos stZeros pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stZeros pending zeros bs cs).workTapePos i +
↑((read stZeros (boolEmb true)).workActions i).2 }.workTapePos
((fun i ↦ i) ⟨3, ⋯⟩) =
(if true = true then scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (true :: bs) cs
else scanCfg input (moveInputPos pos 1) stZeros pending (zeros + 1) bs cs).workTapePos
((fun i ↦ i) ⟨3, ⋯⟩) <;> true.refine_2.«0» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stZeros pending zeros bs cs).inputSymbol = some (boolEmb true)⊢ { state := (read stZeros (boolEmb true)).q',
inputPos := moveInputPos (scanCfg input pos stZeros pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb true)).workActions i).1 with
| none => (scanCfg input pos stZeros pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stZeros pending zeros bs cs).workTapes i)
((scanCfg input pos stZeros pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stZeros pending zeros bs cs).workTapePos i +
↑((read stZeros (boolEmb true)).workActions i).2 }.workTapePos
((fun i ↦ i) ⟨0, ⋯⟩) =
(if true = true then scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (true :: bs) cs
else scanCfg input (moveInputPos pos 1) stZeros pending (zeros + 1) bs cs).workTapePos
((fun i ↦ i) ⟨0, ⋯⟩)true.refine_2.«1» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stZeros pending zeros bs cs).inputSymbol = some (boolEmb true)⊢ { state := (read stZeros (boolEmb true)).q',
inputPos := moveInputPos (scanCfg input pos stZeros pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb true)).workActions i).1 with
| none => (scanCfg input pos stZeros pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stZeros pending zeros bs cs).workTapes i)
((scanCfg input pos stZeros pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stZeros pending zeros bs cs).workTapePos i +
↑((read stZeros (boolEmb true)).workActions i).2 }.workTapePos
((fun i ↦ i) ⟨1, ⋯⟩) =
(if true = true then scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (true :: bs) cs
else scanCfg input (moveInputPos pos 1) stZeros pending (zeros + 1) bs cs).workTapePos
((fun i ↦ i) ⟨1, ⋯⟩)true.refine_2.«2» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stZeros pending zeros bs cs).inputSymbol = some (boolEmb true)⊢ { state := (read stZeros (boolEmb true)).q',
inputPos := moveInputPos (scanCfg input pos stZeros pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb true)).workActions i).1 with
| none => (scanCfg input pos stZeros pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stZeros pending zeros bs cs).workTapes i)
((scanCfg input pos stZeros pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stZeros pending zeros bs cs).workTapePos i +
↑((read stZeros (boolEmb true)).workActions i).2 }.workTapePos
((fun i ↦ i) ⟨2, ⋯⟩) =
(if true = true then scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (true :: bs) cs
else scanCfg input (moveInputPos pos 1) stZeros pending (zeros + 1) bs cs).workTapePos
((fun i ↦ i) ⟨2, ⋯⟩)true.refine_2.«3» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolhin:(scanCfg input pos stZeros pending zeros bs cs).inputSymbol = some (boolEmb true)⊢ { state := (read stZeros (boolEmb true)).q',
inputPos := moveInputPos (scanCfg input pos stZeros pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stZeros (boolEmb true)).workActions i).1 with
| none => (scanCfg input pos stZeros pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stZeros pending zeros bs cs).workTapes i)
((scanCfg input pos stZeros pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stZeros pending zeros bs cs).workTapePos i +
↑((read stZeros (boolEmb true)).workActions i).2 }.workTapePos
((fun i ↦ i) ⟨3, ⋯⟩) =
(if true = true then scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (true :: bs) cs
else scanCfg input (moveInputPos pos 1) stZeros pending (zeros + 1) bs cs).workTapePos
((fun i ↦ i) ⟨3, ⋯⟩) simp [read, stTree, stZeros, boolEmb_apply, consume, jump, scanCfg, stSizeCheck] All goals completed! 🐙A width-field bit appends one digit and consumes one unary count position.
theorem step_size (input : List (Fin 3)) (pos : Fin (input.length + 2))
(pending zeros : ℕ) (bs cs : List Bool) (b : Bool)
(hin : (scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputSymbol =
some (boolEmb b)) :
machine.step (scanCfg input pos stSizeBit pending (zeros + 1) bs cs) =
scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (b :: bs) cs := by input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputSymbol = some (boolEmb b)⊢ step (scanCfg input pos stSizeBit pending (zeros + 1) bs cs) =
scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (b :: bs) cs
rw [step_read _ stSizeBit b rfl hin (Or.inr (Or.inr (Or.inl rfl))) input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stSizeBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3)) ((read stSizeBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapes i)
((scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapePos i +
↑((read stSizeBit (boolEmb b)).workActions i).2 } =
scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (b :: bs) cs] input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stSizeBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3)) ((read stSizeBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapes i)
((scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapePos i +
↑((read stSizeBit (boolEmb b)).workActions i).2 } =
scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (b :: bs) cs
refine Cfg.ext rfl rfl ?_ ?_ refine_1 input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stSizeBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stSizeBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapes i)
((scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapePos i +
↑((read stSizeBit (boolEmb b)).workActions i).2 }.workTapes =
(scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (b :: bs) cs).workTapesrefine_2 input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stSizeBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stSizeBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapes i)
((scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapePos i +
↑((read stSizeBit (boolEmb b)).workActions i).2 }.workTapePos =
(scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (b :: bs) cs).workTapePos
· refine_1 input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stSizeBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stSizeBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapes i)
((scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapePos i +
↑((read stSizeBit (boolEmb b)).workActions i).2 }.workTapes =
(scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (b :: bs) cs).workTapes funext i refine_1 input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputSymbol = some (boolEmb b)i:Fin 4⊢ { state := (read stSizeBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stSizeBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapes i)
((scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapePos i +
↑((read stSizeBit (boolEmb b)).workActions i).2 }.workTapes
i =
(scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (b :: bs) cs).workTapes i
fin_cases i refine_1.«0» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stSizeBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stSizeBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapes i)
((scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapePos i +
↑((read stSizeBit (boolEmb b)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨0, ⋯⟩) =
(scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (b :: bs) cs).workTapes ((fun i ↦ i) ⟨0, ⋯⟩)refine_1.«1» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stSizeBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stSizeBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapes i)
((scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapePos i +
↑((read stSizeBit (boolEmb b)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨1, ⋯⟩) =
(scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (b :: bs) cs).workTapes ((fun i ↦ i) ⟨1, ⋯⟩)refine_1.«2» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stSizeBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stSizeBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapes i)
((scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapePos i +
↑((read stSizeBit (boolEmb b)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨2, ⋯⟩) =
(scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (b :: bs) cs).workTapes ((fun i ↦ i) ⟨2, ⋯⟩)refine_1.«3» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stSizeBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stSizeBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapes i)
((scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapePos i +
↑((read stSizeBit (boolEmb b)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨3, ⋯⟩) =
(scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (b :: bs) cs).workTapes ((fun i ↦ i) ⟨3, ⋯⟩) <;> refine_1.«0» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stSizeBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stSizeBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapes i)
((scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapePos i +
↑((read stSizeBit (boolEmb b)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨0, ⋯⟩) =
(scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (b :: bs) cs).workTapes ((fun i ↦ i) ⟨0, ⋯⟩)refine_1.«1» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stSizeBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stSizeBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapes i)
((scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapePos i +
↑((read stSizeBit (boolEmb b)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨1, ⋯⟩) =
(scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (b :: bs) cs).workTapes ((fun i ↦ i) ⟨1, ⋯⟩)refine_1.«2» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stSizeBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stSizeBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapes i)
((scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapePos i +
↑((read stSizeBit (boolEmb b)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨2, ⋯⟩) =
(scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (b :: bs) cs).workTapes ((fun i ↦ i) ⟨2, ⋯⟩)refine_1.«3» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stSizeBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stSizeBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapes i)
((scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapePos i +
↑((read stSizeBit (boolEmb b)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨3, ⋯⟩) =
(scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (b :: bs) cs).workTapes ((fun i ↦ i) ⟨3, ⋯⟩) simp only [read, stTree, stZeros, stSizeBit, boolEmb_apply, consume,
jump, scanCfg, stSizeCheck, ↓reduceIte, Fin.reduceFinMk, Fin.isValue, Fin.reduceEq] All goals completed! 🐙
exact wordTape_cons bs b All goals completed! 🐙
· refine_2 input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stSizeBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stSizeBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapes i)
((scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapePos i +
↑((read stSizeBit (boolEmb b)).workActions i).2 }.workTapePos =
(scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (b :: bs) cs).workTapePos funext i refine_2 input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputSymbol = some (boolEmb b)i:Fin 4⊢ { state := (read stSizeBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stSizeBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapes i)
((scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapePos i +
↑((read stSizeBit (boolEmb b)).workActions i).2 }.workTapePos
i =
(scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (b :: bs) cs).workTapePos i
fin_cases i refine_2.«0» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stSizeBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stSizeBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapes i)
((scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapePos i +
↑((read stSizeBit (boolEmb b)).workActions i).2 }.workTapePos
((fun i ↦ i) ⟨0, ⋯⟩) =
(scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (b :: bs) cs).workTapePos ((fun i ↦ i) ⟨0, ⋯⟩)refine_2.«1» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stSizeBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stSizeBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapes i)
((scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapePos i +
↑((read stSizeBit (boolEmb b)).workActions i).2 }.workTapePos
((fun i ↦ i) ⟨1, ⋯⟩) =
(scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (b :: bs) cs).workTapePos ((fun i ↦ i) ⟨1, ⋯⟩)refine_2.«2» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stSizeBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stSizeBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapes i)
((scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapePos i +
↑((read stSizeBit (boolEmb b)).workActions i).2 }.workTapePos
((fun i ↦ i) ⟨2, ⋯⟩) =
(scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (b :: bs) cs).workTapePos ((fun i ↦ i) ⟨2, ⋯⟩)refine_2.«3» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stSizeBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stSizeBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapes i)
((scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapePos i +
↑((read stSizeBit (boolEmb b)).workActions i).2 }.workTapePos
((fun i ↦ i) ⟨3, ⋯⟩) =
(scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (b :: bs) cs).workTapePos ((fun i ↦ i) ⟨3, ⋯⟩) <;> refine_2.«0» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stSizeBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stSizeBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapes i)
((scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapePos i +
↑((read stSizeBit (boolEmb b)).workActions i).2 }.workTapePos
((fun i ↦ i) ⟨0, ⋯⟩) =
(scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (b :: bs) cs).workTapePos ((fun i ↦ i) ⟨0, ⋯⟩)refine_2.«1» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stSizeBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stSizeBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapes i)
((scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapePos i +
↑((read stSizeBit (boolEmb b)).workActions i).2 }.workTapePos
((fun i ↦ i) ⟨1, ⋯⟩) =
(scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (b :: bs) cs).workTapePos ((fun i ↦ i) ⟨1, ⋯⟩)refine_2.«2» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stSizeBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stSizeBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapes i)
((scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapePos i +
↑((read stSizeBit (boolEmb b)).workActions i).2 }.workTapePos
((fun i ↦ i) ⟨2, ⋯⟩) =
(scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (b :: bs) cs).workTapePos ((fun i ↦ i) ⟨2, ⋯⟩)refine_2.«3» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stSizeBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stSizeBit pending (zeros + 1) bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stSizeBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapes i)
((scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stSizeBit pending (zeros + 1) bs cs).workTapePos i +
↑((read stSizeBit (boolEmb b)).workActions i).2 }.workTapePos
((fun i ↦ i) ⟨3, ⋯⟩) =
(scanCfg input (moveInputPos pos 1) stSizeCheck pending zeros (b :: bs) cs).workTapePos ((fun i ↦ i) ⟨3, ⋯⟩) simp [read, stTree, stZeros, stSizeBit, boolEmb_apply, consume,
jump, scanCfg, stSizeCheck] All goals completed! 🐙A payload-length bit appends one digit and enters the width countdown.
theorem step_length (input : List (Fin 3)) (pos : Fin (input.length + 2))
(pending zeros : ℕ) (bs cs : List Bool) (b : Bool)
(hin : (scanCfg input pos stLengthBit pending zeros bs cs).inputSymbol = some (boolEmb b)) :
machine.step (scanCfg input pos stLengthBit pending zeros bs cs) =
scanCfg input (moveInputPos pos 1) (stDecrement false) pending zeros bs (b :: cs) := by input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stLengthBit pending zeros bs cs).inputSymbol = some (boolEmb b)⊢ step (scanCfg input pos stLengthBit pending zeros bs cs) =
scanCfg input (moveInputPos pos 1) (stDecrement false) pending zeros bs (b :: cs)
rw [step_read _ stLengthBit b rfl hin (Or.inr (Or.inr (Or.inr (Or.inl rfl)))) input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stLengthBit pending zeros bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stLengthBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stLengthBit pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stLengthBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stLengthBit pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stLengthBit pending zeros bs cs).workTapes i)
((scanCfg input pos stLengthBit pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stLengthBit pending zeros bs cs).workTapePos i +
↑((read stLengthBit (boolEmb b)).workActions i).2 } =
scanCfg input (moveInputPos pos 1) (stDecrement false) pending zeros bs (b :: cs)] input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stLengthBit pending zeros bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stLengthBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stLengthBit pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stLengthBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stLengthBit pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stLengthBit pending zeros bs cs).workTapes i)
((scanCfg input pos stLengthBit pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stLengthBit pending zeros bs cs).workTapePos i +
↑((read stLengthBit (boolEmb b)).workActions i).2 } =
scanCfg input (moveInputPos pos 1) (stDecrement false) pending zeros bs (b :: cs)
refine Cfg.ext rfl rfl ?_ ?_ refine_1 input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stLengthBit pending zeros bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stLengthBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stLengthBit pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stLengthBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stLengthBit pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stLengthBit pending zeros bs cs).workTapes i)
((scanCfg input pos stLengthBit pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stLengthBit pending zeros bs cs).workTapePos i +
↑((read stLengthBit (boolEmb b)).workActions i).2 }.workTapes =
(scanCfg input (moveInputPos pos 1) (stDecrement false) pending zeros bs (b :: cs)).workTapesrefine_2 input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stLengthBit pending zeros bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stLengthBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stLengthBit pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stLengthBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stLengthBit pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stLengthBit pending zeros bs cs).workTapes i)
((scanCfg input pos stLengthBit pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stLengthBit pending zeros bs cs).workTapePos i +
↑((read stLengthBit (boolEmb b)).workActions i).2 }.workTapePos =
(scanCfg input (moveInputPos pos 1) (stDecrement false) pending zeros bs (b :: cs)).workTapePos
· refine_1 input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stLengthBit pending zeros bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stLengthBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stLengthBit pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stLengthBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stLengthBit pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stLengthBit pending zeros bs cs).workTapes i)
((scanCfg input pos stLengthBit pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stLengthBit pending zeros bs cs).workTapePos i +
↑((read stLengthBit (boolEmb b)).workActions i).2 }.workTapes =
(scanCfg input (moveInputPos pos 1) (stDecrement false) pending zeros bs (b :: cs)).workTapes funext i refine_1 input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stLengthBit pending zeros bs cs).inputSymbol = some (boolEmb b)i:Fin 4⊢ { state := (read stLengthBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stLengthBit pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stLengthBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stLengthBit pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stLengthBit pending zeros bs cs).workTapes i)
((scanCfg input pos stLengthBit pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stLengthBit pending zeros bs cs).workTapePos i +
↑((read stLengthBit (boolEmb b)).workActions i).2 }.workTapes
i =
(scanCfg input (moveInputPos pos 1) (stDecrement false) pending zeros bs (b :: cs)).workTapes i
fin_cases i refine_1.«0» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stLengthBit pending zeros bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stLengthBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stLengthBit pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stLengthBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stLengthBit pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stLengthBit pending zeros bs cs).workTapes i)
((scanCfg input pos stLengthBit pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stLengthBit pending zeros bs cs).workTapePos i +
↑((read stLengthBit (boolEmb b)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨0, ⋯⟩) =
(scanCfg input (moveInputPos pos 1) (stDecrement false) pending zeros bs (b :: cs)).workTapes ((fun i ↦ i) ⟨0, ⋯⟩)refine_1.«1» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stLengthBit pending zeros bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stLengthBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stLengthBit pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stLengthBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stLengthBit pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stLengthBit pending zeros bs cs).workTapes i)
((scanCfg input pos stLengthBit pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stLengthBit pending zeros bs cs).workTapePos i +
↑((read stLengthBit (boolEmb b)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨1, ⋯⟩) =
(scanCfg input (moveInputPos pos 1) (stDecrement false) pending zeros bs (b :: cs)).workTapes ((fun i ↦ i) ⟨1, ⋯⟩)refine_1.«2» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stLengthBit pending zeros bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stLengthBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stLengthBit pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stLengthBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stLengthBit pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stLengthBit pending zeros bs cs).workTapes i)
((scanCfg input pos stLengthBit pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stLengthBit pending zeros bs cs).workTapePos i +
↑((read stLengthBit (boolEmb b)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨2, ⋯⟩) =
(scanCfg input (moveInputPos pos 1) (stDecrement false) pending zeros bs (b :: cs)).workTapes ((fun i ↦ i) ⟨2, ⋯⟩)refine_1.«3» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stLengthBit pending zeros bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stLengthBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stLengthBit pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stLengthBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stLengthBit pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stLengthBit pending zeros bs cs).workTapes i)
((scanCfg input pos stLengthBit pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stLengthBit pending zeros bs cs).workTapePos i +
↑((read stLengthBit (boolEmb b)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨3, ⋯⟩) =
(scanCfg input (moveInputPos pos 1) (stDecrement false) pending zeros bs (b :: cs)).workTapes ((fun i ↦ i) ⟨3, ⋯⟩) <;> refine_1.«0» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stLengthBit pending zeros bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stLengthBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stLengthBit pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stLengthBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stLengthBit pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stLengthBit pending zeros bs cs).workTapes i)
((scanCfg input pos stLengthBit pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stLengthBit pending zeros bs cs).workTapePos i +
↑((read stLengthBit (boolEmb b)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨0, ⋯⟩) =
(scanCfg input (moveInputPos pos 1) (stDecrement false) pending zeros bs (b :: cs)).workTapes ((fun i ↦ i) ⟨0, ⋯⟩)refine_1.«1» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stLengthBit pending zeros bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stLengthBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stLengthBit pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stLengthBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stLengthBit pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stLengthBit pending zeros bs cs).workTapes i)
((scanCfg input pos stLengthBit pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stLengthBit pending zeros bs cs).workTapePos i +
↑((read stLengthBit (boolEmb b)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨1, ⋯⟩) =
(scanCfg input (moveInputPos pos 1) (stDecrement false) pending zeros bs (b :: cs)).workTapes ((fun i ↦ i) ⟨1, ⋯⟩)refine_1.«2» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stLengthBit pending zeros bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stLengthBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stLengthBit pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stLengthBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stLengthBit pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stLengthBit pending zeros bs cs).workTapes i)
((scanCfg input pos stLengthBit pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stLengthBit pending zeros bs cs).workTapePos i +
↑((read stLengthBit (boolEmb b)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨2, ⋯⟩) =
(scanCfg input (moveInputPos pos 1) (stDecrement false) pending zeros bs (b :: cs)).workTapes ((fun i ↦ i) ⟨2, ⋯⟩)refine_1.«3» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stLengthBit pending zeros bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stLengthBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stLengthBit pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stLengthBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stLengthBit pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stLengthBit pending zeros bs cs).workTapes i)
((scanCfg input pos stLengthBit pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stLengthBit pending zeros bs cs).workTapePos i +
↑((read stLengthBit (boolEmb b)).workActions i).2 }.workTapes
((fun i ↦ i) ⟨3, ⋯⟩) =
(scanCfg input (moveInputPos pos 1) (stDecrement false) pending zeros bs (b :: cs)).workTapes ((fun i ↦ i) ⟨3, ⋯⟩) simp only [read, stTree, stZeros, stSizeBit, stLengthBit, boolEmb_apply,
consume, jump, scanCfg, stDecrement, ↓reduceIte, Fin.reduceFinMk, Fin.isValue, Fin.reduceEq] refine_1.«3» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stLengthBit pending zeros bs cs).inputSymbol = some (boolEmb b)⊢ Function.update (wordTape cs) (↑cs.length + 1) (some (if b = true then 1 else 0)) = wordTape (b :: cs)
exact wordTape_cons cs b All goals completed! 🐙
· refine_2 input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stLengthBit pending zeros bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stLengthBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stLengthBit pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stLengthBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stLengthBit pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stLengthBit pending zeros bs cs).workTapes i)
((scanCfg input pos stLengthBit pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stLengthBit pending zeros bs cs).workTapePos i +
↑((read stLengthBit (boolEmb b)).workActions i).2 }.workTapePos =
(scanCfg input (moveInputPos pos 1) (stDecrement false) pending zeros bs (b :: cs)).workTapePos funext i refine_2 input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stLengthBit pending zeros bs cs).inputSymbol = some (boolEmb b)i:Fin 4⊢ { state := (read stLengthBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stLengthBit pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stLengthBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stLengthBit pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stLengthBit pending zeros bs cs).workTapes i)
((scanCfg input pos stLengthBit pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stLengthBit pending zeros bs cs).workTapePos i +
↑((read stLengthBit (boolEmb b)).workActions i).2 }.workTapePos
i =
(scanCfg input (moveInputPos pos 1) (stDecrement false) pending zeros bs (b :: cs)).workTapePos i
fin_cases i refine_2.«0» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stLengthBit pending zeros bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stLengthBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stLengthBit pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stLengthBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stLengthBit pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stLengthBit pending zeros bs cs).workTapes i)
((scanCfg input pos stLengthBit pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stLengthBit pending zeros bs cs).workTapePos i +
↑((read stLengthBit (boolEmb b)).workActions i).2 }.workTapePos
((fun i ↦ i) ⟨0, ⋯⟩) =
(scanCfg input (moveInputPos pos 1) (stDecrement false) pending zeros bs (b :: cs)).workTapePos ((fun i ↦ i) ⟨0, ⋯⟩)refine_2.«1» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stLengthBit pending zeros bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stLengthBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stLengthBit pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stLengthBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stLengthBit pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stLengthBit pending zeros bs cs).workTapes i)
((scanCfg input pos stLengthBit pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stLengthBit pending zeros bs cs).workTapePos i +
↑((read stLengthBit (boolEmb b)).workActions i).2 }.workTapePos
((fun i ↦ i) ⟨1, ⋯⟩) =
(scanCfg input (moveInputPos pos 1) (stDecrement false) pending zeros bs (b :: cs)).workTapePos ((fun i ↦ i) ⟨1, ⋯⟩)refine_2.«2» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stLengthBit pending zeros bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stLengthBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stLengthBit pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stLengthBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stLengthBit pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stLengthBit pending zeros bs cs).workTapes i)
((scanCfg input pos stLengthBit pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stLengthBit pending zeros bs cs).workTapePos i +
↑((read stLengthBit (boolEmb b)).workActions i).2 }.workTapePos
((fun i ↦ i) ⟨2, ⋯⟩) =
(scanCfg input (moveInputPos pos 1) (stDecrement false) pending zeros bs (b :: cs)).workTapePos ((fun i ↦ i) ⟨2, ⋯⟩)refine_2.«3» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stLengthBit pending zeros bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stLengthBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stLengthBit pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stLengthBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stLengthBit pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stLengthBit pending zeros bs cs).workTapes i)
((scanCfg input pos stLengthBit pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stLengthBit pending zeros bs cs).workTapePos i +
↑((read stLengthBit (boolEmb b)).workActions i).2 }.workTapePos
((fun i ↦ i) ⟨3, ⋯⟩) =
(scanCfg input (moveInputPos pos 1) (stDecrement false) pending zeros bs (b :: cs)).workTapePos ((fun i ↦ i) ⟨3, ⋯⟩) <;> refine_2.«0» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stLengthBit pending zeros bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stLengthBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stLengthBit pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stLengthBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stLengthBit pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stLengthBit pending zeros bs cs).workTapes i)
((scanCfg input pos stLengthBit pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stLengthBit pending zeros bs cs).workTapePos i +
↑((read stLengthBit (boolEmb b)).workActions i).2 }.workTapePos
((fun i ↦ i) ⟨0, ⋯⟩) =
(scanCfg input (moveInputPos pos 1) (stDecrement false) pending zeros bs (b :: cs)).workTapePos ((fun i ↦ i) ⟨0, ⋯⟩)refine_2.«1» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stLengthBit pending zeros bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stLengthBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stLengthBit pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stLengthBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stLengthBit pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stLengthBit pending zeros bs cs).workTapes i)
((scanCfg input pos stLengthBit pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stLengthBit pending zeros bs cs).workTapePos i +
↑((read stLengthBit (boolEmb b)).workActions i).2 }.workTapePos
((fun i ↦ i) ⟨1, ⋯⟩) =
(scanCfg input (moveInputPos pos 1) (stDecrement false) pending zeros bs (b :: cs)).workTapePos ((fun i ↦ i) ⟨1, ⋯⟩)refine_2.«2» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stLengthBit pending zeros bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stLengthBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stLengthBit pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stLengthBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stLengthBit pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stLengthBit pending zeros bs cs).workTapes i)
((scanCfg input pos stLengthBit pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stLengthBit pending zeros bs cs).workTapePos i +
↑((read stLengthBit (boolEmb b)).workActions i).2 }.workTapePos
((fun i ↦ i) ⟨2, ⋯⟩) =
(scanCfg input (moveInputPos pos 1) (stDecrement false) pending zeros bs (b :: cs)).workTapePos ((fun i ↦ i) ⟨2, ⋯⟩)refine_2.«3» input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stLengthBit pending zeros bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stLengthBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stLengthBit pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stLengthBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stLengthBit pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stLengthBit pending zeros bs cs).workTapes i)
((scanCfg input pos stLengthBit pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stLengthBit pending zeros bs cs).workTapePos i +
↑((read stLengthBit (boolEmb b)).workActions i).2 }.workTapePos
((fun i ↦ i) ⟨3, ⋯⟩) =
(scanCfg input (moveInputPos pos 1) (stDecrement false) pending zeros bs (b :: cs)).workTapePos ((fun i ↦ i) ⟨3, ⋯⟩) simp [read, stTree, stZeros, stSizeBit, stLengthBit, boolEmb_apply,
consume, jump, scanCfg, stDecrement] All goals completed! 🐙A raw payload bit enters the payload countdown without changing either field.
theorem step_payload (input : List (Fin 3)) (pos : Fin (input.length + 2))
(pending zeros : ℕ) (bs cs : List Bool) (b : Bool)
(hin : (scanCfg input pos stPayloadBit pending zeros bs cs).inputSymbol = some (boolEmb b)) :
machine.step (scanCfg input pos stPayloadBit pending zeros bs cs) =
scanCfg input (moveInputPos pos 1) (stDecrement true) pending zeros bs cs := by input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stPayloadBit pending zeros bs cs).inputSymbol = some (boolEmb b)⊢ step (scanCfg input pos stPayloadBit pending zeros bs cs) =
scanCfg input (moveInputPos pos 1) (stDecrement true) pending zeros bs cs
rw [step_read _ stPayloadBit b rfl hin (Or.inr (Or.inr (Or.inr (Or.inr (Or.inl rfl))))) input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stPayloadBit pending zeros bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stPayloadBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stPayloadBit pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stPayloadBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stPayloadBit pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stPayloadBit pending zeros bs cs).workTapes i)
((scanCfg input pos stPayloadBit pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stPayloadBit pending zeros bs cs).workTapePos i +
↑((read stPayloadBit (boolEmb b)).workActions i).2 } =
scanCfg input (moveInputPos pos 1) (stDecrement true) pending zeros bs cs] input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stPayloadBit pending zeros bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stPayloadBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stPayloadBit pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stPayloadBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stPayloadBit pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stPayloadBit pending zeros bs cs).workTapes i)
((scanCfg input pos stPayloadBit pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stPayloadBit pending zeros bs cs).workTapePos i +
↑((read stPayloadBit (boolEmb b)).workActions i).2 } =
scanCfg input (moveInputPos pos 1) (stDecrement true) pending zeros bs cs
refine Cfg.ext rfl rfl rfl ?_ input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stPayloadBit pending zeros bs cs).inputSymbol = some (boolEmb b)⊢ { state := (read stPayloadBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stPayloadBit pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stPayloadBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stPayloadBit pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stPayloadBit pending zeros bs cs).workTapes i)
((scanCfg input pos stPayloadBit pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stPayloadBit pending zeros bs cs).workTapePos i +
↑((read stPayloadBit (boolEmb b)).workActions i).2 }.workTapePos =
(scanCfg input (moveInputPos pos 1) (stDecrement true) pending zeros bs cs).workTapePos
funext i input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stPayloadBit pending zeros bs cs).inputSymbol = some (boolEmb b)i:Fin 4⊢ { state := (read stPayloadBit (boolEmb b)).q',
inputPos := moveInputPos (scanCfg input pos stPayloadBit pending zeros bs cs).inputPos 1,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((read stPayloadBit (boolEmb b)).workActions i).1 with
| none => (scanCfg input pos stPayloadBit pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stPayloadBit pending zeros bs cs).workTapes i)
((scanCfg input pos stPayloadBit pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stPayloadBit pending zeros bs cs).workTapePos i +
↑((read stPayloadBit (boolEmb b)).workActions i).2 }.workTapePos
i =
(scanCfg input (moveInputPos pos 1) (stDecrement true) pending zeros bs cs).workTapePos i
change (scanCfg input pos stPayloadBit pending zeros bs cs).workTapePos i + 0 = _ input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolb:Boolhin:(scanCfg input pos stPayloadBit pending zeros bs cs).inputSymbol = some (boolEmb b)i:Fin 4⊢ (scanCfg input pos stPayloadBit pending zeros bs cs).workTapePos i + 0 =
(scanCfg input (moveInputPos pos 1) (stDecrement true) pending zeros bs cs).workTapePos i
exact Int.add_zero _ All goals completed! 🐙The unary origin test selects the next width bit or begins its countdown.
theorem step_sizeCheck (input : List (Fin 3)) (pos : Fin (input.length + 2))
(pending zeros : ℕ) (bs cs : List Bool) :
machine.step (scanCfg input pos stSizeCheck pending zeros bs cs) =
scanCfg input pos (if zeros = 0 then stDecrement false else stSizeBit)
pending zeros bs cs := by input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Bool⊢ step (scanCfg input pos stSizeCheck pending zeros bs cs) =
scanCfg input pos (if zeros = 0 then stDecrement false else stSizeBit) pending zeros bs cs
have ht : machine.tr stSizeCheck (scanCfg input pos stSizeCheck pending zeros bs cs).inputSymbol
(scanCfg input pos stSizeCheck pending zeros bs cs).workTapeSymbols =
jump (if zeros = 0 then stDecrement false else stSizeBit) := by
change jump (if wordTape [] zeros == some 2 then _ else _) = _ input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Bool⊢ jump (if (wordTape [] ↑zeros == some 2) = true then stDecrement false else stSizeBit) =
jump (if zeros = 0 then stDecrement false else stSizeBit)
cases zeros with
| zero => zero input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕbs:List Boolcs:List Bool⊢ jump (if (wordTape [] ↑0 == some 2) = true then stDecrement false else stSizeBit) =
jump (if 0 = 0 then stDecrement false else stSizeBit) rfl All goals completed! 🐙
| succ zeros => succ input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕbs:List Boolcs:List Boolzeros:ℕ⊢ jump (if (wordTape [] ↑(zeros + 1) == some 2) = true then stDecrement false else stSizeBit) =
jump (if zeros + 1 = 0 then stDecrement false else stSizeBit)
rw [wordTape_succ succ input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕbs:List Boolcs:List Boolzeros:ℕ⊢ jump (if (Option.map ⇑boolEmb [].reverse[zeros]? == some 2) = true then stDecrement false else stSizeBit) =
jump (if zeros + 1 = 0 then stDecrement false else stSizeBit)] succ input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕbs:List Boolcs:List Boolzeros:ℕ⊢ jump (if (Option.map ⇑boolEmb [].reverse[zeros]? == some 2) = true then stDecrement false else stSizeBit) =
jump (if zeros + 1 = 0 then stDecrement false else stSizeBit)
simp input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolht:machine.tr stSizeCheck (scanCfg input pos stSizeCheck pending zeros bs cs).inputSymbol
(scanCfg input pos stSizeCheck pending zeros bs cs).workTapeSymbols =
jump (if zeros = 0 then stDecrement false else stSizeBit)⊢ step (scanCfg input pos stSizeCheck pending zeros bs cs) =
scanCfg input pos (if zeros = 0 then stDecrement false else stSizeBit) pending zeros bs cs
rw [Geb.TreeScanner.step_of_state _ _ stSizeCheck rfl, input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolht:machine.tr stSizeCheck (scanCfg input pos stSizeCheck pending zeros bs cs).inputSymbol
(scanCfg input pos stSizeCheck pending zeros bs cs).workTapeSymbols =
jump (if zeros = 0 then stDecrement false else stSizeBit)⊢ {
state :=
(machine.tr stSizeCheck (scanCfg input pos stSizeCheck pending zeros bs cs).inputSymbol
(scanCfg input pos stSizeCheck pending zeros bs cs).workTapeSymbols).q',
inputPos :=
moveInputPos (scanCfg input pos stSizeCheck pending zeros bs cs).inputPos
(machine.tr stSizeCheck (scanCfg input pos stSizeCheck pending zeros bs cs).inputSymbol
(scanCfg input pos stSizeCheck pending zeros bs cs).workTapeSymbols).inputMove,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((machine.tr stSizeCheck (scanCfg input pos stSizeCheck pending zeros bs cs).inputSymbol
(scanCfg input pos stSizeCheck pending zeros bs cs).workTapeSymbols).workActions
i).1 with
| none => (scanCfg input pos stSizeCheck pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stSizeCheck pending zeros bs cs).workTapes i)
((scanCfg input pos stSizeCheck pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stSizeCheck pending zeros bs cs).workTapePos i +
↑((machine.tr stSizeCheck (scanCfg input pos stSizeCheck pending zeros bs cs).inputSymbol
(scanCfg input pos stSizeCheck pending zeros bs cs).workTapeSymbols).workActions
i).2 } =
scanCfg input pos (if zeros = 0 then stDecrement false else stSizeBit) pending zeros bs cs ht input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolht:machine.tr stSizeCheck (scanCfg input pos stSizeCheck pending zeros bs cs).inputSymbol
(scanCfg input pos stSizeCheck pending zeros bs cs).workTapeSymbols =
jump (if zeros = 0 then stDecrement false else stSizeBit)⊢ { state := (jump (if zeros = 0 then stDecrement false else stSizeBit)).q',
inputPos :=
moveInputPos (scanCfg input pos stSizeCheck pending zeros bs cs).inputPos
(jump (if zeros = 0 then stDecrement false else stSizeBit)).inputMove,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((jump (if zeros = 0 then stDecrement false else stSizeBit)).workActions i).1 with
| none => (scanCfg input pos stSizeCheck pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stSizeCheck pending zeros bs cs).workTapes i)
((scanCfg input pos stSizeCheck pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stSizeCheck pending zeros bs cs).workTapePos i +
↑((jump (if zeros = 0 then stDecrement false else stSizeBit)).workActions i).2 } =
scanCfg input pos (if zeros = 0 then stDecrement false else stSizeBit) pending zeros bs cs] input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolht:machine.tr stSizeCheck (scanCfg input pos stSizeCheck pending zeros bs cs).inputSymbol
(scanCfg input pos stSizeCheck pending zeros bs cs).workTapeSymbols =
jump (if zeros = 0 then stDecrement false else stSizeBit)⊢ { state := (jump (if zeros = 0 then stDecrement false else stSizeBit)).q',
inputPos :=
moveInputPos (scanCfg input pos stSizeCheck pending zeros bs cs).inputPos
(jump (if zeros = 0 then stDecrement false else stSizeBit)).inputMove,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((jump (if zeros = 0 then stDecrement false else stSizeBit)).workActions i).1 with
| none => (scanCfg input pos stSizeCheck pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stSizeCheck pending zeros bs cs).workTapes i)
((scanCfg input pos stSizeCheck pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stSizeCheck pending zeros bs cs).workTapePos i +
↑((jump (if zeros = 0 then stDecrement false else stSizeBit)).workActions i).2 } =
scanCfg input pos (if zeros = 0 then stDecrement false else stSizeBit) pending zeros bs cs
refine Cfg.ext rfl (moveInputPos_zero _) rfl ?_ input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolht:machine.tr stSizeCheck (scanCfg input pos stSizeCheck pending zeros bs cs).inputSymbol
(scanCfg input pos stSizeCheck pending zeros bs cs).workTapeSymbols =
jump (if zeros = 0 then stDecrement false else stSizeBit)⊢ { state := (jump (if zeros = 0 then stDecrement false else stSizeBit)).q',
inputPos :=
moveInputPos (scanCfg input pos stSizeCheck pending zeros bs cs).inputPos
(jump (if zeros = 0 then stDecrement false else stSizeBit)).inputMove,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((jump (if zeros = 0 then stDecrement false else stSizeBit)).workActions i).1 with
| none => (scanCfg input pos stSizeCheck pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stSizeCheck pending zeros bs cs).workTapes i)
((scanCfg input pos stSizeCheck pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stSizeCheck pending zeros bs cs).workTapePos i +
↑((jump (if zeros = 0 then stDecrement false else stSizeBit)).workActions i).2 }.workTapePos =
(scanCfg input pos (if zeros = 0 then stDecrement false else stSizeBit) pending zeros bs cs).workTapePos
funext i input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolht:machine.tr stSizeCheck (scanCfg input pos stSizeCheck pending zeros bs cs).inputSymbol
(scanCfg input pos stSizeCheck pending zeros bs cs).workTapeSymbols =
jump (if zeros = 0 then stDecrement false else stSizeBit)i:Fin 4⊢ { state := (jump (if zeros = 0 then stDecrement false else stSizeBit)).q',
inputPos :=
moveInputPos (scanCfg input pos stSizeCheck pending zeros bs cs).inputPos
(jump (if zeros = 0 then stDecrement false else stSizeBit)).inputMove,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((jump (if zeros = 0 then stDecrement false else stSizeBit)).workActions i).1 with
| none => (scanCfg input pos stSizeCheck pending zeros bs cs).workTapes i
| some s =>
Function.update ((scanCfg input pos stSizeCheck pending zeros bs cs).workTapes i)
((scanCfg input pos stSizeCheck pending zeros bs cs).workTapePos i) s,
workTapePos := fun i ↦
(scanCfg input pos stSizeCheck pending zeros bs cs).workTapePos i +
↑((jump (if zeros = 0 then stDecrement false else stSizeBit)).workActions i).2 }.workTapePos
i =
(scanCfg input pos (if zeros = 0 then stDecrement false else stSizeBit) pending zeros bs cs).workTapePos i
change (scanCfg input pos stSizeCheck pending zeros bs cs).workTapePos i + 0 = _ input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Boolht:machine.tr stSizeCheck (scanCfg input pos stSizeCheck pending zeros bs cs).inputSymbol
(scanCfg input pos stSizeCheck pending zeros bs cs).workTapeSymbols =
jump (if zeros = 0 then stDecrement false else stSizeBit)i:Fin 4⊢ (scanCfg input pos stSizeCheck pending zeros bs cs).workTapePos i + 0 =
(scanCfg input pos (if zeros = 0 then stDecrement false else stSizeBit) pending zeros bs cs).workTapePos i
exact Int.add_zero _ All goals completed! 🐙Checking the unary header counter emits nothing.
theorem outputSymbol_sizeCheck (input : List (Fin 3)) (pos : Fin (input.length + 2))
(pending zeros : ℕ) (bs cs : List Bool) :
machine.outputSymbol (scanCfg input pos stSizeCheck pending zeros bs cs) = none := by input:List (Fin 3)pos:Fin (input.length + 2)pending:ℕzeros:ℕbs:List Boolcs:List Bool⊢ outputSymbol (scanCfg input pos stSizeCheck pending zeros bs cs) = none
rfl All goals completed! 🐙end Geb.BitTree.Elias.Machine