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.MachineConfig public import Geb.Prototypes.Computability.TreeScanner.Steps public import Mathlib.Tactic.FinCases
set_option doc.verso true

Erasing completed delta fields

The cleanup subroutine moves both binary heads toward their marked origins, erasing one cell per transition. The shorter field waits at its origin while the longer field finishes. The pending-tree count is then decremented once.

Main statements

  • step_clearing describes one simultaneous erasure transition.

  • configs_clearing describes all intermediate configurations.

  • configs_clear_done gives the exact cleanup cost and empty output.

Implementation notes

This module concerns Cslib execution. The underlying input reader introduces Classical.choice, so these correspondence statements belong to the execution layer rather than the pure tape representation.

Tags

Elias delta code, Turing machine, cleanup, running time

@[expose] public sectionnamespace Geb.BitTree.Elias.Machineopen Turing MultiTapeTM

Two consecutive phases with no output compose by adding their exact costs.

theorem configs_output_add {input : List (Fin 3)} (cfg mid last : Cfg 4 (Fin 3) Control input) (a b : ) (ha : machine.configs cfg a = mid machine.outputString cfg a = []) (hb : machine.configs mid b = last machine.outputString mid b = []) : machine.configs cfg (a + b) = last machine.outputString cfg (a + b) = [] := input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputmid:Cfg 4 (Fin 3) Control inputlast:Cfg 4 (Fin 3) Control inputa:b:ha:configs cfg a = mid machine.outputString cfg a = []hb:configs mid b = last machine.outputString mid b = []configs cfg (a + b) = last machine.outputString cfg (a + b) = [] input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputmid:Cfg 4 (Fin 3) Control inputlast:Cfg 4 (Fin 3) Control inputa:b:ha:configs cfg a = mid machine.outputString cfg a = []hb:configs mid b = last machine.outputString mid b = []configs cfg (a + b) = lastinput:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputmid:Cfg 4 (Fin 3) Control inputlast:Cfg 4 (Fin 3) Control inputa:b:ha:configs cfg a = mid machine.outputString cfg a = []hb:configs mid b = last machine.outputString mid b = []machine.outputString cfg (a + b) = [] input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputmid:Cfg 4 (Fin 3) Control inputlast:Cfg 4 (Fin 3) Control inputa:b:ha:configs cfg a = mid machine.outputString cfg a = []hb:configs mid b = last machine.outputString mid b = []configs cfg (a + b) = last All goals completed! 🐙 input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputmid:Cfg 4 (Fin 3) Control inputlast:Cfg 4 (Fin 3) Control inputa:b:ha:configs cfg a = mid machine.outputString cfg a = []hb:configs mid b = last machine.outputString mid b = []machine.outputString cfg (a + b) = [] input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputmid:Cfg 4 (Fin 3) Control inputlast:Cfg 4 (Fin 3) Control inputa:b:ha:configs cfg a = mid machine.outputString cfg a = []hb:configs mid b = last machine.outputString mid b = [][] ++ [] = [] All goals completed! 🐙

Bounds for consecutive execution intervals compose at their shared configuration.

theorem headBound_add {input : List (Fin 3)} (cfg : Cfg 4 (Fin 3) Control input) (a b width : ) (ha : t a, HeadBound width (machine.configs cfg t)) (hb : t b, HeadBound width (machine.configs (machine.configs cfg a) t)) (t : ) (ht : t a + b) : HeadBound width (machine.configs cfg t) := input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputa:b:width:ha: t a, HeadBound width (configs cfg t)hb: t b, HeadBound width (configs (configs cfg a) t)t:ht:t a + bHeadBound width (configs cfg t) input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputa:b:width:ha: t a, HeadBound width (configs cfg t)hb: t b, HeadBound width (configs (configs cfg a) t)t:ht:t a + bh:t aHeadBound width (configs cfg t)input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputa:b:width:ha: t a, HeadBound width (configs cfg t)hb: t b, HeadBound width (configs (configs cfg a) t)t:ht:t a + bh:¬t aHeadBound width (configs cfg t) input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputa:b:width:ha: t a, HeadBound width (configs cfg t)hb: t b, HeadBound width (configs (configs cfg a) t)t:ht:t a + bh:t aHeadBound width (configs cfg t) All goals completed! 🐙 input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputa:b:width:ha: t a, HeadBound width (configs cfg t)hb: t b, HeadBound width (configs (configs cfg a) t)t:ht:t a + bh:¬t aHeadBound width (configs cfg t) input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputa:b:width:ha: t a, HeadBound width (configs cfg t)hb: t b, HeadBound width (configs (configs cfg a) t)t:ht:t a + bh:¬t ahe:t = a + (t - a)HeadBound width (configs cfg t) input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputa:b:width:ha: t a, HeadBound width (configs cfg t)hb: t b, HeadBound width (configs (configs cfg a) t)t:ht:t a + bh:¬t ahe:t = a + (t - a)HeadBound width (configs (configs cfg a) (t - a)) exact hb (t - a) (input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputa:b:width:ha: t a, HeadBound width (configs cfg t)hb: t b, HeadBound width (configs (configs cfg a) t)t:ht:t a + bh:¬t ahe:t = a + (t - a)t - a b All goals completed! 🐙)

A nonempty cleanup phase takes the erasing branch of the transition table.

