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.FinCasesset_option doc.verso trueErasing 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_clearingdescribes one simultaneous erasure transition. -
configs_clearingdescribes all intermediate configurations. -
configs_clear_donegives 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 MultiTapeTMTwo 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! 🐙
· right 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) = [] rw [outputString_add_eq_append, right 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 ++ machine.outputString (configs cfg a) b = [] ha.1, right 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 ++ machine.outputString mid b = [] ha.2, right 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 mid b = [] hb.2 right 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 = []⊢ [] ++ [] = []] right 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 = []⊢ [] ++ [] = []
rfl 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) := by 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 + b⊢ HeadBound width (configs cfg t)
by_cases h : t ≤ a pos 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 ≤ a⊢ HeadBound width (configs cfg t)neg 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 ≤ a⊢ HeadBound width (configs cfg t)
· pos 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 ≤ a⊢ HeadBound width (configs cfg t) exact ha t h All goals completed! 🐙
· neg 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 ≤ a⊢ HeadBound width (configs cfg t) have he : t = a + (t - a) := by omega neg 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)
rw [he, neg 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 (a + (t - a))) configs_add neg 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))] neg 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) (by 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 omega 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) } := by 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 =
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' }
change clear _ = _ input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:ℕr:ℕh:0 < p + r⊢ 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' }
have h2 : ((clearingCfg cfg bs cs p r).workTapeSymbols 2 == some 2) = decide (p = 0) :=
prefixTape_marker bs p 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' }
have h3 : ((clearingCfg cfg bs cs p r).workTapeSymbols 3 == some 2) = decide (r = 0) :=
prefixTape_marker cs r 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' }
have hm : ((clearingCfg cfg bs cs p r).workTapeSymbols 2 == some 2 &&
(clearingCfg cfg bs cs p r).workTapeSymbols 3 == some 2) = false := by 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 =
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' }
rw [h2, 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)⊢ (decide (p = 0) && (clearingCfg cfg bs cs p r).workTapeSymbols 3 == some 2) = false h3 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)⊢ (decide (p = 0) && decide (r = 0)) = false] 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)⊢ (decide (p = 0) && decide (r = 0)) = false
cases p zero 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)⊢ (decide (0 = 0) && decide (r = 0)) = falsesucc 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)⊢ (decide (n✝ + 1 = 0) && decide (r = 0)) = false <;> zero 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)⊢ (decide (0 = 0) && decide (r = 0)) = falsesucc 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)⊢ (decide (n✝ + 1 = 0) && decide (r = 0)) = false cases r succ.zero 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)⊢ (decide (n✝ + 1 = 0) && decide (0 = 0)) = falsesucc.succ 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)⊢ (decide (n✝¹ + 1 = 0) && decide (n✝ + 1 = 0)) = false <;> zero.zero 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)⊢ (decide (0 = 0) && decide (0 = 0)) = falsezero.succ 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)⊢ (decide (0 = 0) && decide (n✝ + 1 = 0)) = falsesucc.zero 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)⊢ (decide (n✝ + 1 = 0) && decide (0 = 0)) = falsesucc.succ 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)⊢ (decide (n✝¹ + 1 = 0) && decide (n✝ + 1 = 0)) = false first | rfl All goals completed! 🐙 | omega 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⊢ 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' }
unfold clear 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' }
rw [hm, 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 false = 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' } ite_eq_right Bool.false_ne_true 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⊢ (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' }
dsimp only 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' }
congr 1 e_workActions 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)
funext i e_workActions 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)
fin_cases i e_workActions.«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)e_workActions.«1» 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)e_workActions.«2» 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)e_workActions.«3» 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) <;> e_workActions.«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)e_workActions.«1» 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)e_workActions.«2» 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)e_workActions.«3» 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) cases p e_workActions.«3».zero 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)e_workActions.«3».succ 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) <;> e_workActions.«0».zero 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)e_workActions.«0».succ 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)e_workActions.«1».zero 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)e_workActions.«1».succ 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)e_workActions.«2».zero 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)e_workActions.«2».succ 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)e_workActions.«3».zero 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)e_workActions.«3».succ 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) cases r e_workActions.«3».succ.zero 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)e_workActions.«3».succ.succ 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) <;> e_workActions.«0».zero.zero 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)e_workActions.«0».zero.succ 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)e_workActions.«0».succ.zero 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)e_workActions.«0».succ.succ 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)e_workActions.«1».zero.zero 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)e_workActions.«1».zero.succ 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)e_workActions.«1».succ.zero 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)e_workActions.«1».succ.succ 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)e_workActions.«2».zero.zero 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)e_workActions.«2».zero.succ 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)e_workActions.«2».succ.zero 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)e_workActions.«2».succ.succ 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)e_workActions.«3».zero.zero 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)e_workActions.«3».zero.succ 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)e_workActions.«3».succ.zero 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)e_workActions.«3».succ.succ 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)
simp only [Cfg.workTapeSymbols, clearingCfg, Fin.reduceFinMk, Fin.isValue, Fin.reduceEq,
↓reduceIte, Nat.cast_zero,
prefixTape_zero, prefixTape_succ_ne_marker, or_true, true_or, or_false, false_or,
Nat.succ_ne_zero] 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) := by input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:ℕr:ℕh:0 < p + r⊢ step (clearingCfg cfg bs cs p r) = clearingCfg cfg bs cs (p - 1) (r - 1)
rw [Geb.TreeScanner.step_of_state _ _ stClear rfl, input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:ℕr:ℕh:0 < p + r⊢ { state := (machine.tr stClear (clearingCfg cfg bs cs p r).inputSymbol (clearingCfg cfg bs cs p r).workTapeSymbols).q',
inputPos :=
moveInputPos (clearingCfg cfg bs cs p r).inputPos
(machine.tr stClear (clearingCfg cfg bs cs p r).inputSymbol
(clearingCfg cfg bs cs p r).workTapeSymbols).inputMove,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((machine.tr stClear (clearingCfg cfg bs cs p r).inputSymbol
(clearingCfg cfg bs cs p r).workTapeSymbols).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 +
↑((machine.tr stClear (clearingCfg cfg bs cs p r).inputSymbol
(clearingCfg cfg bs cs p r).workTapeSymbols).workActions
i).2 } =
clearingCfg cfg bs cs (p - 1) (r - 1) tr_clearing cfg bs cs p r h 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 } =
clearingCfg cfg bs cs (p - 1) (r - 1)
refine Cfg.ext rfl (moveInputPos_zero _) ?_ ?_ refine_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)).workTapesrefine_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 =
(clearingCfg cfg bs cs (p - 1) (r - 1)).workTapePos
· refine_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)).workTapes funext i refine_1 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
fin_cases i refine_1.«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) ⟨0, ⋯⟩) =
(clearingCfg cfg bs cs (p - 1) (r - 1)).workTapes ((fun i ↦ i) ⟨0, ⋯⟩)refine_1.«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) ⟨1, ⋯⟩) =
(clearingCfg cfg bs cs (p - 1) (r - 1)).workTapes ((fun i ↦ i) ⟨1, ⋯⟩)refine_1.«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) ⟨2, ⋯⟩) =
(clearingCfg cfg bs cs (p - 1) (r - 1)).workTapes ((fun i ↦ i) ⟨2, ⋯⟩)refine_1.«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) ⟨3, ⋯⟩) =
(clearingCfg cfg bs cs (p - 1) (r - 1)).workTapes ((fun i ↦ i) ⟨3, ⋯⟩) <;> refine_1.«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) ⟨0, ⋯⟩) =
(clearingCfg cfg bs cs (p - 1) (r - 1)).workTapes ((fun i ↦ i) ⟨0, ⋯⟩)refine_1.«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) ⟨1, ⋯⟩) =
(clearingCfg cfg bs cs (p - 1) (r - 1)).workTapes ((fun i ↦ i) ⟨1, ⋯⟩)refine_1.«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) ⟨2, ⋯⟩) =
(clearingCfg cfg bs cs (p - 1) (r - 1)).workTapes ((fun i ↦ i) ⟨2, ⋯⟩)refine_1.«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) ⟨3, ⋯⟩) =
(clearingCfg cfg bs cs (p - 1) (r - 1)).workTapes ((fun i ↦ i) ⟨3, ⋯⟩) cases p refine_1.«3».zero 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, ⋯⟩)refine_1.«3».succ 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, ⋯⟩) <;> refine_1.«0».zero 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, ⋯⟩)refine_1.«0».succ 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, ⋯⟩)refine_1.«1».zero 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, ⋯⟩)refine_1.«1».succ 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, ⋯⟩)refine_1.«2».zero 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, ⋯⟩)refine_1.«2».succ 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, ⋯⟩)refine_1.«3».zero 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, ⋯⟩)refine_1.«3».succ 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, ⋯⟩) cases r refine_1.«3».succ.zero 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, ⋯⟩)refine_1.«3».succ.succ 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, ⋯⟩) <;> refine_1.«0».zero.zero 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, ⋯⟩)refine_1.«0».zero.succ 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, ⋯⟩)refine_1.«0».succ.zero 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, ⋯⟩)refine_1.«0».succ.succ 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, ⋯⟩)refine_1.«1».zero.zero 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, ⋯⟩)refine_1.«1».zero.succ 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, ⋯⟩)refine_1.«1».succ.zero 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, ⋯⟩)refine_1.«1».succ.succ 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, ⋯⟩)refine_1.«2».zero.zero 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, ⋯⟩)refine_1.«2».zero.succ 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, ⋯⟩)refine_1.«2».succ.zero 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, ⋯⟩)refine_1.«2».succ.succ 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, ⋯⟩)refine_1.«3».zero.zero 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, ⋯⟩)refine_1.«3».zero.succ 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, ⋯⟩)refine_1.«3».succ.zero 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, ⋯⟩)refine_1.«3».succ.succ 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, ⋯⟩)
simp only [clearingCfg, Fin.reduceFinMk, Fin.isValue, Fin.reduceEq, ↓reduceIte,
Nat.add_eq_zero_iff, one_ne_zero, and_false, add_tsub_cancel_right, zero_tsub] refine_1.«3».succ.succ 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✝ <;> refine_1.«2».succ.zero input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Booln✝:ℕh:0 < n✝ + 1 + 0⊢ Function.update (prefixTape bs (n✝ + 1)) (↑(n✝ + 1)) none = prefixTape bs n✝refine_1.«2».succ.succ 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✝refine_1.«3».zero.succ 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✝refine_1.«3».succ.succ 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
| exact prefixTape_erase bs _ refine_1.«3».succ.succ 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✝
| exact prefixTape_erase cs _ All goals completed! 🐙
· refine_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 =
(clearingCfg cfg bs cs (p - 1) (r - 1)).workTapePos funext i refine_2 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
fin_cases i refine_2.«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) ⟨0, ⋯⟩) =
(clearingCfg cfg bs cs (p - 1) (r - 1)).workTapePos ((fun i ↦ i) ⟨0, ⋯⟩)refine_2.«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) ⟨1, ⋯⟩) =
(clearingCfg cfg bs cs (p - 1) (r - 1)).workTapePos ((fun i ↦ i) ⟨1, ⋯⟩)refine_2.«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) ⟨2, ⋯⟩) =
(clearingCfg cfg bs cs (p - 1) (r - 1)).workTapePos ((fun i ↦ i) ⟨2, ⋯⟩)refine_2.«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) ⟨3, ⋯⟩) =
(clearingCfg cfg bs cs (p - 1) (r - 1)).workTapePos ((fun i ↦ i) ⟨3, ⋯⟩) <;> refine_2.«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) ⟨0, ⋯⟩) =
(clearingCfg cfg bs cs (p - 1) (r - 1)).workTapePos ((fun i ↦ i) ⟨0, ⋯⟩)refine_2.«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) ⟨1, ⋯⟩) =
(clearingCfg cfg bs cs (p - 1) (r - 1)).workTapePos ((fun i ↦ i) ⟨1, ⋯⟩)refine_2.«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) ⟨2, ⋯⟩) =
(clearingCfg cfg bs cs (p - 1) (r - 1)).workTapePos ((fun i ↦ i) ⟨2, ⋯⟩)refine_2.«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) ⟨3, ⋯⟩) =
(clearingCfg cfg bs cs (p - 1) (r - 1)).workTapePos ((fun i ↦ i) ⟨3, ⋯⟩) cases p refine_2.«3».zero 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, ⋯⟩)refine_2.«3».succ 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, ⋯⟩) <;> refine_2.«0».zero 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, ⋯⟩)refine_2.«0».succ 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, ⋯⟩)refine_2.«1».zero 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, ⋯⟩)refine_2.«1».succ 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, ⋯⟩)refine_2.«2».zero 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, ⋯⟩)refine_2.«2».succ 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, ⋯⟩)refine_2.«3».zero 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, ⋯⟩)refine_2.«3».succ 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, ⋯⟩) cases r refine_2.«3».succ.zero 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, ⋯⟩)refine_2.«3».succ.succ 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, ⋯⟩) <;> refine_2.«0».zero.zero 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, ⋯⟩)refine_2.«0».zero.succ 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, ⋯⟩)refine_2.«0».succ.zero 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, ⋯⟩)refine_2.«0».succ.succ 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, ⋯⟩)refine_2.«1».zero.zero 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, ⋯⟩)refine_2.«1».zero.succ 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, ⋯⟩)refine_2.«1».succ.zero 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, ⋯⟩)refine_2.«1».succ.succ 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, ⋯⟩)refine_2.«2».zero.zero 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, ⋯⟩)refine_2.«2».zero.succ 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, ⋯⟩)refine_2.«2».succ.zero 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, ⋯⟩)refine_2.«2».succ.succ 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, ⋯⟩)refine_2.«3».zero.zero 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, ⋯⟩)refine_2.«3».zero.succ 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, ⋯⟩)refine_2.«3».succ.zero 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, ⋯⟩)refine_2.«3».succ.succ 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, ⋯⟩) simp [clearingCfg] 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 := by input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:ℕr:ℕh:0 < p + r⊢ outputSymbol (clearingCfg cfg bs cs p r) = none
change (machine.tr stClear _ _).outS = 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
rw [tr_clearing cfg bs cs p r h 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] 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
rfl 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 = [] := by input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:ℕr:ℕt:ℕht: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 = []
revert ht 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 = []
apply Nat.rec (motive := fun t ↦ 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 = []) ?_ ?_ 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 = [] intro _ input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:ℕr:ℕt:ℕa✝: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 = []
exact ⟨rfl, rfl⟩ 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 = [] intro t ih ht 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 r⊢ 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 = []
obtain ⟨hc, hout⟩ := ih (by 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 r⊢ t ≤ max p r omega 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 = []⊢ 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 = []
have hp : 0 < p - t + (r - t) := by input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Boolp:ℕr:ℕt:ℕht: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 = [] omega 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 = []
constructor left 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)right 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 = []
· left 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) rw [configs_succ_eq_step', left 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)⊢ step (configs (clearingCfg cfg bs cs p r) t) = clearingCfg cfg bs cs (p - t.succ) (r - t.succ) hc, left 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)⊢ step (clearingCfg cfg bs cs (p - t) (r - t)) = clearingCfg cfg bs cs (p - t.succ) (r - t.succ) step_clearing cfg bs cs _ _ hp left 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)] left 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)
congr 1 All goals completed! 🐙
· right 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 = [] rw [outputString_succ, right 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 ++ (outputSymbol (configs (clearingCfg cfg bs cs p r) t)).toList = [] hout, right 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)⊢ [] ++ (outputSymbol (configs (clearingCfg cfg bs cs p r) t)).toList = [] hc, right 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)⊢ [] ++ (outputSymbol (clearingCfg cfg bs cs (p - t) (r - t))).toList = [] outputSymbol_clearing cfg bs cs _ _ hp right 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 = []] right 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 = []
rfl 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 := by input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputbs:List Boolcs:List Bool⊢ step (clearingCfg cfg bs cs 0 0) = clearedCfg cfg
have ht : machine.tr stClear (clearingCfg cfg bs cs 0 0).inputSymbol
(clearingCfg cfg bs cs 0 0).workTapeSymbols =
{ jump stLeaf with
workActions := fun i ↦
if i = 0 then (none, -1)
else if i = 1 then (none, 0)
else (none, 1) } := rfl 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
rw [Geb.TreeScanner.step_of_state _ _ stClear rfl, 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 := (machine.tr stClear (clearingCfg cfg bs cs 0 0).inputSymbol (clearingCfg cfg bs cs 0 0).workTapeSymbols).q',
inputPos :=
moveInputPos (clearingCfg cfg bs cs 0 0).inputPos
(machine.tr stClear (clearingCfg cfg bs cs 0 0).inputSymbol
(clearingCfg cfg bs cs 0 0).workTapeSymbols).inputMove,
workTapes := fun i ↦
match (motive := Option (Option (Fin 3)) → ℤ → Option (Fin 3))
((machine.tr stClear (clearingCfg cfg bs cs 0 0).inputSymbol
(clearingCfg cfg bs cs 0 0).workTapeSymbols).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 +
↑((machine.tr stClear (clearingCfg cfg bs cs 0 0).inputSymbol
(clearingCfg cfg bs cs 0 0).workTapeSymbols).workActions
i).2 } =
clearedCfg cfg ht 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 } =
clearedCfg cfg
refine Cfg.ext rfl (moveInputPos_zero _) ?_ ?_ refine_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 =
(clearedCfg cfg).workTapesrefine_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 =
(clearedCfg cfg).workTapePos
· refine_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 =
(clearedCfg cfg).workTapes funext i refine_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' }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
fin_cases i refine_1.«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) ⟨0, ⋯⟩) =
(clearedCfg cfg).workTapes ((fun i ↦ i) ⟨0, ⋯⟩)refine_1.«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) ⟨1, ⋯⟩) =
(clearedCfg cfg).workTapes ((fun i ↦ i) ⟨1, ⋯⟩)refine_1.«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) ⟨2, ⋯⟩) =
(clearedCfg cfg).workTapes ((fun i ↦ i) ⟨2, ⋯⟩)refine_1.«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) ⟨3, ⋯⟩) =
(clearedCfg cfg).workTapes ((fun i ↦ i) ⟨3, ⋯⟩) <;> refine_1.«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) ⟨0, ⋯⟩) =
(clearedCfg cfg).workTapes ((fun i ↦ i) ⟨0, ⋯⟩)refine_1.«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) ⟨1, ⋯⟩) =
(clearedCfg cfg).workTapes ((fun i ↦ i) ⟨1, ⋯⟩)refine_1.«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) ⟨2, ⋯⟩) =
(clearedCfg cfg).workTapes ((fun i ↦ i) ⟨2, ⋯⟩)refine_1.«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) ⟨3, ⋯⟩) =
(clearedCfg cfg).workTapes ((fun i ↦ i) ⟨3, ⋯⟩) rfl All goals completed! 🐙
· refine_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 =
(clearedCfg cfg).workTapePos funext i refine_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' }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
fin_cases i refine_2.«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) ⟨0, ⋯⟩) =
(clearedCfg cfg).workTapePos ((fun i ↦ i) ⟨0, ⋯⟩)refine_2.«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) ⟨1, ⋯⟩) =
(clearedCfg cfg).workTapePos ((fun i ↦ i) ⟨1, ⋯⟩)refine_2.«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) ⟨2, ⋯⟩) =
(clearedCfg cfg).workTapePos ((fun i ↦ i) ⟨2, ⋯⟩)refine_2.«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) ⟨3, ⋯⟩) =
(clearedCfg cfg).workTapePos ((fun i ↦ i) ⟨3, ⋯⟩) <;> refine_2.«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) ⟨0, ⋯⟩) =
(clearedCfg cfg).workTapePos ((fun i ↦ i) ⟨0, ⋯⟩)refine_2.«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) ⟨1, ⋯⟩) =
(clearedCfg cfg).workTapePos ((fun i ↦ i) ⟨1, ⋯⟩)refine_2.«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) ⟨2, ⋯⟩) =
(clearedCfg cfg).workTapePos ((fun i ↦ i) ⟨2, ⋯⟩)refine_2.«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) ⟨3, ⋯⟩) =
(clearedCfg cfg).workTapePos ((fun i ↦ i) ⟨3, ⋯⟩) simp [clearingCfg, clearedCfg, sub_eq_add_neg] 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 := rflBoth 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) = [] := by 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) = []
obtain ⟨hc, hout⟩ := configs_clearing cfg bs cs p r (max p r) (Nat.le_refl _) 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) = []
have hp : p - max p r = 0 := by omega 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 = 0⊢ 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) = []
have hr : r - max p r = 0 := by omega 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 = 0⊢ 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) = []
rw [hp, 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 (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 = 0⊢ 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) = [] hr 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⊢ 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) = []] at hc 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⊢ 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) = []
constructor left 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⊢ configs (clearingCfg cfg bs cs p r) (max p r + 1) = clearedCfg cfgright 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⊢ machine.outputString (clearingCfg cfg bs cs p r) (max p r + 1) = []
· left 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⊢ configs (clearingCfg cfg bs cs p r) (max p r + 1) = clearedCfg cfg rw [configs_succ_eq_step', left 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⊢ step (configs (clearingCfg cfg bs cs p r) (max p r)) = clearedCfg cfg hc, left 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⊢ step (clearingCfg cfg bs cs 0 0) = clearedCfg cfg step_clearing_zero left 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⊢ clearedCfg cfg = clearedCfg cfg] All goals completed! 🐙
· right 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⊢ machine.outputString (clearingCfg cfg bs cs p r) (max p r + 1) = [] rw [outputString_succ, right 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⊢ machine.outputString (clearingCfg cfg bs cs p r) (max p r) ++
(outputSymbol (configs (clearingCfg cfg bs cs p r) (max p r))).toList =
[] hout, right 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⊢ [] ++ (outputSymbol (configs (clearingCfg cfg bs cs p r) (max p r))).toList = [] hc, right 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⊢ [] ++ (outputSymbol (clearingCfg cfg bs cs 0 0)).toList = [] outputSymbol_clearing_zero right 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 = []] right 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 = []
rfl 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 := by input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control input⊢ step (clearedCfg cfg) = completedCfg cfg
rw [Geb.TreeScanner.step_of_state _ _ stLeaf rfl 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 } =
completedCfg cfg
refine Cfg.ext rfl (moveInputPos_zero _) rfl ?_ 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
funext i 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
change (clearedCfg cfg).workTapePos i + 0 = _ input:List (Fin 3)cfg:Cfg 4 (Fin 3) Control inputi:Fin 4⊢ (clearedCfg cfg).workTapePos i + 0 = (completedCfg cfg).workTapePos i
exact Int.add_zero _ 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 := rflErasing 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) = [] := by 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) = []
obtain ⟨hc, hout⟩ := configs_clear_done cfg bs cs p r 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) = []
constructor left 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 cfgright 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) = []
· left 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 rw [show max p r + 2 = (max p r + 1) + 1 by 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) = [] omega All goals completed! 🐙,
configs_succ_eq_step', left 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) = []⊢ step (configs (clearingCfg cfg bs cs p r) (max p r + 1)) = completedCfg cfg hc, left 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) = []⊢ step (clearedCfg cfg) = completedCfg cfg step_leaf left 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) = []⊢ completedCfg cfg = completedCfg cfg] All goals completed! 🐙
· right 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) = [] rw [show max p r + 2 = (max p r + 1) + 1 by 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) = [] omega All goals completed! 🐙,
outputString_succ, right 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 + 1) ++
(outputSymbol (configs (clearingCfg cfg bs cs p r) (max p r + 1))).toList =
[] hout, right 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) = []⊢ [] ++ (outputSymbol (configs (clearingCfg cfg bs cs p r) (max p r + 1))).toList = [] hc, right 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) = []⊢ [] ++ (outputSymbol (clearedCfg cfg)).toList = [] outputSymbol_leaf right 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 = []] right 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 = []
rfl 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) := by 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 + 2⊢ HeadBound width (configs (clearingCfg cfg bs cs p r) t)
have h0 := hcfg 0 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 ≤ ↑width⊢ HeadBound width (configs (clearingCfg cfg bs cs p r) t)
have h1 := hcfg 1 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 ≤ ↑width⊢ HeadBound width (configs (clearingCfg cfg bs cs p r) t)
intro i 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 4⊢ 0 ≤ (configs (clearingCfg cfg bs cs p r) t).workTapePos i ∧
(configs (clearingCfg cfg bs cs p r) t).workTapePos i ≤ ↑width
by_cases hfirst : t ≤ max p r pos 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 r⊢ 0 ≤ (configs (clearingCfg cfg bs cs p r) t).workTapePos i ∧
(configs (clearingCfg cfg bs cs p r) t).workTapePos i ≤ ↑widthneg 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 r⊢ 0 ≤ (configs (clearingCfg cfg bs cs p r) t).workTapePos i ∧
(configs (clearingCfg cfg bs cs p r) t).workTapePos i ≤ ↑width
· pos 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 r⊢ 0 ≤ (configs (clearingCfg cfg bs cs p r) t).workTapePos i ∧
(configs (clearingCfg cfg bs cs p r) t).workTapePos i ≤ ↑width rw [(configs_clearing cfg bs cs p r t hfirst).1 pos 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 r⊢ 0 ≤ (clearingCfg cfg bs cs (p - t) (r - t)).workTapePos i ∧
(clearingCfg cfg bs cs (p - t) (r - t)).workTapePos i ≤ ↑width] pos 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 r⊢ 0 ≤ (clearingCfg cfg bs cs (p - t) (r - t)).workTapePos i ∧
(clearingCfg cfg bs cs (p - t) (r - t)).workTapePos i ≤ ↑width
fin_cases i pos.«_@».1604955806._hygCtx._hyg.109.«0» 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 r⊢ 0 ≤ (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, ⋯⟩) ≤ ↑widthpos.«_@».1604955806._hygCtx._hyg.109.«1» 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 r⊢ 0 ≤ (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, ⋯⟩) ≤ ↑widthpos.«_@».1604955806._hygCtx._hyg.109.«2» 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 r⊢ 0 ≤ (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, ⋯⟩) ≤ ↑widthpos.«_@».1604955806._hygCtx._hyg.109.«3» 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 r⊢ 0 ≤ (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 <;> pos.«_@».1604955806._hygCtx._hyg.109.«0» 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 r⊢ 0 ≤ (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, ⋯⟩) ≤ ↑widthpos.«_@».1604955806._hygCtx._hyg.109.«1» 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 r⊢ 0 ≤ (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, ⋯⟩) ≤ ↑widthpos.«_@».1604955806._hygCtx._hyg.109.«2» 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 r⊢ 0 ≤ (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, ⋯⟩) ≤ ↑widthpos.«_@».1604955806._hygCtx._hyg.109.«3» 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 r⊢ 0 ≤ (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 simp [clearingCfg] pos.«_@».1604955806._hygCtx._hyg.109.«3» 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 r⊢ r ≤ width + t <;> pos.«_@».1604955806._hygCtx._hyg.109.«0» 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 r⊢ 0 ≤ cfg.workTapePos 0 ∧ cfg.workTapePos 0 ≤ ↑widthpos.«_@».1604955806._hygCtx._hyg.109.«1» 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 r⊢ 0 ≤ cfg.workTapePos 1 ∧ cfg.workTapePos 1 ≤ ↑widthpos.«_@».1604955806._hygCtx._hyg.109.«2» 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 r⊢ p ≤ width + tpos.«_@».1604955806._hygCtx._hyg.109.«3» 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 r⊢ r ≤ width + t omega All goals completed! 🐙
· neg 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 r⊢ 0 ≤ (configs (clearingCfg cfg bs cs p r) t).workTapePos i ∧
(configs (clearingCfg cfg bs cs p r) t).workTapePos i ≤ ↑width by_cases hlast : t = max p r + 2 pos 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 + 2⊢ 0 ≤ (configs (clearingCfg cfg bs cs p r) t).workTapePos i ∧
(configs (clearingCfg cfg bs cs p r) t).workTapePos i ≤ ↑widthneg 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 + 2⊢ 0 ≤ (configs (clearingCfg cfg bs cs p r) t).workTapePos i ∧
(configs (clearingCfg cfg bs cs p r) t).workTapePos i ≤ ↑width
· pos 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 + 2⊢ 0 ≤ (configs (clearingCfg cfg bs cs p r) t).workTapePos i ∧
(configs (clearingCfg cfg bs cs p r) t).workTapePos i ≤ ↑width rw [hlast, pos 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 + 2⊢ 0 ≤ (configs (clearingCfg cfg bs cs p r) (max p r + 2)).workTapePos i ∧
(configs (clearingCfg cfg bs cs p r) (max p r + 2)).workTapePos i ≤ ↑width (configs_clear_ready cfg bs cs p r).1 pos 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 + 2⊢ 0 ≤ (completedCfg cfg).workTapePos i ∧ (completedCfg cfg).workTapePos i ≤ ↑width] pos 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 + 2⊢ 0 ≤ (completedCfg cfg).workTapePos i ∧ (completedCfg cfg).workTapePos i ≤ ↑width
fin_cases i pos.«_@».1604955806._hygCtx._hyg.312.«0» 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 + 2⊢ 0 ≤ (completedCfg cfg).workTapePos ((fun i ↦ i) ⟨0, ⋯⟩) ∧ (completedCfg cfg).workTapePos ((fun i ↦ i) ⟨0, ⋯⟩) ≤ ↑widthpos.«_@».1604955806._hygCtx._hyg.312.«1» 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 + 2⊢ 0 ≤ (completedCfg cfg).workTapePos ((fun i ↦ i) ⟨1, ⋯⟩) ∧ (completedCfg cfg).workTapePos ((fun i ↦ i) ⟨1, ⋯⟩) ≤ ↑widthpos.«_@».1604955806._hygCtx._hyg.312.«2» 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 + 2⊢ 0 ≤ (completedCfg cfg).workTapePos ((fun i ↦ i) ⟨2, ⋯⟩) ∧ (completedCfg cfg).workTapePos ((fun i ↦ i) ⟨2, ⋯⟩) ≤ ↑widthpos.«_@».1604955806._hygCtx._hyg.312.«3» 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 + 2⊢ 0 ≤ (completedCfg cfg).workTapePos ((fun i ↦ i) ⟨3, ⋯⟩) ∧ (completedCfg cfg).workTapePos ((fun i ↦ i) ⟨3, ⋯⟩) ≤ ↑width <;> pos.«_@».1604955806._hygCtx._hyg.312.«0» 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 + 2⊢ 0 ≤ (completedCfg cfg).workTapePos ((fun i ↦ i) ⟨0, ⋯⟩) ∧ (completedCfg cfg).workTapePos ((fun i ↦ i) ⟨0, ⋯⟩) ≤ ↑widthpos.«_@».1604955806._hygCtx._hyg.312.«1» 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 + 2⊢ 0 ≤ (completedCfg cfg).workTapePos ((fun i ↦ i) ⟨1, ⋯⟩) ∧ (completedCfg cfg).workTapePos ((fun i ↦ i) ⟨1, ⋯⟩) ≤ ↑widthpos.«_@».1604955806._hygCtx._hyg.312.«2» 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 + 2⊢ 0 ≤ (completedCfg cfg).workTapePos ((fun i ↦ i) ⟨2, ⋯⟩) ∧ (completedCfg cfg).workTapePos ((fun i ↦ i) ⟨2, ⋯⟩) ≤ ↑widthpos.«_@».1604955806._hygCtx._hyg.312.«3» 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 + 2⊢ 0 ≤ (completedCfg cfg).workTapePos ((fun i ↦ i) ⟨3, ⋯⟩) ∧ (completedCfg cfg).workTapePos ((fun i ↦ i) ⟨3, ⋯⟩) ≤ ↑width simp [completedCfg, clearedCfg] pos.«_@».1604955806._hygCtx._hyg.312.«3» 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 + 2⊢ 1 ≤ width <;> pos.«_@».1604955806._hygCtx._hyg.312.«0» 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 + 2⊢ 1 ≤ cfg.workTapePos 0 ∧ cfg.workTapePos 0 ≤ ↑width + 1pos.«_@».1604955806._hygCtx._hyg.312.«1» 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 + 2⊢ 0 ≤ cfg.workTapePos 1 ∧ cfg.workTapePos 1 ≤ ↑widthpos.«_@».1604955806._hygCtx._hyg.312.«2» 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 + 2⊢ 1 ≤ widthpos.«_@».1604955806._hygCtx._hyg.312.«3» 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 + 2⊢ 1 ≤ width omega All goals completed! 🐙
· neg 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 + 2⊢ 0 ≤ (configs (clearingCfg cfg bs cs p r) t).workTapePos i ∧
(configs (clearingCfg cfg bs cs p r) t).workTapePos i ≤ ↑width have he : t = max p r + 1 := by 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 + 2⊢ HeadBound width (configs (clearingCfg cfg bs cs p r) t) omega neg 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 + 1⊢ 0 ≤ (configs (clearingCfg cfg bs cs p r) t).workTapePos i ∧
(configs (clearingCfg cfg bs cs p r) t).workTapePos i ≤ ↑width
rw [he, neg 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 + 1⊢ 0 ≤ (configs (clearingCfg cfg bs cs p r) (max p r + 1)).workTapePos i ∧
(configs (clearingCfg cfg bs cs p r) (max p r + 1)).workTapePos i ≤ ↑width (configs_clear_done cfg bs cs p r).1 neg 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 + 1⊢ 0 ≤ (clearedCfg cfg).workTapePos i ∧ (clearedCfg cfg).workTapePos i ≤ ↑width] neg 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 + 1⊢ 0 ≤ (clearedCfg cfg).workTapePos i ∧ (clearedCfg cfg).workTapePos i ≤ ↑width
fin_cases i neg.«_@».1604955806._hygCtx._hyg.312.«0» 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 + 1⊢ 0 ≤ (clearedCfg cfg).workTapePos ((fun i ↦ i) ⟨0, ⋯⟩) ∧ (clearedCfg cfg).workTapePos ((fun i ↦ i) ⟨0, ⋯⟩) ≤ ↑widthneg.«_@».1604955806._hygCtx._hyg.312.«1» 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 + 1⊢ 0 ≤ (clearedCfg cfg).workTapePos ((fun i ↦ i) ⟨1, ⋯⟩) ∧ (clearedCfg cfg).workTapePos ((fun i ↦ i) ⟨1, ⋯⟩) ≤ ↑widthneg.«_@».1604955806._hygCtx._hyg.312.«2» 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 + 1⊢ 0 ≤ (clearedCfg cfg).workTapePos ((fun i ↦ i) ⟨2, ⋯⟩) ∧ (clearedCfg cfg).workTapePos ((fun i ↦ i) ⟨2, ⋯⟩) ≤ ↑widthneg.«_@».1604955806._hygCtx._hyg.312.«3» 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 + 1⊢ 0 ≤ (clearedCfg cfg).workTapePos ((fun i ↦ i) ⟨3, ⋯⟩) ∧ (clearedCfg cfg).workTapePos ((fun i ↦ i) ⟨3, ⋯⟩) ≤ ↑width <;> neg.«_@».1604955806._hygCtx._hyg.312.«0» 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 + 1⊢ 0 ≤ (clearedCfg cfg).workTapePos ((fun i ↦ i) ⟨0, ⋯⟩) ∧ (clearedCfg cfg).workTapePos ((fun i ↦ i) ⟨0, ⋯⟩) ≤ ↑widthneg.«_@».1604955806._hygCtx._hyg.312.«1» 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 + 1⊢ 0 ≤ (clearedCfg cfg).workTapePos ((fun i ↦ i) ⟨1, ⋯⟩) ∧ (clearedCfg cfg).workTapePos ((fun i ↦ i) ⟨1, ⋯⟩) ≤ ↑widthneg.«_@».1604955806._hygCtx._hyg.312.«2» 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 + 1⊢ 0 ≤ (clearedCfg cfg).workTapePos ((fun i ↦ i) ⟨2, ⋯⟩) ∧ (clearedCfg cfg).workTapePos ((fun i ↦ i) ⟨2, ⋯⟩) ≤ ↑widthneg.«_@».1604955806._hygCtx._hyg.312.«3» 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 + 1⊢ 0 ≤ (clearedCfg cfg).workTapePos ((fun i ↦ i) ⟨3, ⋯⟩) ∧ (clearedCfg cfg).workTapePos ((fun i ↦ i) ⟨3, ⋯⟩) ≤ ↑width simp [clearedCfg] neg.«_@».1604955806._hygCtx._hyg.312.«3» 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 + 1⊢ 1 ≤ width <;> neg.«_@».1604955806._hygCtx._hyg.312.«0» 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 + 1⊢ 1 ≤ cfg.workTapePos 0 ∧ cfg.workTapePos 0 ≤ ↑width + 1neg.«_@».1604955806._hygCtx._hyg.312.«1» 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 + 1⊢ 0 ≤ cfg.workTapePos 1 ∧ cfg.workTapePos 1 ≤ ↑widthneg.«_@».1604955806._hygCtx._hyg.312.«2» 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 + 1⊢ 1 ≤ widthneg.«_@».1604955806._hygCtx._hyg.312.«3» 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 + 1⊢ 1 ≤ width omega All goals completed! 🐙end Geb.BitTree.Elias.Machine