theorem tr_clearing {input : List (Fin 3)} (cfg : Cfg 4 (Fin 3) Control input) (bs cs : List Bool) (p r : ) (h : 0 < p + r) : machine.tr stClear (clearingCfg cfg bs cs p r).inputSymbol (clearingCfg cfg bs cs p r).workTapeSymbols = { jump stClear with workActions := fun i if i = 2 then (if p = 0 then (none, 0) else (some none, -1)) else if i = 3 then (if r = 0 then (none, 0) else (some none, -1)) else (none, 0) } := input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:h:0 < p + rmachine.tr stClear (clearingCfg cfg bs cs p r).inputSymbol (clearingCfg cfg bs cs p r).workTapeSymbols = let __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' } input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:h:0 < p + rclear (clearingCfg cfg bs cs p r).workTapeSymbols = let __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' } input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:h:0 < p + rh2:((clearingCfg cfg bs cs p r).workTapeSymbols 2 == some 2) = decide (p = 0)clear (clearingCfg cfg bs cs p r).workTapeSymbols = let __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' } input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:h:0 < p + rh2:((clearingCfg cfg bs cs p r).workTapeSymbols 2 == some 2) = decide (p = 0)h3:((clearingCfg cfg bs cs p r).workTapeSymbols 3 == some 2) = decide (r = 0)clear (clearingCfg cfg bs cs p r).workTapeSymbols = let __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' } input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:h:0 < p + rh2:((clearingCfg cfg bs cs p r).workTapeSymbols 2 == some 2) = decide (p = 0)h3:((clearingCfg cfg bs cs p r).workTapeSymbols 3 == some 2) = decide (r = 0)hm:((clearingCfg cfg bs cs p r).workTapeSymbols 2 == some 2 && (clearingCfg cfg bs cs p r).workTapeSymbols 3 == some 2) = falseclear (clearingCfg cfg bs cs p r).workTapeSymbols = let __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' } input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:h:0 < p + rh2:((clearingCfg cfg bs cs p r).workTapeSymbols 2 == some 2) = decide (p = 0)h3:((clearingCfg cfg bs cs p r).workTapeSymbols 3 == some 2) = decide (r = 0)hm:((clearingCfg cfg bs cs p r).workTapeSymbols 2 == some 2 && (clearingCfg cfg bs cs p r).workTapeSymbols 3 == some 2) = false(if ((clearingCfg cfg bs cs p r).workTapeSymbols 2 == some 2 && (clearingCfg cfg bs cs p r).workTapeSymbols 3 == some 2) = true then have __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' } else have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 0 i = 1 (clearingCfg cfg bs cs p r).workTapeSymbols i = some 2 then (none, 0) else (some none, -1), outS := __src.outS, q' := __src.q' }) = let __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' } input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:h:0 < p + rh2:((clearingCfg cfg bs cs p r).workTapeSymbols 2 == some 2) = decide (p = 0)h3:((clearingCfg cfg bs cs p r).workTapeSymbols 3 == some 2) = decide (r = 0)hm:((clearingCfg cfg bs cs p r).workTapeSymbols 2 == some 2 && (clearingCfg cfg bs cs p r).workTapeSymbols 3 == some 2) = false(have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 0 i = 1 (clearingCfg cfg bs cs p r).workTapeSymbols i = some 2 then (none, 0) else (some none, -1), outS := __src.outS, q' := __src.q' }) = let __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' } input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:h:0 < p + rh2:((clearingCfg cfg bs cs p r).workTapeSymbols 2 == some 2) = decide (p = 0)h3:((clearingCfg cfg bs cs p r).workTapeSymbols 3 == some 2) = decide (r = 0)hm:((clearingCfg cfg bs cs p r).workTapeSymbols 2 == some 2 && (clearingCfg cfg bs cs p r).workTapeSymbols 3 == some 2) = false{ inputMove := (jump stClear).inputMove, workActions := fun i if i = 0 i = 1 (clearingCfg cfg bs cs p r).workTapeSymbols i = some 2 then (none, 0) else (some none, -1), outS := (jump stClear).outS, q' := (jump stClear).q' } = { inputMove := (jump stClear).inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := (jump stClear).outS, q' := (jump stClear).q' } input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:h:0 < p + rh2:((clearingCfg cfg bs cs p r).workTapeSymbols 2 == some 2) = decide (p = 0)h3:((clearingCfg cfg bs cs p r).workTapeSymbols 3 == some 2) = decide (r = 0)hm:((clearingCfg cfg bs cs p r).workTapeSymbols 2 == some 2 && (clearingCfg cfg bs cs p r).workTapeSymbols 3 == some 2) = false(fun i if i = 0 i = 1 (clearingCfg cfg bs cs p r).workTapeSymbols i = some 2 then (none, 0) else (some none, -1)) = fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0) input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:h:0 < p + rh2:((clearingCfg cfg bs cs p r).workTapeSymbols 2 == some 2) = decide (p = 0)h3:((clearingCfg cfg bs cs p r).workTapeSymbols 3 == some 2) = decide (r = 0)hm:((clearingCfg cfg bs cs p r).workTapeSymbols 2 == some 2 && (clearingCfg cfg bs cs p r).workTapeSymbols 3 == some 2) = falsei:Fin 4(if i = 0 i = 1 (clearingCfg cfg bs cs p r).workTapeSymbols i = some 2 then (none, 0) else (some none, -1)) = if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0) input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:h:0 < p + rh2:((clearingCfg cfg bs cs p r).workTapeSymbols 2 == some 2) = decide (p = 0)h3:((clearingCfg cfg bs cs p r).workTapeSymbols 3 == some 2) = decide (r = 0)hm:((clearingCfg cfg bs cs p r).workTapeSymbols 2 == some 2 && (clearingCfg cfg bs cs p r).workTapeSymbols 3 == some 2) = false(if (fun i i) 0, = 0 (fun i i) 0, = 1 (clearingCfg cfg bs cs p r).workTapeSymbols ((fun i i) 0, ) = some 2 then (none, 0) else (some none, -1)) = if (fun i i) 0, = 2 then if p = 0 then (none, 0) else (some none, -1) else if (fun i i) 0, = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0)input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:h:0 < p + rh2:((clearingCfg cfg bs cs p r).workTapeSymbols 2 == some 2) = decide (p = 0)h3:((clearingCfg cfg bs cs p r).workTapeSymbols 3 == some 2) = decide (r = 0)hm:((clearingCfg cfg bs cs p r).workTapeSymbols 2 == some 2 && (clearingCfg cfg bs cs p r).workTapeSymbols 3 == some 2) = false(if (fun i i) 1, = 0 (fun i i) 1, = 1 (clearingCfg cfg bs cs p r).workTapeSymbols ((fun i i) 1, ) = some 2 then (none, 0) else (some none, -1)) = if (fun i i) 1, = 2 then if p = 0 then (none, 0) else (some none, -1) else if (fun i i) 1, = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0)input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:h:0 < p + rh2:((clearingCfg cfg bs cs p r).workTapeSymbols 2 == some 2) = decide (p = 0)h3:((clearingCfg cfg bs cs p r).workTapeSymbols 3 == some 2) = decide (r = 0)hm:((clearingCfg cfg bs cs p r).workTapeSymbols 2 == some 2 && (clearingCfg cfg bs cs p r).workTapeSymbols 3 == some 2) = false(if (fun i i) 2, = 0 (fun i i) 2, = 1 (clearingCfg cfg bs cs p r).workTapeSymbols ((fun i i) 2, ) = some 2 then (none, 0) else (some none, -1)) = if (fun i i) 2, = 2 then if p = 0 then (none, 0) else (some none, -1) else if (fun i i) 2, = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0)input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:h:0 < p + rh2:((clearingCfg cfg bs cs p r).workTapeSymbols 2 == some 2) = decide (p = 0)h3:((clearingCfg cfg bs cs p r).workTapeSymbols 3 == some 2) = decide (r = 0)hm:((clearingCfg cfg bs cs p r).workTapeSymbols 2 == some 2 && (clearingCfg cfg bs cs p r).workTapeSymbols 3 == some 2) = false(if (fun i i) 3, = 0 (fun i i) 3, = 1 (clearingCfg cfg bs cs p r).workTapeSymbols ((fun i i) 3, ) = some 2 then (none, 0) else (some none, -1)) = if (fun i i) 3, = 2 then if p = 0 then (none, 0) else (some none, -1) else if (fun i i) 3, = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0) input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:h:0 < p + rh2:((clearingCfg cfg bs cs p r).workTapeSymbols 2 == some 2) = decide (p = 0)h3:((clearingCfg cfg bs cs p r).workTapeSymbols 3 == some 2) = decide (r = 0)hm:((clearingCfg cfg bs cs p r).workTapeSymbols 2 == some 2 && (clearingCfg cfg bs cs p r).workTapeSymbols 3 == some 2) = false(if (fun i i) 0, = 0 (fun i i) 0, = 1 (clearingCfg cfg bs cs p r).workTapeSymbols ((fun i i) 0, ) = some 2 then (none, 0) else (some none, -1)) = if (fun i i) 0, = 2 then if p = 0 then (none, 0) else (some none, -1) else if (fun i i) 0, = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0)input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:h:0 < p + rh2:((clearingCfg cfg bs cs p r).workTapeSymbols 2 == some 2) = decide (p = 0)h3:((clearingCfg cfg bs cs p r).workTapeSymbols 3 == some 2) = decide (r = 0)hm:((clearingCfg cfg bs cs p r).workTapeSymbols 2 == some 2 && (clearingCfg cfg bs cs p r).workTapeSymbols 3 == some 2) = false(if (fun i i) 1, = 0 (fun i i) 1, = 1 (clearingCfg cfg bs cs p r).workTapeSymbols ((fun i i) 1, ) = some 2 then (none, 0) else (some none, -1)) = if (fun i i) 1, = 2 then if p = 0 then (none, 0) else (some none, -1) else if (fun i i) 1, = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0)input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:h:0 < p + rh2:((clearingCfg cfg bs cs p r).workTapeSymbols 2 == some 2) = decide (p = 0)h3:((clearingCfg cfg bs cs p r).workTapeSymbols 3 == some 2) = decide (r = 0)hm:((clearingCfg cfg bs cs p r).workTapeSymbols 2 == some 2 && (clearingCfg cfg bs cs p r).workTapeSymbols 3 == some 2) = false(if (fun i i) 2, = 0 (fun i i) 2, = 1 (clearingCfg cfg bs cs p r).workTapeSymbols ((fun i i) 2, ) = some 2 then (none, 0) else (some none, -1)) = if (fun i i) 2, = 2 then if p = 0 then (none, 0) else (some none, -1) else if (fun i i) 2, = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0)input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:h:0 < p + rh2:((clearingCfg cfg bs cs p r).workTapeSymbols 2 == some 2) = decide (p = 0)h3:((clearingCfg cfg bs cs p r).workTapeSymbols 3 == some 2) = decide (r = 0)hm:((clearingCfg cfg bs cs p r).workTapeSymbols 2 == some 2 && (clearingCfg cfg bs cs p r).workTapeSymbols 3 == some 2) = false(if (fun i i) 3, = 0 (fun i i) 3, = 1 (clearingCfg cfg bs cs p r).workTapeSymbols ((fun i i) 3, ) = some 2 then (none, 0) else (some none, -1)) = if (fun i i) 3, = 2 then if p = 0 then (none, 0) else (some none, -1) else if (fun i i) 3, = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0) input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolr:h:0 < 0 + rh2:((clearingCfg cfg bs cs 0 r).workTapeSymbols 2 == some 2) = decide (0 = 0)h3:((clearingCfg cfg bs cs 0 r).workTapeSymbols 3 == some 2) = decide (r = 0)hm:((clearingCfg cfg bs cs 0 r).workTapeSymbols 2 == some 2 && (clearingCfg cfg bs cs 0 r).workTapeSymbols 3 == some 2) = false(if (fun i i) 3, = 0 (fun i i) 3, = 1 (clearingCfg cfg bs cs 0 r).workTapeSymbols ((fun i i) 3, ) = some 2 then (none, 0) else (some none, -1)) = if (fun i i) 3, = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if (fun i i) 3, = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0)input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolr:n✝:h:0 < n✝ + 1 + rh2:((clearingCfg cfg bs cs (n✝ + 1) r).workTapeSymbols 2 == some 2) = decide (n✝ + 1 = 0)h3:((clearingCfg cfg bs cs (n✝ + 1) r).workTapeSymbols 3 == some 2) = decide (r = 0)hm:((clearingCfg cfg bs cs (n✝ + 1) r).workTapeSymbols 2 == some 2 && (clearingCfg cfg bs cs (n✝ + 1) r).workTapeSymbols 3 == some 2) = false(if (fun i i) 3, = 0 (fun i i) 3, = 1 (clearingCfg cfg bs cs (n✝ + 1) r).workTapeSymbols ((fun i i) 3, ) = some 2 then (none, 0) else (some none, -1)) = if (fun i i) 3, = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if (fun i i) 3, = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0) input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolr:h:0 < 0 + rh2:((clearingCfg cfg bs cs 0 r).workTapeSymbols 2 == some 2) = decide (0 = 0)h3:((clearingCfg cfg bs cs 0 r).workTapeSymbols 3 == some 2) = decide (r = 0)hm:((clearingCfg cfg bs cs 0 r).workTapeSymbols 2 == some 2 && (clearingCfg cfg bs cs 0 r).workTapeSymbols 3 == some 2) = false(if (fun i i) 0, = 0 (fun i i) 0, = 1 (clearingCfg cfg bs cs 0 r).workTapeSymbols ((fun i i) 0, ) = some 2 then (none, 0) else (some none, -1)) = if (fun i i) 0, = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if (fun i i) 0, = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0)input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolr:n✝:h:0 < n✝ + 1 + rh2:((clearingCfg cfg bs cs (n✝ + 1) r).workTapeSymbols 2 == some 2) = decide (n✝ + 1 = 0)h3:((clearingCfg cfg bs cs (n✝ + 1) r).workTapeSymbols 3 == some 2) = decide (r = 0)hm:((clearingCfg cfg bs cs (n✝ + 1) r).workTapeSymbols 2 == some 2 && (clearingCfg cfg bs cs (n✝ + 1) r).workTapeSymbols 3 == some 2) = false(if (fun i i) 0, = 0 (fun i i) 0, = 1 (clearingCfg cfg bs cs (n✝ + 1) r).workTapeSymbols ((fun i i) 0, ) = some 2 then (none, 0) else (some none, -1)) = if (fun i i) 0, = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if (fun i i) 0, = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0)input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolr:h:0 < 0 + rh2:((clearingCfg cfg bs cs 0 r).workTapeSymbols 2 == some 2) = decide (0 = 0)h3:((clearingCfg cfg bs cs 0 r).workTapeSymbols 3 == some 2) = decide (r = 0)hm:((clearingCfg cfg bs cs 0 r).workTapeSymbols 2 == some 2 && (clearingCfg cfg bs cs 0 r).workTapeSymbols 3 == some 2) = false(if (fun i i) 1, = 0 (fun i i) 1, = 1 (clearingCfg cfg bs cs 0 r).workTapeSymbols ((fun i i) 1, ) = some 2 then (none, 0) else (some none, -1)) = if (fun i i) 1, = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if (fun i i) 1, = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0)input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolr:n✝:h:0 < n✝ + 1 + rh2:((clearingCfg cfg bs cs (n✝ + 1) r).workTapeSymbols 2 == some 2) = decide (n✝ + 1 = 0)h3:((clearingCfg cfg bs cs (n✝ + 1) r).workTapeSymbols 3 == some 2) = decide (r = 0)hm:((clearingCfg cfg bs cs (n✝ + 1) r).workTapeSymbols 2 == some 2 && (clearingCfg cfg bs cs (n✝ + 1) r).workTapeSymbols 3 == some 2) = false(if (fun i i) 1, = 0 (fun i i) 1, = 1 (clearingCfg cfg bs cs (n✝ + 1) r).workTapeSymbols ((fun i i) 1, ) = some 2 then (none, 0) else (some none, -1)) = if (fun i i) 1, = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if (fun i i) 1, = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0)input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolr:h:0 < 0 + rh2:((clearingCfg cfg bs cs 0 r).workTapeSymbols 2 == some 2) = decide (0 = 0)h3:((clearingCfg cfg bs cs 0 r).workTapeSymbols 3 == some 2) = decide (r = 0)hm:((clearingCfg cfg bs cs 0 r).workTapeSymbols 2 == some 2 && (clearingCfg cfg bs cs 0 r).workTapeSymbols 3 == some 2) = false(if (fun i i) 2, = 0 (fun i i) 2, = 1 (clearingCfg cfg bs cs 0 r).workTapeSymbols ((fun i i) 2, ) = some 2 then (none, 0) else (some none, -1)) = if (fun i i) 2, = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if (fun i i) 2, = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0)input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolr:n✝:h:0 < n✝ + 1 + rh2:((clearingCfg cfg bs cs (n✝ + 1) r).workTapeSymbols 2 == some 2) = decide (n✝ + 1 = 0)h3:((clearingCfg cfg bs cs (n✝ + 1) r).workTapeSymbols 3 == some 2) = decide (r = 0)hm:((clearingCfg cfg bs cs (n✝ + 1) r).workTapeSymbols 2 == some 2 && (clearingCfg cfg bs cs (n✝ + 1) r).workTapeSymbols 3 == some 2) = false(if (fun i i) 2, = 0 (fun i i) 2, = 1 (clearingCfg cfg bs cs (n✝ + 1) r).workTapeSymbols ((fun i i) 2, ) = some 2 then (none, 0) else (some none, -1)) = if (fun i i) 2, = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if (fun i i) 2, = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0)input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolr:h:0 < 0 + rh2:((clearingCfg cfg bs cs 0 r).workTapeSymbols 2 == some 2) = decide (0 = 0)h3:((clearingCfg cfg bs cs 0 r).workTapeSymbols 3 == some 2) = decide (r = 0)hm:((clearingCfg cfg bs cs 0 r).workTapeSymbols 2 == some 2 && (clearingCfg cfg bs cs 0 r).workTapeSymbols 3 == some 2) = false(if (fun i i) 3, = 0 (fun i i) 3, = 1 (clearingCfg cfg bs cs 0 r).workTapeSymbols ((fun i i) 3, ) = some 2 then (none, 0) else (some none, -1)) = if (fun i i) 3, = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if (fun i i) 3, = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0)input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolr:n✝:h:0 < n✝ + 1 + rh2:((clearingCfg cfg bs cs (n✝ + 1) r).workTapeSymbols 2 == some 2) = decide (n✝ + 1 = 0)h3:((clearingCfg cfg bs cs (n✝ + 1) r).workTapeSymbols 3 == some 2) = decide (r = 0)hm:((clearingCfg cfg bs cs (n✝ + 1) r).workTapeSymbols 2 == some 2 && (clearingCfg cfg bs cs (n✝ + 1) r).workTapeSymbols 3 == some 2) = false(if (fun i i) 3, = 0 (fun i i) 3, = 1 (clearingCfg cfg bs cs (n✝ + 1) r).workTapeSymbols ((fun i i) 3, ) = some 2 then (none, 0) else (some none, -1)) = if (fun i i) 3, = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if (fun i i) 3, = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0) input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Booln✝:h:0 < n✝ + 1 + 0h2:((clearingCfg cfg bs cs (n✝ + 1) 0).workTapeSymbols 2 == some 2) = decide (n✝ + 1 = 0)h3:((clearingCfg cfg bs cs (n✝ + 1) 0).workTapeSymbols 3 == some 2) = decide (0 = 0)hm:((clearingCfg cfg bs cs (n✝ + 1) 0).workTapeSymbols 2 == some 2 && (clearingCfg cfg bs cs (n✝ + 1) 0).workTapeSymbols 3 == some 2) = false(if (fun i i) 3, = 0 (fun i i) 3, = 1 (clearingCfg cfg bs cs (n✝ + 1) 0).workTapeSymbols ((fun i i) 3, ) = some 2 then (none, 0) else (some none, -1)) = if (fun i i) 3, = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if (fun i i) 3, = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0)input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Booln✝¹:n✝:h:0 < n✝¹ + 1 + (n✝ + 1)h2:((clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapeSymbols 2 == some 2) = decide (n✝¹ + 1 = 0)h3:((clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapeSymbols 3 == some 2) = decide (n✝ + 1 = 0)hm:((clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapeSymbols 2 == some 2 && (clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapeSymbols 3 == some 2) = false(if (fun i i) 3, = 0 (fun i i) 3, = 1 (clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapeSymbols ((fun i i) 3, ) = some 2 then (none, 0) else (some none, -1)) = if (fun i i) 3, = 2 then if n✝¹ + 1 = 0 then (none, 0) else (some none, -1) else if (fun i i) 3, = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0) input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolh:0 < 0 + 0h2:((clearingCfg cfg bs cs 0 0).workTapeSymbols 2 == some 2) = decide (0 = 0)h3:((clearingCfg cfg bs cs 0 0).workTapeSymbols 3 == some 2) = decide (0 = 0)hm:((clearingCfg cfg bs cs 0 0).workTapeSymbols 2 == some 2 && (clearingCfg cfg bs cs 0 0).workTapeSymbols 3 == some 2) = false(if (fun i i) 0, = 0 (fun i i) 0, = 1 (clearingCfg cfg bs cs 0 0).workTapeSymbols ((fun i i) 0, ) = some 2 then (none, 0) else (some none, -1)) = if (fun i i) 0, = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if (fun i i) 0, = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0)input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Booln✝:h:0 < 0 + (n✝ + 1)h2:((clearingCfg cfg bs cs 0 (n✝ + 1)).workTapeSymbols 2 == some 2) = decide (0 = 0)h3:((clearingCfg cfg bs cs 0 (n✝ + 1)).workTapeSymbols 3 == some 2) = decide (n✝ + 1 = 0)hm:((clearingCfg cfg bs cs 0 (n✝ + 1)).workTapeSymbols 2 == some 2 && (clearingCfg cfg bs cs 0 (n✝ + 1)).workTapeSymbols 3 == some 2) = false(if (fun i i) 0, = 0 (fun i i) 0, = 1 (clearingCfg cfg bs cs 0 (n✝ + 1)).workTapeSymbols ((fun i i) 0, ) = some 2 then (none, 0) else (some none, -1)) = if (fun i i) 0, = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if (fun i i) 0, = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0)input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Booln✝:h:0 < n✝ + 1 + 0h2:((clearingCfg cfg bs cs (n✝ + 1) 0).workTapeSymbols 2 == some 2) = decide (n✝ + 1 = 0)h3:((clearingCfg cfg bs cs (n✝ + 1) 0).workTapeSymbols 3 == some 2) = decide (0 = 0)hm:((clearingCfg cfg bs cs (n✝ + 1) 0).workTapeSymbols 2 == some 2 && (clearingCfg cfg bs cs (n✝ + 1) 0).workTapeSymbols 3 == some 2) = false(if (fun i i) 0, = 0 (fun i i) 0, = 1 (clearingCfg cfg bs cs (n✝ + 1) 0).workTapeSymbols ((fun i i) 0, ) = some 2 then (none, 0) else (some none, -1)) = if (fun i i) 0, = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if (fun i i) 0, = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0)input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Booln✝¹:n✝:h:0 < n✝¹ + 1 + (n✝ + 1)h2:((clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapeSymbols 2 == some 2) = decide (n✝¹ + 1 = 0)h3:((clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapeSymbols 3 == some 2) = decide (n✝ + 1 = 0)hm:((clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapeSymbols 2 == some 2 && (clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapeSymbols 3 == some 2) = false(if (fun i i) 0, = 0 (fun i i) 0, = 1 (clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapeSymbols ((fun i i) 0, ) = some 2 then (none, 0) else (some none, -1)) = if (fun i i) 0, = 2 then if n✝¹ + 1 = 0 then (none, 0) else (some none, -1) else if (fun i i) 0, = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0)input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolh:0 < 0 + 0h2:((clearingCfg cfg bs cs 0 0).workTapeSymbols 2 == some 2) = decide (0 = 0)h3:((clearingCfg cfg bs cs 0 0).workTapeSymbols 3 == some 2) = decide (0 = 0)hm:((clearingCfg cfg bs cs 0 0).workTapeSymbols 2 == some 2 && (clearingCfg cfg bs cs 0 0).workTapeSymbols 3 == some 2) = false(if (fun i i) 1, = 0 (fun i i) 1, = 1 (clearingCfg cfg bs cs 0 0).workTapeSymbols ((fun i i) 1, ) = some 2 then (none, 0) else (some none, -1)) = if (fun i i) 1, = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if (fun i i) 1, = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0)input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Booln✝:h:0 < 0 + (n✝ + 1)h2:((clearingCfg cfg bs cs 0 (n✝ + 1)).workTapeSymbols 2 == some 2) = decide (0 = 0)h3:((clearingCfg cfg bs cs 0 (n✝ + 1)).workTapeSymbols 3 == some 2) = decide (n✝ + 1 = 0)hm:((clearingCfg cfg bs cs 0 (n✝ + 1)).workTapeSymbols 2 == some 2 && (clearingCfg cfg bs cs 0 (n✝ + 1)).workTapeSymbols 3 == some 2) = false(if (fun i i) 1, = 0 (fun i i) 1, = 1 (clearingCfg cfg bs cs 0 (n✝ + 1)).workTapeSymbols ((fun i i) 1, ) = some 2 then (none, 0) else (some none, -1)) = if (fun i i) 1, = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if (fun i i) 1, = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0)input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Booln✝:h:0 < n✝ + 1 + 0h2:((clearingCfg cfg bs cs (n✝ + 1) 0).workTapeSymbols 2 == some 2) = decide (n✝ + 1 = 0)h3:((clearingCfg cfg bs cs (n✝ + 1) 0).workTapeSymbols 3 == some 2) = decide (0 = 0)hm:((clearingCfg cfg bs cs (n✝ + 1) 0).workTapeSymbols 2 == some 2 && (clearingCfg cfg bs cs (n✝ + 1) 0).workTapeSymbols 3 == some 2) = false(if (fun i i) 1, = 0 (fun i i) 1, = 1 (clearingCfg cfg bs cs (n✝ + 1) 0).workTapeSymbols ((fun i i) 1, ) = some 2 then (none, 0) else (some none, -1)) = if (fun i i) 1, = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if (fun i i) 1, = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0)input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Booln✝¹:n✝:h:0 < n✝¹ + 1 + (n✝ + 1)h2:((clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapeSymbols 2 == some 2) = decide (n✝¹ + 1 = 0)h3:((clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapeSymbols 3 == some 2) = decide (n✝ + 1 = 0)hm:((clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapeSymbols 2 == some 2 && (clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapeSymbols 3 == some 2) = false(if (fun i i) 1, = 0 (fun i i) 1, = 1 (clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapeSymbols ((fun i i) 1, ) = some 2 then (none, 0) else (some none, -1)) = if (fun i i) 1, = 2 then if n✝¹ + 1 = 0 then (none, 0) else (some none, -1) else if (fun i i) 1, = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0)input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolh:0 < 0 + 0h2:((clearingCfg cfg bs cs 0 0).workTapeSymbols 2 == some 2) = decide (0 = 0)h3:((clearingCfg cfg bs cs 0 0).workTapeSymbols 3 == some 2) = decide (0 = 0)hm:((clearingCfg cfg bs cs 0 0).workTapeSymbols 2 == some 2 && (clearingCfg cfg bs cs 0 0).workTapeSymbols 3 == some 2) = false(if (fun i i) 2, = 0 (fun i i) 2, = 1 (clearingCfg cfg bs cs 0 0).workTapeSymbols ((fun i i) 2, ) = some 2 then (none, 0) else (some none, -1)) = if (fun i i) 2, = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if (fun i i) 2, = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0)input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Booln✝:h:0 < 0 + (n✝ + 1)h2:((clearingCfg cfg bs cs 0 (n✝ + 1)).workTapeSymbols 2 == some 2) = decide (0 = 0)h3:((clearingCfg cfg bs cs 0 (n✝ + 1)).workTapeSymbols 3 == some 2) = decide (n✝ + 1 = 0)hm:((clearingCfg cfg bs cs 0 (n✝ + 1)).workTapeSymbols 2 == some 2 && (clearingCfg cfg bs cs 0 (n✝ + 1)).workTapeSymbols 3 == some 2) = false(if (fun i i) 2, = 0 (fun i i) 2, = 1 (clearingCfg cfg bs cs 0 (n✝ + 1)).workTapeSymbols ((fun i i) 2, ) = some 2 then (none, 0) else (some none, -1)) = if (fun i i) 2, = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if (fun i i) 2, = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0)input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Booln✝:h:0 < n✝ + 1 + 0h2:((clearingCfg cfg bs cs (n✝ + 1) 0).workTapeSymbols 2 == some 2) = decide (n✝ + 1 = 0)h3:((clearingCfg cfg bs cs (n✝ + 1) 0).workTapeSymbols 3 == some 2) = decide (0 = 0)hm:((clearingCfg cfg bs cs (n✝ + 1) 0).workTapeSymbols 2 == some 2 && (clearingCfg cfg bs cs (n✝ + 1) 0).workTapeSymbols 3 == some 2) = false(if (fun i i) 2, = 0 (fun i i) 2, = 1 (clearingCfg cfg bs cs (n✝ + 1) 0).workTapeSymbols ((fun i i) 2, ) = some 2 then (none, 0) else (some none, -1)) = if (fun i i) 2, = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if (fun i i) 2, = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0)input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Booln✝¹:n✝:h:0 < n✝¹ + 1 + (n✝ + 1)h2:((clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapeSymbols 2 == some 2) = decide (n✝¹ + 1 = 0)h3:((clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapeSymbols 3 == some 2) = decide (n✝ + 1 = 0)hm:((clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapeSymbols 2 == some 2 && (clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapeSymbols 3 == some 2) = false(if (fun i i) 2, = 0 (fun i i) 2, = 1 (clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapeSymbols ((fun i i) 2, ) = some 2 then (none, 0) else (some none, -1)) = if (fun i i) 2, = 2 then if n✝¹ + 1 = 0 then (none, 0) else (some none, -1) else if (fun i i) 2, = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0)input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolh:0 < 0 + 0h2:((clearingCfg cfg bs cs 0 0).workTapeSymbols 2 == some 2) = decide (0 = 0)h3:((clearingCfg cfg bs cs 0 0).workTapeSymbols 3 == some 2) = decide (0 = 0)hm:((clearingCfg cfg bs cs 0 0).workTapeSymbols 2 == some 2 && (clearingCfg cfg bs cs 0 0).workTapeSymbols 3 == some 2) = false(if (fun i i) 3, = 0 (fun i i) 3, = 1 (clearingCfg cfg bs cs 0 0).workTapeSymbols ((fun i i) 3, ) = some 2 then (none, 0) else (some none, -1)) = if (fun i i) 3, = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if (fun i i) 3, = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0)input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Booln✝:h:0 < 0 + (n✝ + 1)h2:((clearingCfg cfg bs cs 0 (n✝ + 1)).workTapeSymbols 2 == some 2) = decide (0 = 0)h3:((clearingCfg cfg bs cs 0 (n✝ + 1)).workTapeSymbols 3 == some 2) = decide (n✝ + 1 = 0)hm:((clearingCfg cfg bs cs 0 (n✝ + 1)).workTapeSymbols 2 == some 2 && (clearingCfg cfg bs cs 0 (n✝ + 1)).workTapeSymbols 3 == some 2) = false(if (fun i i) 3, = 0 (fun i i) 3, = 1 (clearingCfg cfg bs cs 0 (n✝ + 1)).workTapeSymbols ((fun i i) 3, ) = some 2 then (none, 0) else (some none, -1)) = if (fun i i) 3, = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if (fun i i) 3, = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0)input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Booln✝:h:0 < n✝ + 1 + 0h2:((clearingCfg cfg bs cs (n✝ + 1) 0).workTapeSymbols 2 == some 2) = decide (n✝ + 1 = 0)h3:((clearingCfg cfg bs cs (n✝ + 1) 0).workTapeSymbols 3 == some 2) = decide (0 = 0)hm:((clearingCfg cfg bs cs (n✝ + 1) 0).workTapeSymbols 2 == some 2 && (clearingCfg cfg bs cs (n✝ + 1) 0).workTapeSymbols 3 == some 2) = false(if (fun i i) 3, = 0 (fun i i) 3, = 1 (clearingCfg cfg bs cs (n✝ + 1) 0).workTapeSymbols ((fun i i) 3, ) = some 2 then (none, 0) else (some none, -1)) = if (fun i i) 3, = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if (fun i i) 3, = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0)input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Booln✝¹:n✝:h:0 < n✝¹ + 1 + (n✝ + 1)h2:((clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapeSymbols 2 == some 2) = decide (n✝¹ + 1 = 0)h3:((clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapeSymbols 3 == some 2) = decide (n✝ + 1 = 0)hm:((clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapeSymbols 2 == some 2 && (clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapeSymbols 3 == some 2) = false(if (fun i i) 3, = 0 (fun i i) 3, = 1 (clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapeSymbols ((fun i i) 3, ) = some 2 then (none, 0) else (some none, -1)) = if (fun i i) 3, = 2 then if n✝¹ + 1 = 0 then (none, 0) else (some none, -1) else if (fun i i) 3, = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0) All goals completed! 🐙

One erasure transition lowers each positive binary head by one.

theorem step_clearing {input : List (Fin 3)} (cfg : Cfg 4 (Fin 3) Control input) (bs cs : List Bool) (p r : ) (h : 0 < p + r) : machine.step (clearingCfg cfg bs cs p r) = clearingCfg cfg bs cs (p - 1) (r - 1) := input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:h:0 < p + rstep (clearingCfg cfg bs cs p r) = clearingCfg cfg bs cs (p - 1) (r - 1) input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:h:0 < p + r{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs p r).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs p r).workTapes i | some s => Function.update ((clearingCfg cfg bs cs p r).workTapes i) ((clearingCfg cfg bs cs p r).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs p r).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 } = clearingCfg cfg bs cs (p - 1) (r - 1) input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:h:0 < p + r{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs p r).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs p r).workTapes i | some s => Function.update ((clearingCfg cfg bs cs p r).workTapes i) ((clearingCfg cfg bs cs p r).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs p r).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes = (clearingCfg cfg bs cs (p - 1) (r - 1)).workTapesinput:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:h:0 < p + r{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs p r).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs p r).workTapes i | some s => Function.update ((clearingCfg cfg bs cs p r).workTapes i) ((clearingCfg cfg bs cs p r).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs p r).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos = (clearingCfg cfg bs cs (p - 1) (r - 1)).workTapePos input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:h:0 < p + r{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs p r).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs p r).workTapes i | some s => Function.update ((clearingCfg cfg bs cs p r).workTapes i) ((clearingCfg cfg bs cs p r).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs p r).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes = (clearingCfg cfg bs cs (p - 1) (r - 1)).workTapes input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:h:0 < p + ri:Fin 4{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs p r).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs p r).workTapes i | some s => Function.update ((clearingCfg cfg bs cs p r).workTapes i) ((clearingCfg cfg bs cs p r).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs p r).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes i = (clearingCfg cfg bs cs (p - 1) (r - 1)).workTapes i input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:h:0 < p + r{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs p r).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs p r).workTapes i | some s => Function.update ((clearingCfg cfg bs cs p r).workTapes i) ((clearingCfg cfg bs cs p r).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs p r).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes ((fun i i) 0, ) = (clearingCfg cfg bs cs (p - 1) (r - 1)).workTapes ((fun i i) 0, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:h:0 < p + r{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs p r).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs p r).workTapes i | some s => Function.update ((clearingCfg cfg bs cs p r).workTapes i) ((clearingCfg cfg bs cs p r).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs p r).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes ((fun i i) 1, ) = (clearingCfg cfg bs cs (p - 1) (r - 1)).workTapes ((fun i i) 1, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:h:0 < p + r{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs p r).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs p r).workTapes i | some s => Function.update ((clearingCfg cfg bs cs p r).workTapes i) ((clearingCfg cfg bs cs p r).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs p r).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes ((fun i i) 2, ) = (clearingCfg cfg bs cs (p - 1) (r - 1)).workTapes ((fun i i) 2, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:h:0 < p + r{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs p r).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs p r).workTapes i | some s => Function.update ((clearingCfg cfg bs cs p r).workTapes i) ((clearingCfg cfg bs cs p r).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs p r).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes ((fun i i) 3, ) = (clearingCfg cfg bs cs (p - 1) (r - 1)).workTapes ((fun i i) 3, ) input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:h:0 < p + r{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs p r).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs p r).workTapes i | some s => Function.update ((clearingCfg cfg bs cs p r).workTapes i) ((clearingCfg cfg bs cs p r).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs p r).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes ((fun i i) 0, ) = (clearingCfg cfg bs cs (p - 1) (r - 1)).workTapes ((fun i i) 0, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:h:0 < p + r{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs p r).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs p r).workTapes i | some s => Function.update ((clearingCfg cfg bs cs p r).workTapes i) ((clearingCfg cfg bs cs p r).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs p r).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes ((fun i i) 1, ) = (clearingCfg cfg bs cs (p - 1) (r - 1)).workTapes ((fun i i) 1, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:h:0 < p + r{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs p r).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs p r).workTapes i | some s => Function.update ((clearingCfg cfg bs cs p r).workTapes i) ((clearingCfg cfg bs cs p r).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs p r).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes ((fun i i) 2, ) = (clearingCfg cfg bs cs (p - 1) (r - 1)).workTapes ((fun i i) 2, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:h:0 < p + r{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs p r).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs p r).workTapes i | some s => Function.update ((clearingCfg cfg bs cs p r).workTapes i) ((clearingCfg cfg bs cs p r).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs p r).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes ((fun i i) 3, ) = (clearingCfg cfg bs cs (p - 1) (r - 1)).workTapes ((fun i i) 3, ) input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolr:h:0 < 0 + r{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs 0 r).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs 0 r).workTapes i | some s => Function.update ((clearingCfg cfg bs cs 0 r).workTapes i) ((clearingCfg cfg bs cs 0 r).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs 0 r).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes ((fun i i) 3, ) = (clearingCfg cfg bs cs (0 - 1) (r - 1)).workTapes ((fun i i) 3, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolr:n✝:h:0 < n✝ + 1 + r{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs (n✝ + 1) r).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs (n✝ + 1) r).workTapes i | some s => Function.update ((clearingCfg cfg bs cs (n✝ + 1) r).workTapes i) ((clearingCfg cfg bs cs (n✝ + 1) r).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs (n✝ + 1) r).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes ((fun i i) 3, ) = (clearingCfg cfg bs cs (n✝ + 1 - 1) (r - 1)).workTapes ((fun i i) 3, ) input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolr:h:0 < 0 + r{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs 0 r).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs 0 r).workTapes i | some s => Function.update ((clearingCfg cfg bs cs 0 r).workTapes i) ((clearingCfg cfg bs cs 0 r).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs 0 r).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes ((fun i i) 0, ) = (clearingCfg cfg bs cs (0 - 1) (r - 1)).workTapes ((fun i i) 0, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolr:n✝:h:0 < n✝ + 1 + r{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs (n✝ + 1) r).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs (n✝ + 1) r).workTapes i | some s => Function.update ((clearingCfg cfg bs cs (n✝ + 1) r).workTapes i) ((clearingCfg cfg bs cs (n✝ + 1) r).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs (n✝ + 1) r).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes ((fun i i) 0, ) = (clearingCfg cfg bs cs (n✝ + 1 - 1) (r - 1)).workTapes ((fun i i) 0, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolr:h:0 < 0 + r{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs 0 r).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs 0 r).workTapes i | some s => Function.update ((clearingCfg cfg bs cs 0 r).workTapes i) ((clearingCfg cfg bs cs 0 r).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs 0 r).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes ((fun i i) 1, ) = (clearingCfg cfg bs cs (0 - 1) (r - 1)).workTapes ((fun i i) 1, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolr:n✝:h:0 < n✝ + 1 + r{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs (n✝ + 1) r).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs (n✝ + 1) r).workTapes i | some s => Function.update ((clearingCfg cfg bs cs (n✝ + 1) r).workTapes i) ((clearingCfg cfg bs cs (n✝ + 1) r).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs (n✝ + 1) r).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes ((fun i i) 1, ) = (clearingCfg cfg bs cs (n✝ + 1 - 1) (r - 1)).workTapes ((fun i i) 1, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolr:h:0 < 0 + r{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs 0 r).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs 0 r).workTapes i | some s => Function.update ((clearingCfg cfg bs cs 0 r).workTapes i) ((clearingCfg cfg bs cs 0 r).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs 0 r).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes ((fun i i) 2, ) = (clearingCfg cfg bs cs (0 - 1) (r - 1)).workTapes ((fun i i) 2, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolr:n✝:h:0 < n✝ + 1 + r{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs (n✝ + 1) r).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs (n✝ + 1) r).workTapes i | some s => Function.update ((clearingCfg cfg bs cs (n✝ + 1) r).workTapes i) ((clearingCfg cfg bs cs (n✝ + 1) r).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs (n✝ + 1) r).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes ((fun i i) 2, ) = (clearingCfg cfg bs cs (n✝ + 1 - 1) (r - 1)).workTapes ((fun i i) 2, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolr:h:0 < 0 + r{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs 0 r).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs 0 r).workTapes i | some s => Function.update ((clearingCfg cfg bs cs 0 r).workTapes i) ((clearingCfg cfg bs cs 0 r).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs 0 r).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes ((fun i i) 3, ) = (clearingCfg cfg bs cs (0 - 1) (r - 1)).workTapes ((fun i i) 3, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolr:n✝:h:0 < n✝ + 1 + r{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs (n✝ + 1) r).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs (n✝ + 1) r).workTapes i | some s => Function.update ((clearingCfg cfg bs cs (n✝ + 1) r).workTapes i) ((clearingCfg cfg bs cs (n✝ + 1) r).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs (n✝ + 1) r).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes ((fun i i) 3, ) = (clearingCfg cfg bs cs (n✝ + 1 - 1) (r - 1)).workTapes ((fun i i) 3, ) input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Booln✝:h:0 < n✝ + 1 + 0{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs (n✝ + 1) 0).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs (n✝ + 1) 0).workTapes i | some s => Function.update ((clearingCfg cfg bs cs (n✝ + 1) 0).workTapes i) ((clearingCfg cfg bs cs (n✝ + 1) 0).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs (n✝ + 1) 0).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes ((fun i i) 3, ) = (clearingCfg cfg bs cs (n✝ + 1 - 1) (0 - 1)).workTapes ((fun i i) 3, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Booln✝¹:n✝:h:0 < n✝¹ + 1 + (n✝ + 1){ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝¹ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝¹ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝¹ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapes i | some s => Function.update ((clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapes i) ((clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝¹ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes ((fun i i) 3, ) = (clearingCfg cfg bs cs (n✝¹ + 1 - 1) (n✝ + 1 - 1)).workTapes ((fun i i) 3, ) input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolh:0 < 0 + 0{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs 0 0).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs 0 0).workTapes i | some s => Function.update ((clearingCfg cfg bs cs 0 0).workTapes i) ((clearingCfg cfg bs cs 0 0).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs 0 0).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes ((fun i i) 0, ) = (clearingCfg cfg bs cs (0 - 1) (0 - 1)).workTapes ((fun i i) 0, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Booln✝:h:0 < 0 + (n✝ + 1){ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs 0 (n✝ + 1)).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs 0 (n✝ + 1)).workTapes i | some s => Function.update ((clearingCfg cfg bs cs 0 (n✝ + 1)).workTapes i) ((clearingCfg cfg bs cs 0 (n✝ + 1)).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs 0 (n✝ + 1)).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes ((fun i i) 0, ) = (clearingCfg cfg bs cs (0 - 1) (n✝ + 1 - 1)).workTapes ((fun i i) 0, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Booln✝:h:0 < n✝ + 1 + 0{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs (n✝ + 1) 0).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs (n✝ + 1) 0).workTapes i | some s => Function.update ((clearingCfg cfg bs cs (n✝ + 1) 0).workTapes i) ((clearingCfg cfg bs cs (n✝ + 1) 0).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs (n✝ + 1) 0).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes ((fun i i) 0, ) = (clearingCfg cfg bs cs (n✝ + 1 - 1) (0 - 1)).workTapes ((fun i i) 0, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Booln✝¹:n✝:h:0 < n✝¹ + 1 + (n✝ + 1){ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝¹ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝¹ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝¹ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapes i | some s => Function.update ((clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapes i) ((clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝¹ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes ((fun i i) 0, ) = (clearingCfg cfg bs cs (n✝¹ + 1 - 1) (n✝ + 1 - 1)).workTapes ((fun i i) 0, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolh:0 < 0 + 0{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs 0 0).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs 0 0).workTapes i | some s => Function.update ((clearingCfg cfg bs cs 0 0).workTapes i) ((clearingCfg cfg bs cs 0 0).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs 0 0).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes ((fun i i) 1, ) = (clearingCfg cfg bs cs (0 - 1) (0 - 1)).workTapes ((fun i i) 1, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Booln✝:h:0 < 0 + (n✝ + 1){ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs 0 (n✝ + 1)).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs 0 (n✝ + 1)).workTapes i | some s => Function.update ((clearingCfg cfg bs cs 0 (n✝ + 1)).workTapes i) ((clearingCfg cfg bs cs 0 (n✝ + 1)).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs 0 (n✝ + 1)).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes ((fun i i) 1, ) = (clearingCfg cfg bs cs (0 - 1) (n✝ + 1 - 1)).workTapes ((fun i i) 1, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Booln✝:h:0 < n✝ + 1 + 0{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs (n✝ + 1) 0).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs (n✝ + 1) 0).workTapes i | some s => Function.update ((clearingCfg cfg bs cs (n✝ + 1) 0).workTapes i) ((clearingCfg cfg bs cs (n✝ + 1) 0).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs (n✝ + 1) 0).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes ((fun i i) 1, ) = (clearingCfg cfg bs cs (n✝ + 1 - 1) (0 - 1)).workTapes ((fun i i) 1, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Booln✝¹:n✝:h:0 < n✝¹ + 1 + (n✝ + 1){ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝¹ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝¹ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝¹ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapes i | some s => Function.update ((clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapes i) ((clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝¹ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes ((fun i i) 1, ) = (clearingCfg cfg bs cs (n✝¹ + 1 - 1) (n✝ + 1 - 1)).workTapes ((fun i i) 1, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolh:0 < 0 + 0{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs 0 0).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs 0 0).workTapes i | some s => Function.update ((clearingCfg cfg bs cs 0 0).workTapes i) ((clearingCfg cfg bs cs 0 0).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs 0 0).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes ((fun i i) 2, ) = (clearingCfg cfg bs cs (0 - 1) (0 - 1)).workTapes ((fun i i) 2, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Booln✝:h:0 < 0 + (n✝ + 1){ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs 0 (n✝ + 1)).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs 0 (n✝ + 1)).workTapes i | some s => Function.update ((clearingCfg cfg bs cs 0 (n✝ + 1)).workTapes i) ((clearingCfg cfg bs cs 0 (n✝ + 1)).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs 0 (n✝ + 1)).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes ((fun i i) 2, ) = (clearingCfg cfg bs cs (0 - 1) (n✝ + 1 - 1)).workTapes ((fun i i) 2, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Booln✝:h:0 < n✝ + 1 + 0{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs (n✝ + 1) 0).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs (n✝ + 1) 0).workTapes i | some s => Function.update ((clearingCfg cfg bs cs (n✝ + 1) 0).workTapes i) ((clearingCfg cfg bs cs (n✝ + 1) 0).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs (n✝ + 1) 0).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes ((fun i i) 2, ) = (clearingCfg cfg bs cs (n✝ + 1 - 1) (0 - 1)).workTapes ((fun i i) 2, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Booln✝¹:n✝:h:0 < n✝¹ + 1 + (n✝ + 1){ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝¹ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝¹ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝¹ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapes i | some s => Function.update ((clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapes i) ((clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝¹ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes ((fun i i) 2, ) = (clearingCfg cfg bs cs (n✝¹ + 1 - 1) (n✝ + 1 - 1)).workTapes ((fun i i) 2, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolh:0 < 0 + 0{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs 0 0).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs 0 0).workTapes i | some s => Function.update ((clearingCfg cfg bs cs 0 0).workTapes i) ((clearingCfg cfg bs cs 0 0).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs 0 0).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes ((fun i i) 3, ) = (clearingCfg cfg bs cs (0 - 1) (0 - 1)).workTapes ((fun i i) 3, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Booln✝:h:0 < 0 + (n✝ + 1){ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs 0 (n✝ + 1)).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs 0 (n✝ + 1)).workTapes i | some s => Function.update ((clearingCfg cfg bs cs 0 (n✝ + 1)).workTapes i) ((clearingCfg cfg bs cs 0 (n✝ + 1)).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs 0 (n✝ + 1)).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes ((fun i i) 3, ) = (clearingCfg cfg bs cs (0 - 1) (n✝ + 1 - 1)).workTapes ((fun i i) 3, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Booln✝:h:0 < n✝ + 1 + 0{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs (n✝ + 1) 0).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs (n✝ + 1) 0).workTapes i | some s => Function.update ((clearingCfg cfg bs cs (n✝ + 1) 0).workTapes i) ((clearingCfg cfg bs cs (n✝ + 1) 0).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs (n✝ + 1) 0).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes ((fun i i) 3, ) = (clearingCfg cfg bs cs (n✝ + 1 - 1) (0 - 1)).workTapes ((fun i i) 3, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Booln✝¹:n✝:h:0 < n✝¹ + 1 + (n✝ + 1){ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝¹ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝¹ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝¹ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapes i | some s => Function.update ((clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapes i) ((clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝¹ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes ((fun i i) 3, ) = (clearingCfg cfg bs cs (n✝¹ + 1 - 1) (n✝ + 1 - 1)).workTapes ((fun i i) 3, ) input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Booln✝¹:n✝:h:0 < n✝¹ + 1 + (n✝ + 1)Function.update (prefixTape cs (n✝ + 1)) (↑(n✝ + 1)) none = prefixTape cs n✝ input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Booln✝:h:0 < n✝ + 1 + 0Function.update (prefixTape bs (n✝ + 1)) (↑(n✝ + 1)) none = prefixTape bs n✝input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Booln✝¹:n✝:h:0 < n✝¹ + 1 + (n✝ + 1)Function.update (prefixTape bs (n✝ + 1)) (↑(n✝ + 1)) none = prefixTape bs n✝input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Booln✝:h:0 < 0 + (n✝ + 1)Function.update (prefixTape cs (n✝ + 1)) (↑(n✝ + 1)) none = prefixTape cs n✝input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Booln✝¹:n✝:h:0 < n✝¹ + 1 + (n✝ + 1)Function.update (prefixTape cs (n✝ + 1)) (↑(n✝ + 1)) none = prefixTape cs n✝ first | input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Booln✝¹:n✝:h:0 < n✝¹ + 1 + (n✝ + 1)Function.update (prefixTape cs (n✝ + 1)) (↑(n✝ + 1)) none = prefixTape cs n✝ | All goals completed! 🐙 input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:h:0 < p + r{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs p r).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs p r).workTapes i | some s => Function.update ((clearingCfg cfg bs cs p r).workTapes i) ((clearingCfg cfg bs cs p r).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs p r).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos = (clearingCfg cfg bs cs (p - 1) (r - 1)).workTapePos input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:h:0 < p + ri:Fin 4{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs p r).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs p r).workTapes i | some s => Function.update ((clearingCfg cfg bs cs p r).workTapes i) ((clearingCfg cfg bs cs p r).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs p r).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos i = (clearingCfg cfg bs cs (p - 1) (r - 1)).workTapePos i input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:h:0 < p + r{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs p r).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs p r).workTapes i | some s => Function.update ((clearingCfg cfg bs cs p r).workTapes i) ((clearingCfg cfg bs cs p r).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs p r).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos ((fun i i) 0, ) = (clearingCfg cfg bs cs (p - 1) (r - 1)).workTapePos ((fun i i) 0, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:h:0 < p + r{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs p r).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs p r).workTapes i | some s => Function.update ((clearingCfg cfg bs cs p r).workTapes i) ((clearingCfg cfg bs cs p r).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs p r).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos ((fun i i) 1, ) = (clearingCfg cfg bs cs (p - 1) (r - 1)).workTapePos ((fun i i) 1, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:h:0 < p + r{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs p r).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs p r).workTapes i | some s => Function.update ((clearingCfg cfg bs cs p r).workTapes i) ((clearingCfg cfg bs cs p r).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs p r).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos ((fun i i) 2, ) = (clearingCfg cfg bs cs (p - 1) (r - 1)).workTapePos ((fun i i) 2, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:h:0 < p + r{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs p r).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs p r).workTapes i | some s => Function.update ((clearingCfg cfg bs cs p r).workTapes i) ((clearingCfg cfg bs cs p r).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs p r).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos ((fun i i) 3, ) = (clearingCfg cfg bs cs (p - 1) (r - 1)).workTapePos ((fun i i) 3, ) input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:h:0 < p + r{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs p r).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs p r).workTapes i | some s => Function.update ((clearingCfg cfg bs cs p r).workTapes i) ((clearingCfg cfg bs cs p r).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs p r).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos ((fun i i) 0, ) = (clearingCfg cfg bs cs (p - 1) (r - 1)).workTapePos ((fun i i) 0, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:h:0 < p + r{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs p r).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs p r).workTapes i | some s => Function.update ((clearingCfg cfg bs cs p r).workTapes i) ((clearingCfg cfg bs cs p r).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs p r).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos ((fun i i) 1, ) = (clearingCfg cfg bs cs (p - 1) (r - 1)).workTapePos ((fun i i) 1, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:h:0 < p + r{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs p r).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs p r).workTapes i | some s => Function.update ((clearingCfg cfg bs cs p r).workTapes i) ((clearingCfg cfg bs cs p r).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs p r).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos ((fun i i) 2, ) = (clearingCfg cfg bs cs (p - 1) (r - 1)).workTapePos ((fun i i) 2, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:h:0 < p + r{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs p r).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs p r).workTapes i | some s => Function.update ((clearingCfg cfg bs cs p r).workTapes i) ((clearingCfg cfg bs cs p r).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs p r).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos ((fun i i) 3, ) = (clearingCfg cfg bs cs (p - 1) (r - 1)).workTapePos ((fun i i) 3, ) input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolr:h:0 < 0 + r{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs 0 r).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs 0 r).workTapes i | some s => Function.update ((clearingCfg cfg bs cs 0 r).workTapes i) ((clearingCfg cfg bs cs 0 r).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs 0 r).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos ((fun i i) 3, ) = (clearingCfg cfg bs cs (0 - 1) (r - 1)).workTapePos ((fun i i) 3, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolr:n✝:h:0 < n✝ + 1 + r{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs (n✝ + 1) r).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs (n✝ + 1) r).workTapes i | some s => Function.update ((clearingCfg cfg bs cs (n✝ + 1) r).workTapes i) ((clearingCfg cfg bs cs (n✝ + 1) r).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs (n✝ + 1) r).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos ((fun i i) 3, ) = (clearingCfg cfg bs cs (n✝ + 1 - 1) (r - 1)).workTapePos ((fun i i) 3, ) input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolr:h:0 < 0 + r{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs 0 r).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs 0 r).workTapes i | some s => Function.update ((clearingCfg cfg bs cs 0 r).workTapes i) ((clearingCfg cfg bs cs 0 r).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs 0 r).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos ((fun i i) 0, ) = (clearingCfg cfg bs cs (0 - 1) (r - 1)).workTapePos ((fun i i) 0, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolr:n✝:h:0 < n✝ + 1 + r{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs (n✝ + 1) r).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs (n✝ + 1) r).workTapes i | some s => Function.update ((clearingCfg cfg bs cs (n✝ + 1) r).workTapes i) ((clearingCfg cfg bs cs (n✝ + 1) r).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs (n✝ + 1) r).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos ((fun i i) 0, ) = (clearingCfg cfg bs cs (n✝ + 1 - 1) (r - 1)).workTapePos ((fun i i) 0, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolr:h:0 < 0 + r{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs 0 r).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs 0 r).workTapes i | some s => Function.update ((clearingCfg cfg bs cs 0 r).workTapes i) ((clearingCfg cfg bs cs 0 r).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs 0 r).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos ((fun i i) 1, ) = (clearingCfg cfg bs cs (0 - 1) (r - 1)).workTapePos ((fun i i) 1, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolr:n✝:h:0 < n✝ + 1 + r{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs (n✝ + 1) r).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs (n✝ + 1) r).workTapes i | some s => Function.update ((clearingCfg cfg bs cs (n✝ + 1) r).workTapes i) ((clearingCfg cfg bs cs (n✝ + 1) r).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs (n✝ + 1) r).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos ((fun i i) 1, ) = (clearingCfg cfg bs cs (n✝ + 1 - 1) (r - 1)).workTapePos ((fun i i) 1, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolr:h:0 < 0 + r{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs 0 r).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs 0 r).workTapes i | some s => Function.update ((clearingCfg cfg bs cs 0 r).workTapes i) ((clearingCfg cfg bs cs 0 r).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs 0 r).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos ((fun i i) 2, ) = (clearingCfg cfg bs cs (0 - 1) (r - 1)).workTapePos ((fun i i) 2, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolr:n✝:h:0 < n✝ + 1 + r{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs (n✝ + 1) r).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs (n✝ + 1) r).workTapes i | some s => Function.update ((clearingCfg cfg bs cs (n✝ + 1) r).workTapes i) ((clearingCfg cfg bs cs (n✝ + 1) r).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs (n✝ + 1) r).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos ((fun i i) 2, ) = (clearingCfg cfg bs cs (n✝ + 1 - 1) (r - 1)).workTapePos ((fun i i) 2, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolr:h:0 < 0 + r{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs 0 r).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs 0 r).workTapes i | some s => Function.update ((clearingCfg cfg bs cs 0 r).workTapes i) ((clearingCfg cfg bs cs 0 r).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs 0 r).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos ((fun i i) 3, ) = (clearingCfg cfg bs cs (0 - 1) (r - 1)).workTapePos ((fun i i) 3, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolr:n✝:h:0 < n✝ + 1 + r{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs (n✝ + 1) r).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs (n✝ + 1) r).workTapes i | some s => Function.update ((clearingCfg cfg bs cs (n✝ + 1) r).workTapes i) ((clearingCfg cfg bs cs (n✝ + 1) r).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs (n✝ + 1) r).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos ((fun i i) 3, ) = (clearingCfg cfg bs cs (n✝ + 1 - 1) (r - 1)).workTapePos ((fun i i) 3, ) input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Booln✝:h:0 < n✝ + 1 + 0{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs (n✝ + 1) 0).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs (n✝ + 1) 0).workTapes i | some s => Function.update ((clearingCfg cfg bs cs (n✝ + 1) 0).workTapes i) ((clearingCfg cfg bs cs (n✝ + 1) 0).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs (n✝ + 1) 0).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos ((fun i i) 3, ) = (clearingCfg cfg bs cs (n✝ + 1 - 1) (0 - 1)).workTapePos ((fun i i) 3, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Booln✝¹:n✝:h:0 < n✝¹ + 1 + (n✝ + 1){ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝¹ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝¹ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝¹ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapes i | some s => Function.update ((clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapes i) ((clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝¹ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos ((fun i i) 3, ) = (clearingCfg cfg bs cs (n✝¹ + 1 - 1) (n✝ + 1 - 1)).workTapePos ((fun i i) 3, ) input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolh:0 < 0 + 0{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs 0 0).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs 0 0).workTapes i | some s => Function.update ((clearingCfg cfg bs cs 0 0).workTapes i) ((clearingCfg cfg bs cs 0 0).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs 0 0).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos ((fun i i) 0, ) = (clearingCfg cfg bs cs (0 - 1) (0 - 1)).workTapePos ((fun i i) 0, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Booln✝:h:0 < 0 + (n✝ + 1){ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs 0 (n✝ + 1)).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs 0 (n✝ + 1)).workTapes i | some s => Function.update ((clearingCfg cfg bs cs 0 (n✝ + 1)).workTapes i) ((clearingCfg cfg bs cs 0 (n✝ + 1)).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs 0 (n✝ + 1)).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos ((fun i i) 0, ) = (clearingCfg cfg bs cs (0 - 1) (n✝ + 1 - 1)).workTapePos ((fun i i) 0, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Booln✝:h:0 < n✝ + 1 + 0{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs (n✝ + 1) 0).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs (n✝ + 1) 0).workTapes i | some s => Function.update ((clearingCfg cfg bs cs (n✝ + 1) 0).workTapes i) ((clearingCfg cfg bs cs (n✝ + 1) 0).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs (n✝ + 1) 0).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos ((fun i i) 0, ) = (clearingCfg cfg bs cs (n✝ + 1 - 1) (0 - 1)).workTapePos ((fun i i) 0, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Booln✝¹:n✝:h:0 < n✝¹ + 1 + (n✝ + 1){ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝¹ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝¹ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝¹ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapes i | some s => Function.update ((clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapes i) ((clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝¹ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos ((fun i i) 0, ) = (clearingCfg cfg bs cs (n✝¹ + 1 - 1) (n✝ + 1 - 1)).workTapePos ((fun i i) 0, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolh:0 < 0 + 0{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs 0 0).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs 0 0).workTapes i | some s => Function.update ((clearingCfg cfg bs cs 0 0).workTapes i) ((clearingCfg cfg bs cs 0 0).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs 0 0).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos ((fun i i) 1, ) = (clearingCfg cfg bs cs (0 - 1) (0 - 1)).workTapePos ((fun i i) 1, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Booln✝:h:0 < 0 + (n✝ + 1){ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs 0 (n✝ + 1)).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs 0 (n✝ + 1)).workTapes i | some s => Function.update ((clearingCfg cfg bs cs 0 (n✝ + 1)).workTapes i) ((clearingCfg cfg bs cs 0 (n✝ + 1)).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs 0 (n✝ + 1)).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos ((fun i i) 1, ) = (clearingCfg cfg bs cs (0 - 1) (n✝ + 1 - 1)).workTapePos ((fun i i) 1, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Booln✝:h:0 < n✝ + 1 + 0{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs (n✝ + 1) 0).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs (n✝ + 1) 0).workTapes i | some s => Function.update ((clearingCfg cfg bs cs (n✝ + 1) 0).workTapes i) ((clearingCfg cfg bs cs (n✝ + 1) 0).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs (n✝ + 1) 0).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos ((fun i i) 1, ) = (clearingCfg cfg bs cs (n✝ + 1 - 1) (0 - 1)).workTapePos ((fun i i) 1, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Booln✝¹:n✝:h:0 < n✝¹ + 1 + (n✝ + 1){ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝¹ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝¹ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝¹ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapes i | some s => Function.update ((clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapes i) ((clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝¹ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos ((fun i i) 1, ) = (clearingCfg cfg bs cs (n✝¹ + 1 - 1) (n✝ + 1 - 1)).workTapePos ((fun i i) 1, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolh:0 < 0 + 0{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs 0 0).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs 0 0).workTapes i | some s => Function.update ((clearingCfg cfg bs cs 0 0).workTapes i) ((clearingCfg cfg bs cs 0 0).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs 0 0).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos ((fun i i) 2, ) = (clearingCfg cfg bs cs (0 - 1) (0 - 1)).workTapePos ((fun i i) 2, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Booln✝:h:0 < 0 + (n✝ + 1){ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs 0 (n✝ + 1)).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs 0 (n✝ + 1)).workTapes i | some s => Function.update ((clearingCfg cfg bs cs 0 (n✝ + 1)).workTapes i) ((clearingCfg cfg bs cs 0 (n✝ + 1)).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs 0 (n✝ + 1)).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos ((fun i i) 2, ) = (clearingCfg cfg bs cs (0 - 1) (n✝ + 1 - 1)).workTapePos ((fun i i) 2, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Booln✝:h:0 < n✝ + 1 + 0{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs (n✝ + 1) 0).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs (n✝ + 1) 0).workTapes i | some s => Function.update ((clearingCfg cfg bs cs (n✝ + 1) 0).workTapes i) ((clearingCfg cfg bs cs (n✝ + 1) 0).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs (n✝ + 1) 0).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos ((fun i i) 2, ) = (clearingCfg cfg bs cs (n✝ + 1 - 1) (0 - 1)).workTapePos ((fun i i) 2, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Booln✝¹:n✝:h:0 < n✝¹ + 1 + (n✝ + 1){ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝¹ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝¹ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝¹ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapes i | some s => Function.update ((clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapes i) ((clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝¹ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos ((fun i i) 2, ) = (clearingCfg cfg bs cs (n✝¹ + 1 - 1) (n✝ + 1 - 1)).workTapePos ((fun i i) 2, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolh:0 < 0 + 0{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs 0 0).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs 0 0).workTapes i | some s => Function.update ((clearingCfg cfg bs cs 0 0).workTapes i) ((clearingCfg cfg bs cs 0 0).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs 0 0).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos ((fun i i) 3, ) = (clearingCfg cfg bs cs (0 - 1) (0 - 1)).workTapePos ((fun i i) 3, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Booln✝:h:0 < 0 + (n✝ + 1){ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs 0 (n✝ + 1)).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs 0 (n✝ + 1)).workTapes i | some s => Function.update ((clearingCfg cfg bs cs 0 (n✝ + 1)).workTapes i) ((clearingCfg cfg bs cs 0 (n✝ + 1)).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs 0 (n✝ + 1)).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if 0 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos ((fun i i) 3, ) = (clearingCfg cfg bs cs (0 - 1) (n✝ + 1 - 1)).workTapePos ((fun i i) 3, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Booln✝:h:0 < n✝ + 1 + 0{ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs (n✝ + 1) 0).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs (n✝ + 1) 0).workTapes i | some s => Function.update ((clearingCfg cfg bs cs (n✝ + 1) 0).workTapes i) ((clearingCfg cfg bs cs (n✝ + 1) 0).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs (n✝ + 1) 0).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if 0 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos ((fun i i) 3, ) = (clearingCfg cfg bs cs (n✝ + 1 - 1) (0 - 1)).workTapePos ((fun i i) 3, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Booln✝¹:n✝:h:0 < n✝¹ + 1 + (n✝ + 1){ state := (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝¹ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).inputPos (have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝¹ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝¹ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapes i | some s => Function.update ((clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapes i) ((clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs (n✝¹ + 1) (n✝ + 1)).workTapePos i + ((have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if n✝¹ + 1 = 0 then (none, 0) else (some none, -1) else if i = 3 then if n✝ + 1 = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos ((fun i i) 3, ) = (clearingCfg cfg bs cs (n✝¹ + 1 - 1) (n✝ + 1 - 1)).workTapePos ((fun i i) 3, ) All goals completed! 🐙

Erasing a cell emits nothing.

theorem outputSymbol_clearing {input : List (Fin 3)} (cfg : Cfg 4 (Fin 3) Control input) (bs cs : List Bool) (p r : ) (h : 0 < p + r) : machine.outputSymbol (clearingCfg cfg bs cs p r) = none := input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:h:0 < p + routputSymbol (clearingCfg cfg bs cs p r) = none input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:h:0 < p + r(machine.tr stClear (clearingCfg cfg bs cs p r).inputSymbol (clearingCfg cfg bs cs p r).workTapeSymbols).outS = none input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:h:0 < p + r(have __src := jump stClear; { inputMove := __src.inputMove, workActions := fun i if i = 2 then if p = 0 then (none, 0) else (some none, -1) else if i = 3 then if r = 0 then (none, 0) else (some none, -1) else (none, 0), outS := __src.outS, q' := __src.q' }).outS = none All goals completed! 🐙

At every erasure step the heads are their initial positions minus elapsed time.

theorem configs_clearing {input : List (Fin 3)} (cfg : Cfg 4 (Fin 3) Control input) (bs cs : List Bool) (p r t : ) (ht : t max p r) : machine.configs (clearingCfg cfg bs cs p r) t = clearingCfg cfg bs cs (p - t) (r - t) machine.outputString (clearingCfg cfg bs cs p r) t = [] := input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:t:ht:t max p rconfigs (clearingCfg cfg bs cs p r) t = clearingCfg cfg bs cs (p - t) (r - t) machine.outputString (clearingCfg cfg bs cs p r) t = [] input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:t:t max p r configs (clearingCfg cfg bs cs p r) t = clearingCfg cfg bs cs (p - t) (r - t) machine.outputString (clearingCfg cfg bs cs p r) t = [] input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:t:Nat.zero max p r configs (clearingCfg cfg bs cs p r) Nat.zero = clearingCfg cfg bs cs (p - Nat.zero) (r - Nat.zero) machine.outputString (clearingCfg cfg bs cs p r) Nat.zero = []input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:t: (n : ), (n max p r configs (clearingCfg cfg bs cs p r) n = clearingCfg cfg bs cs (p - n) (r - n) machine.outputString (clearingCfg cfg bs cs p r) n = []) n.succ max p r configs (clearingCfg cfg bs cs p r) n.succ = clearingCfg cfg bs cs (p - n.succ) (r - n.succ) machine.outputString (clearingCfg cfg bs cs p r) n.succ = [] input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:t:Nat.zero max p r configs (clearingCfg cfg bs cs p r) Nat.zero = clearingCfg cfg bs cs (p - Nat.zero) (r - Nat.zero) machine.outputString (clearingCfg cfg bs cs p r) Nat.zero = [] input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:t:a✝:Nat.zero max p rconfigs (clearingCfg cfg bs cs p r) Nat.zero = clearingCfg cfg bs cs (p - Nat.zero) (r - Nat.zero) machine.outputString (clearingCfg cfg bs cs p r) Nat.zero = [] All goals completed! 🐙 input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:t: (n : ), (n max p r configs (clearingCfg cfg bs cs p r) n = clearingCfg cfg bs cs (p - n) (r - n) machine.outputString (clearingCfg cfg bs cs p r) n = []) n.succ max p r configs (clearingCfg cfg bs cs p r) n.succ = clearingCfg cfg bs cs (p - n.succ) (r - n.succ) machine.outputString (clearingCfg cfg bs cs p r) n.succ = [] input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:t✝:t:ih:t max p r configs (clearingCfg cfg bs cs p r) t = clearingCfg cfg bs cs (p - t) (r - t) machine.outputString (clearingCfg cfg bs cs p r) t = []ht:t.succ max p rconfigs (clearingCfg cfg bs cs p r) t.succ = clearingCfg cfg bs cs (p - t.succ) (r - t.succ) machine.outputString (clearingCfg cfg bs cs p r) t.succ = [] input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:t✝:t:ih:t max p r configs (clearingCfg cfg bs cs p r) t = clearingCfg cfg bs cs (p - t) (r - t) machine.outputString (clearingCfg cfg bs cs p r) t = []ht:t.succ max p rhc:configs (clearingCfg cfg bs cs p r) t = clearingCfg cfg bs cs (p - t) (r - t)hout:machine.outputString (clearingCfg cfg bs cs p r) t = []configs (clearingCfg cfg bs cs p r) t.succ = clearingCfg cfg bs cs (p - t.succ) (r - t.succ) machine.outputString (clearingCfg cfg bs cs p r) t.succ = [] input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:t✝:t:ih:t max p r configs (clearingCfg cfg bs cs p r) t = clearingCfg cfg bs cs (p - t) (r - t) machine.outputString (clearingCfg cfg bs cs p r) t = []ht:t.succ max p rhc:configs (clearingCfg cfg bs cs p r) t = clearingCfg cfg bs cs (p - t) (r - t)hout:machine.outputString (clearingCfg cfg bs cs p r) t = []hp:0 < p - t + (r - t)configs (clearingCfg cfg bs cs p r) t.succ = clearingCfg cfg bs cs (p - t.succ) (r - t.succ) machine.outputString (clearingCfg cfg bs cs p r) t.succ = [] input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:t✝:t:ih:t max p r configs (clearingCfg cfg bs cs p r) t = clearingCfg cfg bs cs (p - t) (r - t) machine.outputString (clearingCfg cfg bs cs p r) t = []ht:t.succ max p rhc:configs (clearingCfg cfg bs cs p r) t = clearingCfg cfg bs cs (p - t) (r - t)hout:machine.outputString (clearingCfg cfg bs cs p r) t = []hp:0 < p - t + (r - t)configs (clearingCfg cfg bs cs p r) t.succ = clearingCfg cfg bs cs (p - t.succ) (r - t.succ)input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:t✝:t:ih:t max p r configs (clearingCfg cfg bs cs p r) t = clearingCfg cfg bs cs (p - t) (r - t) machine.outputString (clearingCfg cfg bs cs p r) t = []ht:t.succ max p rhc:configs (clearingCfg cfg bs cs p r) t = clearingCfg cfg bs cs (p - t) (r - t)hout:machine.outputString (clearingCfg cfg bs cs p r) t = []hp:0 < p - t + (r - t)machine.outputString (clearingCfg cfg bs cs p r) t.succ = [] input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:t✝:t:ih:t max p r configs (clearingCfg cfg bs cs p r) t = clearingCfg cfg bs cs (p - t) (r - t) machine.outputString (clearingCfg cfg bs cs p r) t = []ht:t.succ max p rhc:configs (clearingCfg cfg bs cs p r) t = clearingCfg cfg bs cs (p - t) (r - t)hout:machine.outputString (clearingCfg cfg bs cs p r) t = []hp:0 < p - t + (r - t)configs (clearingCfg cfg bs cs p r) t.succ = clearingCfg cfg bs cs (p - t.succ) (r - t.succ) input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:t✝:t:ih:t max p r configs (clearingCfg cfg bs cs p r) t = clearingCfg cfg bs cs (p - t) (r - t) machine.outputString (clearingCfg cfg bs cs p r) t = []ht:t.succ max p rhc:configs (clearingCfg cfg bs cs p r) t = clearingCfg cfg bs cs (p - t) (r - t)hout:machine.outputString (clearingCfg cfg bs cs p r) t = []hp:0 < p - t + (r - t)clearingCfg cfg bs cs (p - t - 1) (r - t - 1) = clearingCfg cfg bs cs (p - t.succ) (r - t.succ) All goals completed! 🐙 input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:t✝:t:ih:t max p r configs (clearingCfg cfg bs cs p r) t = clearingCfg cfg bs cs (p - t) (r - t) machine.outputString (clearingCfg cfg bs cs p r) t = []ht:t.succ max p rhc:configs (clearingCfg cfg bs cs p r) t = clearingCfg cfg bs cs (p - t) (r - t)hout:machine.outputString (clearingCfg cfg bs cs p r) t = []hp:0 < p - t + (r - t)machine.outputString (clearingCfg cfg bs cs p r) t.succ = [] input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:t✝:t:ih:t max p r configs (clearingCfg cfg bs cs p r) t = clearingCfg cfg bs cs (p - t) (r - t) machine.outputString (clearingCfg cfg bs cs p r) t = []ht:t.succ max p rhc:configs (clearingCfg cfg bs cs p r) t = clearingCfg cfg bs cs (p - t) (r - t)hout:machine.outputString (clearingCfg cfg bs cs p r) t = []hp:0 < p - t + (r - t)[] ++ none.toList = [] All goals completed! 🐙

Once both origins are reached, cleanup resets the heads and decrements pending trees.

theorem step_clearing_zero {input : List (Fin 3)} (cfg : Cfg 4 (Fin 3) Control input) (bs cs : List Bool) : machine.step (clearingCfg cfg bs cs 0 0) = clearedCfg cfg := input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolstep (clearingCfg cfg bs cs 0 0) = clearedCfg cfg input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolht:machine.tr stClear (clearingCfg cfg bs cs 0 0).inputSymbol (clearingCfg cfg bs cs 0 0).workTapeSymbols = let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }step (clearingCfg cfg bs cs 0 0) = clearedCfg cfg input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolht:machine.tr stClear (clearingCfg cfg bs cs 0 0).inputSymbol (clearingCfg cfg bs cs 0 0).workTapeSymbols = let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }{ state := (let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs 0 0).inputPos (let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs 0 0).workTapes i | some s => Function.update ((clearingCfg cfg bs cs 0 0).workTapes i) ((clearingCfg cfg bs cs 0 0).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs 0 0).workTapePos i + ((let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).workActions i).2 } = clearedCfg cfg input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolht:machine.tr stClear (clearingCfg cfg bs cs 0 0).inputSymbol (clearingCfg cfg bs cs 0 0).workTapeSymbols = let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }{ state := (let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs 0 0).inputPos (let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs 0 0).workTapes i | some s => Function.update ((clearingCfg cfg bs cs 0 0).workTapes i) ((clearingCfg cfg bs cs 0 0).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs 0 0).workTapePos i + ((let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes = (clearedCfg cfg).workTapesinput:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolht:machine.tr stClear (clearingCfg cfg bs cs 0 0).inputSymbol (clearingCfg cfg bs cs 0 0).workTapeSymbols = let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }{ state := (let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs 0 0).inputPos (let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs 0 0).workTapes i | some s => Function.update ((clearingCfg cfg bs cs 0 0).workTapes i) ((clearingCfg cfg bs cs 0 0).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs 0 0).workTapePos i + ((let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos = (clearedCfg cfg).workTapePos input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolht:machine.tr stClear (clearingCfg cfg bs cs 0 0).inputSymbol (clearingCfg cfg bs cs 0 0).workTapeSymbols = let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }{ state := (let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs 0 0).inputPos (let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs 0 0).workTapes i | some s => Function.update ((clearingCfg cfg bs cs 0 0).workTapes i) ((clearingCfg cfg bs cs 0 0).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs 0 0).workTapePos i + ((let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes = (clearedCfg cfg).workTapes input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolht:machine.tr stClear (clearingCfg cfg bs cs 0 0).inputSymbol (clearingCfg cfg bs cs 0 0).workTapeSymbols = let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }i:Fin 4{ state := (let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs 0 0).inputPos (let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs 0 0).workTapes i | some s => Function.update ((clearingCfg cfg bs cs 0 0).workTapes i) ((clearingCfg cfg bs cs 0 0).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs 0 0).workTapePos i + ((let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes i = (clearedCfg cfg).workTapes i input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolht:machine.tr stClear (clearingCfg cfg bs cs 0 0).inputSymbol (clearingCfg cfg bs cs 0 0).workTapeSymbols = let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }{ state := (let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs 0 0).inputPos (let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs 0 0).workTapes i | some s => Function.update ((clearingCfg cfg bs cs 0 0).workTapes i) ((clearingCfg cfg bs cs 0 0).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs 0 0).workTapePos i + ((let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes ((fun i i) 0, ) = (clearedCfg cfg).workTapes ((fun i i) 0, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolht:machine.tr stClear (clearingCfg cfg bs cs 0 0).inputSymbol (clearingCfg cfg bs cs 0 0).workTapeSymbols = let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }{ state := (let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs 0 0).inputPos (let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs 0 0).workTapes i | some s => Function.update ((clearingCfg cfg bs cs 0 0).workTapes i) ((clearingCfg cfg bs cs 0 0).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs 0 0).workTapePos i + ((let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes ((fun i i) 1, ) = (clearedCfg cfg).workTapes ((fun i i) 1, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolht:machine.tr stClear (clearingCfg cfg bs cs 0 0).inputSymbol (clearingCfg cfg bs cs 0 0).workTapeSymbols = let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }{ state := (let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs 0 0).inputPos (let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs 0 0).workTapes i | some s => Function.update ((clearingCfg cfg bs cs 0 0).workTapes i) ((clearingCfg cfg bs cs 0 0).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs 0 0).workTapePos i + ((let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes ((fun i i) 2, ) = (clearedCfg cfg).workTapes ((fun i i) 2, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolht:machine.tr stClear (clearingCfg cfg bs cs 0 0).inputSymbol (clearingCfg cfg bs cs 0 0).workTapeSymbols = let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }{ state := (let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs 0 0).inputPos (let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs 0 0).workTapes i | some s => Function.update ((clearingCfg cfg bs cs 0 0).workTapes i) ((clearingCfg cfg bs cs 0 0).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs 0 0).workTapePos i + ((let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes ((fun i i) 3, ) = (clearedCfg cfg).workTapes ((fun i i) 3, ) input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolht:machine.tr stClear (clearingCfg cfg bs cs 0 0).inputSymbol (clearingCfg cfg bs cs 0 0).workTapeSymbols = let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }{ state := (let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs 0 0).inputPos (let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs 0 0).workTapes i | some s => Function.update ((clearingCfg cfg bs cs 0 0).workTapes i) ((clearingCfg cfg bs cs 0 0).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs 0 0).workTapePos i + ((let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes ((fun i i) 0, ) = (clearedCfg cfg).workTapes ((fun i i) 0, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolht:machine.tr stClear (clearingCfg cfg bs cs 0 0).inputSymbol (clearingCfg cfg bs cs 0 0).workTapeSymbols = let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }{ state := (let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs 0 0).inputPos (let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs 0 0).workTapes i | some s => Function.update ((clearingCfg cfg bs cs 0 0).workTapes i) ((clearingCfg cfg bs cs 0 0).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs 0 0).workTapePos i + ((let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes ((fun i i) 1, ) = (clearedCfg cfg).workTapes ((fun i i) 1, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolht:machine.tr stClear (clearingCfg cfg bs cs 0 0).inputSymbol (clearingCfg cfg bs cs 0 0).workTapeSymbols = let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }{ state := (let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs 0 0).inputPos (let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs 0 0).workTapes i | some s => Function.update ((clearingCfg cfg bs cs 0 0).workTapes i) ((clearingCfg cfg bs cs 0 0).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs 0 0).workTapePos i + ((let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes ((fun i i) 2, ) = (clearedCfg cfg).workTapes ((fun i i) 2, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolht:machine.tr stClear (clearingCfg cfg bs cs 0 0).inputSymbol (clearingCfg cfg bs cs 0 0).workTapeSymbols = let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }{ state := (let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs 0 0).inputPos (let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs 0 0).workTapes i | some s => Function.update ((clearingCfg cfg bs cs 0 0).workTapes i) ((clearingCfg cfg bs cs 0 0).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs 0 0).workTapePos i + ((let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapes ((fun i i) 3, ) = (clearedCfg cfg).workTapes ((fun i i) 3, ) All goals completed! 🐙 input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolht:machine.tr stClear (clearingCfg cfg bs cs 0 0).inputSymbol (clearingCfg cfg bs cs 0 0).workTapeSymbols = let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }{ state := (let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs 0 0).inputPos (let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs 0 0).workTapes i | some s => Function.update ((clearingCfg cfg bs cs 0 0).workTapes i) ((clearingCfg cfg bs cs 0 0).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs 0 0).workTapePos i + ((let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos = (clearedCfg cfg).workTapePos input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolht:machine.tr stClear (clearingCfg cfg bs cs 0 0).inputSymbol (clearingCfg cfg bs cs 0 0).workTapeSymbols = let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }i:Fin 4{ state := (let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs 0 0).inputPos (let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs 0 0).workTapes i | some s => Function.update ((clearingCfg cfg bs cs 0 0).workTapes i) ((clearingCfg cfg bs cs 0 0).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs 0 0).workTapePos i + ((let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos i = (clearedCfg cfg).workTapePos i input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolht:machine.tr stClear (clearingCfg cfg bs cs 0 0).inputSymbol (clearingCfg cfg bs cs 0 0).workTapeSymbols = let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }{ state := (let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs 0 0).inputPos (let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs 0 0).workTapes i | some s => Function.update ((clearingCfg cfg bs cs 0 0).workTapes i) ((clearingCfg cfg bs cs 0 0).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs 0 0).workTapePos i + ((let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos ((fun i i) 0, ) = (clearedCfg cfg).workTapePos ((fun i i) 0, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolht:machine.tr stClear (clearingCfg cfg bs cs 0 0).inputSymbol (clearingCfg cfg bs cs 0 0).workTapeSymbols = let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }{ state := (let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs 0 0).inputPos (let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs 0 0).workTapes i | some s => Function.update ((clearingCfg cfg bs cs 0 0).workTapes i) ((clearingCfg cfg bs cs 0 0).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs 0 0).workTapePos i + ((let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos ((fun i i) 1, ) = (clearedCfg cfg).workTapePos ((fun i i) 1, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolht:machine.tr stClear (clearingCfg cfg bs cs 0 0).inputSymbol (clearingCfg cfg bs cs 0 0).workTapeSymbols = let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }{ state := (let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs 0 0).inputPos (let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs 0 0).workTapes i | some s => Function.update ((clearingCfg cfg bs cs 0 0).workTapes i) ((clearingCfg cfg bs cs 0 0).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs 0 0).workTapePos i + ((let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos ((fun i i) 2, ) = (clearedCfg cfg).workTapePos ((fun i i) 2, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolht:machine.tr stClear (clearingCfg cfg bs cs 0 0).inputSymbol (clearingCfg cfg bs cs 0 0).workTapeSymbols = let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }{ state := (let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs 0 0).inputPos (let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs 0 0).workTapes i | some s => Function.update ((clearingCfg cfg bs cs 0 0).workTapes i) ((clearingCfg cfg bs cs 0 0).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs 0 0).workTapePos i + ((let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos ((fun i i) 3, ) = (clearedCfg cfg).workTapePos ((fun i i) 3, ) input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolht:machine.tr stClear (clearingCfg cfg bs cs 0 0).inputSymbol (clearingCfg cfg bs cs 0 0).workTapeSymbols = let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }{ state := (let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs 0 0).inputPos (let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs 0 0).workTapes i | some s => Function.update ((clearingCfg cfg bs cs 0 0).workTapes i) ((clearingCfg cfg bs cs 0 0).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs 0 0).workTapePos i + ((let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos ((fun i i) 0, ) = (clearedCfg cfg).workTapePos ((fun i i) 0, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolht:machine.tr stClear (clearingCfg cfg bs cs 0 0).inputSymbol (clearingCfg cfg bs cs 0 0).workTapeSymbols = let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }{ state := (let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs 0 0).inputPos (let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs 0 0).workTapes i | some s => Function.update ((clearingCfg cfg bs cs 0 0).workTapes i) ((clearingCfg cfg bs cs 0 0).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs 0 0).workTapePos i + ((let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos ((fun i i) 1, ) = (clearedCfg cfg).workTapePos ((fun i i) 1, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolht:machine.tr stClear (clearingCfg cfg bs cs 0 0).inputSymbol (clearingCfg cfg bs cs 0 0).workTapeSymbols = let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }{ state := (let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs 0 0).inputPos (let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs 0 0).workTapes i | some s => Function.update ((clearingCfg cfg bs cs 0 0).workTapes i) ((clearingCfg cfg bs cs 0 0).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs 0 0).workTapePos i + ((let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos ((fun i i) 2, ) = (clearedCfg cfg).workTapePos ((fun i i) 2, )input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolht:machine.tr stClear (clearingCfg cfg bs cs 0 0).inputSymbol (clearingCfg cfg bs cs 0 0).workTapeSymbols = let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }{ state := (let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).q', inputPos := moveInputPos (clearingCfg cfg bs cs 0 0).inputPos (let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).workActions i).1 with | none => (clearingCfg cfg bs cs 0 0).workTapes i | some s => Function.update ((clearingCfg cfg bs cs 0 0).workTapes i) ((clearingCfg cfg bs cs 0 0).workTapePos i) s, workTapePos := fun i (clearingCfg cfg bs cs 0 0).workTapePos i + ((let __src := jump stLeaf; { inputMove := __src.inputMove, workActions := fun i if i = 0 then (none, -1) else if i = 1 then (none, 0) else (none, 1), outS := __src.outS, q' := __src.q' }).workActions i).2 }.workTapePos ((fun i i) 3, ) = (clearedCfg cfg).workTapePos ((fun i i) 3, ) All goals completed! 🐙

The final cleanup transition emits nothing.

theorem outputSymbol_clearing_zero {input : List (Fin 3)} (cfg : Cfg 4 (Fin 3) Control input) (bs cs : List Bool) : machine.outputSymbol (clearingCfg cfg bs cs 0 0) = none := rfl

Both fields clear in the larger head position plus one transition.

theorem configs_clear_done {input : List (Fin 3)} (cfg : Cfg 4 (Fin 3) Control input) (bs cs : List Bool) (p r : ) : machine.configs (clearingCfg cfg bs cs p r) (max p r + 1) = clearedCfg cfg machine.outputString (clearingCfg cfg bs cs p r) (max p r + 1) = [] := input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:configs (clearingCfg cfg bs cs p r) (max p r + 1) = clearedCfg cfg machine.outputString (clearingCfg cfg bs cs p r) (max p r + 1) = [] input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:hc:configs (clearingCfg cfg bs cs p r) (max p r) = clearingCfg cfg bs cs (p - max p r) (r - max p r)hout:machine.outputString (clearingCfg cfg bs cs p r) (max p r) = []configs (clearingCfg cfg bs cs p r) (max p r + 1) = clearedCfg cfg machine.outputString (clearingCfg cfg bs cs p r) (max p r + 1) = [] input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:hc:configs (clearingCfg cfg bs cs p r) (max p r) = clearingCfg cfg bs cs (p - max p r) (r - max p r)hout:machine.outputString (clearingCfg cfg bs cs p r) (max p r) = []hp:p - max p r = 0configs (clearingCfg cfg bs cs p r) (max p r + 1) = clearedCfg cfg machine.outputString (clearingCfg cfg bs cs p r) (max p r + 1) = [] input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:hc:configs (clearingCfg cfg bs cs p r) (max p r) = clearingCfg cfg bs cs (p - max p r) (r - max p r)hout:machine.outputString (clearingCfg cfg bs cs p r) (max p r) = []hp:p - max p r = 0hr:r - max p r = 0configs (clearingCfg cfg bs cs p r) (max p r + 1) = clearedCfg cfg machine.outputString (clearingCfg cfg bs cs p r) (max p r + 1) = [] input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:hc:configs (clearingCfg cfg bs cs p r) (max p r) = clearingCfg cfg bs cs 0 0hout:machine.outputString (clearingCfg cfg bs cs p r) (max p r) = []hp:p - max p r = 0hr:r - max p r = 0configs (clearingCfg cfg bs cs p r) (max p r + 1) = clearedCfg cfg machine.outputString (clearingCfg cfg bs cs p r) (max p r + 1) = [] input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:hc:configs (clearingCfg cfg bs cs p r) (max p r) = clearingCfg cfg bs cs 0 0hout:machine.outputString (clearingCfg cfg bs cs p r) (max p r) = []hp:p - max p r = 0hr:r - max p r = 0configs (clearingCfg cfg bs cs p r) (max p r + 1) = clearedCfg cfginput:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:hc:configs (clearingCfg cfg bs cs p r) (max p r) = clearingCfg cfg bs cs 0 0hout:machine.outputString (clearingCfg cfg bs cs p r) (max p r) = []hp:p - max p r = 0hr:r - max p r = 0machine.outputString (clearingCfg cfg bs cs p r) (max p r + 1) = [] input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:hc:configs (clearingCfg cfg bs cs p r) (max p r) = clearingCfg cfg bs cs 0 0hout:machine.outputString (clearingCfg cfg bs cs p r) (max p r) = []hp:p - max p r = 0hr:r - max p r = 0configs (clearingCfg cfg bs cs p r) (max p r + 1) = clearedCfg cfg All goals completed! 🐙 input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:hc:configs (clearingCfg cfg bs cs p r) (max p r) = clearingCfg cfg bs cs 0 0hout:machine.outputString (clearingCfg cfg bs cs p r) (max p r) = []hp:p - max p r = 0hr:r - max p r = 0machine.outputString (clearingCfg cfg bs cs p r) (max p r + 1) = [] input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:hc:configs (clearingCfg cfg bs cs p r) (max p r) = clearingCfg cfg bs cs 0 0hout:machine.outputString (clearingCfg cfg bs cs p r) (max p r) = []hp:p - max p r = 0hr:r - max p r = 0[] ++ none.toList = [] All goals completed! 🐙

Testing the decremented pending count changes only finite control.

theorem step_leaf {input : List (Fin 3)} (cfg : Cfg 4 (Fin 3) Control input) : machine.step (clearedCfg cfg) = completedCfg cfg := input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputstep (clearedCfg cfg) = completedCfg cfg input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control input{ state := (machine.tr stLeaf (clearedCfg cfg).inputSymbol (clearedCfg cfg).workTapeSymbols).q', inputPos := moveInputPos (clearedCfg cfg).inputPos (machine.tr stLeaf (clearedCfg cfg).inputSymbol (clearedCfg cfg).workTapeSymbols).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((machine.tr stLeaf (clearedCfg cfg).inputSymbol (clearedCfg cfg).workTapeSymbols).workActions i).1 with | none => (clearedCfg cfg).workTapes i | some s => Function.update ((clearedCfg cfg).workTapes i) ((clearedCfg cfg).workTapePos i) s, workTapePos := fun i (clearedCfg cfg).workTapePos i + ((machine.tr stLeaf (clearedCfg cfg).inputSymbol (clearedCfg cfg).workTapeSymbols).workActions i).2 } = completedCfg cfg input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control input{ state := (machine.tr stLeaf (clearedCfg cfg).inputSymbol (clearedCfg cfg).workTapeSymbols).q', inputPos := moveInputPos (clearedCfg cfg).inputPos (machine.tr stLeaf (clearedCfg cfg).inputSymbol (clearedCfg cfg).workTapeSymbols).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((machine.tr stLeaf (clearedCfg cfg).inputSymbol (clearedCfg cfg).workTapeSymbols).workActions i).1 with | none => (clearedCfg cfg).workTapes i | some s => Function.update ((clearedCfg cfg).workTapes i) ((clearedCfg cfg).workTapePos i) s, workTapePos := fun i (clearedCfg cfg).workTapePos i + ((machine.tr stLeaf (clearedCfg cfg).inputSymbol (clearedCfg cfg).workTapeSymbols).workActions i).2 }.workTapePos = (completedCfg cfg).workTapePos input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputi:Fin 4{ state := (machine.tr stLeaf (clearedCfg cfg).inputSymbol (clearedCfg cfg).workTapeSymbols).q', inputPos := moveInputPos (clearedCfg cfg).inputPos (machine.tr stLeaf (clearedCfg cfg).inputSymbol (clearedCfg cfg).workTapeSymbols).inputMove, workTapes := fun i match (motive := Option (Option (Fin 3)) Option (Fin 3)) ((machine.tr stLeaf (clearedCfg cfg).inputSymbol (clearedCfg cfg).workTapeSymbols).workActions i).1 with | none => (clearedCfg cfg).workTapes i | some s => Function.update ((clearedCfg cfg).workTapes i) ((clearedCfg cfg).workTapePos i) s, workTapePos := fun i (clearedCfg cfg).workTapePos i + ((machine.tr stLeaf (clearedCfg cfg).inputSymbol (clearedCfg cfg).workTapeSymbols).workActions i).2 }.workTapePos i = (completedCfg cfg).workTapePos i input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputi:Fin 4(clearedCfg cfg).workTapePos i + 0 = (completedCfg cfg).workTapePos i All goals completed! 🐙

Testing the pending count emits nothing.

theorem outputSymbol_leaf {input : List (Fin 3)} (cfg : Cfg 4 (Fin 3) Control input) : machine.outputSymbol (clearedCfg cfg) = none := rfl

Erasing and completing a leaf takes two transitions beyond the larger head position.

theorem configs_clear_ready {input : List (Fin 3)} (cfg : Cfg 4 (Fin 3) Control input) (bs cs : List Bool) (p r : ) : machine.configs (clearingCfg cfg bs cs p r) (max p r + 2) = completedCfg cfg machine.outputString (clearingCfg cfg bs cs p r) (max p r + 2) = [] := input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:configs (clearingCfg cfg bs cs p r) (max p r + 2) = completedCfg cfg machine.outputString (clearingCfg cfg bs cs p r) (max p r + 2) = [] input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:hc:configs (clearingCfg cfg bs cs p r) (max p r + 1) = clearedCfg cfghout:machine.outputString (clearingCfg cfg bs cs p r) (max p r + 1) = []configs (clearingCfg cfg bs cs p r) (max p r + 2) = completedCfg cfg machine.outputString (clearingCfg cfg bs cs p r) (max p r + 2) = [] input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:hc:configs (clearingCfg cfg bs cs p r) (max p r + 1) = clearedCfg cfghout:machine.outputString (clearingCfg cfg bs cs p r) (max p r + 1) = []configs (clearingCfg cfg bs cs p r) (max p r + 2) = completedCfg cfginput:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:hc:configs (clearingCfg cfg bs cs p r) (max p r + 1) = clearedCfg cfghout:machine.outputString (clearingCfg cfg bs cs p r) (max p r + 1) = []machine.outputString (clearingCfg cfg bs cs p r) (max p r + 2) = [] input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:hc:configs (clearingCfg cfg bs cs p r) (max p r + 1) = clearedCfg cfghout:machine.outputString (clearingCfg cfg bs cs p r) (max p r + 1) = []configs (clearingCfg cfg bs cs p r) (max p r + 2) = completedCfg cfg All goals completed! 🐙 input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:hc:configs (clearingCfg cfg bs cs p r) (max p r + 1) = clearedCfg cfghout:machine.outputString (clearingCfg cfg bs cs p r) (max p r + 1) = []machine.outputString (clearingCfg cfg bs cs p r) (max p r + 2) = [] input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:hc:configs (clearingCfg cfg bs cs p r) (max p r + 1) = clearedCfg cfghout:machine.outputString (clearingCfg cfg bs cs p r) (max p r + 1) = [][] ++ none.toList = [] All goals completed! 🐙

Cleanup visits only the initial nonnegative head interval.

theorem configs_clear_headBound {input : List (Fin 3)} (cfg : Cfg 4 (Fin 3) Control input) (bs cs : List Bool) (p r width : ) (hcfg : HeadBound width cfg) (hp : p width) (hr : r width) (hpending : 1 cfg.workTapePos 0) (t : ) (ht : t max p r + 2) : HeadBound width (machine.configs (clearingCfg cfg bs cs p r) t) := input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2HeadBound width (configs (clearingCfg cfg bs cs p r) t) input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthHeadBound width (configs (clearingCfg cfg bs cs p r) t) input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthHeadBound width (configs (clearingCfg cfg bs cs p r) t) input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthi:Fin 40 (configs (clearingCfg cfg bs cs p r) t).workTapePos i (configs (clearingCfg cfg bs cs p r) t).workTapePos i width input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthi:Fin 4hfirst:t max p r0 (configs (clearingCfg cfg bs cs p r) t).workTapePos i (configs (clearingCfg cfg bs cs p r) t).workTapePos i widthinput:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthi:Fin 4hfirst:¬t max p r0 (configs (clearingCfg cfg bs cs p r) t).workTapePos i (configs (clearingCfg cfg bs cs p r) t).workTapePos i width input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthi:Fin 4hfirst:t max p r0 (configs (clearingCfg cfg bs cs p r) t).workTapePos i (configs (clearingCfg cfg bs cs p r) t).workTapePos i width input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthi:Fin 4hfirst:t max p r0 (clearingCfg cfg bs cs (p - t) (r - t)).workTapePos i (clearingCfg cfg bs cs (p - t) (r - t)).workTapePos i width input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthhfirst:t max p r0 (clearingCfg cfg bs cs (p - t) (r - t)).workTapePos ((fun i i) 0, ) (clearingCfg cfg bs cs (p - t) (r - t)).workTapePos ((fun i i) 0, ) widthinput:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthhfirst:t max p r0 (clearingCfg cfg bs cs (p - t) (r - t)).workTapePos ((fun i i) 1, ) (clearingCfg cfg bs cs (p - t) (r - t)).workTapePos ((fun i i) 1, ) widthinput:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthhfirst:t max p r0 (clearingCfg cfg bs cs (p - t) (r - t)).workTapePos ((fun i i) 2, ) (clearingCfg cfg bs cs (p - t) (r - t)).workTapePos ((fun i i) 2, ) widthinput:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthhfirst:t max p r0 (clearingCfg cfg bs cs (p - t) (r - t)).workTapePos ((fun i i) 3, ) (clearingCfg cfg bs cs (p - t) (r - t)).workTapePos ((fun i i) 3, ) width input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthhfirst:t max p r0 (clearingCfg cfg bs cs (p - t) (r - t)).workTapePos ((fun i i) 0, ) (clearingCfg cfg bs cs (p - t) (r - t)).workTapePos ((fun i i) 0, ) widthinput:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthhfirst:t max p r0 (clearingCfg cfg bs cs (p - t) (r - t)).workTapePos ((fun i i) 1, ) (clearingCfg cfg bs cs (p - t) (r - t)).workTapePos ((fun i i) 1, ) widthinput:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthhfirst:t max p r0 (clearingCfg cfg bs cs (p - t) (r - t)).workTapePos ((fun i i) 2, ) (clearingCfg cfg bs cs (p - t) (r - t)).workTapePos ((fun i i) 2, ) widthinput:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthhfirst:t max p r0 (clearingCfg cfg bs cs (p - t) (r - t)).workTapePos ((fun i i) 3, ) (clearingCfg cfg bs cs (p - t) (r - t)).workTapePos ((fun i i) 3, ) width input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthhfirst:t max p rr width + t input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthhfirst:t max p r0 cfg.workTapePos 0 cfg.workTapePos 0 widthinput:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthhfirst:t max p r0 cfg.workTapePos 1 cfg.workTapePos 1 widthinput:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthhfirst:t max p rp width + tinput:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthhfirst:t max p rr width + t All goals completed! 🐙 input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthi:Fin 4hfirst:¬t max p r0 (configs (clearingCfg cfg bs cs p r) t).workTapePos i (configs (clearingCfg cfg bs cs p r) t).workTapePos i width input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthi:Fin 4hfirst:¬t max p rhlast:t = max p r + 20 (configs (clearingCfg cfg bs cs p r) t).workTapePos i (configs (clearingCfg cfg bs cs p r) t).workTapePos i widthinput:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthi:Fin 4hfirst:¬t max p rhlast:¬t = max p r + 20 (configs (clearingCfg cfg bs cs p r) t).workTapePos i (configs (clearingCfg cfg bs cs p r) t).workTapePos i width input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthi:Fin 4hfirst:¬t max p rhlast:t = max p r + 20 (configs (clearingCfg cfg bs cs p r) t).workTapePos i (configs (clearingCfg cfg bs cs p r) t).workTapePos i width input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthi:Fin 4hfirst:¬t max p rhlast:t = max p r + 20 (completedCfg cfg).workTapePos i (completedCfg cfg).workTapePos i width input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthhfirst:¬t max p rhlast:t = max p r + 20 (completedCfg cfg).workTapePos ((fun i i) 0, ) (completedCfg cfg).workTapePos ((fun i i) 0, ) widthinput:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthhfirst:¬t max p rhlast:t = max p r + 20 (completedCfg cfg).workTapePos ((fun i i) 1, ) (completedCfg cfg).workTapePos ((fun i i) 1, ) widthinput:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthhfirst:¬t max p rhlast:t = max p r + 20 (completedCfg cfg).workTapePos ((fun i i) 2, ) (completedCfg cfg).workTapePos ((fun i i) 2, ) widthinput:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthhfirst:¬t max p rhlast:t = max p r + 20 (completedCfg cfg).workTapePos ((fun i i) 3, ) (completedCfg cfg).workTapePos ((fun i i) 3, ) width input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthhfirst:¬t max p rhlast:t = max p r + 20 (completedCfg cfg).workTapePos ((fun i i) 0, ) (completedCfg cfg).workTapePos ((fun i i) 0, ) widthinput:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthhfirst:¬t max p rhlast:t = max p r + 20 (completedCfg cfg).workTapePos ((fun i i) 1, ) (completedCfg cfg).workTapePos ((fun i i) 1, ) widthinput:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthhfirst:¬t max p rhlast:t = max p r + 20 (completedCfg cfg).workTapePos ((fun i i) 2, ) (completedCfg cfg).workTapePos ((fun i i) 2, ) widthinput:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthhfirst:¬t max p rhlast:t = max p r + 20 (completedCfg cfg).workTapePos ((fun i i) 3, ) (completedCfg cfg).workTapePos ((fun i i) 3, ) width input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthhfirst:¬t max p rhlast:t = max p r + 21 width input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthhfirst:¬t max p rhlast:t = max p r + 21 cfg.workTapePos 0 cfg.workTapePos 0 width + 1input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthhfirst:¬t max p rhlast:t = max p r + 20 cfg.workTapePos 1 cfg.workTapePos 1 widthinput:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthhfirst:¬t max p rhlast:t = max p r + 21 widthinput:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthhfirst:¬t max p rhlast:t = max p r + 21 width All goals completed! 🐙 input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthi:Fin 4hfirst:¬t max p rhlast:¬t = max p r + 20 (configs (clearingCfg cfg bs cs p r) t).workTapePos i (configs (clearingCfg cfg bs cs p r) t).workTapePos i width input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthi:Fin 4hfirst:¬t max p rhlast:¬t = max p r + 2he:t = max p r + 10 (configs (clearingCfg cfg bs cs p r) t).workTapePos i (configs (clearingCfg cfg bs cs p r) t).workTapePos i width input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthi:Fin 4hfirst:¬t max p rhlast:¬t = max p r + 2he:t = max p r + 10 (clearedCfg cfg).workTapePos i (clearedCfg cfg).workTapePos i width input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthhfirst:¬t max p rhlast:¬t = max p r + 2he:t = max p r + 10 (clearedCfg cfg).workTapePos ((fun i i) 0, ) (clearedCfg cfg).workTapePos ((fun i i) 0, ) widthinput:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthhfirst:¬t max p rhlast:¬t = max p r + 2he:t = max p r + 10 (clearedCfg cfg).workTapePos ((fun i i) 1, ) (clearedCfg cfg).workTapePos ((fun i i) 1, ) widthinput:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthhfirst:¬t max p rhlast:¬t = max p r + 2he:t = max p r + 10 (clearedCfg cfg).workTapePos ((fun i i) 2, ) (clearedCfg cfg).workTapePos ((fun i i) 2, ) widthinput:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthhfirst:¬t max p rhlast:¬t = max p r + 2he:t = max p r + 10 (clearedCfg cfg).workTapePos ((fun i i) 3, ) (clearedCfg cfg).workTapePos ((fun i i) 3, ) width input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthhfirst:¬t max p rhlast:¬t = max p r + 2he:t = max p r + 10 (clearedCfg cfg).workTapePos ((fun i i) 0, ) (clearedCfg cfg).workTapePos ((fun i i) 0, ) widthinput:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthhfirst:¬t max p rhlast:¬t = max p r + 2he:t = max p r + 10 (clearedCfg cfg).workTapePos ((fun i i) 1, ) (clearedCfg cfg).workTapePos ((fun i i) 1, ) widthinput:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthhfirst:¬t max p rhlast:¬t = max p r + 2he:t = max p r + 10 (clearedCfg cfg).workTapePos ((fun i i) 2, ) (clearedCfg cfg).workTapePos ((fun i i) 2, ) widthinput:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthhfirst:¬t max p rhlast:¬t = max p r + 2he:t = max p r + 10 (clearedCfg cfg).workTapePos ((fun i i) 3, ) (clearedCfg cfg).workTapePos ((fun i i) 3, ) width input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthhfirst:¬t max p rhlast:¬t = max p r + 2he:t = max p r + 11 width input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthhfirst:¬t max p rhlast:¬t = max p r + 2he:t = max p r + 11 cfg.workTapePos 0 cfg.workTapePos 0 width + 1input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthhfirst:¬t max p rhlast:¬t = max p r + 2he:t = max p r + 10 cfg.workTapePos 1 cfg.workTapePos 1 widthinput:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthhfirst:¬t max p rhlast:¬t = max p r + 2he:t = max p r + 11 widthinput:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:r:width:hcfg:HeadBound width cfghp:p widthhr:r widthhpending:1 cfg.workTapePos 0t:ht:t max p r + 2h0:0 cfg.workTapePos 0 cfg.workTapePos 0 widthh1:0 cfg.workTapePos 1 cfg.workTapePos 1 widthhfirst:¬t max p rhlast:¬t = max p r + 2he:t = max p r + 11 width All goals completed! 🐙
end Geb.BitTree.Elias.Machine